spec rev 2: parity guard (Astra round 1)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/superpowers/specs/2026-11-09-parity-guard-design.md+55 −30docs/superpowers/specs/CODEX-FINDINGS-parity-guard.md+46 −0docs/superpowers/specs/CODEX-REVIEW-BRIEF-parity-guard-R2.md+32 −0
CI cancelled — superseded by a newer push — run details
Intent
<task-notification> <task-id>brtho1914</task-id> <tool-use-id>toolu_019rXVUbWPwcGKQJQ9kJvZQq</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/a1de5273-c148-49b8-8267-3dee9d49c9c1/tasks/brtho1914.output</output-file> <status>completed</status> <summary>Background command "Confirm push; run Astra review of parity spec" completed (exit code 0)</summary> </task-notification>
Attributed to this commit: 27.7 g CO₂e (3,582,026 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on design-parity-guard, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.
diff --git a/docs/superpowers/specs/2026-11-09-parity-guard-design.md b/docs/superpowers/specs/2026-11-09-parity-guard-design.md| index 60e635fe9..830d14de2 100644 |
| --- a/docs/superpowers/specs/2026-11-09-parity-guard-design.md |
| +++ b/docs/superpowers/specs/2026-11-09-parity-guard-design.md |
| @@ -1,6 +1,8 @@ |
| # CLI and console parity: the stock and its guard (slice 3) |
| -Status: draft for Paul, 2026-11-09. Slice 3 of "agent-first onboarding and |
| +Status: rev 2 for Paul, 2026-11-09. Astra round 1: |
| +`CODEX-FINDINGS-parity-guard.md` (NOT READY: P1 CLI enumeration, three P2s), |
| +all accepted, marked **(codex N)**. Slice 3 of "agent-first onboarding and |
| console parity". |
| ## Why |
| @@ -80,37 +82,60 @@ actions update `parity/parity.tsv` in the same branch. |
| ## Calls after the builder check (mine, 2026-11-09) |
| -1. **A row is a capability and lists its exact members**: zero or more CLI |
| - verb paths (e.g. `secrets set`, `secrets unset`, `secrets list`) and zero |
| - or more console routes as registered (`METHOD pattern`). Every enumerated |
| - verb path and every enumerated console route must appear in exactly one |
| - row; a member in two rows fails. `gap` rows still list the side that |
| - exists. |
| +1. **Rows are capabilities; coverage is separate from reference** |
| + **(codex 3)**. A row lists zero or more CLI verb paths and zero or more |
| + console routes (route identity = method + pattern exactly as registered; |
| + methodless registrations keep an empty method). Coverage rule: every |
| + enumerated verb path and every enumerated route appears in at least one |
| + row. A route may appear in several rows when one route serves several |
| + capabilities (e.g. `GET /a/{sqid}/apps/{app}/settings/{section}` serves |
| + storage, email and feature flags); a verb path appears in exactly one |
| + row. Duplicate row IDs, and duplicate members within a row, are invalid. |
| 2. **The table classifies, not a prefix list.** Every non-`/api/cli/*` |
| - route the console registers (pages, form POSTs, GET data endpoints, auth, |
| - demo, email-link, alerts, ops, static) appears in some row; its status |
| - says whether it counts toward customer parity. Statuses add `auth`, |
| - `demo`, `asset` and `internal` for rows that are neither customer |
| - capability nor gap, each with a reason. The counts in `docs/parity.md` |
| - cover customer rows only. |
| -3. **Routes are enumerated from the console's own route register** |
| - (`claimEntries`, every `registerRoute`), built by a test inside |
| - `internal/console` with every optional route group switched on (host |
| - claim, moves, demo, and any other config-gated group), so no route hides |
| - behind a flag. `/api/cli/*` doors are excluded by their registration |
| - helper (`cliRoute` family), not by a typed prefix. |
| -4. **The CLI unit is the verb path** (command + subcommand), not flags. |
| - Verb paths are derived from the dispatch code: the top-level switch in |
| - `main.go` and each command's first-argument switch (go/ast over the |
| - module root, plus the handful of commands dispatched into other |
| - packages), checked by a root-package test. Flag-level capabilities |
| - (`apps set --interactive`) are noted in the row, not enumerated. Hidden |
| - plumbing verbs (leading `__`, internal helpers) and help aliases get |
| - `internal` rows. If AST parsing proves fragile, the builder may add a |
| - small verb registry the dispatch itself uses (census applies then). |
| -5. **Operator and box-local verbs get exact rows** (no wildcards), several |
| + route the console registers appears in some row; its status says whether |
| + it counts toward customer parity. Statuses add `auth`, `demo`, `asset` |
| + and `internal` (each with a reason). Counts in `docs/parity.md` cover |
| + customer rows only. |
| +3. **Structural rules per status** **(codex 4)**, each with a negative |
| + fixture: every row is non-empty; `both` and `partial` list at least one |
| + member on EACH side, and `partial` has a note saying what is missing; |
| + `gap` lists members on exactly one side and names its work package; |
| + `cli-only` lists only CLI members, `console-only` only routes, both with a |
| + reason; `auth`/`demo`/`asset`/`internal`/`operator`/`box-local` have a |
| + reason. |
| +4. **Console routes are enumerated statically** **(codex 2)**: the guard |
| + reads every `registerRoute` / `cliRoute`-family call site in |
| + `internal/console` (go/ast) and takes its literal pattern, so a route |
| + behind any configuration gate, current or future, is found whether or |
| + not a test enables it. A call site whose pattern is not a literal (or |
| + whose method cannot be read) fails the guard with its location. The |
| + runtime register (`claimEntries`, all optional groups on) is a |
| + cross-check: every runtime route must be in the static set. `/api/cli/*` |
| + doors are excluded by their registration helper, not by prefix. Empty |
| + discovery fails on its own, before table comparison. |
| +5. **CLI verb paths: one scanner shared with the docs site** **(codex 1)**. |
| + `internal/docsite/cliscan.go` already scans the CLI dispatch for the docs. |
| + The parity guard uses (and extends) that scanner, so docs and parity |
| + cannot disagree. It must recognise every dispatch shape in the tree |
| + today, each with a fixture: the top-level switch; per-command switches |
| + on `args[N]` or on a local verb variable (`config_cli.go`); `if args[N] == |
| + "x"` branches (`main.go` `version target`, `releases retention`, |
| + `releases authorize`); nested conditionals (`instances import |
| + commit/abort`); rejecting conditions that define a valid bare form |
| + (`apps source pull`); constant-valued cases resolved through go/types, |
| + including constants from other packages (`internal/cgroup/shim.go` |
| + `__cgexec`, `__cgprobe`, dispatched before main's switch); aliases |
| + (listed as aliases of one verb path). Any function in the dispatch tree |
| + that compares an argument against a string or constant in a shape the |
| + scanner does not recognise fails the guard with its location, so a new |
| + shape cannot slip through. Flag-level capabilities are noted in rows, |
| + not enumerated. Hidden plumbing verbs (leading `__`, internal helpers) and |
| + help aliases get `internal` rows. If the scanner cannot be made robust, |
| + the fallback is a verb registry the dispatch itself uses (census |
| + approval then, and `cliscan.go` and its test updated with it). |
| +6. **Operator and box-local verbs get exact rows** (no wildcards), several |
| verbs per row where they form one capability. |
| -6. **Two tests, one table:** the console test checks routes, the root test |
| +7. **Two tests, one table:** the console test checks routes, the root test |
| checks verb paths and the generated page; both read `parity/parity.tsv`. |
| `make parity-doc` is a new target; the stale check regenerates and diffs. |
diff --git a/docs/superpowers/specs/CODEX-FINDINGS-parity-guard.md b/docs/superpowers/specs/CODEX-FINDINGS-parity-guard.md| new file mode 100644 |
| index 000000000..67035e05b |
| --- /dev/null |
| +++ b/docs/superpowers/specs/CODEX-FINDINGS-parity-guard.md |
| @@ -0,0 +1,46 @@ |
| +Reviewed `f887860aa2826def6b1fcaf4178d3527d710655e`, round 1 of 3. Found one P1 and three P2s. |
| + |
| +1. **P1 — The proposed CLI scan misses existing verb paths.** |
| + Builder call 4 specifies the top-level switch and first-argument switches, but dispatch already uses other forms: |
| + - `version target`, `releases retention` and `releases authorize` use `if` branches in [main.go](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-parity-guard/main.go:75). |
| + - `apps source pull` uses a rejecting condition in [apps_source.go](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-parity-guard/apps_source.go:26). |
| + - `instances import commit/abort` use a nested conditional in [instances_import.go](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-parity-guard/instances_import.go:116). |
| + - `config destinations add/set/remove/...` dispatch through a local `verb` variable in [config_cli.go](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-parity-guard/config_cli.go:79). |
| + - `__cgexec` and `__cgprobe` dispatch through constants in another package, before main’s switch: [shim.go](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-parity-guard/internal/cgroup/shim.go:39). |
| + |
| + A switch-only implementation either rejects legitimate inventory members or omits them from both enumeration and stock, allowing subsequent changes to escape. Specify recursive argument dispatch, conditional and constant handling, aliases, and valid bare-command forms. Unsupported dispatch shapes must fail explicitly; alternatively, commit to the dispatch-backed registry. Require fixtures covering these existing shapes and additions within each. |
| + |
| + **Fault family:** completeness of CLI enumeration. |
| + |
| +2. **P2 — Enabling known route groups does not guard against new configuration gates.** |
| + [Builder call 3](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-parity-guard/docs/superpowers/specs/2026-11-09-parity-guard-design.md:96) relies on a test server with every optional group enabled. But `claimEntries` records only registrations that execute. For example, [registerDemoRoutes](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-parity-guard/internal/console/apidemo.go:269) returns before registering anything when its configuration is off. |
| + |
| + A new browser route behind a new, default-false flag can be absent from both the fixture and table while the guard passes. The existing [one-registrar test](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-parity-guard/internal/console/claim_routes_test.go:54) prevents direct mux registration but does not detect this omission. |
| + |
| + Require a code-derived completeness check against registration sites, or unconditional route declarations consumed by production registration. Test a newly gated route with the fixture flag unset. Reject empty discovery independently of table equality. |
| + |
| + **Fault family:** completeness of console enumeration. |
| + |
| +3. **P2 — Exclusive route membership forces unrelated capabilities into one row.** |
| + [Builder call 1](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-parity-guard/docs/superpowers/specs/2026-11-09-parity-guard-design.md:83) permits each registered route in exactly one capability row. However, `GET /a/{sqid}/apps/{app}/settings/{section}` serves storage, email, feature flags and other separate capabilities: [registration](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-parity-guard/internal/console/server.go:2111), [section dispatch](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-parity-guard/internal/console/server.go:5207). |
| + |
| + Consequently, separate rows for `store status`, `email status`, `features list` and email credential management cannot all name their actual browser counterpart. Combining them produces a broad row with one status across independent capabilities—including the inventory’s partial credential support—and obscures progress. |
| + |
| + Separate route coverage from capability references: retain exact coverage and stale-reference checks, but allow explicitly shared routes across capability rows. Keep duplicate capability IDs and duplicate members within a row invalid. |
| + |
| + **Fault family:** capability granularity and faithful parity reporting. |
| + |
| +4. **P2 — Status validation does not enforce the status definitions.** |
| + [The guard’s validation rules](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-parity-guard/docs/superpowers/specs/2026-11-09-parity-guard-design.md:31) check allowed status names and selected notes, while builder call 1 allows zero members on either side. They do not require `both` and `partial` to contain both sides. |
| + |
| + Removing a counterpart from code and its table member can therefore leave a one-sided `both` row passing every stated check. Empty rows could also inflate counts. |
| + |
| + Require nonempty capability rows, both sides for `both`/`partial`, exactly one side for `gap`, the appropriate side for `cli-only`/`console-only`, and the required explanation for `partial` and every reason-bearing classification. Add negative fixtures for these contradictions. |
| + |
| + **Fault family:** structural validity of parity classifications. |
| + |
| +The census assumption is sound for tests, docs and an unlinked helper package. A production dispatch registry requires census approval. If that fallback replaces main’s switch, it also requires updating [the documentation scanner](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-parity-guard/internal/docsite/cliscan.go:36): [its existing test](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-parity-guard/internal/docsite/cli_test.go:14) fails when the switch disappears. Route identities must also preserve methodless registrations, which exist for operator endpoints. |
| + |
| +No files changed, subagents used, or test suites run. |
| + |
| +NOT READY |
| \ No newline at end of file |
diff --git a/docs/superpowers/specs/CODEX-REVIEW-BRIEF-parity-guard-R2.md b/docs/superpowers/specs/CODEX-REVIEW-BRIEF-parity-guard-R2.md| new file mode 100644 |
| index 000000000..dc5b63eb7 |
| --- /dev/null |
| +++ b/docs/superpowers/specs/CODEX-REVIEW-BRIEF-parity-guard-R2.md |
| @@ -0,0 +1,32 @@ |
| +# Review brief: spec "CLI and console parity: the stock and its guard", round 2 of 3 |
| + |
| +Repo carlos/platform, branch `design-parity-guard`, commit: the commit that |
| +adds this file. Under review: |
| +`docs/superpowers/specs/2026-11-09-parity-guard-design.md`, seeded from |
| +`docs/superpowers/notes/2026-11-09-parity-inventory.md`. Authorities: main's |
| +code (main.go and the CLI dispatchers; internal/console route registration, |
| +claim_routes.go, server.go registerRoute and the cliRoute family). |
| + |
| +Fixed, do not re-argue: Paul's direction (parity both ways; keep the stock; |
| +gaps closed over time, not now). The builder-check calls are the author's; |
| +challenge them on correctness and robustness. |
| + |
| +Check: |
| +1. Can the guard really enumerate ALL CLI verb paths and ALL console routes |
| + from code (no second hand list), including config-gated route groups and |
| + commands dispatched into other packages? Name anything it would miss. |
| +2. Would it fail on every kind of drift the spec promises, and not pass |
| + vacuously (e.g. an enumeration that silently returns nothing)? |
| +3. Is the row model (capability rows listing exact members, statuses) sound |
| + and not so noisy that people rubber-stamp rows? |
| +4. Census or other repo gates the build would trip. |
| + |
| +Severity P1/P2/P3; end with exactly one verdict: READY, READY AFTER FIXES, |
| +NOT READY. Do not edit files. No subagents. No full test suites. |
| + |
| +## Round 2 |
| + |
| +Round 1: `CODEX-FINDINGS-parity-guard.md` (P1 CLI enumeration; P2 console |
| +gated routes, exclusive route membership, status structure), all accepted. |
| +First one line per round-1 finding: resolved, partly, or not; then new |
| +findings with their fault family; say whether any family recurs. |