review: Plan 6 whole-branch R1 findings and the R2 brief
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/superpowers/reviews/CODEX-FINDINGS-rootfs-apps-6-branch-R1.md+103 −0docs/superpowers/reviews/CODEX-REVIEW-BRIEF-rootfs-apps-6-branch-R2.md+27 −0
CI failed — run details
Intent
<task-notification> <task-id>a5339d0c974800f9a</task-id> <tool-use-id>toolu_01D7oRpJkkjnCUiiXCPDH9ur</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ba9fa944-a429-4788-9b3c-f2b2f42617f3/tasks/a5339d0c974800f9a.output</output-file> <status>completed</status> <summary>Agent "Plan 6 Task 16: carlos run on fleet" 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>Both review findings are fixed, committed and pushed. - **Commit:** 45736122. - **Pushed tip:** `origin/rootfs-apps-6-interactive` at 45736122 (fast-forward from 3e60617e, no force). - **Tests:** all pass once: console targeted (run door, relay, interactive, route roles, claims, lifetimes), provision census and run, host run/relay, both tagged witnesses. Cross-builds for darwin/arm64, windows/amd64 and linux/arm64 pass. Each check has a mutation: P1's door check, P1's pickup check, and P2's journal call were each removed in turn, and each was caught by its test. - **Seal:** unchanged at c86929d0. Only the `internal/provision` envelope moved; I re-proposed the overlay with all 72 claims carried over unchanged, and `make census-card` is clean. **P1, pickup after the grant expires:** - The run door now refuses a run past its grant's `pickupBy`: a 404, before any sweep has pruned it. - The pickup itself now uses `provision.RunPickBefore`. It refuses a queued run past either the record's pickup deadline or the grant's, checked inside the mutation, so a retried write asks again. It adds no store request. - One witness has a box attach in time but its pickup lands past the window: it gets not-picked, the record is unchanged, and the sweep then expires the run with today's result. The other replays an expired token at the door and gets a 404 with no upgrade. **P2, refused service credential leaves no trace:** - The interactive route is now registered through a new `cliRouteJournaled`. When the role gate refuses a service credential, it writes the door's journal line, once per caller per minute, and still returns the same 403. - The test now goes through the registered HTTP route. It sends two attempts and expects one 403 journal line. - The route-roles test's source scanner had to learn the new registration function, in `svcroutes_test.go`. The two re-pinned record-write census entries are `Server.relayPickup` and `Server.registerCLIRoutes`. I left the untracked `docs/superpowers/reviews/CODEX-FINDINGS-rootfs-apps-6-branch-R1.md` out of the commit, since it isn't my file.</result> <usage><subagent_tokens>541313</subagent_tokens><tool_uses>20</tool_uses><duration_ms>551424</duration_ms></usage> </task-notification>
Attributed to this commit: 43.1 g CO₂e (5,604,879 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on rootfs-apps-6-interactive, 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-rootfs-apps-6-branch-R1.md b/docs/superpowers/reviews/CODEX-FINDINGS-rootfs-apps-6-branch-R1.md| new file mode 100644 |
| index 000000000..8fb8814d1 |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/CODEX-FINDINGS-rootfs-apps-6-branch-R1.md |
| @@ -0,0 +1,103 @@ |
| +Reviewed `6f1f6ca6..098df29c`, whole-branch round **1 of 3**. No files edited or subagents spawned. |
| + |
| +**P1 — Task 16: the console can pick a run after its grant expires.** |
| + |
| +Evidence: [apirunsbox.go:213](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-6/internal/console/apirunsbox.go:213) checks the token without checking `pickupBy`. `claim` checks only attachment state. After reading `request.json`, [relayPickup:392](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-6/internal/console/apirunsbox.go:392) invokes `RunPick`, whose queued-state check at [run.go:238](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-6/internal/provision/run.go:238) also ignores the pickup deadline. Pruning occurs in the sweep and skips attached relays. |
| + |
| +Failure scenario: a box verifies its grant and connects at 59 seconds. The request read finishes at 61 seconds, before the next expiry sweep. The console picks the still-queued run and the box launches it after the signed pickup window. A caller replaying an expired token can also reach this path between sweeps. |
| + |
| +Fix: enforce expiry when claiming the relay and again inside the pickup mutation, checking the grant’s `pickupBy` and the queued record’s deadline. Cover a connection established before expiry whose pickup crosses the deadline. These checks require no additional store requests. |
| + |
| +Fault family: **grant expiry must be enforced at the console’s write-authority boundary**, independently of box cooperation and housekeeping. |
| + |
| +**P2 — Task 10/refusal follow-up: service-credential refusals bypass the required journal line.** |
| + |
| +Evidence: the interactive route uses the empty role set at [authcli.go:799](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-6/internal/console/authcli.go:799). A valid service credential therefore returns from `cliGate` at [authcli.go:475](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-6/internal/console/authcli.go:475), before reaching `journalUnplaced` at [apiinteractive.go:98](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-6/internal/console/apiinteractive.go:98). The logging witness invokes the handler directly at [apiinteractive_refused_test.go:274](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-6/internal/console/apiinteractive_refused_test.go:274), bypassing that gate. |
| + |
| +Failure scenario: a service credential requests an interactive session through the real HTTP route. It is correctly refused, but produces neither an interactive audit row nor the controller-required refusal journal line. |
| + |
| +Fix: journal the interactive route’s service refusal where the outer gate rejects it, retaining the role-first refusal and rate limit. Exercise this through the registered HTTP route. |
| + |
| +Fault family: **refusal observability across authentication layers**. |
| + |
| +No new P3 findings. The swallowed audit-insert error remains the expressly deferred follow-up in `progress.md:95`; audit completeness still has that recorded limitation. |
| + |
| +Task 16 departures: |
| + |
| +- **Console End after durable `result.json`: accepted.** It acknowledges the result; the separately admitted finish continues through cutover. |
| +- **Run-ended log after the bucket done attempt: accepted.** It remains conditional on successful result writing. |
| +- **RUN-C21 retired through `runCopyRetired`: accepted.** The obsolete refusal is removed while its approved historical row remains accounted for. |
| + |
| +The budget witnesses count actual S3 requests: **13 judged / 11 legacy console requests beyond chunks**, and **2 object GETs plus 3 record reads on the box**. No new recurring per-box polling was found. |
| + |
| +**Census verdicts** |
| + |
| +**APPROVE applies individually to every unit named below.** Evidence locations are relative to this worktree. These approvals concern the root-read boundaries; the console findings above remain outstanding. |
| + |
| +| File | Units and verified lines | Verdict and basis | |
| +|---|---|---| |
| +| `interactive_cli.go` | `consoleOpen:142`, `sessionOpen:149`, `runSession:167`, `type session:235`, `session.bridge:349`, `openSession:571` | **APPROVE each.** CLI state, authenticated connection and existing terminal descriptors; `Open` references are type names. | |
| +| `interactive_term_unix.go` | `fdInput.Read:168` | **APPROVE.** Existing stdin only; nonblocking reads return to stop-aware polling. | |
| +| `internal/activator/activator.go` | `type Service:1244`, `Service.installProcLocked:3171`, `Service.finishStop:4888`, `Service.sweepOnce:5105` | **APPROVE each.** Watch installation covers rootfs entries; outstanding kills retain the entry; attached sessions receive the existing hold protections. | |
| +| `internal/activator/backend_rootfs.go` | `ExecBackend.StartRelease:176`, `ExecBackend.startRootfsCmd:228`, `ExecBackend.startRootfsRun:316`, `ExecBackend.KillOneShot:372` | **APPROVE each.** Serving-image provenance, role restrictions, root validation and bounded termination proof remain intact. | |
| +| `internal/activator/backend_unit.go` | `SplitBackend.KillOneShot:524` | **APPROVE.** Dispatches to the selected backend or refuses. | |
| +| `internal/activator/cmd.go` | `sessionIncarnationLocked:54`, `Service.stopOneShotsAtLeaseLocked:548`, `Service.stopOneShotAtLease:569`, `Service.killOneShot:601`, `Service.RunCmd:713` | **APPROVE each.** Exact session lifetime comparison, including zero; role-specific outstanding-kill counts prevent successor-unit reuse. | |
| +| `internal/activator/cmdunit.go` | `type CmdSpec:40`, `ExecBackend.ttyVars:233`, `ExecBackend.StartCmd:389`, `cmdUnit.Poll:517`, `cmdUnit.StopAndSettle:548` | **APPROVE each.** Separate role inputs and environments; validated starts; role-specific polling; proof precedes I/O cleanup. | |
| +| `internal/activator/prepare.go` | `ExecBackend.prepareKeyedAt:61` | **APPROVE.** Extends the existing one-shot exceptions to tty, removing unintended environment/log handling. | |
| +| `internal/activator/pty_linux.go` | `openPTY:40`, `ptyTerminal.Read:267` | **APPROVE each.** Fixed `/dev/ptmx`, slave obtained by descriptor, exclusive slave and root-peer handoff. | |
| +| `internal/activator/rootfs_service.go` | `Service.rootfsTick:673`, `Service.residentLeaseShort:930`, `Service.residentLeaseLost:958`, `Service.residentLeaseLostLocked:991` | **APPROVE each.** Covers hibernating one-shots and retains outstanding termination authority against entry reuse. | |
| +| `internal/activator/rootfsenv.go` | `ExecBackend.rootfsTTYVars:28` | **APPROVE.** Composes the generation environment with canonical instance values. | |
| +| `internal/activator/rootfsrelease.go` | `Service.runRelease:367`, `Service.releaseAdmitLocked:574` | **APPROVE each.** Release holds remain cmd-specific; either role’s start window refuses admission. | |
| +| `internal/host/agent.go` | `runAgent:238`; changed wiring at `701`, `1115` | **APPROVE.** Passes the existing judge and joins interactive shutdown. | |
| +| `internal/host/interactive.go` | `interactiveWorker.owned:243`, `interactiveWorker.consider:255`, `sessionRun.receiveOpen:472`, `sessionRun.serve:628`, `sessionRun.bridge:736` | **APPROVE each.** Ownership, HA hold, signed grant, incarnation and setting checks precede launch; termination proof gates session completion. | |
| +| `internal/host/runexec.go` | `runsWorker.execute:129` | **APPROVE.** Directory removal belongs to `AfterSettled`; relay loss cancels execution; bucket writes retain their sink. | |
| +| `internal/host/runs.go` | `runsWorker.consider:169`, `runsWorker.pickup:229` | **APPROVE each.** Fleet paths avoid direct writes; pickup retains judged read-back and ownership checks. | |
| +| `internal/host/runrelay.go` | `runsWorker.sinkFor:138` | **APPROVE.** Checks HA ownership and the signed run/account/app/host scope before dialing; no root input added. | |
| +| `internal/host/units/carlos-instance-cmd@.service` | `external:1` | **APPROVE.** Restrictive `/dev/pts` mount only. | |
| +| `internal/host/units/carlos-instance-gen@.service` | `external:1` | **APPROVE.** Same restrictive namespace addition. | |
| +| `internal/host/units/carlos-instance-probe.service` | `external:1` | **APPROVE.** Restrictive mount and fixed capability environment preserve rollout compatibility. | |
| +| `internal/host/units/carlos-instance-seed@.service` | `external:1` | **APPROVE.** Restrictive namespace addition. | |
| +| `internal/host/units/carlos-instance-sidecar@.service` | `external:1` | **APPROVE.** Restrictive namespace addition. | |
| +| `internal/host/units/carlos-instance@.service` | `external:1` | **APPROVE.** Restrictive namespace addition. | |
| +| `internal/host/units/carlos-instance-tty@.service` | `external:1`; stdin `40`, executable binds `64` | **APPROVE.** Protected handoff socket, root-controlled executable sources and unchanged namespace boundary. | |
| +| `internal/host/units/carlos-instance-rootfs-tty@.service` | `external:1`; image `66`, launch/resolver binds `70` | **APPROVE.** Role-specific root-controlled image and launch sources; rootfs isolation retained. | |
| +| `internal/instancectl/cmd.go` | `Server.oneShotStatus:159` | **APPROVE.** Validated host and route-selected role determine a read-only status query. | |
| +| `internal/instancectl/rootfs.go` | `resolveRootfsLaunch:224`, `Server.ensureRootfsExe:315` | **APPROVE each.** TTY shares the validated process/argv rules and root-owned layout walk. | |
| +| `internal/instancectl/server.go` | `type Server:40` | **APPROVE.** Declaration comments describe role-specific locks; no new read. | |
| +| `internal/instanceexec/probe.go` | `productionProbeEnv:125` | **APPROVE.** Namespace-local probe wiring and fixed capability switch. | |
| +| `internal/instanceexec/tty_linux.go` | `receivePTY:72` | **APPROVE.** Validates one received descriptor as a tty slave; refusals close received descriptors. | |
| +| `internal/interactive/frames.go` | `Receive:88`, `readRefusal:301`, `handshakeRecorder.Read:354` | **APPROVE each.** Existing dialed connection and bounded in-memory handshake/frame consumption. | |
| +| `internal/interactive/grant.go` | `MintToken:149` | **APPROVE.** Cryptographic randomness; no tenant-selected path. | |
| +| `internal/interactive/interactive.go` | `type Open:142`, `Open.Normalized:164`, `Open.Check:176` | **APPROVE each.** In-memory declarations, defaults and validation. | |
| +| `internal/layout/plan.go` | `NestedPlatformNames:199` | **APPROVE.** Adds one fixed platform filename. | |
| +| `internal/provision/reconcile.go` | `Reconcile:1065`; hook `1722` | **APPROVE.** Notes scoped session records; main’s fleet-box ownership exclusions remain present. | |
| +| `internal/provision/seed.go` | `SeedAbortBecause:231` | **APPROVE.** Adds an import-abort refusal while a session marker exists. | |
| +| `run.go` | `runRun:864` | **APPROVE.** Dispatches interactive requests through the authenticated session client. | |
| + |
| +Removed unit: |
| + |
| +| Unit | Verdict | Evidence | |
| +|---|---|---| |
| +| `internal/instancectl/cmd.go:Server.handleCmdStatus` | **APPROVE** | Accounted-for move into `Server.oneShotStatus:159`; role/query validation remains present. | |
| + |
| +Re-pinned envelopes: |
| + |
| +| Envelope | Verdict | Evidence | |
| +|---|---|---| |
| +| `.` | **APPROVE** | Terminal lifecycle changes above; Task 13 round 2 stops stdin before restoration and restores descriptor flags after joining. | |
| +| `internal/activator` | **APPROVE** | Role separation, proof-backed cleanup, lease-kill joining and generation pins remain intact. | |
| +| `internal/appconfig` | **APPROVE** | `interactive.go:39` validates names and changes only the default bundle’s setting through CAS. | |
| +| `internal/host` | **APPROVE** | Reviewed worker wiring, grant verification, launch checks and sink dispatch above. | |
| +| `internal/host/units` | **APPROVE** | Reviewed namespace restrictions and both role-specific tty templates above. | |
| +| `internal/instancectl` | **APPROVE** | Route-selected roles, validated staged sources, separate locks and proof-backed removal remain enforced. | |
| +| `internal/instanceexec` | **APPROVE** | Descriptor validation and controlling-terminal setup preserve tenant execution identity and namespace scoping. | |
| +| `internal/interactive` | **APPROVE** | Signed kinds and disjoint IDs separate grants; framing and handshake reads remain bounded. | |
| +| `internal/layout` | **APPROVE** | Fixed tty platform-name addition only. | |
| +| `internal/provision` | **APPROVE** | Additive marker, guarded transitions, scoped reconciliation hook and import refusal. | |
| +| `internal/runs` | **APPROVE** | Chunk output moves behind a validated sink; create-only bucket behavior and lost-sink termination remain intact. | |
| + |
| +This explicitly approves Task 13 round 2’s `openSession`, `fdInput.Read` and root envelope, plus Task 16’s `consider`, `pickup`, `sinkFor` and extended `execute` claim. |
| + |
| +Read-only fingerprint checks matched **71 unit bodies**, **69 legacy fingerprints**, and all **51 chain seals**, ending at `c86929d08b9b2038fa103d1c7311ab2958e7100e92dc550d36daeb364affd029`. Targeted Go tests and dependency listing could not start because the sandbox denied Go’s temporary/cache writes. Darwin and Windows stubs were inspected; cross-builds were not rerun. No full suites ran. |
| + |
| +**NOT READY** |
| \ No newline at end of file |
diff --git a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-rootfs-apps-6-branch-R2.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-rootfs-apps-6-branch-R2.md| new file mode 100644 |
| index 000000000..2ee049756 |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-rootfs-apps-6-branch-R2.md |
| @@ -0,0 +1,27 @@ |
| +# Review brief: rootfs apps Plan 6, whole branch, round 2 of 3 |
| + |
| +Repo carlos/platform, branch `rootfs-apps-6-interactive`, commit 45736122 (run `git rev-parse HEAD` for the full sha). |
| +Under review: the fix diff `3e60617e..45736122`, in the context of round 1's brief, `docs/superpowers/reviews/CODEX-REVIEW-BRIEF-rootfs-apps-6-branch.md`, whose authorities and fixed rulings still hold. |
| + |
| +## Round 2 |
| + |
| +Earlier rounds: `docs/superpowers/reviews/CODEX-FINDINGS-rootfs-apps-6-branch-R1.md`. |
| + |
| +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 in the changed code only. The verdict covers everything outstanding. |
| + |
| +Also check: |
| +- RunPickBefore: the deadline is checked inside the mutation, so a retried CAS re-checks it; no store request is added; the bucket path (non-fleet) is unchanged. |
| +- cliRouteJournaled: the 403 and role-first ordering are unchanged for every other route; the journal line is rate-limited per caller per minute. |
| +- Census: the internal/provision envelope re-pin and the record-write re-pins of Server.relayPickup and Server.registerCLIRoutes. APPROVE or REJECT. |
| + |
| +## 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. |
| +- **P3**: clarity or polish. Goes on a follow-up list. |
| + |
| +## Output |
| + |
| +Findings ranked P1, P2, P3, each with evidence (file:line), failure scenario, fix and fault family. Then the census verdicts. End with exactly one verdict: READY, READY AFTER FIXES, or NOT READY (with the P1s listed). |
| + |
| +Do not edit files. Do not spawn Anthropic-model reviewers or subagents of your own. Do not run the full test suites. |