plan 4: first-slice amendments from the preflight against Plans 1-3 as built
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+116
−0
docs/superpowers/plans/2026-10-24-rootfs-apps-4-console-and-docs.md+116 −0
diff --git a/docs/superpowers/plans/2026-10-24-rootfs-apps-4-console-and-docs.md b/docs/superpowers/plans/2026-10-24-rootfs-apps-4-console-and-docs.md| index 383ff4544..945ebf2e8 100644 |
| --- a/docs/superpowers/plans/2026-10-24-rootfs-apps-4-console-and-docs.md |
| +++ b/docs/superpowers/plans/2026-10-24-rootfs-apps-4-console-and-docs.md |
| @@ -53,6 +53,122 @@ The shared contract fixes most names this plan uses. The items below were propos |
| - **D9. Pools refuse on every deployment.** Plan 3 D6 refuses `Pool` on a rootfs record in `ValidateShape`, whatever the deployment. So `rootfsPlacementRefusal` refuses a pooled rootfs instance (RFS-4-C02) before the single-tenant allowance, not after: on a single-tenant deployment too. |
| - **D10. The default memory tier for a rootfs instance is 1 GB** (`cgroup.TierChildren`, Paul's ruling R9; Plan 2 deviation 9). Row RFS-4-C53 says so. |
| +## First-slice amendments (preflight 2026-10-27) |
| + |
| +The first merge builds Tasks 1, 2, 3, 5 and 5a on `rootfs-apps-3-lifecycle`, before Plan 3 merges, and ships with Plan 3 Group A as v0.29.0 (Paul, 2026-10-26). These tasks depend on Group A only: nothing from Plan 3 Task 12 (cut), Group R or Group W. The preflight below checked every name and line against the code as built. Where a row and the task text disagree, the row's disposition wins: |
| + |
| +- **Adopted as proposed:** every row's "proposed amendment" not named below. In particular: |
| + - 1.2: no trimming (D6); `" 1 "` must error. |
| + - 2.3: call `ownsFleet`. |
| + - 2.4: 500, matching the place door. |
| + - 2.5: no `rootfsOnOwnBoxes`; the plans-caps 3b section is history. |
| + - 2.6: count only the boxes `ListFleetBoxes` reports active. |
| + - 3.2: re-check the first kind inside the writers' own `lockApp`, never a handler-wide lock; refuse with the existing try-again sentence. |
| + - 3.3: `shouldStampHA` is false for a record with a runtime. |
| + - 3.4: keep the direct stamp and cite `RuntimeFromManifest`. |
| + - 5.1: 503 RFS-1-C79. |
| + - 5.2: `placeRecords`, fail closed. |
| + - 5a.3: Put only. |
| + - 5a.4: the backfill runs as a bounded goroutine after `NewServer`. |
| + - 5a.5: build the view from `ListFleetBoxes`. |
| + - New fixtures take names that collide with nothing, and their manifest has no Pool. |
| +- **Task 4 is cut.** Paul's Plan 3 Task 13 ruling already refuses `apps place` for any app whose established kind is rootfs (RFS-3-C24). RFS-4-C03 and C04 are struck, and Review Focus 2 is dropped. |
| +- **Copy back to review:** RFS-4-C01 (its remedy becomes `carlos apps create --place fleet/<name>` before the first ship), and C05 and C06 (they name overlap deploys; C06 uses the region-name helper of row 2.8). They go through the copy-review gate with Plan 3's RFS-3-C30 to C32 before gate A. |
| +- **Accepted and noted, no code:** |
| + - 3.6: claim consoles. Claims are shelved, and armed boxes publish `rootfs_ready` false. |
| + - 3.7: nearest-region history. |
| + - 5.3: the check after the spool stays where it is. |
| + - X.3: Plan 3's record guards need nothing new. |
| +- **Per-task security review (Astra, under the AGENTS.md stopping rules):** Tasks 3, 5 and 5a; Task 2 is reviewed with Task 3. Tasks 1 and 2 otherwise rely on the whole-branch review. |
| + |
| +### Plan 4 Tasks 1-5a preflight against the branch as built |
| + |
| +Read-only check of `docs/superpowers/plans/2026-10-24-rootfs-apps-4-console-and-docs.md` Tasks 1, 2, 3, 4, 5, 5a against `rootfs-apps-3-lifecycle` at 4a23d27b (Plans 1 and 2 merged, Plan 3 Group A built, Task 12 cut) and origin/main 81db4870 (6 commits ahead of the branch). |
| + |
| +#### Summary |
| + |
| +1. **Blocker, Task 3:** the door's `defer s.lockApp(...)` deadlocks. Since Plan 3 Task 13 and main's #407, every console record writer takes `lockApp` itself (`createRecordMarked` hostsused.go:561, `createRecordWithLifetime` via `withAppHost`), and Go's mutex does not re-enter. It also breaks the lock order (`planLock` takes the account lock later, at apiinstances.go:1817). Fix: do the first-kind recheck inside the writers' own lock and refuse with "try again" (row 3.2). |
| +2. **Task 4 is superseded.** Paul's Task 13 round-3 ruling already refuses `apps place` for any app whose established kind is rootfs, using RFS-3-C24, on every deployment and for the same target too. Cut Task 4's code, strike C03 and C04, and drop Review Focus 2. |
| +3. **C01's remedy is now wrong.** It says "place it with carlos apps place", but the only way left is `carlos apps create --place fleet/<f>` before the first ship. C05 and C06 also leave out two readiness conditions: overlap deploys must be on and claim control off. All three rows go back to Paul. |
| +4. **Task 1:** the test and the interface trim whitespace (`" 1 "` reads as true). D6 and the box's `singleTenant` read it exactly, so the console and the boxes would disagree. Drop the trim. |
| +5. **Task 3, born HA:** `shouldStampHA` would mark a rootfs record HA on a single-tenant deployment whose region is in CONSOLE_HA_REGIONS. Exclude records with a runtime (console only). |
| +6. **Task 5:** count records with the strict, judged listing that Task 13 already uses, not `ListRecords`, which skips unreadable records. Answer errors with the door's existing RFS-1-C79 at 503, not C08 at 502. |
| +7. **Task 5a:** `fleetOwnerCheck` now takes a ctx and is unexported, so the console witness cannot call it. Layer the census on the current head (`operatorPagesWriteCensusInventory` after merging main). Under C2, `internal/hostops` is in the root binary, so the classifier needs a gate-A census card; the console code needs none. Classify Put only. |
| +8. **Stale assumptions:** plans-caps 3b and 4c are merged. They leave always-on rootfs instances alone, so `rootfsOnOwnBoxes` has no caller; use the existing `ownsFleet`. Many test fixtures collide with existing helpers: `shopManifest`, `fixtureAccount`, `createInstance`, `deleteInstance`. The tito-based manifest also carries Pool "tito". |
| +9. **No dependency** on Task 12, Group R or Group W in Tasks 1-5a. `runtimeFixed`, `checkKindUnchanged` and the registry guards need no change: the slice only creates records. |
| +10. **(a) Yes, with conditions.** Order: `apps create --place fleet/home`, enable instances, `carlos ship --rootfs`, then `carlos promote` (ship does not move a channel), then `instances create`. The box needs v0.29.0, nested layout, CARLOS_SWAP=overlap and a passed probe. #416 still looks open. There is no sample or guide yet, so the operator binds Puma to `unix://$CARLOS_SOCKET` by hand, runs db:prepare in `web`, and runs no workers. |
| +11. **(b) Yes by design (N1 overlap), unproven on a real box.** Migrations in the new `web` run while the old one serves, so they must be backward compatible. A failed boot keeps the old generation serving. Workers are not handed over; Group W is not built. Add a continuous-request probe to the dev re-run. |
| +12. **(c) Security review needed for Tasks 3, 5 and 5a.** Task 3 mints permanent tenancy facts and holds the lock boundary. Task 5 is a concurrency boundary over production storage. Task 5a adds the box's ownership proof and a root-binary classifier. Task 2 is reviewed with Task 3. Tasks 1 and 4 need only the whole-branch review. |
| + |
| +#### Mismatch table |
| + |
| +| # | task | plan says | code has | consequence | proposed amendment | |
| +|---|---|---|---|---|---| |
| +| X.1 | all | Build target "main with Plans 1 to 3 merged" | Paul 2026-10-26: the slice is built on `rootfs-apps-3-lifecycle` before Plan 3 merges, released as v0.29.0 (ledger ruling). origin/main is 6 commits ahead (operator-pages, analytics-onramp, alias-wake-338, rollup-tenant-tags, HA P1a follow-up #433, usage-attribution-390), touching `internal/console/server.go`, `view.go`, `fleets.go`, `internal/registry`, the census chain | Line refs and the census head shift again after the merge | Merge origin/main before Task 1; re-read the line refs below after the merge | |
| +| X.2 | all | Plan 3 D8: "Plan 4 depends on Group W" | Tasks 1-5a use no worker, release or `carlos run` code; Task 12 cut does not touch them | None | State in Plan 4's header that Tasks 1-5a depend on Group A only; W stays a dependency of Task 6 (D3) and the sample | |
| +| X.3 | all | (implicit) creates must pass Plan 3's record guards | `runtimeFixed` admits any create (`len(prior)==0`, provision/runtime.go:130); lifetime write-backs keep runtime and region; `checkKindUnchanged` (hostsused.go:236) only judges rewrites; `UpsertUnlessRootfs`/`SetPlacement`/`Upsert` region rule are registry-side and reached only by reconcile and place | No change needed | None; note it so the implementer does not add guards | |
| +| 1.1 | 1 | `Config` at server.go:476, `ReservePlatformDomains` :625-634; `applyMovesSwitch` call :463, def :1525 | `Config` :483, `ReservePlatformDomains` :652-661; call :569, def :1769 | Line drift only | Update refs | |
| +| 1.2 | 1 | Interfaces: anything else "after `strings.TrimSpace`" errors; test table has `" 1 ": true` | D6 and the box's `singleTenant` (internal/host/rootfsplacement.go:304) accept exactly `""`, `"0"`, `"1"`, no trim; `" 1 "` is off on the box | A console with `" 1 "` allows unplaced rootfs creates every box refuses: the exact split Review Focus 5 exists to prevent | No trim. Move `" 1 "` (and `"1 "`) to the must-error list | |
| +| 1.3 | 1 | (none) | Boxes get the variable via `internal/hostenv` (hostenv.go:78); the console reads its own environment | An operator can set one side only | Task 11 / roll note: set it in the console's env and every box's host.env together | |
| +| 2.1 | 2 | D1: `AppKind` reads "the newest readable, valid release among the 20 newest" | `AppKind` lists every version (`VersionCandidates(..., math.MaxInt)`, release/rootfs_ship.go:58) | One full release listing per create of a rootfs or unfixed app; correct, slightly costlier | Fix the text; no code change | |
| +| 2.2 | 2 | `release.Channel` :1238, `GetManifest` :710, `staticHeadRefusal` :1838, `consoleRegistry.GetFleet` view.go:518, `LoadBoxes` :150, `BoxStale` :137, `homeRegionIn/Out` :306/:322 | :1343, :815, apiinstances.go:2101, view.go:533, fleet.go:151, :138, apiinstancemove.go:319/:335 | Drift only | Update refs | |
| +| 2.3 | 2 | `rootfsPlacementRefusal` reads `FleetPlacement`, `GetFleet`, compares `Account` | plans-caps 3b already has `ownsFleet(reg, acct, placement)` (plancaps.go:508), the same predicate | Two copies of the ownership rule | Call `ownsFleet` after the pool and single-tenant arms | |
| +| 2.4 | 2 | `GetFleet` error: "502 with the existing text could not check the fleet (fleets.go:606)" | That sentence is at fleets.go:620 and answers 500 | Status mismatch with the existing door | Say 500 (match the place door) or keep 502 on purpose and say so | |
| +| 2.5 | 2 | `rootfsOnOwnBoxes` for plans-caps 3b, "not built"; section "What Plan 3b of plans-caps must honour" | 3b is merged: `checkAlwaysOnCreate`/`checkAlwaysOn`/`onOwnBoxes` (plancaps.go:402-506) refuse never-sleep sidecars only, never an instance create; 4c's awake ceiling applies only when the entry hibernates (activator.go:5132), so residents skip it | `rootfsOnOwnBoxes` and `TestRootfsOnOwnBoxes` have no caller; the section is stale | Drop `rootfsOnOwnBoxes` from this slice; rewrite the section as "checked: 3b and 4c leave always-on rootfs instances alone" with these refs; keep `TestRootfsCreateUnderPlansMintsAlwaysOn` | |
| +| 2.6 | 2 | `rootfsReadyRefusal` counts any fresh heartbeat under `fleets/<f>/status/boxes/` (single tenant: any platform box in the region) | Detached fleet boxes keep a fresh heartbeat for up to 15 min; `loadFleetPage` joins heartbeats with `ListFleetBoxes`; single-tenant region boxes may be dedicated-pool only (`CARLOS_POOLS`, now with `@shared`) | An advisory pass for a box that never takes the row (the box still refuses with RFS-2) | Count only labels `ListFleetBoxes` reports active; on single tenant, only boxes that serve the shared pool if the snapshot says so; otherwise accept and note | |
| +| 2.7 | 2 | C05/C06 ("fact"): a box can "once it runs a platform release with rootfs support, on the nested layout, and has passed its rootfs check" | `rootfs_ready` = `host.RootfsBoxReady`: claim control off, nested, probe passed, **overlap swaps on** (rootfsplacement.go:95-127) | A box without `CARLOS_SWAP=overlap` stays refused after the user does what the sentence says | Revised C05/C06 to Paul naming overlap deploys (and claim control if Paul wants it); a fact row whose fact changed goes back per the plan's own rule | |
| +| 2.8 | 2 | C06 `<region>` = `s.homeRegionOut(region)` "the home region's name" | `homeRegionOut` returns a code (apiinstancemove.go:335); main's region sentences use `offlineName`/`placeOf` for names | The sentence shows a code where its siblings show a name | Use the same name helper the other region refusals use | |
| +| 2.9 | 2-5 | New fixtures: `shopManifest()` = `titoManifest()` renamed; `fixtureAccount(t, fx, "bab")`; `createFleet`, `createFleetAs`, `refStatus`, `shipRootfsRelease`, `writeFleetBox` | `shopManifest(app, domain)` exists (remoteinstances_test.go:57, Pool "shop"); `titoManifest()` has Pool "tito" and Seed; `fixtureAccount(fx)` exists (accountfleet_test.go:61); `instanceFixture` creates only app `titogo` in the store | Redeclaration compile errors; every rootfs create on the fixture refuses C02, and `validateRuntime` refuses the pool; `shop` fails `instanceGate` without a store row | Name it `rootfsShopManifest()` with Pool "", no Seed, Domain `example.com`; use `fixtureAccount(fx)`; `fx.st.CreateAppIn(OpsAccountID, "shop", ...)` before `enableInstances`; reuse `placeKindWorld`, `placeRootfsWorld`, `putKindMarker`, `failGetStore` (rootfs_move_test.go, seedmove_test.go) and `rootfsShipFixture` (apiship_rootfs_test.go:36) | |
| +| 3.1 | 3 | `handleAPIInstanceCreate` :987; `seeded` :1073; `placed` :1205; `region` :1238-1331; `probeRec` :1305; `staticHeadRefusal` :1417-1420; literal :1421; `ValidateShape` :1523; `PrepareInstance` :1612 | :1192; :1285; :1417; :1440-1540; :1517; :1629-1632; :1633; :1743; :1851 | Drift only | Update refs | |
| +| 3.2 | 3 | Step 1: when `head.Unfixed`, `defer s.lockApp(acct.Sqid, app)()` at the rootfs block, held to the handler's return; "if something along the create path takes it, stop and report" | Every record writer takes `lockApp` itself: `createRecordMarked` (hostsused.go:561), `createRecordWithLifetime` via `withAppHost` (lifetimes_create.go:45), the seed and import doors through the same two (recordlock.go, #407; Task 13 01f06913). `keyedLocks` is a plain `sync.Mutex` (applocks.go). `planLock` takes the account lock at apiinstances.go:1817, after the block, against the "account before app" order (applocks.go:56) | The create blocks forever on its own lock (every create of an app with no release); lock-order inversion with `/new-temporary` and `restoreApp`. The plan's stop condition is met | No lock at the door. Pass the door's `head.Unfixed` to the writer; inside its existing `lockApp`, before the create-only put, re-read `release.EstablishedKind`; if it now says rootfs, refuse with the existing 502 "could not create the instance — try again" and write nothing (the retry reads the marker and mints rootfs). The same check runs for seed and import, which share the writers. The record-write witness (record_write_lock_test.go) already proves every console record write holds the lock. Both interleaving tests keep their outcomes; `TestCreateDuringAnUnpublishedFirstRootfsShipMintsRootfs` reads the marker before any lock | |
| +| 3.3 | 3 | Stamp `Runtime`/`Hibernate` after the literal; nothing about HA | After the seed hand-offs the door sets `rec.HA = s.shouldStampHA(rec)` (apiinstances.go:1841; seedmove.go:44: instance kind, no role, region in `CONSOLE_HA_REGIONS`, "" = home); `validateRuntime` does not refuse HA | On a single-tenant deployment with an HA home or explicit region, a rootfs record is born HA, against C7 (one box per instance). Fleet placements are never HA | `shouldStampHA` returns false when `rec.Runtime != ""` (console only, no census card), with a test on a single-tenant HA region | |
| +| 3.4 | 3 | Stamp by hand: `rec.Runtime = provision.RuntimeRootfsV1; rec.Hibernate = &h` | Plan 3 built `provision.RuntimeFromManifest(m)` (provision/runtime.go:24) as the mint helper; a marker-only head has no manifest | Two mint spellings | Keep the direct stamp (the marker path needs it) and cite `RuntimeFromManifest` as the rule it mirrors, or add `RuntimeFromKind(release.AppKindInfo)` beside it (provision is in the root binary: census card) | |
| +| 3.5 | 3 | `TestRootfsCreateRefusals` "replica" case on `readyApp` (fleet placed): 422 C10 | A fleet-placed app's replica is refused first by the existing 400 (apiinstances.go:1530) | Test fails; C10 is reachable only on an unplaced app | Run the C10 case on an unplaced app (single tenant, ready platform box), or on the shared deployment unplaced, where C10 precedes C01 by the block's order | |
| +| 3.6 | 3 | "This plan adds no launch path, so it says nothing new about a box with armed claim control" | With `cfg.HostClaim`, `chooseCreateFirst` (nocapacity.go:247) picks a box from `PlaceableBoxes` (no rootfs readiness), and `beginClaimCreate`/`finishClaimCreate` (claim_create.go) write the record without `lockApp` | The first-kind boundary does not hold on a claim console; claim-armed boxes publish `rootfs_ready` false (RFS-2-C06), so C05/C06 refuses rootfs creates there anyway | Accept and state it (claims shelved); or refuse an unfixed create under `HostClaim` while a rootfs first ship can race. Recommend accept + note | |
| +| 3.7 | 3 | (none) | Nearest-region: once the hostname history is active, a data create must name an examined fleet (`hostsTargetRefusal`, hostsused.go:197; also `apps create --place`) | A fleet created after activation refuses every create until the history is completed | Ops/Task 11 note only; the dev switch is off today | |
| +| 4.1 | 4 | `rootfsPlaceRefusal`: same target is a no-op (200), clearing refuses C03, a move with instances refuses C04, single tenant clears with 200; Review Focus 2 | Paul's Task 13 round-3 ruling (5ed99f60): `placeAppTarget` refuses any app whose `EstablishedKind` is rootfs with RFS-3-C24 (`rootfsPlaceWords`, seedmove.go:171), under `lockApp`, before the claim branch, on every deployment, same target included (fleets.go:632-654); `SetPlacement` refuses runtime rows (`ErrRuntimePlacement`); `TestPlaceRefusesARootfsKindApp` (rootfs_move_test.go:444) pins it | Task 4 as written contradicts a ruling; 5 of its 7 tests would fail | Cut Task 4's code and `rootfsPlaceRefusal`. Keep only door witnesses not yet covered: the browser flash (`handleAppPlace`, C24) and C24 before `claimResponseUnavailable` with `HostClaim` on. Strike RFS-4-C03 and C04 (`rootfsCopyStruck`). Delete Review Focus 2 | |
| +| 4.2 | 3/4 | C01: "... place it on one of your fleets first with carlos apps place" | C01 fires only when the head is rootfs, which is exactly when `apps place` refuses (C24, whose words talk about instances even when there are none). `apps place` is also cut once the hostname history is active (fleets.go:584-595) | A user who shipped before placing follows C01 into C24; the only remedy is a new app made with `carlos apps create <name> --place fleet/<f>` before its first ship | Revised C01 to Paul, e.g. "<app> is a rootfs app, and a rootfs app runs only on boxes your account owns. a rootfs app is placed when it is made: create a new app with carlos apps create --place fleet/<name> and ship to it". Optionally a C24 variant for the no-instance case (Paul's call) | |
| +| 5.1 | 5 | Slot error mapping: `EstablishedKind` error 502 C08; `EstablishFirstKind` conflict 409, "another error is the existing 502" | The rootfs door already answers a kind check it could not make as 503 RFS-1-C79 `shipKindUnchecked` ("could not check this app's releases. nothing was shipped. try again", apicli.go:1742) via `shipKindRefusedAtPublication` (apiship_rootfs.go:144), which also maps both conflicts | Two sentences and statuses for one failure at one door; C08 does not say nothing was shipped | In the slot, route every `EstablishedKind`/`EstablishFirstKind`/record-list error through `shipKindRefusedAtPublication` (C79, 503). C08 stays a create-door row | |
| +| 5.2 | 5 | Count with `provision.ListRecords` (`instanceListMax`) | `ListRecords` skips unreadable records and truncates at max (provision.go:3043); Task 13's `placeRecords` uses `ListRecordsStrictJudged` with no cap (seedmove.go:96) | An unreadable or 501st binary record goes uncounted, the marker is written, and that record can never serve (permanent, §5.0) | Use `placeRecords`; any unreadable record refuses (C79), fail closed | |
| +| 5.3 | 5 | The check sits in the slot after the image is spooled | The slot runs after up to 2 GiB is uploaded and spooled (`apiShipRootfsReadDeadline`) | The user uploads for minutes, then is told to delete instances | Optional: an advisory, lock-free copy of the rule beside the pre-body `CheckShipKind` in `handleAPIShip`; the slot's check stays authoritative | |
| +| 5.4 | 5 | `createInstance(t, fx, token, host)`, `deleteInstance(...)`, `shipRootfsThroughTheDoor` | `createInstance(t, fx, token, body)` (apiinstancesprivatestore_test.go:59, app `titogo`), `deleteInstance(t, fromFixture, host)` (apiinstanceimport_test.go:1556) exist; `rootfsShipFixture` exists | Redeclaration errors | New names (`createShopInstance`, `deleteShopInstance`); build the ship helper on `rootfsShipFixture` | |
| +| 5a.1 | 5a | Witness: `fleetOwnerCheck(store, "home", time.Now)("bab")`; "if importing internal/host cycles, decode by hand" | Signature is `func(ctx, acct)` since Plan 3 Task 7 (rootfsplacement.go:225), and it is unexported; `internal/host` does not import `internal/console` (no cycle), but a console test cannot call an unexported host function at all | The witness does not compile as written | Take the plan's fallback: read with `release.GetQualified`/`Get` and decode exactly as `fleetOwnerCheck` does, with a comment naming it. Exporting a shared reader touches `internal/host`, which another implementer is editing: coordinate first | |
| +| 5a.2 | 5a | Census entries layered on `rootfsApps1WriteCensusInventory`, `PROPOSED-rootfs-apps-4`, added to Task 10's #280 proposal | `TestPlan9B8RecordWriteCensus` (plan9_b8_census_test.go:360) still walks every package, console included; its head is `nearestRegionBWriteCensusInventory` on the branch and `operatorPagesWriteCensusInventory` on main. Census C2 (7c9e9d6a): cards only for packages the root binary compiles; `internal/hostops` is one (`go list -deps .`), `internal/console` is not | Wrong base function; a needless #280 proposal for console sites; the classifier change would miss its card | Layer the B8 entries on whatever head exists after merging main; no #280 rows for console sites; put the `hostops` classifier into gate A's `census-propose NAME=rootfs-apps-3` | |
| +| 5a.3 | 5a | `classifyFleetOwner` admits Put and Delete; `deleteFleetOwner` written, no caller | No fleet delete door exists | A reviewed delete path in a root-binary classifier with nothing using it | Put only; leave `deleteFleetOwner` and the Delete arm to the fleet-removal change (refuse up front) | |
| +| 5a.4 | 5a | "beside the other one-shot backfills `cmd/console/main.go` runs after the registry opens" | No such group: the console opens the registry per request (`openRegistry`); the only nearby backfill is the mail user boundary (main.go:617) | The implementer has no place to copy | Start `backfillFleetOwners` in a goroutine after `console.NewServer` (main.go:574) with a bounded context; a no-op when `Releases` is nil or `Registry` is "" | |
| +| 5a.5 | 5a | Repaired retry answers "exactly as a fresh create does (200, `fleetView` of the stored row)" | A fresh create renders `Boxes: []`; a repaired row may have boxes added since | The repair answer can under-report boxes | Build the view from `ListFleetBoxes`, or say the repair answer shows no boxes | |
| + |
| +Line refs checked and unchanged: `handleAPIFleetNew` fleets.go:156, `CreateFleet` :211, the 500 sentence :214, the 409 :217; `registry.CreateFleet`/`GetFleet`/`ListFleets` fleets.go:183/211/230; `release.FleetOwnerKey`/`FleetOwner` release.go:176-185; `release.EstablishedKind`, `EstablishFirstKind`, `AppKindMarkerKey`, `KindConflictError`, `HibernateConflictError` in rootfs_ship.go; `BoxMetrics.RootfsReady` (snapshot.go:643); the slot comment in `shipRootfsParts` (apiship_rootfs.go:291); `doorRefusal{Status, Msg}` (domainattach.go:74); all RFS-4-C01 to C11 are approved in the deck and listed in `rootfsCopyIDs`. |
| + |
| +#### (a) Rootfs app end to end on a dev fleet box after Tasks 1-5a |
| + |
| +No code is missing for a rootfs instance to be served on a fleet box. Group A runs it: the N1 start and swap, Task 7's admission, Task 8's residency and the D7 placeholder database. Task 3 mints the record, and Task 5a writes the owner record the box checks. What the operator still needs: |
| + |
| +1. Order. `carlos fleets new home` (5a writes the owner record; existing fleets need a console restart for the backfill). Then `carlos apps create shop --place fleet/home` **before** the first ship: once the app's kind is rootfs, `apps place` refuses (Task 13). Then the operator enables instances with a manifest that has no pool. |
| +2. `carlos ship --rootfs --processes processes.json` (Plan 1), then `carlos promote`. Ship does not move a channel (ship_rootfs.go:254-297), and the create reads the channel head. |
| +3. `carlos instances create shop --host ...` mints `rootfs-v1`, always on, after the readiness check passes. |
| +4. The box needs v0.29.0 (Group A plus this slice), the nested layout, `CARLOS_SWAP=overlap` with generations, claim control off and a passed rootfs probe. Bootstrap issue #416 (`/run/carlos-control` owned by root:root after a fresh offcloud bootstrap) shows no fix in the git log; expect a hand fix on a fresh box. Paul's go also requires Plan 2 Task 10's instance checks (4.x, 5.x) on dev. |
| +5. The Rails 8 image is the operator's own until Tasks 8-9: arm64, Puma bound to `unix://$CARLOS_SOCKET` (no Thruster on TCP), `db:prepare` inside the `web` command (no Group R), the primary database at `CARLOS_DB` with Solid Cache, Queue and Cable in it or under the writable instance directory, and Solid Queue inside Puma (Group W is not built: a declared worker is logged and not run). |
| +6. Not blockers: `carlos instances list` shows no runtime yet (Task 6); `carlos run` is refused (Task 12 cut, R7). Prove it from the app's pages and `carlos logs`. |
| +7. Merge path: Task 15's console floor (in progress), gate A, the whole-branch review, the census, release v0.29.0, then roll dev boxes before the dev console. |
| + |
| +#### (b) Second ship: N1 overlap swap with no downtime |
| + |
| +By design, yes. A second rootfs ship with the same hibernation, plus a promote, makes the box's rollout scheduler start the new generation's `web` on its own socket and wait up to 120 s for health. It then moves the canonical link and drains the old generation (N1, `TestOverlapSwapStartsTheRootfsGeneration` in internal/activator/rootfs_staged_test.go). `rootfs_ready` already requires overlap swaps, so a ready box always overlaps. Caveats: |
| + |
| +- Without Group R, migrations run in the new `web`'s boot while the old one still serves the same SQLite file, so they must be backward compatible (spec §5.2). A `db:prepare` that fails stops the new generation becoming healthy, and the old one keeps serving. |
| +- Workers are not handed over until Group W is built. |
| +- The swap has been proven only through `fakeControl` and the control-handler harness, never on a real box. |
| + |
| +Add a timed second ship under continuous requests to the dev re-run (Plan 2 Task 10 / Plan 4 Task 11) before calling it zero downtime. |
| + |
| +#### (c) Tasks that need a per-task security review (AGENTS.md rule 3) |
| + |
| +- **Task 3:** a tenancy gate at the instance door. It mints a permanent runtime and hibernation (§5.0) and decides own-boxes placement, and it is where the first-kind lock boundary must hold without deadlocking (row 3.2). The born-HA interaction (row 3.3) belongs to it too. Review Task 2's pure functions in the same pass. |
| +- **Task 5:** a concurrency boundary over production storage. The kind marker and the record count decide permanently whether a record can ever serve, and the race tests run under `-race`. |
| +- **Task 5a:** a new bucket key that is the fleet box's only ownership proof for rootfs starts, and a classifier family in a root-binary package (census card). The retry repair path must not become a cross-account oracle or writer. |
| +- **No per-task review:** Task 1 (a parse and a field; fix row 1.2) and Task 4 (tests only after row 4.1). The whole-branch review covers both. |
| + |
| ## What Plan 3b of plans-caps must honour (spec §5.6, last paragraph) |
| Plans-caps Plan 3b (never-sleep refusals, `docs/superpowers/specs/2026-10-20-plans-caps-packs-design.md` §5.2) is not built. When it is: |