carlos / platform Public

review: parity guard Task 2 Astra round 3 findings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 89693dcc7b6effa1cfb21f886e94151e7abe0e43 parent 53ed9f0
1 file changed, +58 −0
  • docs/superpowers/reviews/CODEX-FINDINGS-parity-guard-T2-R3.md +58 −0

Intent

Human

<task-notification> <task-id>bzau8djyg</task-id> <tool-use-id>toolu_0149M47wrvwF1YuXPmYfSUA3</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/2185be7a-bc2c-4a32-953d-1ee7721363e3/tasks/bzau8djyg.output</output-file> <status>completed</status> <summary>Background command "~/.cache/parity-build/review-t2r3.sh; echo exit=$?" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 5.79 g CO₂e (694,938 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-FINDINGS-parity-guard-T2-R3.md b/docs/superpowers/reviews/CODEX-FINDINGS-parity-guard-T2-R3.md
new file mode 100644
index 000000000..33ddf8661
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-FINDINGS-parity-guard-T2-R3.md
@@ -0,0 +1,58 @@
+R2 P1: **partly resolved**. Direct `instanceupdates.Mount(s.mux, …)` is rejected at [svcroutes_test.go:1203](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-parity-guard/internal/console/svcroutes_test.go:1203), but equivalent registrations still escape the boundary.
+
+1. **P1 — Construction and middleware exceptions still allow the served mux to escape.** Spec B2/B5; Task 2.
+
+ The constructor exception accepts any value for `mux:` in `NewServer`, without checking its origin ([svcroutes_test.go:1192](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-parity-guard/internal/console/svcroutes_test.go:1192)). Before the existing `Server` literal, add:
+
+ ```go
+ m := http.NewServeMux()
+ instanceupdates.Mount(m, "probe",
+ func() (string, error) { return "probe", nil },
+ func(string) (instanceupdates.Report, error) {
+ return instanceupdates.Report{}, nil
+ },
+ )
+ ```
+
+ Then replace the initializer at [server.go:1859](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-parity-guard/internal/console/server.go:1859) with `mux: m`. No forbidden selector appears. `Mount` registers `GET /updates` at [control.go:36](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-parity-guard/internal/instanceupdates/control.go:36), and the existing middleware serves that mux.
+
+ The middleware exception also checks spelling rather than identity: [svcroutes_test.go:1247](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-parity-guard/internal/console/svcroutes_test.go:1247) accepts an identifier named `perf`. A nested block in `NewServer` can shadow it with a value whose `Middleware` function receives `s.mux`, type-asserts it to `*http.ServeMux`, and calls the external mounting helper. Every matching occurrence is exempted, not just the reviewed assignment.
+
+ Both variants add a served route without `claimEntries`; the equality test reads only that inventory ([routedecls_test.go:136](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-parity-guard/internal/console/routedecls_test.go:136)).
+
+ **Concrete fix:** Require the exact fresh-mux initializer and a single middleware assignment resolved to the actual imported package. Refuse other mux construction and escape forms before accepting the source. Include negative fixtures for both examples.
+
+ **Fault family:** Registration completeness—every served route must pass through `registerRoute` and enter the scanned inventory.
+
+2. **P1 — The boundary does not constrain the handler the console actually serves.** Spec B2/B5; Task 2.
+
+ `registrarViolations` does not restrict `s.handler` assignments ([svcroutes_test.go:1202](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-parity-guard/internal/console/svcroutes_test.go:1202)), although requests dispatch through it at [lifetimes_cutover.go:406](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-parity-guard/internal/console/lifetimes_cutover.go:406) and line 424.
+
+ After the normal middleware assignment, create and mount a second mux using the preceding example, then add:
+
+ ```go
+ next := s.handler
+ s.handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ if r.URL.Path == "/updates" {
+ m.ServeHTTP(w, r)
+ return
+ }
+ next.ServeHTTP(w, r)
+ })
+ ```
+
+ This preserves existing routes and serves the additional handler without any forbidden selector or inventory change.
+
+ The new field check does not close alternative access paths either: it collects only named, directly spelled pointer fields ([claim_routes_test.go:81](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-parity-guard/internal/console/claim_routes_test.go:81)). An embedded `*http.ServeMux` has no `fld.Names` and is omitted. Reflection combined with `unsafe` can also recover the existing mux through `FieldByName("mux").UnsafeAddr()` without a `.mux` selector; neither mechanism is refused.
+
+ **Concrete fix:** Extend the enforced boundary to construction, handler assignment and request dispatch. Reject unreviewed alternate serving paths, embedded/aliased routing fields, and reflective or unsafe access to routing state. Pin the reviewed serving implementation or require explicit review when it changes; add a fixture that preserves existing routes while serving an extra one.
+
+ **Fault family:** Registration completeness—the inventory must describe the handler chain that receives requests.
+
+No additional production breakage was identified in `a06cfc26`; these are remaining holes in its guard.
+
+Both P1s share one cause: filtering selected names does not establish exclusive ownership of the serving path. An up-front refusal of all routing forms outside an explicitly checked construction-and-serving boundary would remove them. Cutting the exhaustive completeness claim would remove that obligation, but would leave these routes outside the security scanners. This is round 3 of 3; another review round requires Paul’s approval.
+
+Verification was static. The two targeted registrar tests could not start because the read-only sandbox prevented Go from creating its work directory. No files were edited, no subagents were spawned, and no full suites were run.
+
+**NOT READY**
\ No newline at end of file