notes: parity guard Task 2 mutation checks
The ten mutations of the plan's Task 2 Step 5, each with the test that failed and its message, and the person-only scan gap mutation 8 found.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/superpowers/notes/2026-11-09-parity-guard-mutations.md+29 −0
CI passed — run details
Intent
<task-notification> <task-id>a1f0482034841246c</task-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" is waiting on its own background work</summary> <note>This agent stopped with background work of its own still running. It may resume on its own when that work completes or reports, and the same task-id notifies again if it does; the result below may be interim.</note> <result>Waiting on the full run.</result> <usage><subagent_tokens>266416</subagent_tokens><tool_uses>141</tool_uses><duration_ms>3316036</duration_ms></usage> </task-notification>
<task-notification> <task-id>a1f0482034841246c</task-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" is waiting on its own background work</summary> <note>This agent stopped with background work of its own still running. It may resume on its own when that work completes or reports, and the same task-id notifies again if it does; the result below may be interim.</note> <result>Still waiting on the full console run.</result> <usage><subagent_tokens>266791</subagent_tokens><tool_uses>142</tool_uses><duration_ms>5120764</duration_ms></usage> </task-notification>
<task-notification> <task-id>a1f0482034841246c</task-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" is waiting on its own background work</summary> <note>This agent stopped with background work of its own still running. It may resume on its own when that work completes or reports, and the same task-id notifies again if it does; the result below may be interim.</note> <result>Waiting for the full run to finish.</result> <usage><subagent_tokens>267810</subagent_tokens><tool_uses>144</tool_uses><duration_ms>6926934</duration_ms></usage> </task-notification>
<task-notification> <task-id>a1f0482034841246c</task-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" is waiting on its own background work</summary> <note>This agent stopped with background work of its own still running. It may resume on its own when that work completes or reports, and the same task-id notifies again if it does; the result below may be interim.</note> <result>Still waiting.</result> <usage><subagent_tokens>268768</subagent_tokens><tool_uses>146</tool_uses><duration_ms>8737090</duration_ms></usage> </task-notification>
diff --git a/docs/superpowers/notes/2026-11-09-parity-guard-mutations.md b/docs/superpowers/notes/2026-11-09-parity-guard-mutations.md| new file mode 100644 |
| index 000000000..c6914f75a |
| --- /dev/null |
| +++ b/docs/superpowers/notes/2026-11-09-parity-guard-mutations.md |
| @@ -0,0 +1,29 @@ |
| +# Parity guard, Task 2: mutation checks |
| + |
| +Each mutation was applied by hand to the tree at 90c76253 (plus the scan |
| +fix in e9d1a97b for mutation 8 and its rerun of 6), the named tests were |
| +run with `go test ./internal/console/ -count=1 -run '<tests>'`, and the |
| +file was restored with `git checkout` before the next one. None of them is |
| +in the committed tree. |
| + |
| +| # | Mutation | Failing test | Message | |
| +|---|----------|--------------|---------| |
| +| 1 | `GET /api/cli/apps` declared `Kind: kindPlain` | TestAuthCLIFamilyResolvesOnlyPersons (any test that scans) | `GET /api/cli/apps at routedecls.go:428:2: declared kindPlain, bypassing the role gate` (and `a plain declaration with Allow, Target or Refused, which only cli kinds read`) | |
| +| 2 | `s.mux.HandleFunc("GET /x", s.handleHome)` added in NewServer | TestClaimConsoleMuxHasOneRegistrar | `mux registration outside registerRoute: server.go:1945:2` | |
| +| 3 | `s.registerRoute(routeDecl{Pattern: "GET /y", Handler: (*Server).handleHome}, s.handleHome)` added in NewServer | TestClaimConsoleMuxHasOneRegistrar; TestRouteDeclsMatchRegistrations | `registerRoute outside registerDecls and the helpers forwarding to registerRoute: server.go:1945:2`; `configuration 0: GET /y is registered but no declaration whose gate holds names it` (one line per configuration). Every scanner test (checked with TestAuthCLIFamilyResolvesOnlyPersons) also reports `a routeDecl literal outside routeDecls at server.go:1945:18; every route is declared in routeDecls`. | |
| +| 4 | `GET /api/cli/apps` given `Allow: svcrole.Set{}` | TestEveryCLIDoorNamesItsRoles (all six subtests) | `doors registered with an empty role set: got [... "GET /api/cli/apps" ...], want [...]` | |
| +| 5 | `Gate: gateHostClaim` dropped from `POST /api/cli/ops/hosts/{host}/resolve` | TestEveryCLIDoorNamesItsRoles | `POST /api/cli/ops/hosts/{host}/resolve: declared with gate "", want gateHostClaim` (and the per-configuration presence checks) | |
| +| 6 | `handleCLIWhoami` calls `s.store.CLIPrincipal(bearer(r), time.Now())` | TestAuthCLIFamilyResolvesOnlyPersons | `GET /auth/cli/whoami: resolves a bearer through CLIPrincipal at authcli.go:1365:17 — the /auth/cli/ family must go through cliUser, which answers only for a person` | |
| +| 7 | `GET /auth/cli/whoami` declared `Build: func(s *Server) http.HandlerFunc { return s.handleCLIWhoami }` | TestAuthCLIFamilyResolvesOnlyPersons | `GET /auth/cli/whoami: handler is neither a (*Server) method expression nor a Build returning a function literal; this test cannot see inside it` | |
| +| 8 | `_, _ = principalFrom(r.Context())` in the `GET /healthz` Build literal's inner body | TestAuthCLIFamilyResolvesOnlyPersons | `GET /healthz: resolves a bearer through principalFrom at routedecls.go:367:11 — ...` | |
| +| 9 | `POST /auth/cli/revoke` declaration removed | TestAuthCLIFamilyResolvesOnlyPersons | `POST /auth/cli/revoke: not found as a plain declaration; either it moved or the walker is broken` | |
| +| 10 | `gateDemo.holds` returns false | TestRouteDeclsMatchRegistrations | `GET /api/box/demo-builds: no configuration registers it (gate "demo" never holds)` (one per demo declaration) and `gate "demo" is never on in the configuration matrix` | |
| + |
| +## What the mutations found |
| + |
| +Mutation 8 first PASSED. `assertBodyResolvesOnlyPersons` matched only |
| +selector expressions, and `principalFrom` is a package function, so a call |
| +of it is a bare identifier the scan never saw. That gap predates this |
| +branch (the old scanner had the same match). e9d1a97b makes the scan match |
| +identifiers, which covers selector names too; mutation 8 then failed as |
| +shown, and mutation 6 was rerun and still fails. |