carlos / platform Public

Tunnel WebSockets (#471): Astra plan review brief, round 2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 464897b715664c2dfe1959350dad0990098f9da4 parent 8d3bd5f
1 file changed, +56 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-tunnel-websockets-plan-R2.md +56 −0

CI passed — run details

Intent

Attributed to this commit: 45.4 g CO₂e (5,898,652 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on design-tunnel-websockets-471, 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-tunnel-websockets-plan-R2.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-tunnel-websockets-plan-R2.md
new file mode 100644
index 000000000..fd72b3a28
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-tunnel-websockets-plan-R2.md
@@ -0,0 +1,56 @@
+# Review brief: tunnel WebSockets implementation plan (#471), round 2 of 3
+
+Repo carlos/platform, branch `design-tunnel-websockets-471`, commit 8d3bd5f1dd655d68149c6719711a002fcacaca29.
+Under review: `docs/superpowers/plans/2026-10-30-tunnel-websockets.md` (rev 2).
+Authorities: `docs/superpowers/specs/2026-10-30-tunnel-websockets-design.md` rev 4, APPROVED by Paul 2026-10-30 (recorded on #471), on this branch; main's code at `c24e7a04`, merged into this branch at `4c4bc976`; `docs/superpowers/plans/2026-10-30-fleet-public-routes.md` (house style); `docs/site/rails.md` (the sample's build and check); AGENTS.md (census, request budget, provider-neutral core, production-wired witnesses, stopping rules). Do not review against unmerged branches; if this work needs one, say so as a P1 and stop.
+
+You are an independent reviewer. Read the plan, then the spec, then the code it names, and check every claim against that code (file:line). Library code is golang.org/x/net v0.60.0 and the Go 1.26.10 standard library.
+
+## Fixed: do not re-argue
+
+- The spec, rev 4, as approved by Paul: option B (the upgrade carried unchanged in one HTTP/2 stream); the cap of 128 per box; the hub's receive windows unchanged; `-tunnel` rows included; the Action Cable channel in the sample as the last code task; the tenancy sweep with one reload mutex; the reservation with an `AfterFunc` backstop; no release floor, no switch. Report only where the plan fails to implement the spec, or where the spec's mechanism cannot be built as the plan says.
+- The controller's plan requirements (platform-60): Task 0 copy deck TWS-C01..C03 kept pending until Paul approves the text; upgrades stay refused until Task 5 turns on the hub's marker; every changed function's callers listed and migrated in its task; every refusal test with a fixture that can produce the refusal; interleavings on deterministic hooks; one shared decision; persisted changes read back before use; a live task with a 101, the welcome and pings, a revocation and plain HTTP unchanged, no flagship.
+- The controller's rulings on round 1 (platform-60): P1-1 no production trust seam, the witnesses re-run their own test binary as a child with `SSL_CERT_FILE` naming the fixture's CA, `tunnelclient.Dial` unchanged, the helper named and the child shown getting a connected channel; P1-2 the inline script submits the form with `fetch` (same POST, the form's CSRF token, no navigation) and the page updates only from the broadcast, no new visible words; P2-3 `Config.Limits` reaches `serveUntilDead` and `Serve`, the `Loop` caller at `fleet_public_routes_e2e_test.go:500` and every `NewTunnelHub` caller covered; P2-4 case 2 repeated in full through a static `-tunnel` route; P2-5 `carlos ship --check` with the guide's placeholders plus a WebSocket handshake against the container; P2-6 `carlos apps delete --account bab cable`, cleanup by the Trash's expiry, no purge step. Report only mechanisms that fail these.
+
+## What to check
+
+1. The trusted child (Task 6's `runTrustedChild`): does re-running the test binary with `SSL_CERT_FILE` and an empty `SSL_CERT_DIR` make Go's Linux system pool trust the fixture CA for `tunnelclient.Dial` (`crypto/x509/root_unix.go:36`, `:53`; `internal/tunnelclient/tunnelclient.go:206-209`), with verification on? Is the child's "connected channel" assertion and the unknown-CA negative control enough to prove it? Is the `//go:build linux` restriction acceptable for CI?
+2. The sample (Task 8): does intercepting the `button_to` form's submit and posting it with `fetch` keep the CSRF check passing and avoid navigation? Does broadcasting `done` and `total` keep both counts right without a reload? Are there any new visible words?
+3. The container check (Task 8 Step 2): will the stated `docker run` start migrations and puma on port 3000 with the image as built, and will Action Cable accept the `https://127.0.0.1:3000` origin under `assume_ssl`?
+4. The inventory (Tasks 1, 3, 5): `serveUntilDead`'s new parameter and `TestLoopAppliesConfigLimits`; the `NewTunnelHub`/`EnableTunnels` caller list; the nil-edge fail-closed path.
+5. Case 2b (Task 6): is it case 2 in full through the third arm, on the real box edge and shim?
+6. Task 10's revocation and cleanup against `apps.go:140-145`, `:240-248` and `docs/site/cli.md:141-142`.
+7. Anything rev 2 broke that round 1 did not flag.
+
+## Round 2
+
+Earlier rounds: `docs/superpowers/reviews/CODEX-FINDINGS-tunnel-websockets-plan-R1.md` (round 1, NOT READY, 2 P1 and 4 P2). The round number counts every earlier review of this plan, under any file name or reviewer.
+
+Where rev 2 answers each round 1 finding (the plan's "Review dispositions (Astra plan R1)" table has the detail):
+
+- P1-1 (TLS trust for the real loop): Task 6 Interfaces (`runTrustedChild`, `newTLSFixture`, `trusted_child_test.go`, `//go:build linux`), Task 6 Step 1's first assertion and `TestTrustedChildIsNeeded`; Task 7 Interfaces.
+- P1-2 (the form reloads the page): Task 8 Interfaces (the `fetch` interception, `PingJob`'s broadcast of `done` and `total`, the two spans); Task 10 Step 3.
+- P2-3 (inventory): Task 1 callers and Interfaces (`serveUntilDead`), `TestLoopAppliesConfigLimits`; Task 3's caller list and Step 2's extra runs; Task 5's `EnableTunnels` entry, `TestHubWithoutEdgeRefusesUpgrades` and census step.
+- P2-4 (the `-tunnel` arm): Task 6 case 2b.
+- P2-5 (the container check): Task 8 Steps 1 and 2.
+- P2-6 (the delete command and purge): Task 10 Step 4.
+
+First give one line per P1 and P2 from round 1: resolved, partly, or not. Carry every unresolved or partly resolved finding forward at its current severity, then add new findings. The verdict covers everything outstanding, earlier rounds included.
+
+## Severity
+
+- **P1**: unsafe, would not compile, a test fails, or it would not work. Blocks the plan.
+- **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.