Ship WARDEN-WP-0030: delegation register for every catalog lane
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 1s

Every execution position is now explicit. Catalog entries carry
delegation.mode (permanent / native / interim) with intended owner and
blocker. warden route gaps lists the interim set. Promotion requires
the ownership question. Doctrine lives in AccessRouting.md; the
register was published to the named owner repos.
This commit is contained in:
tegwick 2026-08-15 20:54:58 +02:00
parent 8d3706fa06
commit c93e3c9b43
11 changed files with 619 additions and 29 deletions

View file

@ -659,6 +659,8 @@ def _entry_summary(entry) -> dict:
if entry.has_rotation
else {}
),
# Delegation register (WP-0030) — implicit interim if the block is absent.
"delegation": entry.effective_delegation.to_dict(),
}
@ -769,6 +771,85 @@ def route_list(
)
@route_app.command("gaps")
def route_gaps(
output_json: Annotated[bool, typer.Option("--json", help="Output JSON")] = False,
all_entries: Annotated[bool, typer.Option("--all", help="Include draft entries")] = False,
stale_days: Annotated[
int,
typer.Option(
"--stale-days",
help="Days since delegation review before an interim lane is stale (default 90)",
min=1,
),
] = 90,
) -> None:
"""List interim lanes: intended owner, blocker, and age since review."""
from warden.routing.catalog import days_since_review
catalog = _load_catalog()
entries = catalog.gaps(include_draft=all_entries)
if output_json:
payload = []
for e in entries:
d = e.effective_delegation
reviewed = d.reviewed or e.reviewed
payload.append(
{
"id": e.id,
"title": e.title,
"status": e.status,
"mode": d.mode,
"intended_owner": d.intended_owner,
"blocked_on": d.blocked_on,
"reviewed": reviewed,
"days_since_review": days_since_review(reviewed),
"implicit": d.implicit,
"stale": days_since_review(reviewed) > stale_days,
}
)
print(json.dumps(payload, indent=2))
return
if not entries:
console.print("No interim routing gaps (every execution position is classified).")
return
table = Table(title="Interim delegation register")
table.add_column("ID")
table.add_column("Owner")
table.add_column("Blocked on")
table.add_column("Reviewed")
table.add_column("Days")
table.add_column("Status")
for e in entries:
d = e.effective_delegation
reviewed = d.reviewed or e.reviewed
days = days_since_review(reviewed)
reviewed_styled = f"[yellow]{reviewed}[/yellow]" if days > stale_days else reviewed
days_styled = f"[yellow]{days}[/yellow]" if days > stale_days else str(days)
status_styled = e.status if e.status == "active" else f"[yellow]{e.status}[/yellow]"
table.add_row(
e.id,
d.intended_owner or "[yellow]unknown[/yellow]",
d.blocked_on or "",
reviewed_styled,
days_styled,
status_styled,
)
console.print(table)
stale_n = sum(
1
for e in entries
if days_since_review(e.effective_delegation.reviewed or e.reviewed) > stale_days
)
if stale_n:
console.print(
f"[yellow]{stale_n} interim lane(s) past {stale_days}d review cadence.[/yellow]"
)
@route_app.command("show")
def route_show(
entry_id: Annotated[str, typer.Argument(help="Catalog entry id (see `warden route list`)")],
@ -813,6 +894,17 @@ def route_show(
console.print(f" wiki : {entry.wiki_ref}")
console.print(f" canon : {entry.canon_ref}")
console.print(f" reviewed : {entry.reviewed} status: {entry.status}")
d = entry.effective_delegation
owner = d.intended_owner or "unknown"
if d.mode == "interim":
console.print(
f" delegation: [yellow]interim[/yellow] → {owner}"
+ (f" blocked: {d.blocked_on}" if d.blocked_on else "")
)
elif d.mode == "native":
console.print(f" delegation: native → {owner} already fronts this")
else:
console.print(" delegation: permanent (ops-warden owns this front door)")
if entry.warden_executes:
console.print("\n[green]ops-warden issues this directly.[/green]")