rootfs plan 6: amendment rev 3 (Astra R2: 1 P1, 1 P2 resolved) and the R3 brief
- P1 (Task 16 cutover witness): kept the cutover refusal and no redial. The CLI keeps following through the drain (its expire POST gets 503 from the draining gate, which runAnswer does not type as a console refusal) and exits 3 only after a terminal expiry lands following activation, by its own retry or by the sweep. Two witnesses: the sweep path with the CLI's expire request held, and the CLI path. Corrected the deadline claim and the finish-retry bound (activation needs lifetimeSettle plus a watch pass or cutover poll). Swept the same family in Tasks 10 and 11: activation is driven by clock plus lifetimesWatchOnce; the session timeline is stated; new TestAWaitingSessionExpiresDuringTheDrain. - P2 (Task 10 budget): the four scoped mutations' change-index GET/PUT pairs (8 requests) counted apart from the serial bump's GET/PUT; totals 21 judged / 18 legacy; record, judge, index and serial retries listed separately. Same accounting added to Task 16. Findings: docs/superpowers/reviews/CODEX-FINDINGS-rootfs-plan6-amendment-R2.md Brief: docs/superpowers/reviews/CODEX-REVIEW-BRIEF-rootfs-plan6-amendment-R3.md No code changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/superpowers/plans/2026-10-24-rootfs-apps-6-interactive.md+97 −22docs/superpowers/reviews/CODEX-FINDINGS-rootfs-plan6-amendment-R2.md+31 −0docs/superpowers/reviews/CODEX-REVIEW-BRIEF-rootfs-plan6-amendment-R3.md+94 −0
CI failed — run details
Intent
<task-notification> <task-id>a22c01ff96affa652</task-id> <tool-use-id>toolu_013SHsqGMe7UqaUHPHHB5oFm</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ba9fa944-a429-4788-9b3c-f2b2f42617f3/tasks/a22c01ff96affa652.output</output-file> <status>completed</status> <summary>Agent "#471 Task 1: box half" 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. I fixed both Important findings and the first two Minors in one commit, as asked; the bufio.Reader Minor stays as accepted. **Commit:** `8b89a04b` on design-tunnel-websockets-471, not pushed. It sits on top of the Task 1 commit `13985af5`. **Tests:** all 16 tunnelclient tests pass under `-race`. The edge run (`TestTunnel|TestFleet|TestReqRecords|TestGuard`), build, vet, gofmt and the darwin/windows/arm64 cross-builds are clean. The census card is unchanged, so the spec §7 paragraph still holds. **What changed:** 1. **Marker leak (Important 1):** the shim now strips an app-set `Carlos-Tunnel-Upgraded` when the handler returns without writing anything, on both the plain and the upgrade path. A hijack's own 200 keeps its marker. The reviewer's case is now a subtest on each path; both failed before the fix and pass after. 2. **Write fence (Important 2):** a new test, `TestShimHoldsTheStreamWhileAWriteIsBlocked`, replaces the old one that depended on scheduling. - The hub never reads, so a 5 MiB write can't finish against its 4 MiB stream window. - Two test hooks on the conn mark when the write is inside the guarded section and when the fence starts. They are unset in production. - While the write is blocked, only one thing can happen: the fence starts if it is there, or ServeHTTP returns if it is not. The test decides on whichever arrives, not on timing. - Removing only `fence()` fails it in 30 of 30 runs under `-race`. 3. **FlushError (Minor 1):** `shimWriter.FlushError` now returns the stream's error, and `Flush` calls it. The new test resets the stream and checks that the flush fails, with a live-stream control. 4. **Two marker lines (Minor 2):** `TestShimRefusesABadToken` now has a "two marker lines" case that must get a 400 without reaching the handler. **Mutations caught:** | Mutation | Test that fails | |---|---| | Drop the strip on return | Both "returns without writing" subtests | | Drop only `fence()` | `TestShimHoldsTheStreamWhileAWriteIsBlocked` | | `FlushError` returns nil | `TestShimFlushReportsTheStreamError/reset_stream` | | Drop the `len(toks) != 1` check | `TestShimRefusesABadToken/two_marker_lines` | **Concerns:** - The fence test and the two-lines case pinned behaviour that already worked, so they passed at RED. The mutations are what show they fail when that behaviour is removed. - The fence test pins the accepted behaviour from review Minor 4: a write blocked on hub flow control holds the box handler open until the hub resets the stream. Tasks 2 and 5 must keep the hub resetting the stream on `Close`, and keep the reservation's context backstop. The fix report, with commands and output, is appended to `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-tunnel-websockets-471/.superpowers/sdd/2026-10-30-tunnel-websockets/task-1-report.md`.</result> <usage><subagent_tokens>179333</subagent_tokens><tool_uses>15</tool_uses><duration_ms>281166</duration_ms></usage> </task-notification>
<task-notification> <task-id>a6e0f081246482cb1</task-id> <tool-use-id>toolu_0145yEaPnc9NbcMb284QFdbE</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ba9fa944-a429-4788-9b3c-f2b2f42617f3/tasks/a6e0f081246482cb1.output</output-file> <status>completed</status> <summary>Agent "Re-review #471 Task 1 fixes" 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>- **Important 1 (marker escapes when the handler returns without writing):** ADDRESSED. `upgrade.go:103` defers `stripUnwritten()` ahead of the marker branch, so it covers the plain and upgrade paths. `:162-166` skips a hijacked stream, so the hijack's own 200 keeps its marker. Pinned by the "return" subtest at `upgrade_box_test.go:205-217` and "returns without writing" at `:247`. - **Important 2 (nothing pins the fence):** ADDRESSED. `TestShimHoldsTheStreamWhileAWriteIsBlocked` (`upgrade_box_test.go:528`) blocks a 5 MiB write on the hub's 4 MiB stream window and returns the handler under it. It then waits on `hookFence` versus `ServeHTTP` returning. Only the fence can win while the write is blocked, so dropping `fence()` (`upgrade.go:217`) fails it. The timeouts are failure bounds only; they don't decide the order. - **Minor 1 (no `FlushError` on `shimWriter`):** ADDRESSED. `upgrade.go:196` strips and returns the stream's flush error, and `Flush` at `:192` calls it. `TestShimFlushReportsTheStreamError` (`upgrade_box_test.go:600`) fails if the error is swallowed, and has a live-stream control. - **Minor 2 (more than one marker line untested):** ADDRESSED. `upgrade_box_test.go:285` ("two marker lines") must get a 400 with no handler run. That exercises the `len(toks) != 1` refusal at `upgrade.go:112`. - **Test hooks:** `hookWrite` and `hookFence` (`upgrade.go:277-280`) are nil in production and cannot be set from outside the package. They are fields of the unexported `upgradedConn`, and `Hijack` returns a `net.Conn`. The only assignments in the module are at `upgrade_box_test.go:543-544`, after `Hijack` and before the conn is shared. Their reads are nil-guarded at `upgrade.go:298` and `:322`. - **Test run:** I ran the new and changed tests once with `-race -count=1` and `TMPDIR=/tmp/g`. All passed (1.055 s). The fix report names the covering tests and shows RED output and mutation results, and they match the diff. - **New breakage:** no Critical or Important. One Minor: `hookFence` fires at the start of `fence()`, before `life.Lock()` (`upgrade.go:321-323`). The test pins that `finish` calls `fence()`. A mutation that keeps the call but removes the lock lines would not reliably fail it. I'd accept that. - **Out-of-scope observations:** none. - **Fix round:** all findings addressed, no new Critical/Important breakage. The report is in `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-tunnel-websockets-471/.superpowers/sdd/2026-10-30-tunnel-websockets/task-1-rereview-1.md`.</result> <usage><subagent_tokens>65390</subagent_tokens><tool_uses>10</tool_uses><duration_ms>71655</duration_ms></usage> </task-notification>
Attributed to this commit: 20.5 g CO₂e (2,704,146 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/plans/2026-10-24-rootfs-apps-6-interactive.md b/docs/superpowers/plans/2026-10-24-rootfs-apps-6-interactive.md| index ddde9b02d..242f7aaad 100644 |
| --- a/docs/superpowers/plans/2026-10-24-rootfs-apps-6-interactive.md |
| +++ b/docs/superpowers/plans/2026-10-24-rootfs-apps-6-interactive.md |
| @@ -85,7 +85,7 @@ Findings from `docs/superpowers/reviews/CODEX-FINDINGS-rootfs-plan6-amendment-R1 |
| - **P1-2, no interface carries the declared-process selector: accepted.** Checked: `TTYSpec` had only the terminal fields, `CmdSpec` (`internal/activator/cmdunit.go`) has no process field, and root gives a declared process its own env and working directory but an argv web's (`internal/instancectl/rootfs.go`, `resolveRootfsLaunch`). Fix: `CmdSpec.Process`, carried end to end (Task 8's six-hop list). The CLI's `Open.Process` is kept by the console (Task 10, which no longer rewrites `Open` to the resolved argv), forwarded by the splice (Task 11) and set by the box (Task 12). The backend picks `rootfsCmdLaunch{Process}` or `{Argv}`, exactly one. Tests: `TestRootfsTTYKeepsTheDeclaredProcess` (Task 8), `TestRootfsTTYDeclaredProcessKeepsItsEnvAndDir` (Task 6), `TestInteractiveWorkerPassesTheProcessThrough` (Task 12), and the extended `TestConsoleProcessResolvesFromTheManifest` and `TestSpliceCarriesBothWays`. |
| - **P1-3, renaming the cleanup owner breaks the pinned removal guards: accepted.** Checked: `rootfsRemovalOwners` names `cleanCmdExe` (`internal/instancectl/rootfs_removal_guard_test.go`), `removalAllowPins` pins it, and its ceiling refuses any new entry (`internal/activator/rootfs_invariants_test.go`). Fix (Task 6): no owner is renamed or added. `cleanCmdExe`, `removeCmdExe` and instancectl's `startRootfsCmd` keep their names and gain a role parameter. The guard lists stay byte for byte. Task 6 runs all four guards: `TestRootfsFilesAreRemovedOnlyBehindTheProof`, `TestRootfsRemovalGuardFixtures`, `TestRootfsRemovalOwnersUnchanged` and `TestRootfsInvariantTablesOnlyGrow`. In the same family, Task 7a's rootfs run arm and `KillOneShot` move into `backend_rootfs.go`, so the INV-1 verb guard reads them. `oneShotKiller` joins `rootfsSeamInterfaces`, and Task 8 adds the binary tty verbs to `rootfsBinaryVerbs`. Both are detector lists that may only grow. |
| - **P1-4, C47's third checked consumer: accepted.** Checked: `IP1-57` in `docs/superpowers/plans/2026-10-21-instance-policy-copy.json:82` holds today's text, and `TestInstancePolicyCopyIsApplied` (`approved_instance_policy_copy_test.go:42`) checks it. Fix (Task 4): all three checked records change in one commit (RFS-6-C47, `zdd.apps-set.nothing`, `IP1-57`), and the task runs all three gates. A `git grep` before the edit confirms there is no fourth. |
| -- **P1-5, a pickup retry after draining cannot fit the window: accepted, refused up front.** Checked: `lifetimeSettle` = 60 s (`internal/console/lifetimes_cutover.go:44`) runs from the drain's start or the last legacy unit, `runs.PickupWindow` = 60 s, and runs past their deadline are never picked (`internal/host/runs.go`, `consider`). So a fleet run queued when a drain starts can never be picked in time. Fix (Task 16): the relay answers not-picked with `Why: "cutover"`, the box never redials it, and the run expires as an unpicked run does (the CLI at its deadline, the sweep after activation). It needs no new copy. A run picked before the drain finishes normally; its finish CAS lands after activation. Test: `TestQueuedFleetRunAtACutoverExpires`, with the gate and run clocks advancing together. |
| +- **P1-5, a pickup retry after draining cannot fit the window: accepted, refused up front.** Checked: `lifetimeSettle` = 60 s (`internal/console/lifetimes_cutover.go:44`) runs from the drain's start or the last legacy unit, `runs.PickupWindow` = 60 s, and runs past their deadline are never picked (`internal/host/runs.go`, `consider`). So a fleet run queued when a drain starts can never be picked in time. Fix (Task 16): the relay answers not-picked with `Why: "cutover"`, the box never redials it, and the run expires as an unpicked run does. (Rev 3 corrects how the CLI sees it: the CLI does not exit at its deadline. It keeps following through the drain and exits 3 after the terminal expiry lands, following activation. See Task 16.) It needs no new copy. A run picked before the drain finishes normally; its finish CAS lands after activation. Test: `TestQueuedFleetRunAtACutoverExpires`, with the gate and run clocks advancing together. |
| - **P2-6, the request budget left out reads: accepted.** Task 10's budget now counts: |
| - the setting reads, 1 on the console and 1 on the box; |
| - the judge's slot GET on every judged record read; |
| @@ -95,6 +95,39 @@ Findings from `docs/superpowers/reviews/CODEX-FINDINGS-rootfs-plan6-amendment-R1 |
| String IDs added or changed in rev 2: none. |
| +### Amendment rev 3: review dispositions (Astra R2 of the amendment) |
| + |
| +Findings from `docs/superpowers/reviews/CODEX-FINDINGS-rootfs-plan6-amendment-R2.md`, checked against the code at c24e7a04 first. Both are accepted. Round 2 marked R1 P1-1 to P1-4 and P2-7 resolved, and R1 P1-5 and P2-6 partly resolved. These two findings complete them. |
| + |
| +- **P1, the Task 16 cutover witness required an impossible CLI exit time: accepted, with Astra's fix as given.** Checked: |
| + - `followRun` (`run.go`) reports "not picked up" only after its expire POST (`runAPI.expire`) answers `RunExpired`, or after a poll reads the terminal state. |
| + - The draining gate refuses that POST with 503 (`serveAdmitted`, `lifetimes_cutover.go`). |
| + - `runAnswer` types only 4xx as `runConsoleError`, so after a 503 the CLI keeps `expireAt` and asks again on its next poll, about once a second. |
| + |
| + The cutover refusal and the no-redial rule are unchanged. Task 16 now says, against the real gate: |
| + - the CLI keeps following through the drain; |
| + - activation comes once `lifetimeSettle` (60 s) has passed, on the next cutover watch pass (10 s) or the operator's cutover poll; |
| + - the terminal expiry then lands by whichever is first: the CLI's next expire POST, or the run sweep (every 30 s); |
| + - the CLI exits 3 with today's `runNotPickedUp` line only after that. |
| + |
| + The rev 2 claim that the CLI reports at its pickup deadline is corrected (Task 16 and the rev 2 P1-5 line). Two witnesses replace the one: |
| + - `TestQueuedFleetRunAtACutoverExpiresBySweep` holds the CLI's expire request, so the sweep wins deterministically. The released POST then answers 409 "already ended" and writes nothing new. |
| + - `TestQueuedFleetRunAtACutoverExpiresByTheCLI` runs no sweep, so the CLI's POST wins. |
| + |
| + **The same family, swept (rev 3).** Every claimed timeline against the real gate: |
| + - Tasks 10 and 11's cutover tests no longer claim the gate "activates" when the drain empties. Each advances the gate clock past `lifetimeSettle` and runs one `lifetimesWatchOnce`. |
| + - Task 10 states the session timeline: no admission while draining (RFS-6-C37, CLI exit 2); a session admitted earlier works through the drain; an end during the drain reaches the CLI at once and waits for the sweep's first pass after activation. |
| + - New witness: `TestAWaitingSessionExpiresDuringTheDrain`. |
| + - Task 16's finish-retry bound is corrected to include the watch's cadence. |
| +- **P2, Task 10's budget left out the change-index requests: accepted.** Checked: |
| + - the console's deployment store enables the change index (`NewDeploymentS3Store`); |
| + - every successful mutation in a change scope bumps `control/changes.json` with a GET and a conditional PUT (`bumpAfterMutation`, `changeIndexAttempts` = 4, `changeIndexBumpBudget` = 2 s); |
| + - `BumpSerial` is a separate GET and PUT of `control/serial`, which is in no scope. |
| + |
| + Task 10's budget now counts the four scoped mutations (two record PUTs, the grant PUT and DELETE) as 8 index requests, apart from the serial's 2. It gives totals: 21 requests judged and 18 legacy for an ordinary session, plus 2 for `carlos console`. It lists record CAS, judge-round, index CAS and serial CAS retries separately. The same accounting is added to Task 16 for a fleet run (12 judged and 10 legacy beyond the chunks; `runs/` keys are a data prefix, so they bump no index). |
| + |
| +String IDs added or changed in rev 3: none. |
| + |
| --- |
| ## Contract deviations |
| @@ -1165,12 +1198,24 @@ git commit -m "activator: a session is held and settled like a run, beside it (r |
| - At the upgrade, the handler ends its request's unit (`endRequestUnit(r.Context())`). A session open for 6 hours therefore never holds a cutover's drain. |
| - Steps 3 to 6 (reserve, grant `Put`, the record CAS, `activate`, the serial bump and the `interactive-start` row) run as one write step: `s.lifetimesStep(ctx, true, …)`, bounded by `interactive.OpenWait` as before. If the gate refuses the step (the gate is draining), the session ends: End refused, `Detail` RFS-6-C37. The reservation is released, and nothing is written. |
| - Every end (the marker clear, the grant delete and the `interactive-end` row) is its own write step. If the gate refuses it while draining, the hub keeps the id in `endPending` with its End, and the sweep finishes it (Task 11). The CLI still gets its End at once. |
| -- **Request budget (PF-22; rev 2, Astra R1 P2-6).** Store requests per session. "Judged" means the context carries the lifetime judge (lifetimes on). A judged record read is then the record GET plus the host incarnation slot GET (`LifetimeJudge.Observe`, `internal/provision/lifetime_judge.go`), and up to three such rounds if the slot moves under it. With lifetimes off (legacy), each read is the record GET alone. |
| - - **Console, before the upgrade:** 1 judged record read (2 GETs judged, 1 legacy), and 1 GET of the app's `config.json` for the interactive setting (`appconfig.GetInteractive`). For `carlos console`, 1 channel pointer GET and 1 manifest GET. |
| - - **Console, two logical record transitions per session: admit and clear.** Each is one `updateRecord`: a judged read (2 GETs judged, 1 legacy) and one conditional PUT. A CAS conflict repeats the read and the PUT, which is a retry, not another transition. When the end step is refused while draining, the sweep makes the clear instead. That replaces the ordinary clear, so it is still one transition. The only extra attempt is a clear the sweep tries after a new session has replaced the marker: one judged read and no PUT (`ErrInteractiveConflict`). |
| - - **Console, other writes:** 1 grant PUT and 1 grant DELETE, and 1 serial bump (the existing change-index write). Audit rows are console SQL, not bucket requests. |
| - - **Owning box:** 1 grant GET and 1 `config.json` GET (the box half of C9, `allowed`). The box reads no record of its own: the marker reaches it on the reconcile pass and change index it already runs, judged there as today. Nothing new is polled. |
| - - **Every other box:** none. It ignores the marker before reading anything (Task 12). |
| + - **The timeline against the real gate (rev 3).** No session is admitted while the gate drains: its write step is refused, so it ends with RFS-6-C37 and the CLI exits 2. A session admitted before the drain keeps working through it: the box door needs no write, and keepalives and data are frames. An end during the drain reaches the CLI at once, and its writes wait for the sweep. The sweep runs as a mutating `lifetimesIteration` every 30 s, so its first pass is admitted only after activation. Activation comes once `lifetimeSettle` (60 s) has passed since the later of the drain's start and the last legacy unit's end, on the next cutover watch pass (10 s) or the operator's cutover poll. So an ended session's marker and grant stay for at most about `lifetimeSettle` + 10 s + 30 s after the drain's last legacy unit ends. A box never re-dials it: its agent has the id in `seen`, and a restarted agent finds the grant past `PickupBy` (`ErrGrantExpired`). |
| +- **Request budget (PF-22; rev 2, Astra R1 P2-6; rev 3, Astra R2 P2).** These are the store requests for one ordinary session: admitted, attached, ended. "Judged" means the context carries the lifetime judge (lifetimes on). A judged record read is then the record GET plus the host incarnation slot GET (`LifetimeJudge.Observe`, `internal/provision/lifetime_judge.go`). With lifetimes off (legacy), it is the record GET alone. The record sequence a judged write carries is inside the record body, so it costs no request of its own. |
| + - **Console, before the upgrade:** 1 judged record read (2 GETs judged, 1 legacy), and 1 GET of the app's `config.json` for the interactive setting (`appconfig.GetInteractive`). For `carlos console`, add 1 channel pointer GET and 1 manifest GET. |
| + - **Console, two logical record transitions: admit and clear.** Each is one `updateRecord`: a judged read (2 GETs judged, 1 legacy) and one conditional PUT. When the end step is refused while draining, the sweep makes the clear instead. That replaces the ordinary clear, so it is still one transition. |
| + - **Console, the grant:** 1 PUT at admission and 1 DELETE at the end. |
| + - **Console, the change index (automatic, rev 3).** The console's deployment store has the change index enabled (`NewDeploymentS3Store`, `EnableChangeIndex`, `internal/release/store.go`). After every successful mutation of a key in a change scope, it bumps `control/changes.json` (`bumpAfterMutation`, `internal/release/changeindex.go`): one GET and one conditional PUT. Both the record (`apps/<acct>/<app>/instances/<host>.json`) and the grant (`apps/<acct>/<app>/interactive/<id>.json`) are in the app's scope `apps/<acct>/<app>`. So the session's four scoped mutations (two record PUTs, the grant PUT and the grant DELETE) add 4 index GETs and 4 index PUTs: 8 requests. |
| + - **Console, the serial bump:** `s.bumpSerial` after admission is `release.BumpSerial`, one GET and one conditional PUT of `control/serial` (`internal/release/serial.go`). It is separate from the index, and `control/serial` is in no change scope, so it bumps no index: 2 requests. |
| + - **Console total, ordinary session, no retries:** |
| + - judged: 2 (pre-upgrade read) + 1 (setting) + 2 × (2 + 1) (two transitions) + 2 (grant) + 8 (index) + 2 (serial) = 21 requests, plus 2 for `carlos console`; |
| + - legacy: 1 + 1 + 2 × (1 + 1) + 2 + 8 + 2 = 18, plus 2 for `carlos console`. |
| + - **Retries, counted apart from the totals above. Each is bounded, and each is a retry, not another transition:** |
| + - *Record CAS*: a conflicting conditional PUT repeats `updateRecord`'s read and PUT (a judged one re-observes, `TestUpdateRecordJudgeRechecksLifetimeAfterCASConflict`). Its index bump happens once, after the PUT that lands. |
| + - *Judge rounds*: if the incarnation slot moves under a judged read, the read repeats, up to 3 rounds of 2 GETs. |
| + - *Index CAS*: a lost index race repeats its GET and PUT, up to `changeIndexAttempts` = 4 attempts with 20 to 120 ms of jitter, within `changeIndexBumpBudget` (2 s). A failure is logged, and the write it follows stands. |
| + - *Serial CAS*: a lost serial race repeats its GET and PUT, up to 4 attempts within the 2 s context `bumpSerial` gives it. A failure is logged, and boxes fall back to the hourly pass. |
| + - *Extra clear attempt*: the only one is a sweep's clear after a new session has replaced the marker. That is 1 judged read and no PUT (`ErrInteractiveConflict`), so no index bump. The old grant's DELETE still happens once, with its index bump. |
| + - **Owning box:** 1 grant GET and 1 `config.json` GET (the box half of C9, `allowed`). The box writes nothing, so it makes no index or serial request. It reads no record of its own: the marker reaches it on the reconcile pass and change index it already runs, judged there as today. Nothing new is polled. |
| + - **Every other box:** none. It ignores the marker before reading anything (Task 12). The index generation the session's writes move for the app scope is read by the boxes' existing change-index poll, which makes no extra request for it. |
| - **Connections:** one WebSocket from the CLI and one from the box, each open for the session. Keepalives are frames, not store requests. |
| - **Perf ring (PF-23).** `consolePerfSkip` skips `GET` on a path that starts `/api/cli/apps/` and ends `/interactive` with an `/instances/` segment, so the setting door's `PUT …/{app}/interactive` is still measured. It also skips the box doors' prefixes (`interactive.AttachPathPrefix`, and Task 16's `interactive.RunAttachPathPrefix`). |
| - **Fixtures (PF-24).** The claim fixture keeps the harness's `bab` path, as Step 4 writes it. The behavioural tests use accounts `bah` and `baj`, the app `shop`, and `shopManifest(app, domain)`. |
| @@ -1259,11 +1304,17 @@ func TestInteractiveOnAHostClaimConsole(t *testing.T) // 409 RFS-6-C35 before an |
| func TestInteractiveAdmitsARootfsResident(t *testing.T) // amended (PF-2): rootfs record, Hibernate false, region "uk": Status waiting |
| // amended 2026-10-30 (PF-4), apiinteractive_lifetimes_test.go, on newLifetimesFx and its cutover door (lifetimes_cutover_test.go): |
| func TestAWaitingSessionHoldsNoLifetimesUnit(t *testing.T) // gate before; a session admitted and waiting (its CLI socket open, the |
| -// 6-hour shape: nothing ends it during the test); the cutover is asked: the gate drains (drainedCh closes) within 1 s and activates |
| -// (status on) while the session is still waiting and still answers keepalives; a write the session makes afterwards (its end) is judged |
| +// 6-hour shape: nothing ends it during the test); the cutover is asked: drainedCh closes within 1 s of real time, because the session |
| +// holds no unit; the gate stays draining until the test advances the gate clock (useLifetimesClock) past lifetimeSettle and runs one |
| +// lifetimesWatchOnce, which activates it (rev 3: activation needs the settle and a watch pass or cutover poll, never only the drain); |
| +// the session is still waiting and still answers keepalives throughout; a write the session makes afterwards (its end) is judged |
| func TestAdmissionRefusedWhileDrainingEndsWithC37(t *testing.T) // the gate draining (a legacy unit held open by the test keeps it there): |
| // the pre-upgrade checks pass (a read is admitted), the Open frame arrives, the write step is refused: End refused, Detail RFS-6-C37; |
| // no grant object, record bytes unchanged, no audit row, no serial bump, the hub holds no entry for the id |
| +func TestAWaitingSessionExpiresDuringTheDrain(t *testing.T) // rev 3: a session admitted before the drain, no box ever attaches; its PickupBy passes |
| +// while the gate drains: the CLI gets End expired at PickupBy (no write is needed to tell it), the end step is refused, the id is in endPending; |
| +// after activation (clock past lifetimeSettle, one watch pass) one sweep pass clears the marker, deletes the grant and writes one interactive-end |
| +// row with reason "expired" |
| func TestASessionsEndStepIsItsOwnUnit(t *testing.T) // a session admitted before the cutover ends (CLI closes) after it activated: the clear, |
| // the grant delete and the audit row run in one unit admitted on (the record write is judged); none runs under the request's ended unit |
| func TestPerfRingSkipsTheSessionDoor(t *testing.T) // amended (PF-23): consolePerfSkip is true for GET …/instances/shop.example.com/interactive and |
| @@ -1272,7 +1323,7 @@ func TestPerfRingSkipsTheSessionDoor(t *testing.T) // amended (PF-23): consolePe |
| - [ ] **Step 2: Run them and see them fail** |
| -Run: `go test ./internal/console/ -run 'TestInteractive|TestConsoleProcess|TestPickupWindow|TestAdmissionReplaces|TestAdmissionHolds|TestAFailedAdmission|TestTwoSessions|TestCancelledBeforePickup|TestTheSessionOutlives|TestAWaitingSessionHoldsNoLifetimesUnit|TestAdmissionRefusedWhileDraining|TestASessionsEndStep|TestPerfRingSkipsTheSessionDoor' -count=1` |
| +Run: `go test ./internal/console/ -run 'TestInteractive|TestConsoleProcess|TestPickupWindow|TestAdmissionReplaces|TestAdmissionHolds|TestAFailedAdmission|TestTwoSessions|TestCancelledBeforePickup|TestTheSessionOutlives|TestAWaitingSessionHoldsNoLifetimesUnit|TestAWaitingSessionExpiresDuringTheDrain|TestAdmissionRefusedWhileDraining|TestASessionsEndStep|TestPerfRingSkipsTheSessionDoor' -count=1` |
| Expected: FAIL. |
| - [ ] **Step 3: Implement the door and the hub's CLI half** |
| @@ -1367,11 +1418,13 @@ func TestSweepDeletesOrphanGrants(t *testing.T) |
| func TestBoxDoorRefusesAFleetOfAnotherAccount(t *testing.T) // PF-16: a session of account bah on a record placed on fleet/home, where the fleets |
| // table says home belongs to baj; the box presents home's valid credential: 404, the CLI still waits; FleetOwners failing: 404 |
| func TestCutoverDrainsWhileASplicedSessionRuns(t *testing.T) // PF-4: CLI and box attached, data flowing both ways; the cutover is asked: the gate |
| -// drains within 1 s and activates while bytes still cross the splice; the box door's request was never counted (lifetimesExempt) |
| +// drains (drainedCh closes within 1 s) while bytes still cross the splice; the test then advances the gate clock past lifetimeSettle and runs |
| +// one lifetimesWatchOnce: the gate activates, and bytes still cross; the box door's request was never counted (lifetimesExempt) |
| func TestAnEndRefusedWhileDrainingIsFinishedByTheSweep(t *testing.T) // PF-4: the gate draining (a legacy unit held by the test); the box sends |
| -// End exited 0: the CLI gets it at once; the marker and the grant stay; the hub has the id in endPending; the test releases the legacy |
| -// unit, the gate activates, one sweep pass clears the marker, deletes the grant and writes one interactive-end row with reason "exited" |
| -// (not "lost"); a second pass writes nothing |
| +// End exited 0: the CLI gets it at once; the marker and the grant stay; the hub has the id in endPending; a sweep pass attempted while |
| +// draining is not admitted (lifetimesIteration, mutating) and writes nothing; the test releases the legacy unit, advances the gate clock |
| +// past lifetimeSettle and runs one lifetimesWatchOnce, which activates the gate (rev 3); one sweep pass then clears the marker, deletes the |
| +// grant and writes one interactive-end row with reason "exited" (not "lost"); a second pass writes nothing |
| ``` |
| - [ ] **Step 2: Run them and see them fail** |
| @@ -1727,10 +1780,23 @@ A fleet box cannot make a run's bucket writes (the pickup CAS on the record, the |
| - **A fleet run still queued when the gate starts draining is not picked; it expires (rev 2, Astra R1 P1-5).** The numbers: the pickup window is `runs.PickupWindow` = 60 s from admission (`internal/runs/runs.go:32`). The gate activates no sooner than `lifetimeSettle` = 60 s after the later of the drain's start and the last legacy unit's end (`internal/console/lifetimes_cutover.go:44`, `activateWhenDrained`). The pickup is a console record CAS, which the gate refuses while draining. No run is admitted during draining either: the create is a mutating request, and `TestDrainingRefusesEveryClaimsOffMutation` holds that. So a fleet run queued when the drain starts has at most 60 s of window left and needs at least 60 s of drain. It can never be picked before its deadline, and a retry after activation could never fit. The plan therefore refuses it up front, with no retry: |
| - The relay answers `RunPicked{State: RunStateNotPicked, Why: RunNotPickedCutover}` and closes. `RunPicked` gains a `Why` field and the constant `RunNotPickedCutover` (in Interfaces below). |
| - The box's relay sink marks the run id done in its `unfit` map, as for a request it refused. It never dials it again. It writes no result, and the record is unchanged. |
| - - The run ends exactly as any run no box picked up. The CLI's own poll reports it at its pickup deadline (today's "not picked up" line, exit 3). After activation, the console's run sweep (`sweepExpireQueued`, a `lifetimesIteration`) writes the `RefusedExpired` result and the expiry transition. No new string is needed. |
| + - **What the CLI sees, against the real gate (rev 3, Astra R2 P1).** The CLI does not exit at the pickup deadline. When `followRun` (`run.go`) finds the run still queued at `expireAt`, it POSTs `…/runs/{id}/expire` (`runAPI.expire`). While the gate drains, that POST is refused with 503 (`serveAdmitted`: a mutating request, `msgLifetimesDraining`). A 503 is not a `runConsoleError`, since `runAnswer` types only 4xx that way, so `expireAt` is kept, and the CLI asks again on each poll, about once a second. Its status GETs are admitted as reads, so it keeps following. It never sees a terminal state during the drain, and `runPageGiveUp` (2 min, which counts only polls with no state) never fires. |
| + - **Activation.** The gate activates once `lifetimeSettle` (60 s) has passed since the later of the drain's start and the last legacy unit's end. It happens on the next cutover watch pass (every `lifetimesWatchInterval`, 10 s) or on the operator's next cutover-door poll, whichever comes first. |
| + - **The terminal expiry.** After activation, one of two paths lands it first: |
| + - the CLI's next expire POST, at most about 1 s after activation, expires the run itself and prints today's `runNotPickedUp` line ("not picked up within 60 seconds. the run did not start. try again"), exit 3; |
| + - or the console's run sweep (`sweepExpireQueued`, one `lifetimesIteration` pass every 30 s) expires it first. Then the CLI's next poll reads `RunExpired` and prints the same line, exit 3. |
| + |
| + Either way the record ends `RunExpired` with the `RefusedExpired` result, written exactly once (the expiry is a CAS on the queued state, so the loser's write fails or reads the terminal state). The CLI exits 3 only after that terminal expiry has landed. No new string is needed. |
| - Platform-box runs are unaffected: their pickup is the box's own record write, which the console's gate does not govern. |
| - - A run picked before the drain keeps running through it: chunks and `result.json` land, since `runs/` is not record work. Its finish CAS, refused while draining, is retried in a fresh `lifetimesStep` each time, with backoff from 250 ms doubling to 5 s. It goes on until the CAS lands (the first attempt after activation, so at most `lifetimeSettle` plus 5 s after the drain's last legacy unit ends), until the record no longer names the run as the hello's (`ErrRunConflict`), or until the console stops. If the console stops first, today's lost sweep finishes the run at `Deadline + runs.LostAfter` (1 h). It keeps the relay's `result.json`, because `runs.WriteResult` is create-only. |
| + - A run picked before the drain keeps running through it: chunks and `result.json` land, since `runs/` is not record work. Its finish CAS, refused while draining, is retried in a fresh `lifetimesStep` each time, with backoff from 250 ms doubling to 5 s. It goes on until the CAS lands, until the record no longer names the run as the hello's (`ErrRunConflict`), or until the console stops. The CAS lands on the first attempt after activation. Activation comes on the cutover watch's next 10 s pass or the operator's next cutover poll, once `lifetimeSettle` has passed, and the backoff adds at most 5 s after it (rev 3: the earlier "at most `lifetimeSettle` plus 5 s" left out the watch's cadence). If the console stops first, today's lost sweep finishes the run at `Deadline + runs.LostAfter` (1 h). It keeps the relay's `result.json`, because `runs.WriteResult` is create-only. |
| - The run admission's grant `Put` is part of the create request's own mutating unit, as `request.json` is today. |
| +- **Request budget for a fleet run, on the console (rev 3, the same accounting as Task 10).** These are the console's requests beyond today's run admission, which is unchanged except for the grant: |
| + - 1 run-grant PUT at admission. `RunGrantKey` is under `apps/<acct>/<app>/runs/`, and `runs` is a data prefix (`dataPrefixes`, `internal/release/changeindex.go`), so it bumps no index. |
| + - The pickup and the finish, each one `updateRecord`: a judged read (2 GETs, or 1 legacy) and a conditional PUT. Each landed PUT then bumps the index, 1 GET and 1 PUT. |
| + - Per output chunk, 1 PUT. Then 1 `result.json` PUT. Both are under `runs/`, so they bump no index. |
| + - In total, beyond the chunks: judged 1 + 2 × (3 + 2) + 1 = 12 requests, legacy 1 + 2 × (2 + 2) + 1 = 10. |
| + - Retries are as in Task 10: record CAS, judge rounds, and index CAS up to 4 attempts in 2 s. A finish refused while draining is a lifetimes refusal, decided before any store call, so it costs no request until activation. |
| + - The box makes no bucket write. Its reads are today's (`request.json`, inputs, the record), plus 1 run-grant GET. |
| - **Fleet owner (PF-16).** The run door uses Task 11's `fleetIdentityOK(reg, name, token, fleet, rec.Account)`, the owner check included. |
| - **Region HA (PF-15) and judged reads (PF-19).** `sinkFor` and the relay act on an HA route only when `HoldsAwake(rec.Host)`, as Task 12 does. Every record read in the relay sink (the read-back after `RunPicked`) goes through `judgedRecord` under the box judge. |
| - **Boot (PF-30).** `RunHello.Boot` is `newBootID()`, the agent process's id. Comment it "agent boot". It is never the kernel boot id that #451 writes into the legacy lease owner. |
| @@ -1821,18 +1887,27 @@ func TestForgedRunGrantExpiresTheRun(t *testing.T) // a grant signed by an |
| func TestFleetRunsWorkerRelaysARootfsRun(t *testing.T) // PF-1: as above, on a rootfs route |
| func TestRunRelayHoldsNoUnitAcrossACutover(t *testing.T) // PF-4: a relay picked before the drain, streaming chunks; the cutover is asked: the gate drains |
| // (the relay holds no unit) while chunks still land; the box's End during draining: result.json written at once, the finish CAS refused; |
| -// the gate clock (useLifetimesClock) advanced past lifetimeSettle: activation, then the finish lands once, judged |
| -func TestQueuedFleetRunAtACutoverExpires(t *testing.T) // rev 2 (Astra R1 P1-5): the gate clock and the run clock advance together: a fleet run |
| -// admitted at t0; the drain starts at t0+10s; the box dials at t0+20s: RunPicked{not-picked, Why "cutover"}, the record unchanged, no result; |
| -// the box's next two passes do not dial (a counting dial); at t0+61s the CLI's poll reports not picked up (exit 3); at t0+70s the gate activates; |
| -// the next sweep writes RefusedExpired and the expiry transition once; a pickup is never attempted after activation |
| +// the gate clock (useLifetimesClock) advanced past lifetimeSettle and one lifetimesWatchOnce run: activation, then the finish lands once, judged |
| +// rev 3 (Astra R2 P1): two witnesses, one per path to the terminal expiry. Both use the real console.Server and its real gate, the real |
| +// followRun over runAPI (a fake runTerm whose now is the shared clock), and the shared clock (useLifetimesClock) driving the gate, the record |
| +// deadline and the CLI. In both: a fleet run admitted at t0; the drain starts at t0+10s with no legacy unit left; the box dials at t0+20s and gets |
| +// RunPicked{not-picked, Why "cutover"}, with the record unchanged and no result; the box's next two passes do not dial (a counting dial); from t0+60s |
| +// every expire POST the CLI sends answers 503 and the CLI is still following at t0+69s (no exit, no line printed); activation at t0+70s (a watch pass); |
| +// a pickup is never attempted after activation. |
| +func TestQueuedFleetRunAtACutoverExpiresBySweep(t *testing.T) // the CLI's HTTP client holds its first expire POST sent after activation (a test |
| +// RoundTripper that blocks it until released); the sweep pass at t0+71s writes the expiry transition, the RefusedExpired result and one run-end row; |
| +// the held POST is then released: RunExpire conflicts and runTransitionRefused answers 409 "already ended" (a runConsoleError, so the CLI stops |
| +// asking), writing nothing new; the CLI's next poll reads RunExpired: exactly one runNotPickedUp line, exit 3 |
| +func TestQueuedFleetRunAtACutoverExpiresByTheCLI(t *testing.T) // no sweep pass runs (the test never starts one): the CLI's first expire POST after |
| +// activation answers 200 RunExpired: one runNotPickedUp line, exit 3; a sweep pass run afterwards writes nothing (one RefusedExpired result, one |
| +// run-end row) |
| func TestBoxRunDoorRefusesAFleetOfAnotherAccount(t *testing.T) // PF-16: as Task 11's, at /api/box/runs/{id} |
| func TestRelaySinkOnAnHARouteOnlyWhenItHoldsTheHost(t *testing.T) // PF-15: rt.HA and not held: no grant read, no dial |
| ``` |
| - [ ] **Step 2: Run them to make sure they fail** |
| -Run: `go test ./internal/interactive/ -run 'TestRunGrant|TestRunFrames' -count=1`, `go test ./internal/console/ -run 'TestRunDoorAdmitsAFleetInstance|TestBoxRunDoor|TestRelay|TestRunPickupUsesTheBoxBoot|TestRunHelloIsChecked|TestForgedRunGrant|TestRunRelayHoldsNoUnitAcrossACutover|TestQueuedFleetRunAtACutoverExpires' -count=1`, `go test ./internal/host/ -run 'TestFleetRunsWorker|TestPlatformRunsWorker|TestRelayWorkerStartsNothing|TestRelaySinkOnAnHARoute' -count=1` |
| +Run: `go test ./internal/interactive/ -run 'TestRunGrant|TestRunFrames' -count=1`, `go test ./internal/console/ -run 'TestRunDoorAdmitsAFleetInstance|TestBoxRunDoor|TestRelay|TestRunPickupUsesTheBoxBoot|TestRunHelloIsChecked|TestForgedRunGrant|TestRunRelayHoldsNoUnitAcrossACutover|TestQueuedFleetRunAtACutoverExpires' -count=1` (the pattern matches both rev 3 witnesses), `go test ./internal/host/ -run 'TestFleetRunsWorker|TestPlatformRunsWorker|TestRelayWorkerStartsNothing|TestRelaySinkOnAnHARoute' -count=1` |
| Expected: FAIL. |
| - [ ] **Step 3: Implement** as above. Move today's runs-worker writes behind `bucketRunSink` first, with no behaviour change, and run `go test ./internal/host/ -run 'TestRuns|TestRunResult' -count=1` (PASS) before adding the relay. |
diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-rootfs-plan6-amendment-R2.md b/docs/superpowers/reviews/CODEX-FINDINGS-rootfs-plan6-amendment-R2.md| new file mode 100644 |
| index 000000000..fc7b89dbd |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/CODEX-FINDINGS-rootfs-plan6-amendment-R2.md |
| @@ -0,0 +1,31 @@ |
| +Static review of `25b12960cf50e931c09efc27ac7cb1af5c984c98`, round 2/3. No files edited or tests run. `GOCACHE` remained unset. |
| + |
| +- **R1 P1-1 — resolved:** the watch covers every rootfs entry; both loss callers handle one-shots; unwatched starts are refused. |
| +- **R1 P1-2 — resolved:** `Process` survives all six hops, while the audit retains resolved argv. |
| +- **R1 P1-3 — resolved:** removal owners retain their names; the added detector entries are permitted growth. |
| +- **R1 P1-4 — resolved:** Task 4 updates all three checked consumers and runs their gates. |
| +- **R1 P1-5 — partly resolved:** refusal and no redial remove the impossible pickup retry, but the replacement witness requires an impossible CLI exit time. |
| +- **R1 P2-6 — partly resolved:** setting and judge reads are counted; automatic change-index requests remain missing. |
| +- **R1 P2-7 — resolved:** independently recounted 401 rows: 397 live, four struck, two pending. |
| + |
| +1. **P1 — Task 16: the queued-run cutover witness cannot pass against the existing CLI.** |
| + |
| + **Evidence:** [plan:1827](docs/superpowers/plans/2026-10-24-rootfs-apps-6-interactive.md:1827) requires exit 3 at t0+61s, before activation at t0+70s. However, [run.go:535](run.go:535) calls `expire` before reporting an unpicked queued run. That is a POST ([run.go:336](run.go:336)), which the draining gate refuses ([lifetimes_cutover.go:149](internal/console/lifetimes_cutover.go:149)). A 503 does not satisfy the successful-expiry condition at [run.go:545](run.go:545), so following continues. |
| + |
| + **Failure scenario:** Execute the specified timeline through the real CLI and gate. At t0+61s the run remains queued and the CLI has not exited; the witness fails. After activation, the CLI’s expiry retry can also beat the sweep. |
| + |
| + **Fix:** Keep the cutover refusal and no-redial behavior. Require the CLI to remain following during draining, then exit 3 after a terminal expiry lands following activation. Either allow the CLI or sweep to win, or hold the CLI’s expiry request to test the sweep deterministically. Correct the deadline claim at [plan:1730](docs/superpowers/plans/2026-10-24-rootfs-apps-6-interactive.md:1730). |
| + |
| + **Fault family:** Cutover recovery — reporting “did not start” requires a terminal expiry transition. This remains outstanding from R1 P1-5. |
| + |
| +2. **P2 — Task 10: the request budget still omits production store requests.** |
| + |
| + **Evidence:** [plan:1171](docs/superpowers/plans/2026-10-24-rootfs-apps-6-interactive.md:1171) conflates the serial bump with the change-index write. They are separate. Deployment stores enable automatic index bumps ([store.go:950](internal/release/store.go:950)); successful scoped mutations invoke another GET/conditional PUT ([changeindex.go:179](internal/release/changeindex.go:179), [changeindex.go:141](internal/release/changeindex.go:141)). The explicit serial bump itself also performs GET/PUT ([serial.go:51](internal/release/serial.go:51)). |
| + |
| + **Failure scenario:** An ordinary successful session performs two record PUTs, a grant PUT and a grant DELETE. Those four scoped mutations add four index GET/PUT pairs absent from the budget. |
| + |
| + **Fix:** Count those eight requests separately from the serial GET/PUT pair, and describe index and serial CAS retries separately. |
| + |
| + **Fault family:** PF-22 — request accounting must cover actual store calls. This remains outstanding from R1 P2-6. |
| + |
| +NOT READY |
| \ No newline at end of file |
diff --git a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-rootfs-plan6-amendment-R3.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-rootfs-plan6-amendment-R3.md| new file mode 100644 |
| index 000000000..ab6ee1c2d |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-rootfs-plan6-amendment-R3.md |
| @@ -0,0 +1,94 @@ |
| +# Review brief: rootfs apps Plan 6 (interactive sessions), the preflight amendment of 2026-10-30, round 3 of 3 |
| + |
| +Repo carlos/platform, branch `rootfs-apps-6-interactive`, at the commit named in your prompt (this brief's commit). Round 1 reviewed 5d802f2e, and round 2 reviewed 25b12960. |
| +Under review: rev 3 of the amendment in `docs/superpowers/plans/2026-10-24-rootfs-apps-6-interactive.md`. That is: |
| +- the new subsection "### Amendment rev 3: review dispositions (Astra R2 of the amendment)"; |
| +- every line marked "rev 3"; |
| +- everything rounds 1 and 2 covered: the "## Amendment 2026-10-30 (preflight)" section and its rev 2 dispositions, Task 7a, and every block marked "Amended 2026-10-30" or "rev 2". |
| + |
| +`git diff 25b12960 -- docs/superpowers/plans/` shows what rev 3 changed. The branch's code commits (Task 2: 6672a22e, a62099ee) are not under review. |
| + |
| +Authorities: as in rounds 1 and 2. |
| +- The spec, rev 5: `docs/superpowers/specs/2026-10-24-rootfs-apps-design.md`. |
| +- The run design, rev 4: `docs/superpowers/specs/2026-10-08-carlos-run-design.md`. |
| +- The index: `docs/superpowers/plans/2026-10-24-rootfs-apps-0-index.md`. |
| +- main's code at c24e7a04, plus `internal/interactive` as on the branch. |
| +- The preflight table: `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-6/.superpowers/sdd/2026-10-24-rootfs-apps-6-interactive/preflight.md`. |
| +- The reverted Plan 3 Task 12: `git show 6c6f8607 56cc06aa`, with its review `task-12-r1-astra.md` in `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-3/.superpowers/sdd/2026-10-24-rootfs-apps-3-lifecycle/`. |
| + |
| +Do not review against unmerged branches. If this needs one, say so as a P1 and stop. |
| + |
| +You are an independent reviewer. Read the changes, then the code they name, and check every claim against that code. |
| + |
| +## Fixed: do not re-argue |
| + |
| +- The preflight's rulings PF-1 to PF-32, accepted as written. |
| +- `--version` stays deferred (#431). |
| +- Paul's rulings R7, R10 and R11. The census rule of 2026-10-26. |
| +- The wording of RFS-6-C47 and C65 is for Paul's copy review. |
| +- The coordinator's direction: |
| + - prefer refusing a case up front over tolerating it; |
| + - for the Task 16 cutover, keep the up-front refusal ("not picked", `Why: "cutover"`) and the no-redial rule; the CLI keeps following through the drain and exits 3 only after a terminal expiry lands following activation, by its own retry or by the sweep. |
| +- Known, not a finding: until the copy review's commit adds RFS-6-C65 to `rootfsCopyIDs`, `TestRootfsCopyDeckParses` and `TestRootfsCopyRecordIsComplete` fail on this branch. |
| +- Findings that earlier rounds marked resolved. Raise one again only with new evidence. |
| + |
| +## Dispositions of earlier rounds |
| + |
| +Round 1 (`docs/superpowers/reviews/CODEX-FINDINGS-rootfs-plan6-amendment-R1.md`); round 2 reported each as below. |
| + |
| +- P1-1, hibernating rootfs commands never reached the lease kill: resolved in rev 2. The lease watch covers every rootfs entry, and an unwatched start is refused. |
| +- P1-2, the declared-process selector: resolved in rev 2. `CmdSpec.Process` is carried across six hops. |
| +- P1-3, the removal guards: resolved in rev 2. The owners keep their names and gain a role parameter. |
| +- P1-4, C47's consumers: resolved in rev 2. Three checked records change in one commit. |
| +- P1-5, the pickup retry after a drain: partly resolved in rev 2, which refused up front with no redial. Rev 3 completes the witness and the CLI timeline (round 2's P1 below). |
| +- P2-6, the request budget: partly resolved in rev 2. Rev 3 adds the change index and the serial (round 2's P2 below). |
| +- P2-7, the deck's counts: resolved in rev 2. |
| + |
| +Round 2 (`docs/superpowers/reviews/CODEX-FINDINGS-rootfs-plan6-amendment-R2.md`): |
| + |
| +- P1, the Task 16 cutover witness needed an impossible CLI exit time: addressed in rev 3 with Astra's fix. Task 16 now has the CLI timeline against the real gate, a corrected deadline claim, and two witnesses: `…ExpiresBySweep`, which holds the CLI's expire POST, and `…ExpiresByTheCLI`. The same family was swept in Tasks 10 and 11: activation needs `lifetimeSettle` plus a watch pass or cutover poll, and there is a new `TestAWaitingSessionExpiresDuringTheDrain`. |
| +- P2, the budget omitted change-index requests: addressed in rev 3. Task 10 counts the four scoped mutations as 8 index requests, apart from the serial's 2, gives totals, and lists the retries separately. Task 16 gains the same accounting. |
| + |
| +## Round 3 |
| + |
| +First give one line per P1 and P2 from rounds 1 and 2: 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. |
| + |
| +This is the last round. A NOT READY must also say whether its P1s share one cause, and whether refusing the case up front, or cutting the feature, would remove them. |
| + |
| +## What to check |
| + |
| +1. **The Task 16 cutover timeline (round 2's P1).** Walk `followRun` (`run.go`: `expireAt`, `runAPI.expire`, `runAnswer`, `runConsoleError`, `runPageGiveUp`, `runNotPickedUp`) against the real gate (`internal/console/lifetimes_cutover.go`: `admit`, `serveAdmitted`, `activateWhenDrained`, `lifetimesWatchInterval`, `lifetimeSettle`, `StartLifetimesCutoverWatch`, the cutover door's own activation), `handleAPIRunExpire` and `runTransitionRefused` (`internal/console/apirunsfollow.go`) and `sweepExpireQueued` (`internal/console/runsweep.go`). Questions: |
| + - Can the CLI exit, or give up, before a terminal expiry? |
| + - Is the state the same whichever path wins, with one result, one run-end row and one transition? |
| + - Is each witness deterministic as specified: the held RoundTripper in `…BySweep`, and no sweep in `…ByTheCLI`? |
| + - Are the finish-retry and activation bounds now true? |
| +2. **The swept session timelines (Tasks 10 and 11).** Does each claim about the drain hold against the gate? |
| + - an admission refused with C37; |
| + - a session admitted earlier working through the drain; |
| + - an expiry or end during the drain going to `endPending`; |
| + - the sweep's first admitted pass coming after activation; |
| + - no box re-dial. |
| + |
| + Does each test drive activation the only way the gate allows? |
| +3. **The budget (round 2's P2).** Check Task 10's and Task 16's counts against `internal/release/changeindex.go` (`ChangeScope`, `dataPrefixes`, `bumpAfterMutation`, `bumpChangeIndex`), `internal/release/serial.go` (`BumpSerial`), `internal/release/store.go` (`EnableChangeIndex`, `NewDeploymentS3Store`), `internal/provision` (`updateRecord`, `LifetimeJudge.Observe`, `RecordKey`), `internal/interactive` (`GrantKey`) and `internal/runs` (`RunsPrefix`). Are the totals right: 21 judged and 18 legacy for an ordinary session, and 12 and 10 for a fleet run beyond its chunks? Is any store call still missing? |
| +4. **New problems rev 3 introduced:** a test name that a `-run` pattern does not match, a test that cannot be built from the plan's description, or a claim that contradicts another task. |
| + |
| +## 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. |
| + |
| +This is round 3, so a NOT READY also says whether the P1s share one cause, and whether refusing the case up front or cutting the feature would remove them. |
| + |
| +Do not edit files. Do not spawn Anthropic-model reviewers or subagents of your own. Do not run the full test suites. |