carlos / platform Public

rootfs plan 6: amendment rev 4 (Astra R3: one P1 with one cause, two P2s; no fourth round)

Astra R3 was NOT READY on one P1 with a single cause, the cross-package
test harness, plus two P2s. Controller ruling (platform-60): no fourth
round; Task 16's and Task 10's task reviews check these fixes.

- P1: the real-CLI expiry witnesses move to the root package
  (run_cutover_witness_test.go) and reach the console's clock, watch and
  sweep through three forwarding controls in
  internal/console/cutover_witness_controls.go (UseLifetimesClockForTest,
  LifetimesWatchOnceForTest, RunSweepPassForTest), both under the build tag
  carlos_cutover_witness and the UseSQLInstanceIdentityForTest pattern
  (panics outside a test binary). .amadan/test-gate.sh gains one job that
  runs them; TestCutoverWitnessControlsAreTagged holds the shape.
- P2: Task 16's fleet-run budget adds the relay's request.json GET (13
  judged / 11 legacy beyond chunks) and names today's run traffic as
  outside the subtotal.
- P2: Task 10's no-redial claim corrected: seen is per agent; the guarantee
  against a second launch is the box door (only an active, unattached id
  upgrades; ended, endPending or unknown ids get 404), with witnesses in
  Tasks 11 and 12.

