carlos / platform Public

review brief: parity guard Task 2, Astra round 1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 6361f1d1e7bb065ac0bad1951910d8e9abbaed44 parent b331754
1 file changed, +39 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-parity-guard-T2.md +39 −0

Intent

Human

<task-notification> <task-id>a1f0482034841246c</task-id> <tool-use-id>toolu_01WdEFtDvUmd17LEueFeusie</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/2185be7a-bc2c-4a32-953d-1ee7721363e3/tasks/a1f0482034841246c.output</output-file> <status>completed</status> <summary>Agent "Implement Task 2: console routeDecls" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>**Status: done, with two concerns below.** All routes now come from one list, the scanners read that list, and the full console test run was stopped on your instruction. **Commits** (on top of 3d226e39): - Migration, one commit per file: 6ba8172e (server.go), 642b42df (authcli.go), 5d5075e8 (apidemo.go), d261a11e (apidemoreports.go), a9c7d7a5 (apidemooperator.go), ede3a2e0 (apienv.go), 53931f92 (apiinstancemove.go), 82d76a69 (apimail.go). That is 420 declarations, matching the 420 registration calls in the old code. teamdoors.go had no registrations of its own, so it has no migration commit. - 90c76253: the helpers take a `routeDecl`, the group functions are deleted, the scanners are rewritten, and the new equality test is added. - e9d1a97b: fixes a gap in the person-only scan (concern 2). - 22012e0a: updates the record-write census (concern 1). - b3317546: the mutations note, `docs/superpowers/notes/2026-11-09-parity-guard-mutations.md`. **Tests:** - **Builds and checks:** `go build ./...`, `go vet` and `gofmt` are clean. - **Targeted tests:** the scanner, registrar, route census, CLI door roles, person-only, billing door, equality and demo-recovery tests pass at HEAD. The provision record-write census test also passes. - **Brief's broad `-run` pattern:** it hit go test's default 10-minute timeout with no FAIL lines. - **Full console package:** I stopped it by pid after about 90 minutes on a heavily loaded machine. It printed no FAIL lines before the stop. CI on amadan will run the whole package. - **Mutations:** all ten now fail a named test, and none is left in the tree. **Concerns:** 1. **Census change the spec didn't expect.** The record-write census test (`TestPlan9B8RecordWriteCensus` in `internal/provision`) failed after the move. It listed `NewServer`, `registerCLIRoutes` and `registerMovesPhase1Routes` because they held the route patterns, and those now live in `var routeDecls`. 22012e0a adds `internal/provision/parity_guard_census_test.go`, which drops the three and lists `var routeDecls` with the same classification. No record write changes. It needs the branch reviewer's approval like any other record-write census update. I did not run `make census-card`. 2. **Security gap that predates this branch.** Mutation 8 first passed: the person-only scan only matched `x.name` selectors, so a plain handler calling `principalFrom(...)` directly went unseen. e9d1a97b makes it match bare names too; mutations 8 and 6 now fail as they should. **Smaller changes worth knowing:** - **Demo plus host claims:** the equality test can't run with demos fully on alongside host claims, because the console refuses that at startup. I used a demo box on a host-claim console instead; it still turns the demo gate on and the no-host-claim gate off. - **Handler names in the claim list:** a plain route's entry now reads `(*Server).handleX` instead of `handleX-fm`. Only a test diagnostic reads it. - **Moved setup in `NewServer`:** the database setup lines that sat between the old registrations now run before the single registration call, unchanged. Registration reads none of that state. The full report is at `.superpowers/sdd/2026-11-09-parity-guard/task-2-report.md`; git excludes `.superpowers/`, so it is not committed. The scratch directory is removed and nothing I started is still running.</result> <usage><subagent_tokens>278534</subagent_tokens><tool_uses>155</tool_uses><duration_ms>8882128</duration_ms></usage> </task-notification>

