Implement WP-0015-T01/T04/T06: Phase provenance schema + ledger UI
Schema: phase.milestone_release gains required repo_hub/repo_hub_uri/
repo_id/repo_name; phase gains optional base_phase_id. Backfilled the
golden phase-001 fixture (placeholder values, it's synthetic) and the
three real pilot-candidate manifests with actual Forgejo repo ids
confirmed live (net-kingdom=67, vergabe-teilnahme=62,
info-tech-canon=47, all coulomb/*).
Discovered along the way: the schema change alone would have broken
the existing Control Plane registration form, since nothing collected
the four new fields. Fixed inline rather than leaving it broken
between tasks -- this also completes T04's ledger UI change (drop the
hand-typed ledger input, auto-compute /phases/{id}/ledger, add a
drill-down reference link on phase_detail.html) since both changes
touch the same form/route.
Full suite: 94 passing offline (was 84), 158 passing with Docker
(was 146).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
11800c7da1
commit
2a176d9961
13 changed files with 204 additions and 20 deletions
|
|
@ -198,26 +198,41 @@ def phase_new_submit(
|
|||
phase_id: str = Form(...),
|
||||
milestone_release_name: str = Form(...),
|
||||
source_revision: str = Form(...),
|
||||
repo_hub: str = Form(...),
|
||||
repo_hub_uri: str = Form(...),
|
||||
repo_id: int = Form(...),
|
||||
repo_name: str = Form(...),
|
||||
base_phase_id: str = Form(""),
|
||||
initial_target_amount: float = Form(...),
|
||||
currency: str = Form(...),
|
||||
future_license: str = Form(...),
|
||||
degeneration_policy: str = Form(...),
|
||||
longstop_at: str = Form(...),
|
||||
ledger_uri: str = Form(..., alias="ledger"),
|
||||
):
|
||||
manifest = {
|
||||
"framework": "TRF-0.1",
|
||||
"license": "TRSL-0.1",
|
||||
"phase": {
|
||||
"id": phase_id,
|
||||
"milestone_release": {"name": milestone_release_name, "source_revision": source_revision},
|
||||
"milestone_release": {
|
||||
"name": milestone_release_name,
|
||||
"source_revision": source_revision,
|
||||
"repo_hub": repo_hub,
|
||||
"repo_hub_uri": repo_hub_uri,
|
||||
"repo_id": repo_id,
|
||||
"repo_name": repo_name,
|
||||
},
|
||||
"initial_target": {"amount": initial_target_amount, "currency": currency},
|
||||
"future_license": future_license,
|
||||
"degeneration_policy": degeneration_policy,
|
||||
"longstop_at": longstop_at,
|
||||
"ledger": ledger_uri,
|
||||
# Auto-computed, never hand-typed (WP-0012-T04) -- this Trust
|
||||
# Service instance is always the ledger's host in Stage 0.
|
||||
"ledger": f"/phases/{phase_id}/ledger",
|
||||
},
|
||||
}
|
||||
if base_phase_id:
|
||||
manifest["phase"]["base_phase_id"] = base_phase_id
|
||||
try:
|
||||
control_plane.register_phase(conn, licensor, manifest)
|
||||
except (control_plane.ControlPlaneError, registry.RegistrationError) as exc:
|
||||
|
|
|
|||
|
|
@ -6,6 +6,16 @@
|
|||
</wn-page-header>
|
||||
<p><wn-tag>{{ manifest.phase.id }}</wn-tag></p>
|
||||
|
||||
<details style="margin-bottom:1rem;color:#888;font-size:0.9rem;">
|
||||
<summary style="cursor:pointer;">Ledger reference (internal — not this Phase's ledger entries, see below)</summary>
|
||||
<p>
|
||||
Raw reference: <code>{{ manifest.phase.ledger }}</code>
|
||||
{% if manifest.phase.ledger.startswith('/phases/') %}
|
||||
· <a href="{{ manifest.phase.ledger }}">view live JSON</a>
|
||||
{% endif %}
|
||||
</p>
|
||||
</details>
|
||||
|
||||
<h3>Status</h3>
|
||||
<table class="wn-plain">
|
||||
<tr><td>Initial Target</td><td>{{ manifest.phase.initial_target.amount }} {{ manifest.phase.initial_target.currency }}</td></tr>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,21 @@
|
|||
<wn-field-row label="Source revision">
|
||||
<wn-input name="source_revision" required></wn-input>
|
||||
</wn-field-row>
|
||||
<wn-field-row label="Repo hub (stable Forgejo instance slug)">
|
||||
<wn-input name="repo_hub" value="forgejo-coulomb" required></wn-input>
|
||||
</wn-field-row>
|
||||
<wn-field-row label="Repo hub URI">
|
||||
<wn-input name="repo_hub_uri" value="https://forgejo.coulomb.social" required></wn-input>
|
||||
</wn-field-row>
|
||||
<wn-field-row label="Repo id (Forgejo's own numeric id)">
|
||||
<wn-input type="number" name="repo_id" required></wn-input>
|
||||
</wn-field-row>
|
||||
<wn-field-row label="Repo name (owner/repo)">
|
||||
<wn-input name="repo_name" required></wn-input>
|
||||
</wn-field-row>
|
||||
<wn-field-row label="Base Phase id (optional — only for a successive Phase)">
|
||||
<wn-input name="base_phase_id"></wn-input>
|
||||
</wn-field-row>
|
||||
<wn-field-row label="Initial Target amount">
|
||||
<wn-input type="number" step="0.01" name="initial_target_amount" required></wn-input>
|
||||
</wn-field-row>
|
||||
|
|
@ -37,9 +52,6 @@
|
|||
<wn-field-row label="Longstop date (ISO 8601)">
|
||||
<wn-input name="longstop_at" required></wn-input>
|
||||
</wn-field-row>
|
||||
<wn-field-row label="Ledger URI (relative path or URL)">
|
||||
<wn-input name="ledger" required></wn-input>
|
||||
</wn-field-row>
|
||||
<wn-button type="submit" variant="primary">Register Phase</wn-button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue