| new file mode 100644 |
| index 000000000..6e4dc00cd |
| --- /dev/null |
| +++ b/docs/superpowers/notes/census-review-rootfs-apps-3-r1.md |
| @@ -0,0 +1,189 @@ |
| +| Unit | Class / disposition | Verdict | Lines read | |
| +|---|---|---|---| |
| +| `internal/activator/activator.go:Service.finishStop` | body / legacy | APPROVE | 4759–4771 | |
| +| `internal/activator/activator.go:Service.respawnWorkerLocked` | body / authority | APPROVE | 4098–4122 | |
| +| `internal/activator/activator.go:Service.serveWakeError` | body / diagnostic | APPROVE | 5888–5904, 5927–5939 | |
| +| `internal/activator/activator.go:type Service` | body / authority | APPROVE | 1338–1375 | |
| +| `internal/activator/recoveryprobe.go:Service.finishRecoveryProbe` | body / legacy | APPROVE | 227–240 | |
| +| `internal/activator/rootfs.go:ExecBackend.rootfsGateCheck` | body / legacy | APPROVE | 141–170 | |
| +| `internal/activator/rootfs.go:ExecBackend.rootfsGates` | body / legacy | APPROVE | 130–132 | |
| +| `internal/activator/rootfs.go:ExecBackend.startRootfsFromLive` | body / legacy | APPROVE | 179–198 | |
| +| `internal/activator/rootfs.go:ExecBackend.startRootfsGen` | body / legacy | APPROVE | 208–238 | |
| +| `internal/appconfig/sync.go:syncHostClaimed` | body / legacy | APPROVE | 638–644 | |
| +| `internal/caps/converge.go:Converge` | body / authority | APPROVE | 229–236 | |
| +| `internal/host/agent.go:makeStartRoute` | body / authority | APPROVE | 4623–4630 | |
| +| `internal/host/agent.go:runAgent` | body / authority | APPROVE | 702–708 | |
| +| `internal/host/restart.go:restartPass` | body / authority | APPROVE | 762–769 | |
| +| `internal/host/restartscope.go:restartScopeLeg` | body / authority | APPROVE | 493–500 | |
| +| `internal/host/rollout.go:armRollout` | body / legacy | APPROVE | 403–412 | |
| +| `internal/host/rootfsplacement.go:agentRootfs.arm` | body / legacy | APPROVE | 374–382 | |
| +| `internal/host/systemapply.go:RunSystemApply` | body / authority | APPROVE | 113–142 | |
| +| `internal/host/systemapply.go:systemApplier.Run` | body / authority | APPROVE | 435–473, 479–515 | |
| +| `internal/provision/offline_move.go:offlineBegin` | body / legacy | APPROVE | 182–190 | |
| +| `internal/provision/provision.go:MoveRequest` | body / legacy | APPROVE | 1488–1496 | |
| +| `internal/provision/provision.go:MoveStartTransition` | body / legacy | APPROVE | 1528–1536 | |
| +| `internal/provision/seedswap.go:importShape` | body / legacy | APPROVE | 47–53 | |
| +| `internal/registry/registry.go:upsertRoute` | body / legacy | APPROVE | 1477–1542 | |
| +| `internal/release/adopt.go:PassFilter` | body / authority | APPROVE | 1238–1246 | |
| +| `internal/release/adopt.go:adoptHost` | body / authority | APPROVE | 2155–2162 | |
| +| `internal/release/rootrestart_history.go:RootRestarts.Observe` | body / authority | APPROVE | 250–257 | |
| +| `internal/schedule/converge.go:StatusFor` | body / legacy | APPROVE | 476–483 | |
| +| `internal/status/snapshot.go:CollectBox` | body / legacy | APPROVE | 1014–1020 | |
| +| `cli.go:addWrite` | new / legacy | APPROVE | 94–100 | |
| +| `cli.go:refuseAddRootfs` | new / legacy | APPROVE | 81–90 | |
| +| `internal/activator/activator.go:Service.awaitWake` | new / legacy | APPROVE | 1779–1791 | |
| +| `internal/activator/activator.go:Service.installProcLocked` | new / legacy | APPROVE | 3007–3029 | |
| +| `internal/activator/backend_exec.go:refuseRuntimeBinaryLaunch` | new / legacy | APPROVE | 2841–2846 | |
| +| `internal/activator/backend_exec.go:refuseUnknownRuntime` | new / legacy | APPROVE | 2831–2836 | |
| +| `internal/activator/backend_rootfs.go:ExecBackend.Processes` | new / legacy | APPROVE | 46–78 | |
| +| `internal/activator/backend_rootfs.go:Service.declaredProcesses` | new / legacy | APPROVE | 117–127 | |
| +| `internal/activator/backend_rootfs.go:Service.rootfsProcessesHook` | new / legacy | APPROVE | 90–112 | |
| +| `internal/activator/backend_unit.go:SplitBackend.PlaceRootfsDB` | new / legacy | APPROVE | 353–360 | |
| +| `internal/activator/backend_unit.go:SplitBackend.Processes` | new / legacy | APPROVE | 365–372 | |
| +| `internal/activator/backend_unit.go:SplitBackend.rootfsStartable` | new / legacy | APPROVE | 342–349 | |
| +| `internal/activator/genbackend.go:refuseHostCgroupProof` | new / legacy | APPROVE | 632–637 | |
| +| `internal/activator/layout.go:LayoutExempt` | new / legacy | APPROVE | 69–79 | |
| +| `internal/activator/rootfs.go:ExecBackend.rootfsStartable` | new / legacy | APPROVE | 137–139 | |
| +| `internal/activator/rootfs.go:ExecBackend.startStagedRootfs` | new / legacy | **REJECT — P1-1** | 253–277, 325–375 | |
| +| `internal/activator/rootfs_service.go:Service.killResidentGens` | new / legacy | APPROVE | 938–959 | |
| +| `internal/activator/rootfs_service.go:Service.noteResidentRefusalLocked` | new / legacy | APPROVE | 591–598 | |
| +| `internal/activator/rootfs_service.go:Service.noteResidentStopLocked` | new / legacy | APPROVE | 1002–1021 | |
| +| `internal/activator/rootfs_service.go:Service.noteResidentWakeLocked` | new / legacy | APPROVE | 971–992 | |
| +| `internal/activator/rootfs_service.go:Service.noteRootfsRefusal` | new / legacy | APPROVE | 250–266 | |
| +| `internal/activator/rootfs_service.go:Service.placeRootfsDB` | new / legacy | APPROVE | 311–320 | |
| +| `internal/activator/rootfs_service.go:Service.residentHeldLocked` | new / legacy | APPROVE | 543–551 | |
| +| `internal/activator/rootfs_service.go:Service.residentJob` | new / legacy | APPROVE | 733–764 | |
| +| `internal/activator/rootfs_service.go:Service.residentLeaseLost` | new / legacy | APPROVE | 897–932 | |
| +| `internal/activator/rootfs_service.go:Service.residentOrderLocked` | new / legacy | APPROVE | 611–620 | |
| +| `internal/activator/rootfs_service.go:Service.rootfsBackendGates` | new / legacy | APPROVE | 205–242 | |
| +| `internal/activator/rootfs_service.go:Service.rootfsRefusalLocked` | new / legacy | APPROVE | 133–147 | |
| +| `internal/activator/rootfs_service.go:Service.rootfsStartRefusal` | new / legacy | APPROVE | 155–173 | |
| +| `internal/activator/rootfs_service.go:Service.rootfsTick` | new / legacy | APPROVE | 643–717 | |
| +| `internal/activator/rootfs_service.go:Service.rootfsWakeRefusal` | new / legacy | APPROVE | 288–296 | |
| +| `internal/activator/rootfs_service.go:firstWakeBudgetFor` | new / legacy | APPROVE | 49–54 | |
| +| `internal/activator/rootfs_service.go:healthBoundFor` | new / legacy | APPROVE | 37–42 | |
| +| `internal/activator/rootfs_service.go:markOwnershipRefusal` | new / legacy | APPROVE | 478–488 | |
| +| `internal/activator/rootfs_service.go:residentRunnable` | new / legacy | APPROVE | 577–584 | |
| +| `internal/activator/rootfs_service.go:residentShaped` | new / legacy | APPROVE | 564–566 | |
| +| `internal/activator/rootfs_service.go:rootfsGateKey` | new / legacy | APPROVE | 182–185 | |
| +| `internal/activator/rootfsdb.go:ExecBackend.PlaceRootfsDB` | new / legacy | APPROVE | 108–168 | |
| +| `internal/activator/rootfsdb.go:buildEmptySQLiteDB` | new / legacy | APPROVE | 58–92 | |
| +| `internal/activator/rootfsdb.go:writeBeneathExcl` | new / legacy | APPROVE | 172–185 | |
| +| `internal/activator/rootfsenv.go:ExecBackend.rootfsCmdVars` | new / legacy | APPROVE | 1–22 | |
| +| `internal/activator/swap.go:Service.genHealthy` | new / legacy | APPROVE | 360–368 | |
| +| `internal/host/socket_advice.go:socketAdvice` | new / legacy | APPROVE | 134–139 | |
| +| `internal/layout/pass.go:Pass.Held` | new / legacy | APPROVE | 675–682 | |
| +| `internal/layout/pass.go:Pass.exempt` | new / legacy | APPROVE | 224–269 | |
| +| `internal/layout/pass.go:Pass.exemptRows` | new / legacy | APPROVE | 273–285 | |
| +| `internal/registry/registry.go:Registry.ResidentInstances` | new / legacy | APPROVE | 3139–3161 | |
| +| `internal/registry/registry.go:Registry.UpsertUnlessRootfs` | new / legacy | APPROVE | 1420–1439 | |
| +| `internal/registry/registry.go:Registry.upsert` | new / legacy | APPROVE | 1447–1473 | |
| +| `internal/registry/runtime.go:Route.ActivatorLeased` | new / legacy | APPROVE | 40–47 | |
| +| `internal/registry/runtime.go:Route.ActivatorOwned` | new / legacy | APPROVE | 25–32 | |
| +| `internal/registry/runtime.go:Route.Resident` | new / legacy | APPROVE | 34–38 | |
| +| `internal/registry/runtime.go:Route.Rootfs` | new / legacy | APPROVE | 16–18 | |
| +| `cli.go:addMintsNested` | reads / legacy | APPROVE | 140–149 | |
| +| `cli.go:runRouteHibernate` | reads / legacy | APPROVE | 1558–1568 | |
| +| `internal/activator/activator.go:Service.doWake` | reads / legacy | APPROVE | 2293–2455, 2492–2501, 2571–2603, 2790–2969 | |
| +| `internal/activator/backend_exec.go:ExecBackend.HasSidecar` | reads / legacy | APPROVE | 3083–3097 | |
| +| `internal/activator/genbackend.go:ExecBackend.EmptyHost` | reads / legacy | APPROVE | 726–749 | |
| +| `internal/activator/genbackend.go:ExecBackend.KillHost` | reads / legacy | APPROVE | 679–695 | |
| +| `internal/activator/genbackend.go:ExecBackend.StartStaged` | reads / legacy | **REJECT — P1-1** | 236–297; `rootfs.go` 253–277, 340–375 | |
| +| `internal/activator/wakeidentity.go:wakeRouteChanged` | reads / legacy | APPROVE | 39–48 | |
| +| `internal/host/layoutleg.go:nestedRowsPresent` | reads / legacy | APPROVE | 327–333 | |
| +| `internal/layout/pass.go:Pass.recheck` | reads / legacy | APPROVE | 637–645 | |
| +| `internal/provision/reconcile.go:Reconcile` | reads / legacy | APPROVE | 1496–1513, 1553–1568, 1725–1758 | |
| +| `internal/provision/reconcile.go:RouteFor` | reads / authority | APPROVE | 545–575 | |
| +| `internal/provision/reconcile.go:everywhereRoute` | reads / legacy | APPROVE | 415–423 | |
| +| `internal/provision/reconcile.go:shapeMismatch` | reads / legacy | APPROVE | 746–755 | |
| +| `internal/registry/registry.go:Registry.SetHibernate` | reads / legacy | APPROVE | 3034–3059 | |
| +| `internal/registry/registry.go:Registry.SetPlacement` | reads / legacy | APPROVE | 2781–2805 | |
| +| `internal/registry/registry.go:normalizeRoute` | reads / authority | APPROVE | 1547–1572 | |
| +| `cli.go:replicationRail` | sites / legacy | APPROVE | 1885–1896 | |
| +| `cli.go:runAdd` | sites / legacy | APPROVE | 309–317, 372–381 | |
| +| `internal/activator/activator.go:Service.ServeScheduled` | sites / legacy | APPROVE | 5774–5797 | |
| +| `internal/activator/activator.go:Service.begin` | sites / legacy | APPROVE | 1609–1692 | |
| +| `internal/activator/activator.go:Service.serve` | sites / legacy | APPROVE | 5799–5803, 5826–5837 | |
| +| `internal/activator/activator.go:Service.sweepOnce` | sites / legacy | APPROVE | 5050–5085, 5384–5391 | |
| +| `internal/activator/activator.go:Service.wake` | sites / legacy | APPROVE | 1927–1990, 2031–2091, 2136–2145 | |
| +| `internal/activator/backend_exec.go:ExecBackend.Seed` | sites / legacy | APPROVE | 976–982 | |
| +| `internal/activator/backend_exec.go:ExecBackend.SeedExe` | sites / legacy | APPROVE | 1001–1007 | |
| +| `internal/activator/backend_exec.go:ExecBackend.Start` | sites / legacy | APPROVE | 1932–1945 | |
| +| `internal/activator/backend_exec.go:ExecBackend.StartGen` | sites / legacy | APPROVE | 1974–1981 | |
| +| `internal/activator/backend_exec.go:ExecBackend.StartGenExe` | sites / legacy | APPROVE | 2001–2009 | |
| +| `internal/activator/backend_exec.go:ExecBackend.StartSidecar` | sites / legacy | APPROVE | 3103–3109 | |
| +| `internal/activator/backend_exec.go:ExecBackend.nestedGate` | sites / legacy | APPROVE | 2820–2859 | |
| +| `internal/activator/backend_exec.go:ExecBackend.spawnInCgroupGated` | sites / authority | APPROVE | 505–520 | |
| +| `internal/activator/containment.go:ExecBackend.spawnInCgroupAtTier` | sites / authority | APPROVE | 236–252 | |
| +| `internal/activator/genbackend.go:ExecBackend.StartSidecarGen` | sites / legacy | APPROVE | 456–462 | |
| +| `internal/activator/genbackend.go:SplitBackend.EmptyHost` | sites / legacy | APPROVE | 754–760 | |
| +| `internal/activator/genbackend.go:SplitBackend.KillHost` | sites / legacy | APPROVE | 701–707 | |
| +| `internal/activator/layout.go:ActivatorManaged` | sites / legacy | APPROVE | 57–67 | |
| +| `internal/activator/layout.go:Classify` | sites / legacy | APPROVE | 89–99 | |
| +| `internal/activator/swap.go:Service.swapOverlap` | sites / legacy | APPROVE | 475–606, 663–669, 708–717 | |
| +| `internal/activator/swaphold.go:Service.startPinnedAt` | sites / legacy | APPROVE | 430–437, 478–484 | |
| +| `internal/activator/wakeplan.go:Service.spawnPlanned` | sites / legacy | APPROVE | 378–385; `verdictFloorGate` 470–489 | |
| +| `internal/edge/edge.go:Edge.Reload` | sites / legacy | APPROVE | 810–819, 924–952, 979–985 | |
| +| `internal/host/layoutleg.go:layoutStatusReport` | sites / diagnostic | APPROVE | 207–213 | |
| +| `internal/host/probes.go:currentSocketProbe` | sites / legacy | APPROVE | 307–313 | |
| +| `internal/host/socket_advice.go:advisorySocketServing` | sites / diagnostic | APPROVE | 83–89 | |
| +| `internal/host/socket_advice.go:socketAdvisoryLoop` | sites / diagnostic | APPROVE | 121–139 | |
| +| `internal/host/socket_advice.go:warnExternalSockets` | sites / diagnostic | APPROVE | 40–48 | |
| +| `internal/layout/pass.go:Pass.Converge` | sites / legacy | APPROVE | 305–352 | |
| +| `internal/layout/pass.go:Pass.convergeHost` | sites / legacy | APPROVE | 354–360 | |
| +| `internal/layout/pass.go:Pass.recoverHost` | sites / legacy | APPROVE | 1181–1202, 1243–1253 | |
| +| `internal/layout/pass.go:Pass.restoreHold` | sites / legacy | APPROVE | 597–609 | |
| +| `internal/layout/pass.go:Pass.shift` | sites / legacy | APPROVE | 829–837 | |
| +| `internal/ops/hibernate_verify.go:HibernatingHosts` | sites / legacy | APPROVE | 55–63 | |
| +| `internal/ops/litestream.go:FleetDBsWithSkipped` | sites / legacy | APPROVE | 353–364 | |
| +| `internal/registry/registry.go:Registry.Upsert` | sites / authority | APPROVE | 1407–1473 | |
| +| `internal/registry/remote_dispatch.go:Registry.dispatchRemote` | sites / hint | APPROVE | 213–220, 309–316 | |
| +| `internal/release/pins.go:BuildStateKept` | sites / authority | APPROVE | 227–239 | |
| +| `internal/rollout/policy.go:Managed` | sites / legacy | APPROVE | 156–170 | |
| +| `internal/host/schedule_wiring.go:activatorDeliverer.managedByGenerations` | quiet / retired direct-read row | APPROVE | 373–377; `registry/runtime.go` 30–32 | |
| +| `.` | envelope / re-pin | APPROVE | `cli.go` rows above; `system.go` 286–386, 571–607 | |
| +| `internal/activator` | envelope / re-pin | **REJECT — P1-1** | Unit rows above; `rootfs_service.go` 1–1021; `rootfs.go` 253–468; changed helpers in `claimspawn.go`, `identity.go`, `logsink.go`, `wakeplan.go` | |
| +| `internal/appconfig` | envelope / re-pin | APPROVE | `sync.go` 638–644 | |
| +| `internal/caps` | envelope / re-pin | APPROVE | `converge.go` 229–236 | |
| +| `internal/edge` | envelope / re-pin | APPROVE | `edge.go` rows above; `prober.go` 23–28 | |
| +| `internal/host` | envelope / re-pin | APPROVE | Unit rows above; `rootfsplacement.go` 226–286, 361–432; `layoutleg.go` 433–460, 789–797; `retention.go` 391–418; `systemapply.go` 479–515 | |
| +| `internal/hostops` | envelope / re-pin | APPROVE | `fleetowner_classifier.go` 1–49; `mutation_classifier.go` 98–180 | |
| +| `internal/instancectl` | envelope / re-pin | APPROVE | `client.go` 524–557; reached `rootfs.go` 161–265, 1004–1115 | |
| +| `internal/layout` | envelope / re-pin | APPROVE | `pass.go` unit rows above | |
| +| `internal/ops` | envelope / re-pin | APPROVE | `hibernate_verify.go` 55–63; `litestream.go` 353–364 | |
| +| `internal/provision` | envelope / re-pin | APPROVE | Unit rows above; `runtime.go` 1–250; `record_sequence.go` 125–182; `provision.go` 124–137, 737–750, 1026–1035 | |
| +| `internal/registry` | envelope / re-pin | APPROVE | Unit rows above; `runtime.go` 1–47; `remote.go` 14–17 | |
| +| `internal/release` | envelope / re-pin | APPROVE | Unit rows above; `layoutintent.go` 213–252; `systempointer.go` 29–42, 257–265, 278–361 | |
| +| `internal/rollout` | envelope / re-pin | APPROVE | `policy.go` 156–170 | |
| +| `internal/rolloutwords` | envelope / re-pin | APPROVE | `words.go` 68–88 | |
| +| `internal/schedule` | envelope / re-pin | APPROVE | `converge.go` 476–483 | |
| +| `internal/status` | envelope / re-pin | APPROVE | `snapshot.go` 1014–1020 | |
| +| `cli.go:runRouteHibernate` | record-write re-pin / key-site | APPROVE | 1558–1568 | |
| +| `internal/console/apiinstancemove.go:Server.moveTransitionSaying` | record-write re-pin / record-writer | APPROVE | 359–384 | |
| +| `internal/console/apiinstancemove.go:Server.handleAPIInstanceMoveRequest` | record-write re-pin / record-writer | APPROVE | 574–590 | |
| +| `internal/provision/provision.go:SetRecordRegion` | record-write re-pin / record-writer | APPROVE | 1026–1035 | |
| +| `internal/console/fleets.go:Server.placeAppTarget` | record-write re-pin / record-writer | APPROVE | 674–720, 767–778, 806–820 | |
| +| `internal/console/lifetimes_create.go:Server.createRecordWithLifetimeLocked` | record-write re-pin / key-site | APPROVE | 60–75; `rootfs.go` 293–311 | |
| +| `internal/console/hostsused.go:Server.createRecordMarked` | record-write re-pin / record-writer | APPROVE | 560–575; `rootfs.go` 293–311 | |
| +| `internal/provision/record_sequence.go:WriteRecord` | record-write re-pin / record-primitive | APPROVE | 125–182; `runtime.go` 106–250 | |
| +| `internal/provision/reconcile.go:Reconcile` | record-write re-pin / key-site | APPROVE | 1496–1513, 1553–1568, 1725–1758 | |
| +| `internal/ops/litestream.go:FleetDBsWithSkipped` | record-write re-pin / key-site | APPROVE | 353–364 | |
| + |
| +Reviewed `origin/main...78fd0d8a8cdcb6c21791d5418b9e8418cdac61a2`, with merge base `bf55f29e67f21b56667b5ab3f6cefa7c9d40c555`. The table covers all 141 units, 17 envelopes and 10 record-write re-pins: **165 approvals, three rejections arising from one finding**. `legacy` means the proposed frozen `accepted-legacy` disposition. The quiet unit has no direct census sites; its field reads remain covered by `Route.ActivatorOwned`. |
| + |
| +**P1-1 — The staged rootfs launcher discards the swap’s selected memory limit.** |
| + |
| +- **Problem and evidence:** `swapOverlap` deliberately preserves the incumbent’s larger memory tier when a size override shrinks or is cleared, and assigns that limit to `m.gen.Tier` ([swap.go:517](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-3/internal/activator/swap.go:517)). The new `startStagedRootfs` retains this nonzero tier but calls `spawnRootfs` without passing it ([rootfs.go:261](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-3/internal/activator/rootfs.go:261)). `spawnRootfs` instead recomputes `b.GenTier(rt, id.Version)` at line 340 and sends that recomputed `MemoryMax` to root at line 375. The returned generation still records the original, larger tier. |
| +- **Failure scenario:** An incumbent runs at `xlarge`—2 GiB—and its size override is cleared. During the next overlap deploy, the scheduler selects 2 GiB for the successor so shrinking waits for a cold start. The rootfs launcher instead requests the 1 GiB default. Root installs that smaller limit in the generation’s drop-in. A successor requiring more than 1 GiB can be OOM-killed and the deploy can fail, despite the scheduler selecting enough memory. If it starts, its recorded tier still disagrees with its actual limit. |
| +- **Fix:** Pass the selected `g.Tier` through the rootfs spawn path, using `GenTier` only when no tier was supplied. Add a focused regression with a nonzero supplied tier larger than the route-derived tier; assert both the control request’s `memory_max` and the returned generation. The existing [tier test](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-3/internal/activator/rootfs_staged_test.go:354) supplies no tier, so it misses this case. |
| +- **Fault family:** Preservation of the scheduler-selected resource limit across the agent-to-root launch boundary; overlap deploys must not introduce a memory shrink. |
| + |
| +**P2:** None. |
| + |
| +**P3:** None. |
| + |
| +The fleet-owner classifier approves only the exact validated key family, a create-only `Put`, and a body naming the key’s account and fleet. The 10 record-write re-pins retain their targets, kinds and classes. |
| + |
| +Validation is by source inspection. The targeted root-read, scope and record-write census tests could not start because the read-only sandbox prevented Go from creating its work directory. No files were edited, no subagents were spawned, and no full suites ran. Network access was blocked, so this verdict was not posted to #280. |
| + |
| +**NOT READY** |
| \ No newline at end of file |