Attributed to this commit: 15.2 g CO₂e (1,796,186 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/reviews/CODEX-REVIEW-BRIEF-parity-guard-T2.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-parity-guard-T2.md
new file mode 100644
index 000000000..fa8129249
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-parity-guard-T2.md
@@ -0,0 +1,39 @@
+# Review brief: parity guard slice 3, Task 2 (console route declarations and scanners), round 1 of 3
+
+Repo carlos/platform, branch `design-parity-guard`, commit b3317546a703ac92c7347647b972af524b74c7d8.
+Under review: the diff `3d226e39..b3317546` (12 commits; `git diff 3d226e39..b3317546`), limited to `internal/console/`, `internal/provision/parity_guard_census_test.go`, `internal/provision/plan9_b8_census_test.go` and `docs/superpowers/notes/2026-11-09-parity-guard-mutations.md`.
+Authorities: the spec `docs/superpowers/specs/2026-11-09-parity-guard-design.md` rev 3.1 (approved by Paul 2026-11-09; section B is this task), the plan `docs/superpowers/plans/2026-11-09-parity-guard.md` Task 2, and AGENTS.md. Both are on this branch; the spec was approved as written, so review the code against it.
+
+You are an independent reviewer. Read the spec section B and the plan task, then the code, and check every claim against the code.
+
+## Fixed: do not re-argue
+
+- Paul approved spec rev 3.1 and the cut that moved the CLI registry to slice 4.
+- Builder rulings (plan "Decisions the builder made"): one `Pattern` string as registered plus a `Handler` field instead of the spec's two `Method` fields; `Build` for cli kinds may return any expression (the person-only body scan stays plain-only, as before this branch).
+
+## What to check
+
+1. **Behaviour is unchanged.** Every route registered before this branch (main at `3d226e39`'s parent tree) is registered after it with the same pattern, the same handler, the same wrapper (`registerRoute`, `cliRoute`, `cliRouteJournaled`, `cliScopedRoute`, with the same `allow`, `target`, `refused`) and under exactly the same configuration conditions (`HostClaim`, `RegionHA` nested in `HostClaim`, `MovesEnabled`, `Demo.Enabled || Demo.BoxMode()`, `!HostClaim`). Any route lost, added, re-gated, or moved to a different wrapper is a P1. Check the `sourceAdmission` special case, the team-role panics, and the statements moved in `NewServer` (state set before registration that registration or handlers read).
+2. **The security scanners did not get weaker** (spec B5). Compare old `scanCLISource`, `TestEveryCLIDoorNamesItsRoles`, `TestAuthCLIFamilyResolvesOnlyPersons`, `TestClaimConsoleMuxHasOneRegistrar` and `billingDoorRoutes` with the new ones: bypass detection (an `/api/cli/` door outside a cli kind; a registration or mux call outside the loop and helpers), every cli door names its roles with the gated-door lists now read from `Gate`, person-only over every plain handler with unreadable handlers failing, named presence checks, non-vacuity. Name any input that the old scanners caught and the new ones miss. Check that a `routeDecl` composite literal outside `routeDecls`, or a second list, cannot register a route the scanners do not see.
+3. **The equality test (spec B3)** really compares the runtime register with the declarations whose gate holds, in every configuration, flips every gate both ways, and its negative fixtures exercise the logic production uses rather than a copy.
+4. **The mutation note** lists ten mutations, each with the test that fails; spot-check at least three by reading the test code that would catch them.
+5. **The record-write census re-pin** (`internal/provision/parity_guard_census_test.go`): no write site was added or dropped; the three units really moved into `var routeDecls` and nothing else changed class or kind.
+6. Security gates order (AGENTS.md: session, CSRF, owner, `requireFreshAuth` last) cannot have changed, since handlers are untouched; confirm handlers are untouched.
+
+## Severity
+
+- **P1**: unsafe, would not compile, a test fails, or it would not work. Blocks merge.
+- **P2**: wrong or missing. Fixed without reopening this review. (The census, and review of any newly changed security, root, termination or production-storage behaviour, still check the fix; see AGENTS.md, "Stopping rules".)
+- **P3**: clarity or polish. Goes on a follow-up list; never a reason for another round.
+
+A P1 states its failure scenario and the evidence (file:line). Do not raise a P2 to P1 to keep the review open.
+
+## Output
+
+Findings ranked P1, P2, P3. Each gives the section or task, the problem, the evidence (file:line, verified), the failure scenario, a concrete fix and the invariant or trust boundary it breaks (that is its fault family). End with exactly one verdict:
+
+- **READY**: no P1 and no P2.
+- **READY AFTER FIXES**: no P1. The listed P2s are fixed without another round.
+- **NOT READY**: one or more P1s, listed.
+
+Do not edit files. Do not spawn Anthropic-model reviewers or subagents of your own. Do not run the full test suites (targeted `go test -run` on a named test is fine).