Findings: docs/superpowers/reviews/CODEX-FINDINGS-rootfs-plan6-amendment-R3.md
No code changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 084289dec6b2084c0eb2cb1fbdd025fd4842aecd parent 981322d
2 files changed, +110 −20
  • docs/superpowers/plans/2026-10-24-rootfs-apps-6-interactive.md +65 −20
  • docs/superpowers/reviews/CODEX-FINDINGS-rootfs-plan6-amendment-R3.md +45 −0
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 242f7aaad..2e81415c5 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
@@ -128,6 +128,23 @@ Findings from `docs/superpowers/reviews/CODEX-FINDINGS-rootfs-plan6-amendment-R2
String IDs added or changed in rev 3: none.
+### Amendment rev 4: review dispositions (Astra R3 of the amendment)
+
+Findings from `docs/superpowers/reviews/CODEX-FINDINGS-rootfs-plan6-amendment-R3.md`: NOT READY on one P1 with one cause (the cross-package test harness), plus two P2s. By the controller's ruling (platform-60) there is no fourth round. All three are fixed here, and Task 16's and Task 10's own task reviews check the fixes.
+
+- **P1, the real-CLI expiry witnesses could not compile in `internal/console`: fixed with Astra's narrower remedy (Task 16).**
+ - The witnesses move to the root package (`run_cutover_witness_test.go`, `package main`), where `followRun`, `runAPI` and `runTerm` live. The console is built as `auth_e2e_test.go` builds it.
+ - The console's clock, watch and sweep are reached through three controls in `internal/console/cutover_witness_controls.go`: `UseLifetimesClockForTest`, `LifetimesWatchOnceForTest` and `RunSweepPassForTest`. Both files carry the build tag `carlos_cutover_witness`, which no other code uses.
+ - The controls reuse the existing pattern of `UseSQLInstanceIdentityForTest` (`internal/console/claim_sql_instance.go`): an exported `…ForTest` that panics outside a test binary. Each one only forwards to the production function, so production behaviour does not change.
+ - `.amadan/test-gate.sh` gains one job that runs the tagged witnesses, because the gate passes no tags.
+ - `TestCutoverWitnessControlsAreTagged` holds the tag and the forwarding shape.
+ - Both deterministic winner cases are kept: the sweep wins with the CLI's POST held, and the CLI wins with no sweep before it.
+ - The files list and test commands are updated.
+- **P2, Task 16's budget left out the relay's `request.json` GET: fixed.** The totals are now 13 judged and 11 legacy beyond the chunks. Today's run traffic (admission, follow polls, expire, cancel and ack, audit) is named as outside the subtotal. Task 10's 21 and 18 are unchanged.
+- **P2, Task 10's claim that a restarted agent never re-dials was false before `PickupBy`: corrected, and the guarantee made explicit.** `seen` is per agent and only saves a dial. The guarantee against a second launch is the console's box door. It upgrades only an `active`, not-yet-attached id, and gives an ended (`ended` or `endPending`), unknown or earlier-console id the same 404. Without the upgrade the box gets no `Open` and calls no `RunCmd`. This guarantee was chosen over persisting `seen`: it holds across agent and console restarts alike, and costs no box state. Witnesses: `TestBoxDoorRefusesAnEndedSessionBeforeItsPickupBy` (Task 11) and `TestARestartedWorkerCannotRelaunchAnEndedSession` (Task 12).
+
+String IDs added or changed in rev 4: none. Paul's copy review approved RFS-6-C47 and RFS-6-C65 unchanged (2026-10-30). The deck and the gate's inventory are updated in the commit after this one.
+
---
## Contract deviations
@@ -1198,7 +1215,7 @@ 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.
- - **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`).
+ - **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. **No second launch (rev 4, Astra R3 P2: the guarantee is the console's, not the agent's).** The agent's `seen` map lives in memory and only saves a dial: the same agent never dials an id twice. A restarted agent has an empty `seen`, and before `PickupBy` it still finds a valid grant, so it may dial again. The guarantee against a second launch is the box door. It upgrades only an id the hub holds as `active` and not yet attached (Task 11, door rules 2 and 3). An id the hub has ended (`ended`, or in `endPending` while its writes wait for the sweep), never held, or held only by an earlier console process gets the same 404. A second attach to a live session gets 409. Without the upgrade the box never receives `Open`, so it never calls `RunCmd`. Past `PickupBy`, the agent also drops the grant itself (`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.
@@ -1379,7 +1396,7 @@ func (s *Server) interactiveSweep(ctx context.Context, recs []provision.Record,
```
The box door:
1. A host-claim console answers 409 RFS-6-C35.
-2. An id failing `ValidID`, an id not in the hub or only reserved there (not yet `active`), a wrong `X-Carlos-Session-Token`, or a fleet-placed record without a valid fleet identity of the record's fleet (`Authorization: Bearer` and `Carlos-Tunnel-Name`, the store door's headers) all get the same `http.NotFound`.
+2. An id failing `ValidID`, an id not in the hub or only reserved there (not yet `active`), an id the hub has ended (`ended` or `endPending`, rev 4: it never becomes `active` again), a wrong `X-Carlos-Session-Token`, or a fleet-placed record without a valid fleet identity of the record's fleet (`Authorization: Bearer` and `Carlos-Tunnel-Name`, the store door's headers) all get the same `http.NotFound`.
3. A second attach gets 409.
4. Otherwise it upgrades and hands the connection to the session.
@@ -1406,6 +1423,9 @@ The sweep phase:
func TestBoxDoorRefusesWithoutTheToken(t *testing.T) // wrong token, unknown id, bad id -> 404, and the CLI still waits
func TestBoxDoorNeedsTheFleetsOwnCredential(t *testing.T) // fleet record: no credential -> 404; another fleet's box -> 404; a detached box -> 404; the right box -> attached
func TestBoxDoorTakesOneBox(t *testing.T) // second attach -> 409
+func TestBoxDoorRefusesAnEndedSessionBeforeItsPickupBy(t *testing.T) // rev 4 (Astra R3 P2): a session attached and ended early (box End exited 0),
+// while the gate drains so its marker and grant stay (endPending), PickupBy still ahead: a fresh dial with the grant's valid token -> 404, no
+// upgrade, no Open sent; the same after activation and the sweep; the hub's id is never active again
func TestSpliceCarriesBothWays(t *testing.T) // CLI data reaches the box; box data, status and end reach the CLI; resize reaches the box as 4 bytes;
// rev 2: a carlos console session's Open reaches the box as {Process: "console", Argv: nil}
func TestSpliceAppliesBackpressure(t *testing.T) // a CLI that stops reading: after the transport's buffers fill, the box's Send blocks; the hub's heap growth while the box pushes 64 MiB stays below 4 MiB (runtime.ReadMemStats delta)
@@ -1527,6 +1547,9 @@ The worker never writes the bucket.
```go
func TestInteractiveWorkerIgnoresAForgedGrant(t *testing.T) // grant signed by another key -> dial never called, launcher never called
+func TestARestartedWorkerCannotRelaunchAnEndedSession(t *testing.T) // rev 4 (Astra R3 P2): a real console.Server (as TestInteractiveSessionEndToEnd);
+// a session runs on worker A and ends early; a new worker B (empty seen, as after an agent restart) is noted the same record, its grant valid
+// and PickupBy ahead: B dials, the box door answers 404, B's launcher RunCmd is never called, and B logs the refusal once and marks the id seen
func TestInteractiveWorkerPassesTheProcessThrough(t *testing.T) // rev 2 (P1-2): Open{Process "console"} -> the launcher's CmdSpec.Process "console", Args nil; Open{Argv} -> Process "", Args the argv
func TestInteractiveWorkerRefusesWhenTheAppDisallows(t *testing.T) // C9, box half: allowed false -> End{Refused: "off"} on the connection; launcher.RunCmd never called
func TestInteractiveWorkerMapsLaunchRefusals(t *testing.T) // ErrCmdClaim -> claim, ErrCmdNotNested -> flat, *CmdWakeError -> wake + Detail, ErrTTYBusy -> busy
@@ -1548,7 +1571,7 @@ func TestInteractiveSessionEndToEnd(t *testing.T) // linux, interactive_e2e_linu
- [ ] **Step 2: Run them and see them fail**
-Run: `go test ./internal/host/ -run 'TestInteractiveWorker|TestInteractiveSessionEndToEnd' -count=1` and `TMPDIR=/tmp/k go test ./internal/activator/ -run TestHoldsAwake -count=1`
+Run: `go test ./internal/host/ -run 'TestInteractiveWorker|TestInteractiveSessionEndToEnd|TestARestartedWorkerCannotRelaunchAnEndedSession' -count=1` and `TMPDIR=/tmp/k go test ./internal/activator/ -run TestHoldsAwake -count=1`
Expected: FAIL.
- [ ] **Step 3: Implement the worker and wire it**
@@ -1765,6 +1788,7 @@ A fleet box cannot make a run's bucket writes (the pickup CAS on the record, the
**Files:**
- Modify: `internal/interactive/grant.go` (`Grant.Kind`), `interactive.go` (the run constants and keys); tests beside them
+- Create (rev 4, Astra R3 P1, the witness harness): `run_cutover_witness_test.go` in the root package, `package main`, with `//go:build carlos_cutover_witness`. It holds the two real-CLI expiry witnesses. `internal/console/cutover_witness_controls.go`, with `//go:build carlos_cutover_witness`, holds the console controls they need. Modify `.amadan/test-gate.sh`: one more job runs them in the gate (Step 2 below).
- Create: `internal/console/apirunsbox.go`, `internal/console/apirunsbox_test.go`; Modify: `internal/console/apiruns.go` (admission writes the grant for a fleet-placed record; `runClassRefusal` loses its fleet arm), `internal/console/interactivehub.go` (run relays beside sessions), `internal/console/runsweep.go` (expire unattached relays), `server.go` (register `GET /api/box/runs/{id}`), `testdata/claim-routes.txt`, `claim_invariant_fixtures_test.go`
- Modify: `internal/host/runexec.go`, `internal/host/runs.go` (the runs worker's writes go through a `runSink`; a fleet box uses the relay sink); Create: `internal/host/runrelay.go`, `internal/host/runrelay_test.go`
- Modify: `docs/site/cli.md` (strike RFS-3-C28's sentence, write RFS-6-C62), the series deck (strike RFS-3-C28, add RFS-6-C62 to C64), `approved_rootfs_copy_test.go`
@@ -1792,9 +1816,11 @@ A fleet box cannot make a run's bucket writes (the pickup CAS on the record, the
- 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.
+ - Before the pickup, 1 `request.json` GET (`runs.ReadRequest`, `internal/runs/store.go`), which the relay reads to set the pickup's deadline (rev 4, Astra R3 P2).
- 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.
+ - In total, beyond the chunks: judged 1 + 1 + 2 × (3 + 2) + 1 = 13 requests, and legacy 1 + 1 + 2 × (2 + 2) + 1 = 11. The terms are the grant PUT, the `request.json` GET, the two transitions with their index bumps, and the result PUT (rev 4; rev 3 left out the `request.json` GET).
+ - Not in this subtotal: today's run traffic, which Task 16 does not change. That is the run's admission (`request.json` and input PUTs), the CLI's follow polls, its expire, cancel and ack POSTs, the console's reads behind them, and the run-start and run-end audit rows (console SQL).
- 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.
@@ -1888,33 +1914,52 @@ func TestFleetRunsWorkerRelaysARootfsRun(t *testing.T) // PF-1: as above, on
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 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)
+// rev 3 (Astra R2 P1), placed by rev 4 (Astra R3 P1): two witnesses, one per path to the terminal expiry. They are in the root package,
+// run_cutover_witness_test.go (package main, //go:build carlos_cutover_witness), because followRun, runAPI and runTerm are package main's.
+// They build the console as auth_e2e_test.go does in package main: console.Open, console.NewServer over a DirStore and a temp registry,
+// httptest, and an apiSession{c: newConsoleClient(ts.URL, token)} for a member's CLI token. They reach the console's clock, watch and sweep
+// only through the tagged controls in internal/console/cutover_witness_controls.go. Before NewServer (which captures the gate's clock):
+// restore := console.UseLifetimesClockForTest(clock.Now), where clock is the test's own, starting at time.Now(). The real followRun over
+// runAPI uses a runTerm whose now is clock.Now. The fleet and its box are created through registry.Registry (CreateFleet, then AddFleetBox
+// with the sha256 hex of a token the test chose), and the test plays the box with interactive.DialFrame at RunMaxFrame.
+// In both: a fleet run admitted at t0; the drain starts at t0+10s (the cutover door, POSTed with an operator's token) 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); at t0+70s the test calls srv.LifetimesWatchOnceForTest(ctx), which activates the gate; a pickup is never attempted
+// after activation.
+func TestQueuedFleetRunAtACutoverExpiresBySweep(t *testing.T) // the CLI's HTTP client (sess.c.httpc.Transport wrapped by a test RoundTripper)
+// holds its first expire POST sent after activation until released; at t0+71s srv.RunSweepPassForTest(ctx, clock.Now()) answers true
+// (admitted) and 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) // RunSweepPassForTest is not called before the CLI's POST: the CLI's first
+// expire POST after activation answers 200 RunExpired: one runNotPickedUp line, exit 3; RunSweepPassForTest called afterwards writes nothing
+// (one RefusedExpired result, one run-end row)
+// internal/console/cutover_witness_controls.go (//go:build carlos_cutover_witness; rev 4). Each control also panics outside a test binary
+// (testing.Testing()), the pattern of UseSQLInstanceIdentityForTest (internal/console/claim_sql_instance.go). Each forwards to the
+// production function and adds no behaviour:
+// func UseLifetimesClockForTest(now func() time.Time) (restore func()) // sets lifetimesNow, the gate's clock seam; call before NewServer
+// func (s *Server) LifetimesWatchOnceForTest(ctx context.Context) // s.lifetimesWatchOnce(ctx): one marker read and activateWhenDrained
+// func (s *Server) RunSweepPassForTest(ctx context.Context, now time.Time) bool // one pass as StartRunSweep runs it: s.lifetimesIteration(ctx,
+// // "run sweep", true, false, ...) around s.runSweepPass(ctx, now, false);
+// // reports whether the gate admitted it
+func TestCutoverWitnessControlsAreTagged(t *testing.T) // in internal/console, untagged: go/parser reads cutover_witness_controls.go: its first
+// line is "//go:build carlos_cutover_witness", it declares exactly these three functions, and each body is one call (or assignment) of the named
+// production function plus the testing.Testing() guard; no other file names the tag except run_cutover_witness_test.go and .amadan/test-gate.sh
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` (the pattern matches both rev 3 witnesses), `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|TestCutoverWitnessControlsAreTagged' -count=1`, `GOFLAGS=-buildvcs=false go test -tags carlos_cutover_witness . -run '^TestQueuedFleetRunAtACutoverExpires' -count=1` (rev 4: the two real-CLI witnesses, root package, matched by one pattern), `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.
- [ ] **Step 4: Census, then run**
-Add `route GET /api/box/runs/{id}` to `claim-routes.txt` and a refused fixture (409, `claimInteractiveUnsupportedMsg`). The runs worker change is agent code; the console's record and `runs/` writes are new Put sites: add them to the record-write census as Plan 1 Task 3 Step 4 does, `PROPOSED-rootfs-apps-6`, and the proposal on #280. Run the Step 2 commands and `go test ./internal/console/ -run 'TestClaimConsoleRouteCensus|TestClaimConsoleMutationInvariant|TestAPIRun|TestRunSweep' -count=1`. Expected: PASS.
+Add `route GET /api/box/runs/{id}` to `claim-routes.txt` and a refused fixture (409, `claimInteractiveUnsupportedMsg`). (Rev 4, Astra R3 P1.) Add one job to `.amadan/test-gate.sh`, beside the `rest` job: `start cutover-witness go test -count=1 -timeout 30m -tags carlos_cutover_witness -run '^TestQueuedFleetRunAtACutoverExpires' .` Without it, the gate, which passes no tags, would never build the tagged witnesses. The tag `carlos_cutover_witness` is used by those two tests, the controls file and this one gate line only. The .sh is a census unit, so it goes on the census card with the rest of this task. No production build sets the tag, and the controls file adds no behaviour: `TestCutoverWitnessControlsAreTagged` holds both. The runs worker change is agent code; the console's record and `runs/` writes are new Put sites: add them to the record-write census as Plan 1 Task 3 Step 4 does, `PROPOSED-rootfs-apps-6`, and the proposal on #280. Run the Step 2 commands and `go test ./internal/console/ -run 'TestClaimConsoleRouteCensus|TestClaimConsoleMutationInvariant|TestAPIRun|TestRunSweep' -count=1`. Expected: PASS.
- [ ] **Step 5: Docs and copy.** In `docs/site/cli.md`'s `carlos run` section, remove RFS-3-C28's sentence and write RFS-6-C62 in its place; mark RFS-3-C28 `struck` in the deck (it stays in `rootfsCopyIDs`, joins `rootfsCopyStruck`) and remove it from `rootfsCopyBuilt` (the gate's struck-row rule, Plan 1 Task 1), and add RFS-6-C62 to C64. (Amended 2026-10-30, PF-13: there is no C28 sentence and C28 is not in `rootfsCopyBuilt`. Strike the row, add it to `rootfsCopyStruck`, take it out of `plan3CopyRuns`, and write C62 as its own paragraph after RFS-3-C27's. Rewrite the file cells of C62 to C64 to the paths written, PF-12.) Run `go test ./internal/docsite/ -count=1` and `GOFLAGS=-buildvcs=false go test . -run 'TestRootfsCopy|TestRootfsBuilt|TestPlan3CopyGroups' -count=1`. Expected: PASS.
@@ -1923,7 +1968,7 @@ Add `route GET /api/box/runs/{id}` to `claim-routes.txt` and a refused fixture (
- [ ] **Step 7: Commit**
```bash
-git add internal/interactive internal/console internal/host docs/site/cli.md docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md approved_rootfs_copy_test.go plan3_groups_test.go internal/provision
+git add internal/interactive internal/console internal/host docs/site/cli.md docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md approved_rootfs_copy_test.go plan3_groups_test.go internal/provision run_cutover_witness_test.go .amadan/test-gate.sh
git commit -m "carlos run: reach fleet boxes over the box-dials-the-console door (rootfs plan 6, ruling R7)"
```
diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-rootfs-plan6-amendment-R3.md b/docs/superpowers/reviews/CODEX-FINDINGS-rootfs-plan6-amendment-R3.md
new file mode 100644
index 000000000..6d66b3bb9
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-FINDINGS-rootfs-plan6-amendment-R3.md
@@ -0,0 +1,45 @@
+- **R1 P1-1 — resolved:** lease supervision covers every rootfs entry; unwatched starts are refused.
+- **R1 P1-2 — resolved:** the declared-process selector survives all six hops.
+- **R1 P1-3 — resolved:** cleanup owners retain their names and gain role parameters.
+- **R1 P1-4 — resolved:** Task 4 updates all three checked consumers.
+- **R1 P1-5 — partly resolved:** refusal and CLI timing are corrected; the replacement witnesses remain unbuildable as specified.
+- **R1 P2-6 — partly resolved:** ordinary-session accounting is correct; fleet-run accounting still omits a required read.
+- **R1 P2-7 — resolved:** 401 rows, 397 live, four struck, two pending.
+- **R2 P1 — partly resolved:** the deadline and activation timeline is corrected; the prescribed witness setup crosses inaccessible package boundaries.
+- **R2 P2 — partly resolved:** index and serial requests are counted correctly; Task 16’s new total remains incomplete.
+
+Static review of `981322d3c8cde479f854a83ec9989cd814b7a623`. No files edited or tests run. `GOCACHE` remained unset.
+
+1. **P1 — Task 16: neither real-CLI expiry witness can compile in the prescribed package.**
+
+ **Evidence:** [plan:1891](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-6/docs/superpowers/plans/2026-10-24-rootfs-apps-6-interactive.md:1891) requires real `followRun`, `runAPI` and `runTerm` together with `useLifetimesClock` and a watch pass. The task places these tests in `internal/console` and runs that package ([plan:1768](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-6/docs/superpowers/plans/2026-10-24-rootfs-apps-6-interactive.md:1768), [plan:1910](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-6/docs/superpowers/plans/2026-10-24-rootfs-apps-6-interactive.md:1910)). However, `followRun` belongs to root’s `package main` ([run.go:440](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-6/run.go:440)); the clock helper belongs to console’s test package ([lifetimes_cutover_test.go:45](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-6/internal/console/lifetimes_cutover_test.go:45)).
+
+ **Failure scenario:** Implementing either witness in `apirunsbox_test.go` produces undefined CLI identifiers. Moving it to root instead makes the console clock, watch and sweep controls inaccessible. No bridging harness is specified.
+
+ **Fix:** Specify a compilable harness before implementation: place the CLI witnesses in root-package tests and provide narrowly scoped, build-tagged console test controls for the shared clock, watch and sweep. Update the files list and test commands accordingly. Preserve both deterministic winner cases.
+
+ **Fault family:** Witness buildability — tests must reach the actual implementation through valid package boundaries.
+
+2. **P2 — Task 16: the fleet-run budget omits the relay’s `request.json` GET.**
+
+ **Evidence:** [plan:1797](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-6/docs/superpowers/plans/2026-10-24-rootfs-apps-6-interactive.md:1797) totals only the grant PUT, pickup, finish and result PUT. Yet pickup explicitly reads `request.json` ([plan:1864](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-6/docs/superpowers/plans/2026-10-24-rootfs-apps-6-interactive.md:1864)); `ReadRequest` performs a store GET ([store.go:33](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-6/internal/runs/store.go:33)).
+
+ **Failure scenario:** Even an uncontended successful relay exceeds the stated 12 judged or 10 legacy requests.
+
+ **Fix:** Add that GET: the listed relay operations total **13 judged and 11 legacy** beyond chunks. Explicitly exclude existing follow, audit and acknowledgment traffic from this subtotal, or account for it separately. Task 10’s **21/18** totals are correct.
+
+ **Fault family:** PF-22 — request accounting must cover actual store calls.
+
+3. **P2 — Task 10: the cross-restart no-redial claim is false before `PickupBy`.**
+
+ **Evidence:** [plan:1201](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-6/docs/superpowers/plans/2026-10-24-rootfs-apps-6-interactive.md:1201) claims a restarted agent finds an expired grant. But `seen` is an in-memory map, and the worker dials an unseen, valid grant before its pickup deadline ([plan:1485](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-6/docs/superpowers/plans/2026-10-24-rootfs-apps-6-interactive.md:1485), [plan:1496](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-6/docs/superpowers/plans/2026-10-24-rootfs-apps-6-interactive.md:1496)). Verification expires it only after that deadline ([grant.go:124](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-6/internal/interactive/grant.go:124)).
+
+ **Failure scenario:** A session attaches and ends early during draining. Its marker and grant remain pending cleanup. An agent restarted before `PickupBy` loses `seen` and can dial again.
+
+ **Fix:** Limit the no-redial claim to the current agent and expired grants. Explicitly require rejection of ended ids at the hub, with a restart-before-deadline witness proving no second launch.
+
+ **Fault family:** Session replay suppression across agent restarts.
+
+The outstanding P1 has one cause: the missing cross-package test harness. Up-front cutover refusal already applies and cannot fix it. Cutting the fleet relay would remove these witnesses; specifying the harness is the narrower remedy.
+
+NOT READY
\ No newline at end of file