Enforce resident isolation at the shared instance spawn entry point
9 files changed,
+278
−25
docs/superpowers/notes/census-proposal-security-review-mitigations.md+3 −5docs/superpowers/reviews/REVIEW-BRIEF-security-review-mitigations.md+12 −0internal/activator/backend_exec.go+5 −6internal/activator/hawake_test.go+28 −1internal/activator/resident_layout_test.go+216 −0internal/activator/stateless_test.go+1 −0internal/host/group_names_test.go+7 −6internal/provision/testdata/plan14-root-reads-chain.tsv+1 −0internal/provision/testdata/plan14-root-reads-security-review-mitigations.tsv+5 −7
CI passed — run details
diff --git a/docs/superpowers/notes/census-proposal-security-review-mitigations.md b/docs/superpowers/notes/census-proposal-security-review-mitigations.md| index 63b57d07b..6c2cda66e 100644 |
| --- a/docs/superpowers/notes/census-proposal-security-review-mitigations.md |
| +++ b/docs/superpowers/notes/census-proposal-security-review-mitigations.md |
| @@ -6,8 +6,7 @@ Ruling `census-ruling-security-review-mitigations`. The independent reviewer app |
| |---|---|---|---| |
| | `internal/host/agent.go` `runAgent` | body | unchanged (9) | Wire the cached operator flat-layout choice into the exec backend's new-resident refusal; no read source added, existing authority retained. | |
| | `internal/host/layoutleg.go` `mintLayoutIntentWith` | body | unchanged (1) | Mint nested on nested-default, activator-armed, floor-capable boxes while isolation readiness is pending; wake still gates on readiness. Explicit flat and incapable-box compatibility unchanged; same intent/env/registry sources. | |
| -| `internal/activator/backend_exec.go` `ExecBackend.Start` | sites | +whole:Route | Pass the existing route to the new resident-layout refusal before flat exec. Adds whole Route read; only restricts never-served stateless resident launches when flat was not chosen. | |
| -| `internal/activator/backend_exec.go` `ExecBackend.startGenFrom` | sites | +whole:Route | Apply the same new-resident refusal before flat/foreign generation exec; adds whole Route read, retains all runtime/layout/root/gVisor refusals. | |
| +| `internal/activator/backend_exec.go` `ExecBackend.spawnChildFrom` | sites | +whole:Route | Enforce the unchanged never-served resident refusal once at the shared flat/foreign primary binary spawn sink, before placement, live-link/token/env/control preparation or execution. Covers plain, generation and staged Service wakes; existing served/explicit-flat exemptions and other gates retained. No new filesystem/store source. | |
| Envelopes re-pinned: `.`, `internal/activator`, `internal/host`, `internal/provision`. |
| @@ -17,14 +16,13 @@ Recorded dispositions, which each change must still satisfy: |
| - `internal/host/agent.go` `runAgent`: authority, task B,C,D,F. Basis: rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): builds the box's lifetime judge once (newBoxJudge, nil with host claims on) and hands it to the seed placement, the moves and runs workers and every loop it starts; read sites unchanged, offsets moved; B,C,D,F authority retained; self-serve moves 1 Task 8: derives the box's lifetimes switch from the judge once (lifetimes := boxJudge != nil) and hands it to the edges file loop; read sites unchanged, offsets moved;rev3=census-ruling-plans-4d-lapse;basis=arms two more plans hooks from the same snapshot: e.SetPlanDisabledFor(planDisabledFor) beside SetPlanGovernedFor, and svc.SetDisabledFor(planDisabledRoute) beside SetMaxRunFor (plans 4d); the reads live in those units (plans-4d-units decision); read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 9b81d97b (with main's plan rate ceiling, edge request records, regional box names, self-serve moves plan 1, plans 4d-1 lapse and its other later changes under main's own census rulings) plus the rootfs placement wiring in the activator start: an agentRootfs built from eb.NestedOK, CARLOS_DEPLOYMENT_SINGLE_TENANT, CARLOS_POOLS, the claim flag, swapArming's answer, the control client's /ready/rootfs and, on a fleet box whose identity resolved, fleetOwnerCheck over the deploy store main already opens for the fleet label (fleetStore), then arm and armedRootfs.Store; this body reads nothing new itself; the closures it wires read later, at a rootfs wake and each status tick: GET /ready/rootfs over the control socket, NestedOK's checks, and release.FleetOwnerKey for the judged row's own account and this box's fleet from the deploy store;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Tasks 7 and 11, #329 plan 3 Task 7 and plan 1 Task 7's policy cache: the control client is built once and handed to eb.Control, to the status tick (egressStatus) and to a new egressNudgeLoop goroutine; armSizeSource(svc, "/sys/fs/cgroup") after the activator Service; armPolicyCache() after armChangeIndex; statusLoop takes egressStatus. The reads are those units' own (decision rows); this body reads nothing new: the same five sites, offsets moved, in the agent; B,C,D,F authority retained.;rev3=census-ruling-remote-instance-metrics;basis=builds the metrics loop's owners closure (metricsOwners over the agent's registry, the activator and cgm.Leftover) when an activator exists and hands it to metricsLoop; reads nothing new itself;rev3=census-ruling-edge-asset-cache-3;basis=adds file:Statfs. runAgent keeps its authority (B,C,D,F). The new site is assetcache.Statfs, an exported assetcache.FS interface value (var Statfs FS = statfsFS{}), not a function value and not a call in runAgent: the ready hook passes it to armEdgeAssetCache as the store's filesystem, and armEdgeAssetCache calls its Space method on the configured data directory (dataDir(): $CARLOS_DATA_DIR, else /data), which calls unix.Statfs there (statfsFS.Space, accepted legacy at census-ruling-edge-asset-cache-2). No request-supplied pathname reaches it.;rev3=census-ruling-remote-metrics-nested;basis=main's body (merged origin/main acfa4f80, under main's own census rulings) plus: snapshots the nested layout (snapshotNestedUnits over /sys/fs/cgroup/carlos.slice/carlos-instances.slice) once at start, before the activator, and hands the metrics loop a unitSources struct (stamped units, routeHostNames, that root and the snapshot); reads nothing new itself;rev3=census-ruling-region-ha-p1a;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): wires region HA P1a into the activator: cfg.Record = haRecordFacts(openDeployStore, boxJudge) (the box's lifetime judge this body already builds with newBoxJudge, nil with host claims on; CI fix) and cfg.Self = lease.CurrentSelf; eb.Lifetimes (the process's lifetime index), eb.Registry, eb.StartupSwept (seedSweptAtStart.Load), eb.FilesStore from newProductionFilesStore (now lease.NewFilesStore, rootaws-loaded, a log line on failure) and lease.SetObligationDir(<data>/.ha-owed) (logged on failure; HA acquires then refuse); this body reads nothing new itself, the same five sites; the reads are those units' own (haRecordFacts and lease's SetObligationDir are new rows on this card); merge of origin/main d7ae1d76: main's own later changes to this body are kept as main has them, under main's rulings (census-ruling-remote-instance-metrics: the metricsOwners closure for metricsLoop; census-ruling-edge-asset-cache-3: the +file:Statfs site, assetcache.Statfs handed to the asset ready hook); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b1;basis=region HA P1b-1: builds one termfence.Confirmer (Self from lease.CurrentSelf at each call, EC2 DescribeInstances method only, client from rootaws.LoadDefaultConfig with retries off, built lazily on first use) and sets eb.OwnerTerminated; this body reads nothing new itself, the same six sites;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 7: the startup Sweep literal hands its answer to startupSwept, which logs as before and, only on a clean sweep, marks rootfs admission swept (MarkRootfsSwept); same Sweep call, no read added;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): sets svc.Fleet = fleetWakeFor(os.Getenv, identity, identErr, fleetStore) from the identity it already resolves once and the deployment store the fleet loops already opened, and logs an ERROR naming the identity error when the box is on a fleet with an invalid identity. fleetWakeFor reads CARLOS_REGION and CARLOS_FLEET from the same environment. Read sites unchanged (6). Agent, not root; a platform box is unchanged.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 12: one call more beside armRunsPass, armInteractivePass(svc, reg, rolloutSink, boxJudge), in the same activator Configure hook, handing it the same box judge; fix round 1 (Astra P2, shutdown): after svc.Shutdown(ctx), shutdownInteractive(ctx) ends and joins every interactive session under the same shutdown budget; the worker's own reads are its units' (interactive.go); this body reads nothing new, the same six sites; merge of origin/main 6f1f6ca6: main's svc.Fleet = fleetWakeFor(...) and its invalid-identity ERROR line are kept as main has them (census-ruling-managed-fleets-1b); this branch's change is the same as above; read sites unchanged (6);rev3=census-ruling-fix-set-aside-exdev;basis=set-aside EXDEV fix: one field more on the agent ExecBackend literal, RawInstanceDir: layout.RawInstanceDir (a pure path join: <dataDir>/.instances/<InstanceID(host)>), so the start rule set-aside moves a copy out through the raw directory instead of through the nosymfollow bind; this body reads nothing new, the same six sites;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: one more assignment beside eb.FilesStore: eb.EscrowKey = haEscrowKey(os.Getenv("CARLOS_SECRETS_KEY")), the agent's own environment parsed by appconfig.ParsePrivateKey as the moves pass parses it (unset or unparseable: a log line and nil, and HA publication refuses on the box). No path is opened or read, no read site added; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 4: one more goroutine beside configSyncLoop: go escrowLoop(agentCtx, reg, svc), the escrow sweep every 30 s over the same registry and Service. This body reads nothing new itself; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 5: one more call beside eb.EscrowKey: wireRawSecretPages(eb, PageOperator, metricsBoxLabel(os.Getenv, readMachineID())), which sets eb.OnRawSecret to page an operator (alerting.Page through PageOperator, LevelIncident) on its own goroutine with a 20 s timeout; metricsBoxLabel and readMachineID are the reads this body already makes for the moves refusal log; no new read site; the same six sites, offsets moved; B,C,D,F authority retained. Merge of origin/main 90c4d3aa: main's own later changes to this body are kept as main has them, under main's rulings; this branch's change is the same as above. Merge of origin/main 00bf5b8c (fleet set-aside EXDEV fix): main's change to this body is kept as main has it, under its own census ruling; this branch's change is unchanged.;rev3=census-ruling-probe-burst-limit;basis=two more sink wirings beside setAnalyticsSink: setProtectionSink(e.SetProtectionRecordOnly) and setAssetOwnersSource(e.AssetOwners), function values the telemetry pass calls; this body reads nothing new, the same six sites; authority B,C,D,F retained; no new root read or write kind;rev3=census-ruling-region-ha-p1b3a;basis=Arm HA placement exactly once on the existing Service before activatorStart and edges publication, wiring AwakeApps and the PageOperator callback; existing six read sites unchanged, no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Final review I3: start the concrete coordinator's renewal worker with agent setup; existing closeReplicaCoordinator shutdown cancels and joins it before release. No new read sites or credentials. Merge origin/main c59715e7: retain main's armHAPlacement(svc, PageOperator) wiring beside the existing activator setup; stateless coordinator and shutdown wiring remain. Same read sites; no new root read or credential.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): in the edge-ready callback, calls act.SetHeldWakeHook(e.HeldWake) when act is non-nil (installing the non-blocking wake callback) and stores e.HeldStreamsForStatus in heldStreamsSource. Wiring of in-memory callbacks only; no read added.;rev3=census-ruling-region-ha-p1b3b-t;basis=Wire Service.SetDutyView to the live edge DutySnapshot in the ready callback. No new read; no new loop or cloud operation. B2 wires the registry as the persistent DutyStore before service startup; no new cloud or filesystem path. B3b: arm one journal-backed termination consumer before service startup using agentCtx and the shared confirmer; expose edge tick and join at edge shutdown. No new direct read sites.;rev3=census-ruling-agent-start-demo-1;basis=Passes the existing registry, data store and hibernation prefix into the demo worker, and the existing instance-control client into the demo before-exec hook. No alternate data store or polling loop. Merge resolution against origin/main 9bd45488 retains main's HA departure controller, lifecycle and duty wiring alongside the demo data store and worker; no read site added by the resolution.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: install closed fixed admission before every launch source, bind activator/backend and edge, wire the real termination Started lifecycle and role reader after the change index; close before cancellation/child shutdown. No new external reads or cloud authority. Fix R1: move bind/lifecycle/edge-option wiring into wireAgentAdmission and worker listing into runWorkerBootPassAfterAdmission. Worker boot waits for admission before listing then uses unchanged bounded wakes and per-host serialization; whole Route read moves to the helper. No new storage, cloud, or root execution authority. Preserve merged main's agent wiring and census basis; the branch removes one whole Route use by moving worker iteration to the helper, with no added read kind.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: arms a fleet-only worker using the existing registry, activator, backend and authenticated console transport. Owned worker stops and joins at shutdown. No new bucket reader. merge of origin/main 9b8b2c50: retain HA duty/departure lifecycle, wake-slot and existing agent wiring alongside the replica placement worker; no new read introduced by resolution. merge of origin/main 6be08467: Retain main demo configuration, admission, build and expiry wiring alongside the replica worker; merge-only body change, no additional read. merge of origin/main 7920cccf: Retain main box-role/group admission wiring and boot publication beside the owned replica worker and shutdown; main moves the boot registry List into runWorkerBootPassAfterAdmission, removing its inline whole Route site. No new read introduced by conflict resolution.;rev3=census-ruling-stateless-replicas-3;basis=Task 1 fix round 1 M3: retain the private snapshot source and cancel/join ownership, but use the replica-health-specific retry loop. It logs its first failure only and retains the existing exponential backoff capped at 30 seconds; unsupported builds return nil. Existing five direct read sites unchanged; no new credentials, bucket reader or app lifecycle action. Fix round 1 Q20: publish Edge.ReplicaSnapshots as a separate in-memory status source, leaving the tenant-visible Upstreams source unchanged. No new external reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Load root-written group marker/configuration, configure signed boot binding and agent receipt completer, wire cancellable admission into departure work and expose cached GroupReaderSnapshot. New indirect boot reads use protected root files; agent-owned receipt controls duplicate initial completion only, never root restart permission. Same five direct sites. Merge 45cebde4 retains the replica health socket lifecycle and setReplicaSource beside GroupReaderSnapshot; no extra read beyond main.;rev3=census-ruling-agent-start-demo-2;basis=agent.go:309-329 opens demo-traffic.db beside the operator-configured registry when a demo domain exists, closes it at shutdown and wires drain-before-purge; :1010-1019 shares the worker and write gate; :1164-1177 installs the fleet identity and closed-until-worker serving callback. One added whole Route pass; the new indirect filesystem/SQL reads are claimed in openDemoTraffic and worker/store units. No request chooses the database pathname.;rev3=census-ruling-region-ha-p1b3b-s;basis=Wire the service duty view to authoritative cached sidecar manifest placement in LifetimeIndex and the edge sidecar projection; missing policy denies duty. Existing instance duty wiring remains.;rev3=census-ruling-region-ha-g2-t3;basis=T3a: wire eb.Page = PageOperator beside OwnerTerminated before departures arm, so suspect-holder pages work if departure setup fails; no new read; existing nine sites and authority unchanged; pages through the existing sink. T3b: publish the same backend through an atomic pointer for the metrics observer, and clear it on return; no new external read or authority.;rev3=census-ruling-agent-start-demo-3;basis=Wire the claim activator and root snapshot client into the demo worker; pass moved readiness to status reporting. Census read-site delta: unchanged (9).;rev3=census-ruling-region-ha-g2-fixes;basis=Wire local pool evidence, live withdrawal activator, startup ingress scan and alias publication, and edge lookup; no new direct sites; new indirect record/claim reads use existing store/judge paths described in ingress helpers.;rev3=census-ruling-region-ha-g2r-fixes;basis=W3: starts the existing record-view backstop loop with a departure-inventory listener (non-blocking, coalesced signal) even without an armed RecordView; it requests the existing full pass (backstopFullDue) there. Same nine read sites; no new read or authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Derive one signal-time deadline with a 90-second budget; cap departure stop and startup/seed/service shutdown joins by it. No read added.;rev3=census-ruling-static-sweep-periodic;basis=in the edge-ready callback, publishes e.LargestStaticTree in staticTreeSource for the disk alert line (diskAlertFrac in the metrics loop); in-memory wiring only, no read added; read sites unchanged (9);rev3=census-ruling-edge-page-cache-1;basis=wires the exec backend's CurrentInputs into the edge cache (wireCurrentInputs) and, in the ready hook after armEdgeAssetCache (whose returned store it now keeps), calls armEdgePageCache, which does nothing unless CARLOS_PAGE_CACHE=1; read sites unchanged (9); no read added;rev3=census-ruling-gvisor-demos;basis=Capture sandbox resolution and refusal once; log errors once; gate route admission and BeforeExec before process launch. No new root read. Task 5: pass the once-captured sandbox effective mode/config error into ExecBackend, UnitBackend and the immutable Client expectation. Same startup environment/registry reads; swapArming declines gVisor before placement. Task 8: arm read-only status projection with the existing Client.SandboxStatus callback. Agent status now queries the existing root /ready endpoint; no new root authority or guest-file input. Merge2 e8a1ddde: retain main wireCurrentInputs and armEdgePageCache through the existing asset-store ready hook alongside branch once-captured sandbox mode, wake gates and root status wiring. No new direct read; main page-cache helpers retain their own census overlays.;rev3=census-ruling-region-ha-held-build;basis=wires the drain state: svc.SetDrainingSource(boxDrain.IsDraining), svc.SetPeerDrainView(e.PeerDraining), e.SetPeerDrainedHook(svc.DropHoldersNaming); in-memory only; no read added; region HA held-requests Task 5: on group members, starts the drain driver over the activator, the edge and boxDrain, and serves its root-only drain socket; no read added beyond the socket's own Branch review r1: the drain state follows the root start fence on group members (the fence reader is the existing fenceLocation.read, a root-owned fixed path); e.SetPeerUndrainedHook(svc.AllowHoldersNaming) beside the drained hook (memory only); the drain socket serves only the agent's own user. No read added. |
| - `internal/host/layoutleg.go` `mintLayoutIntentWith`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route |
| -- `internal/activator/backend_exec.go` `ExecBackend.Start`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-apps-2;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=a rootfs row (Runtime) goes through rootfsGates and startRootfsFromLive, never the layout switch; a binary row's path is unchanged; the new kind is registry:Runtime, one site; no root decision;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: haSpawnGate(rt) first (+whole:Route), refusing an HA-acquired host whose row is no longer contained; otherwise unchanged; only adds a refusal;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 N1 and Task 7: ctx to the rootfs gates; startRootfsFromLive now returns the staged identity (the version is passed on); a row with a runtime other than rootfs-v1 is refused before the binary path (refuseUnknownRuntime); adds a refusal only;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: add/recheck the local start prohibition on generation, worker, sidecar, command or root-control launch, including retained leases; preserve existing lease/ownership checks and fixed-unit exemptions. Whole Route passes to the in-memory predicate; no new filesystem/store read.;rev3=census-ruling-edge-page-cache-1;basis=passes an empty build to startChildAt's new build argument (the live link, whose build is not pinned); read sites unchanged (14); no read added;rev3=census-ruling-gvisor-demos;basis=Task 5: gate launch using startup-captured mode and existing route/role/layout before preparation or execution; migrate structured root start identity and reject mismatches. Unsupported gVisor paths refuse; native behavior and existing root authority checks retained. No new root read source. Merge2 e8a1ddde: keep main page-cache build argument (empty for the unpinned live link) and branch sandbox gate before dispatch. No new read source. |
| -- `internal/activator/backend_exec.go` `ExecBackend.startGenFrom`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-zddr4;basis=Census ruling zddr4: changed legacy row; the generation socket path is chosen through genLayout on the same row's Host, an over-long flat host is logged and keeps its canonical socket as a foreign row does, and the leftover canonical link is cleared for any spawn on the canonical socket. Boundary: agent-side, running as carlos; generation socket directories under the agent's own /run/carlos tree; no root decision; no registry, /data, release or claim read beyond what the unit read before.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Use the verified generation/launch mode to remove CARLOS_DB after environment merges and omit the binary --db argument where applicable. Existing runtime, layout, secrets and exec gates remain; route reads are mode projection only.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: add/recheck the local start prohibition on generation, worker, sidecar, command or root-control launch, including retained leases; preserve existing lease/ownership checks and fixed-unit exemptions. Whole Route passes to the in-memory predicate; no new filesystem/store read.;rev3=census-ruling-edge-page-cache-1;basis=keeps the staged identity's Version (id.Version, from the same StagedIdentity it already resolved) as flatBuild and passes it to startChildAt; read sites unchanged (16); no read added;rev3=census-ruling-gvisor-demos;basis=Task 5: gate launch using startup-captured mode and existing route/role/layout before preparation or execution; migrate structured root start identity and reject mismatches. Unsupported gVisor paths refuse; native behavior and existing root authority checks retained. No new root read source. Merge2 e8a1ddde: retain main staged identity Version as flatBuild passed to startChildAt. Keep branch sandbox refusal and gVisor generation-zero selection before preparation. No new read source. |
| +- `internal/activator/backend_exec.go` `ExecBackend.spawnChildFrom`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-zddr3;basis=Census ruling zddr3: changed legacy row (comment-only change describing the shim placement); the same class as the accepted-legacy Manager.startIn and placementLive under fix1-merge-review (existing agent delegated-cgroup management remains legacy); no root decision; no registry, /data, release or claim reads. Boundary: the agent's own delegated cgroup subtree (including its scratch probe child), /proc/self, and pipes to and from its own parent, running as carlos.;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos (the flat start body): the same change as seedChild: ensureAdminTokenFor(ctx, rt, paths) for the token (the same flat path), the key's producer carrying the HA mint decision, and launchEnvLayer(ctx, rt) for the env and key layer the replica gate reads; a non-HA host's token, key and env are produced and read as before; +whole:Route; only adds refusals for HA hosts;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Use the verified generation/launch mode to remove CARLOS_DB after environment merges and omit the binary --db argument where applicable. Existing runtime, layout, secrets and exec gates remain; route reads are mode projection only.;rev3=census-ruling-edge-page-cache-1;basis=the control listener is now built with the whole route (edge.ListenControl(controlSocket, rt, ...)), the +whole:Route site; it computes the launch inputs once from the build it execs by path (a staged exe's caller-named build, or the gate-resolved pinned version; "" for an unpinned live link) and fileEnv it already read, keeps them on the childProc, and for a live-link spawn publishes them to the in-memory cache (NoteProcessInputs) beside the existing purge; no new file read;rev3=census-ruling-gvisor-demos;basis=Task 5: gate launch using startup-captured mode and existing route/role/layout before preparation or execution; migrate structured root start identity and reject mismatches. Unsupported gVisor paths refuse; native behavior and existing root authority checks retained. No new root read source. Merge2 e8a1ddde: retain main build parameter, pinned live identity, launchInputs from captured build/environment, and current-process input publication. edge.ListenControl now receives the whole Route as main requires (+whole:Route); no new filesystem or storage input. Branch sandboxLaunch remains before preparation and spawn; existing direct primitive gate unchanged. |
| New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff: |
| - new `internal/activator/backend_exec.go:ExecBackend.residentLayoutRefusal`: reads +registry:GoodVersion, +registry:ServingVersion, +whole:Route; written legacy, accepted-legacy, frozen |
| - reads `internal/provision/reconcile.go:RouteFor`: +registry:Stateless; keeps authority, task C,E3 |
| -Seal: `250e3ba91e1bc5fcd6be5cc2bafce4c7d6645d2d2f0c080913b99f01b1d19129` → `954066fff9490cce33ee8eca238bddbdd0bdc781526b3075f1787770429ff15f`. |
| +Seal: `250e3ba91e1bc5fcd6be5cc2bafce4c7d6645d2d2f0c080913b99f01b1d19129` → `c2e46d97699e450c924388780b2cae392e16e64334e5013063a03d50a84b0862`. |
| Overlay: `internal/provision/testdata/plan14-root-reads-security-review-mitigations.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |
diff --git a/docs/superpowers/reviews/REVIEW-BRIEF-security-review-mitigations.md b/docs/superpowers/reviews/REVIEW-BRIEF-security-review-mitigations.md| index 026e4cd90..e9dbec191 100644 |
| --- a/docs/superpowers/reviews/REVIEW-BRIEF-security-review-mitigations.md |
| +++ b/docs/superpowers/reviews/REVIEW-BRIEF-security-review-mitigations.md |
| @@ -25,3 +25,15 @@ Additional changes: replica assignments projected Stateless are minted nested on |
| Inspect all production call paths (Start, generation/staged start, resident migration), source of ServingVersion/GoodVersion exemptions, and timing/source of FlatLayoutChosen. Validate that ordinary member-created copies cannot use an unguarded route or a premature served marker, and that explicit flat and trusted legacy remain operable. Review the full named census proposal in docs/superpowers/notes/census-proposal-security-review-mitigations.md, overlay and chain; give an explicit verdict for every changed/new unit and all four envelopes, including the helpers covered by envelopes. |
| P3 follow-up list from round 2 (not reopened): PDF interim-response filtering can lose default headers; add route-specific header-precedence coverage; strengthen decoder-error/spool-cleanup assertions; expand ServeHTTP's doc comment. The malformed decoder tests were watched fail on old compress and pass on the update. Parent validation of the full changed set uses short disk TMPDIR to avoid fixture socket-length limits. A pre-existing rootfs-worker temp cleanup race is tracked separately; do not misreport a failed run as green. |
| + |
| +## Authorized fourth review: central guard and final census |
| + |
| +Paul explicitly selected “Central guard + one fourth review (Recommended)” after the R3 failure and budget stop were explained. This authorizes exactly one fourth Opus review, not a fifth or a new broad audit. R3 is NOT READY: the two wrapper checks missed Service.doWake -> doStatelessWake -> startPinnedAt -> SplitBackend.StartStaged -> ExecBackend.StartStaged -> spawnChildFrom. Its individual census approvals did not clear that P1. Blocker and approval are recorded in discussion #773; R3 census verdict is recorded on #280. |
| + |
| +The fix now calls the same predicate only in spawnChildFrom, after pathsFor and before placement/live-link/token/env/control preparation or exec. Start/startGenFrom duplicate checks are removed. No predicate, legacy exemption, gVisor gate or ErrFenced copy change. New regression uses real release.Pass to seed stateless on a flat row and the Service resident tick, through SplitBackend into real ExecBackend.StartStaged; it checks the captured ErrFenced, no process/entry and no launch artifacts. It was watched fail before the move and pass after. Direct staged flat/foreign, served/good-version and explicit-flat cases are also covered. An existing argument-projection test now explicitly chooses flat instead of relying on an unset callback. |
| + |
| +Merged main is b1bf1e02ba6c3071456a53912b491ab86b9a819d; final diff supplied by author is against that merged base. Root census has been regenerated over it. Name-class census fingerprint for RouteFor is updated: only local path layout changes, exact names/owners remain unchanged; no new name class. |
| + |
| +CI of the previous tip also exposed independent test-fixture state carry-over. haBackendEmptyIndex now resets the pending obligation set for its fresh fake storage endpoint (RestartObligationsForTest), preserving ProcessStateForTest cleanup. A red/green regression and existing same-store restart/owed-marker tests pass. This is test-only, not a lease runtime change. Review that it does not mask same-store persistence semantics. Full new-tip CI remains mandatory. |
| + |
| +Check the actual shared sink and all callers, unchanged source/trust of served-marker exemptions and explicit flat choice, and all named census units/envelopes at the supplied exact tip. The census question remains separate from isolation correctness. No fresh broad audit; existing P3s stay follow-ups. Return READY / READY AFTER FIXES / NOT READY with evidence. A further blocking finding stops work; no fifth review is authorized. |
diff --git a/internal/activator/backend_exec.go b/internal/activator/backend_exec.go| index 2224b3861..57cb759dc 100644 |
| --- a/internal/activator/backend_exec.go |
| +++ b/internal/activator/backend_exec.go |
| @@ -2162,9 +2162,6 @@ func (b *ExecBackend) Start(ctx context.Context, rt registry.Route) (Proc, strin |
| case LayoutFenced, LayoutConflict: |
| return nil, "", fmt.Errorf("%s: refusing to wake: %s", rt.Host, p.reason) |
| } |
| - if err := b.residentLayoutRefusal(rt, p.layout); err != nil { |
| - return nil, "", err |
| - } |
| return b.startChildAt(ctx, rt, rt.Socket, 0, "", "", cgroup.Limit{}) |
| } |
| @@ -2311,9 +2308,6 @@ func (b *ExecBackend) startGenFrom(ctx context.Context, rt registry.Route, n uin |
| case LayoutFenced, LayoutConflict: |
| return nil, Gen{}, fmt.Errorf("%s: refusing to wake: %s", rt.Host, p.reason) |
| default: |
| - if err := b.residentLayoutRefusal(rt, p.layout); err != nil { |
| - return nil, Gen{}, err |
| - } |
| if sock == rt.Socket { |
| // A link left at the canonical path by an agent that ran with |
| // generations on would make the app's bind fail. That holds for |
| @@ -2452,6 +2446,11 @@ func (b *ExecBackend) spawnChildFrom(ctx context.Context, rt registry.Route, soc |
| } |
| host := rt.Host |
| paths := b.pathsFor(rt) |
| + // Every flat or foreign instance start reaches this function, including |
| + // StartStaged. Refuse before preparing its files or executing its binary. |
| + if err := b.residentLayoutRefusal(rt, paths.layout); err != nil { |
| + return nil, "", err |
| + } |
| dbPath := paths.dbPath |
| child, ownTier, err := b.placeFor(spawnInstance, n) |
| if err != nil { |
diff --git a/internal/activator/hawake_test.go b/internal/activator/hawake_test.go| index 98468785c..9e8d6b01e 100644 |
| --- a/internal/activator/hawake_test.go |
| +++ b/internal/activator/hawake_test.go |
| @@ -72,7 +72,9 @@ func haBackendEmptyIndex(t *testing.T, host string) (*ExecBackend, registry.Rout |
| // obligation store) go back as they were after the test (final review |
| // F5). |
| t.Cleanup(lease.ProcessStateForTest()) |
| - if err := lease.SetObligationDir(t.TempDir()); err != nil { |
| + // Restart, not SetObligationDir (which merges): a prior fixture's |
| + // pending obligation names another store and must not carry over. |
| + if err := lease.RestartObligationsForTest(t.TempDir()); err != nil { |
| t.Fatal(err) |
| } |
| lease.SetSelf(hafresh.Self{Ref: "a", IID: "i-a", Account: "111122223333", Region: "eu-west-1"}) |
| @@ -354,6 +356,31 @@ func publishManifest(t *testing.T, b *ExecBackend, rt registry.Route, files map[ |
| } |
| } |
| +// A fresh HA fixture starts with no obligations: one still pending for an |
| +// earlier fixture's store is never retried against the new fixture's |
| +// independent S3 endpoint (it would fail NoSuchKey there). |
| +func TestHAFixtureIgnoresPriorFixtureObligation(t *testing.T) { |
| + s, e := haServiceEntry(t, "shop.example.com") |
| + s.unit.set(func(u *haUnit) { u.slicePop = false }) |
| + s.failMarkerPuts(1) |
| + var oe *lease.ObligationError |
| + if err := s.a.releaseHAClean(context.Background(), e); !errors.As(err, &oe) { |
| + t.Fatalf("release: %v, want the persisted obligation", err) |
| + } |
| + if n := len(lease.PendingObligations()); n != 1 { |
| + t.Fatalf("%d obligations pending, want the old store's one", n) |
| + } |
| + b, rt := haBackend(t, "shop.example.com") |
| + if n := len(lease.PendingObligations()); n != 0 { |
| + t.Fatalf("fresh fixture inherited %d obligations", n) |
| + } |
| + l, err := b.Acquire(context.Background(), rt) |
| + if err != nil { |
| + t.Fatalf("acquire against the fresh store: %v", err) |
| + } |
| + releaseHALease(t, l) |
| +} |
| + |
| func releaseHALease(t *testing.T, l Lease) { |
| t.Helper() |
| t.Cleanup(func() { |
diff --git a/internal/activator/resident_layout_test.go b/internal/activator/resident_layout_test.go| index bb2e4e05f..b3caa1618 100644 |
| --- a/internal/activator/resident_layout_test.go |
| +++ b/internal/activator/resident_layout_test.go |
| @@ -2,13 +2,19 @@ package activator |
| import ( |
| "context" |
| + "crypto/ed25519" |
| + "crypto/rand" |
| "errors" |
| + "os" |
| "path/filepath" |
| + "runtime" |
| + "sync" |
| "testing" |
| "time" |
| "github.com/carlosframework/platform/internal/provision" |
| "github.com/carlosframework/platform/internal/registry" |
| + "github.com/carlosframework/platform/internal/release" |
| ) |
| // A new binary resident (stateless, not hibernating, never served) whose |
| @@ -77,3 +83,213 @@ func TestExecBackendRefusesANewFlatBinaryResident(t *testing.T) { |
| b.FlatLayoutChosen = func() bool { return true } |
| started("the box chose flat", rt) |
| } |
| + |
| +// neverServedFlatRow is the production projection of a new binary resident |
| +// on a box that did not choose flat: provision.RouteFor on a non-hibernating |
| +// record, minted at the flat paths, marked stateless as staging marks it. |
| +func neverServedFlatRow(t *testing.T, b *ExecBackend, host string) registry.Route { |
| + t.Helper() |
| + off := false |
| + rec := provision.Record{Account: "bab", App: "shop", Host: host, Channel: "canary/test", Hibernate: &off, CreatedAt: time.Unix(1, 0)} |
| + rt := provision.RouteFor(rec, b.DataDir, "", false, nil) |
| + rt.Socket = filepath.Join(b.RunDirOverride, host+".sock") |
| + rt.Stateless = true |
| + if !statelessResident(rt) || rt.ServingVersion != "" || rt.GoodVersion != "" { |
| + t.Fatalf("fixture is not a never-served binary resident: %+v", rt) |
| + } |
| + return rt |
| +} |
| + |
| +// noLaunchArtifacts fails t if a launch of rt got any further than the |
| +// layout refusal: the per-instance env file (the admin token), a control |
| +// socket or any socket at the generation's path. |
| +func noLaunchArtifacts(t *testing.T, b *ExecBackend, rt registry.Route, n uint64) { |
| + t.Helper() |
| + p := b.pathsFor(rt) |
| + for _, path := range []string{p.envFile, rt.Socket, rt.Socket + ".control", b.flatGenSocket(rt.Host, n), b.flatGenSocket(rt.Host, n) + ".control"} { |
| + if _, err := os.Lstat(path); !os.IsNotExist(err) { |
| + t.Fatalf("%s exists after the refused launch (err %v)", path, err) |
| + } |
| + } |
| +} |
| + |
| +// StartStaged is the production exec of a stateless binary resident (the |
| +// activator's wake goes through startPinnedAt, never Start or StartGen), so |
| +// the refusal holds there too, at the flat and the foreign paths, and |
| +// nothing is prepared first: no admin token, no control socket, no child. |
| +func TestExecBackendStartStagedRefusesANewFlatBinaryResident(t *testing.T) { |
| + b := testExecBackend(t) |
| + b.RunDirOverride = shortRunDir(t) |
| + host := "shop.example.com" |
| + rt := neverServedFlatRow(t, b, host) |
| + id := stagedID(t, t.TempDir(), "v1") |
| + gen := func(n uint64) Gen { |
| + return Gen{N: n, Build: "v1", StagedPath: id.StagedPath, Digest: id.Digest, Stateless: true} |
| + } |
| + foreign := rt |
| + foreign.Socket = tmpSock(t) |
| + if l, _ := b.Layout(foreign); l != LayoutForeign { |
| + t.Fatalf("foreign fixture classifies %q", l) |
| + } |
| + for _, tc := range []struct { |
| + name string |
| + rt registry.Route |
| + want Layout |
| + }{{"flat", rt, LayoutFlat}, {"foreign", foreign, LayoutForeign}} { |
| + if l, why := b.Layout(tc.rt); l != tc.want { |
| + t.Fatalf("%s fixture classifies %q (%s)", tc.name, l, why) |
| + } |
| + for _, wired := range []func() bool{nil, func() bool { return false }} { |
| + b.FlatLayoutChosen = wired |
| + g, p, err := b.StartStaged(context.Background(), tc.rt, gen(3)) |
| + if !errors.Is(err, ErrFenced) || p != nil { |
| + t.Fatalf("%s: StartStaged = %+v, %v, %v; want the fenced refusal and no process", tc.name, g, p, err) |
| + } |
| + if tc.want == LayoutFlat { |
| + noLaunchArtifacts(t, b, tc.rt, 3) |
| + } |
| + if _, err := os.Lstat(b.pathsFor(tc.rt).envFile); !os.IsNotExist(err) { |
| + t.Fatalf("%s: the refused launch wrote the instance env file (err %v)", tc.name, err) |
| + } |
| + if _, err := os.Lstat(tc.rt.Socket + ".control"); !os.IsNotExist(err) { |
| + t.Fatalf("%s: the refused launch bound a control socket (err %v)", tc.name, err) |
| + } |
| + } |
| + } |
| + |
| + // Past the layout refusal a stateless row meets the shared-secrets gate: |
| + // proof that a served legacy resident and an explicit flat choice are |
| + // not refused here either. |
| + passed := func(name string, rt registry.Route) { |
| + t.Helper() |
| + if _, _, err := b.StartStaged(context.Background(), rt, gen(4)); errors.Is(err, ErrFenced) || !errors.Is(err, errStatelessSecretsWaiting) { |
| + t.Fatalf("%s: StartStaged = %v, want to pass the layout refusal", name, err) |
| + } |
| + } |
| + b.FlatLayoutChosen = func() bool { return false } |
| + served := rt |
| + served.ServingVersion = "v1" |
| + passed("a resident that has served", served) |
| + good := rt |
| + good.GoodVersion = "v1" |
| + passed("a resident with a good build", good) |
| + b.FlatLayoutChosen = func() bool { return true } |
| + passed("the box chose flat", rt) |
| + // A foreign row has no shared-secrets gate before its exec: it reaches |
| + // the exec itself, which refuses the fixture's non-executable "build". |
| + if _, _, err := b.StartStaged(context.Background(), foreign, gen(5)); err != nil { |
| + var pe *os.PathError |
| + if !errors.As(err, &pe) || pe.Op != "fork/exec" || pe.Path != id.StagedPath { |
| + t.Fatalf("the box chose flat, foreign paths: StartStaged = %v, want to reach the exec", err) |
| + } |
| + } else { |
| + t.Fatal("the non-executable staged fixture unexpectedly launched") |
| + } |
| +} |
| + |
| +// realStagedBackend is the wake rig's backend whose StartStaged is the real |
| +// ExecBackend's, reached as production reaches it (SplitBackend), and |
| +// which keeps what it returned: the HTTP layer maps a failure, so the spy |
| +// holds the error the launch actually refused with. |
| +type realStagedBackend struct { |
| + *wakeRelBackend |
| + split *SplitBackend |
| + smu sync.Mutex |
| + errs []error |
| + procs int |
| +} |
| + |
| +func (b *realStagedBackend) StartStaged(ctx context.Context, rt registry.Route, g Gen) (Gen, Proc, error) { |
| + got, p, err := b.split.StartStaged(ctx, rt, g) |
| + b.smu.Lock() |
| + b.errs = append(b.errs, err) |
| + if p != nil { |
| + b.procs++ |
| + } |
| + b.smu.Unlock() |
| + return got, p, err |
| +} |
| + |
| +func (b *realStagedBackend) launches() ([]error, int) { |
| + b.smu.Lock() |
| + defer b.smu.Unlock() |
| + return append([]error(nil), b.errs...), b.procs |
| +} |
| + |
| +// The activator's own resident wake of a never-served stateless binary row |
| +// (the row staging marked stateless after its flat mint) goes doWake -> |
| +// doStatelessWake -> startPinnedAt -> SplitBackend.StartStaged -> |
| +// ExecBackend.StartStaged -> spawnChildFrom. On a box that did not choose |
| +// flat the launch is refused as fenced there, with no child, instance admin |
| +// token or control socket made. |
| +func TestResidentWakeRefusesANewFlatBinaryResident(t *testing.T) { |
| + r := newWakeRelRig(t) |
| + wireStatelessRig(r) |
| + eb := testExecBackend(t) |
| + eb.RunDirOverride = shortRunDir(t) |
| + eb.FlatLayoutChosen = func() bool { return false } |
| + spy := &realStagedBackend{wakeRelBackend: r.b, split: &SplitBackend{Exec: eb}} |
| + r.a.backend = spy |
| + |
| + reg, err := registry.Open(filepath.Join(t.TempDir(), "registry.db")) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + defer reg.Close() |
| + base := neverServedFlatRow(t, eb, "shop.example.com") |
| + base.Stateless = false // as minted: staging seeds it below |
| + if err := reg.Upsert(base); err != nil { |
| + t.Fatal(err) |
| + } |
| + store := release.NewDirStore(t.TempDir()) |
| + pub, priv, err := ed25519.GenerateKey(rand.Reader) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + platform := runtime.GOOS + "-" + runtime.GOARCH |
| + manifest := release.Manifest{App: "shop", Version: "v1", Kind: "binary", Stateless: true, Artifacts: map[string]release.Artifact{platform: {File: "shop"}}} |
| + ctx := context.Background() |
| + if err := release.Ship(ctx, store, "bab", manifest, map[string][]byte{platform: []byte("binary")}); err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := release.Promote(ctx, store, priv, "bab", "shop", "canary/test", "v1"); err != nil { |
| + t.Fatal(err) |
| + } |
| + opt := t.TempDir() |
| + if err := release.Pass(ctx, reg, store, pub, opt, nil); err != nil { |
| + t.Fatal(err) |
| + } |
| + fresh, err := reg.Get(base.Host) |
| + if err != nil || fresh == nil { |
| + t.Fatalf("staged row: %v %v", fresh, err) |
| + } |
| + r.rt = *fresh |
| + if !statelessResident(r.rt) || r.rt.ServingVersion != "" || r.rt.GoodVersion != "" { |
| + t.Fatalf("staging did not seed a never-served resident: %+v", r.rt) |
| + } |
| + if l, why := eb.Layout(r.rt); l != LayoutFlat { |
| + t.Fatalf("the staged row classifies %q (%s), want flat", l, why) |
| + } |
| + selection, err := release.CanonicalRuntimeSelection(ctx, store, "bab", "shop", "v1", release.VersionPath(opt, "bab", "v1", "shop"), true) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + r.setPlan(WakePlan{Boot: selection.Identity, Mode: ModeHold, Declarations: []release.RuntimeSelection{selection}}) |
| + r.a.Routes, r.a.residentLister = reg, reg |
| + r.a.residentJitter = func() float64 { return 0 } |
| + |
| + tickSettled(t, r.a) |
| + errs, procs := spy.launches() |
| + if len(errs) == 0 { |
| + t.Fatal("the resident wake never reached ExecBackend.StartStaged") |
| + } |
| + for _, err := range errs { |
| + if !errors.Is(err, ErrFenced) { |
| + t.Fatalf("ExecBackend.StartStaged = %v, want the fenced refusal", err) |
| + } |
| + } |
| + if procs != 0 || r.a.hasEntry(r.rt.Host) { |
| + t.Fatalf("a flat child ran: %d process(es), entry %v", procs, r.a.hasEntry(r.rt.Host)) |
| + } |
| + noLaunchArtifacts(t, eb, r.rt, 1) |
| +} |
diff --git a/internal/activator/stateless_test.go b/internal/activator/stateless_test.go| index cc3e0c9f8..d6f4f0873 100644 |
| --- a/internal/activator/stateless_test.go |
| +++ b/internal/activator/stateless_test.go |
| @@ -241,6 +241,7 @@ func TestStatelessEveryEnvironment(t *testing.T) { |
| func TestStatelessBinaryArgumentsAtExec(t *testing.T) { |
| t.Run("flat", func(t *testing.T) { |
| b := testExecBackend(t) |
| + b.FlatLayoutChosen = func() bool { return true } |
| b.RunDirOverride = t.TempDir() |
| host := "shop.example.com" |
| stageLive(t, b, host, "v1") |
diff --git a/internal/host/group_names_test.go b/internal/host/group_names_test.go| index 77a4e0a0a..4667526bb 100644 |
| --- a/internal/host/group_names_test.go |
| +++ b/internal/host/group_names_test.go |
| @@ -440,12 +440,13 @@ var groupNameProducerInventory = map[string]string{ |
| // Edge page cache slice 1: routeScope builds an in-memory upstream only to |
| // read the route's page scope (account, app, primary host). It publishes, |
| // registers and routes no name; no name class. |
| - "../edge/pagecache.go:routeScope": "0d0ce1202034e50490832377c0d1568abaf1ee363d38b6763781906f8f1cf5ac", |
| - "../edge/platformalias.go:PlatformAliasFold": "a18e4963cf88320ef3fb94b666b02838dc12cc3e9b2df3f2cbe2576ca682735f", |
| - "../edge/regional.go:*Edge.foldRegional": "2c52d0d9147ab4b426649a78573a8550e0ba1073e2f5e5ef10e894f2570e9a8d", |
| - "../provision/forward.go:forwardRowFor": "e7294d6a3c96e51646257200f5cedb26aaf491afea23be3d943b3e3f742c4db4", |
| - "../provision/reconcile.go:Reconcile": "b2bc85f6ea8218fe4114a2847c7f4b828daa28181562f104bd5023179c03b9d0", |
| - "../provision/reconcile.go:RouteFor": "0a490d02aefdc829fe1b5bfd82314fd8984afbeceb01e31264920777203964f9", |
| + "../edge/pagecache.go:routeScope": "0d0ce1202034e50490832377c0d1568abaf1ee363d38b6763781906f8f1cf5ac", |
| + "../edge/platformalias.go:PlatformAliasFold": "a18e4963cf88320ef3fb94b666b02838dc12cc3e9b2df3f2cbe2576ca682735f", |
| + "../edge/regional.go:*Edge.foldRegional": "2c52d0d9147ab4b426649a78573a8550e0ba1073e2f5e5ef10e894f2570e9a8d", |
| + "../provision/forward.go:forwardRowFor": "e7294d6a3c96e51646257200f5cedb26aaf491afea23be3d943b3e3f742c4db4", |
| + "../provision/reconcile.go:Reconcile": "b2bc85f6ea8218fe4114a2847c7f4b828daa28181562f104bd5023179c03b9d0", |
| + // Resident replicas use nested local paths; exact-route names and owners do not change. |
| + "../provision/reconcile.go:RouteFor": "f42827f4faca3572837e627a694c72928048e245573c50a75c357a44be28bb8d", |
| "../provision/reconcile.go:mintHeld": "9fe4ad876c727af36cc06bd0105baf344748c61e6f21ced48e5288a323851344", |
| "../provision/seedreconcile.go:purgeAbortedFromLocal": "889e93e6fbd74adf614ba184bcd2f554196eccc4506829c65326a3502e98d89a", |
| "../provision/seedrollback.go:removeOrphanedLocal": "6dd05836ac1d346de23ad555d50bb6c8fcd574cf05b6dfbf916eb0b220d88586", |
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv| index 63371612d..017781e3a 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -141,3 +141,4 @@ plan14-root-reads-region-ha-held-build.tsv beb085e4c6cdb3d430d12a8dc3c93f25cc3fa |
| plan14-root-reads-fixedbox-health-alarms.tsv 0f7153571df8c1b4b50c31f57efcfdf60c71a12c80fd935fb3ea202fa0201dd5 |
| plan14-root-reads-fixed-host-ignore-user-data.tsv 250e3ba91e1bc5fcd6be5cc2bafce4c7d6645d2d2f0c080913b99f01b1d19129 |
| plan14-root-reads-deploy-edge-718.tsv 250e3ba91e1bc5fcd6be5cc2bafce4c7d6645d2d2f0c080913b99f01b1d19129 |
| +plan14-root-reads-security-review-mitigations.tsv c2e46d97699e450c924388780b2cae392e16e64334e5013063a03d50a84b0862 |
diff --git a/internal/provision/testdata/plan14-root-reads-security-review-mitigations.tsv b/internal/provision/testdata/plan14-root-reads-security-review-mitigations.tsv| index 6f2bcb458..e27a06100 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-security-review-mitigations.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-security-review-mitigations.tsv |
| @@ -1,17 +1,15 @@ |
| # Census overlay security-review-mitigations, written by census-propose (#369). census-ruling-security-review-mitigations, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-security-review-mitigations.md. |
| -# 2 body, 2 sites, 4 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| +# 2 body, 1 sites, 4 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| # 2 new dispositions: 1 reads re-frozen at their disposition with the claim, 1 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other. |
| @legacy 271a69c18bec930e0a4a7b7b4f9fe5778e3fd8843809a47bc93b06538937e1ad internal/host/layoutleg.go mintLayoutIntentWith legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-security-review-mitigations;basis=Mint nested on nested-default, activator-armed, floor-capable boxes while isolation readiness is pending; wake still gates on readiness. Explicit flat and incapable-box compatibility unchanged; same intent/env/registry sources. whole:Route@762 e07b678da489350b4cecbfd4c22e6fcc64c42697b3e0e0c25c54c90fba4d5a8b |
| @legacy 7c7a1646ff33daeffda0936279ce612215af0e51ffe288336e6596b4f1cb9a6c internal/activator/backend_exec.go ExecBackend.residentLayoutRefusal legacy accepted-legacy accepted-legacy;rev3=census-ruling-security-review-mitigations;basis=New agent-side refusal reads existing Route GoodVersion and ServingVersion and the route's stateless/resident shape; callback reads cached operator choice. No filesystem/store read, no new root action; served legacy residents and explicit flat remain supported. registry:GoodVersion@138,registry:ServingVersion@111,whole:Route@104 19df4cc383c98d67822d92d69ced57514c7d19473ae364afa473f879da829d7c |
| -@legacy 220d3324bb614ca9260e6a913ede37e94ed7132424af9fc2d3f7f92d48f45b24 internal/activator/backend_exec.go ExecBackend.Start legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-apps-2;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=a rootfs row (Runtime) goes through rootfsGates and startRootfsFromLive, never the layout switch; a binary row's path is unchanged; the new kind is registry:Runtime, one site; no root decision;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: haSpawnGate(rt) first (+whole:Route), refusing an HA-acquired host whose row is no longer contained; otherwise unchanged; only adds a refusal;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 N1 and Task 7: ctx to the rootfs gates; startRootfsFromLive now returns the staged identity (the version is passed on); a row with a runtime other than rootfs-v1 is refused before the binary path (refuseUnknownRuntime); adds a refusal only;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: add/recheck the local start prohibition on generation, worker, sidecar, command or root-control launch, including retained leases; preserve existing lease/ownership checks and fixed-unit exemptions. Whole Route passes to the in-memory predicate; no new filesystem/store read.;rev3=census-ruling-edge-page-cache-1;basis=passes an empty build to startChildAt's new build argument (the live link, whose build is not pinned); read sites unchanged (14); no read added;rev3=census-ruling-gvisor-demos;basis=Task 5: gate launch using startup-captured mode and existing route/role/layout before preparation or execution; migrate structured root start identity and reject mismatches. Unsupported gVisor paths refuse; native behavior and existing root authority checks retained. No new root read source. Merge2 e8a1ddde: keep main page-cache build argument (empty for the unpinned live link) and branch sandbox gate before dispatch. No new read source.;rev3=census-ruling-security-review-mitigations;basis=Pass the existing route to the new resident-layout refusal before flat exec. Adds whole Route read; only restricts never-served stateless resident launches when flat was not chosen. registry:Host@870,registry:Runtime@360,registry:Socket@1012,registry:Socket@527,registry:Socket@742,whole:Route@1008,whole:Route@119,whole:Route@209,whole:Route@245,whole:Route@313,whole:Route@432,whole:Route@523,whole:Route@607,whole:Route@667,whole:Route@738,whole:Route@927 4f9b02b7e63a04bfdf0e1db8987053dd9398cb4c1217076c63b47b2a952e9bc0 |
| -@legacy 39ecb2ea1f85ead128cf41151266aa9e6a9b5d14c86f307ae6fe80a6fdf97348 internal/activator/backend_exec.go ExecBackend.startGenFrom legacy accepted-legacy accepted-legacy;rev3=census-ruling-zddr4;basis=Census ruling zddr4: changed legacy row; the generation socket path is chosen through genLayout on the same row's Host, an over-long flat host is logged and keeps its canonical socket as a foreign row does, and the leftover canonical link is cleared for any spawn on the canonical socket. Boundary: agent-side, running as carlos; generation socket directories under the agent's own /run/carlos tree; no root decision; no registry, /data, release or claim read beyond what the unit read before.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Use the verified generation/launch mode to remove CARLOS_DB after environment merges and omit the binary --db argument where applicable. Existing runtime, layout, secrets and exec gates remain; route reads are mode projection only.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: add/recheck the local start prohibition on generation, worker, sidecar, command or root-control launch, including retained leases; preserve existing lease/ownership checks and fixed-unit exemptions. Whole Route passes to the in-memory predicate; no new filesystem/store read.;rev3=census-ruling-edge-page-cache-1;basis=keeps the staged identity's Version (id.Version, from the same StagedIdentity it already resolved) as flatBuild and passes it to startChildAt; read sites unchanged (16); no read added;rev3=census-ruling-gvisor-demos;basis=Task 5: gate launch using startup-captured mode and existing route/role/layout before preparation or execution; migrate structured root start identity and reject mismatches. Unsupported gVisor paths refuse; native behavior and existing root authority checks retained. No new root read source. Merge2 e8a1ddde: retain main staged identity Version as flatBuild passed to startChildAt. Keep branch sandbox refusal and gVisor generation-zero selection before preparation. No new read source.;rev3=census-ruling-security-review-mitigations;basis=Apply the same new-resident refusal before flat/foreign generation exec; adds whole Route read, retains all runtime/layout/root/gVisor refusals. registry:Host@1046,registry:Host@1445,registry:Host@2164,registry:Host@2326,registry:Host@741,registry:Host@797,registry:Socket@1581,registry:Socket@2070,registry:Socket@2200,registry:Socket@689,registry:Stateless@2499,whole:Route@1321,whole:Route@1510,whole:Route@193,whole:Route@2388,whole:Route@400,whole:Route@436,whole:Route@676 8b96bd0461bda0267cb57f9b2a068db10aa8b6bcbb0705c4ce7cd4185de13752 |
| +@legacy 6008f52811aaf67b35fa92836c8cace9915bf5555df08a31a42cda7ed1be959a internal/activator/backend_exec.go ExecBackend.spawnChildFrom legacy accepted-legacy accepted-legacy;rev3=census-ruling-zddr3;basis=Census ruling zddr3: changed legacy row (comment-only change describing the shim placement); the same class as the accepted-legacy Manager.startIn and placementLive under fix1-merge-review (existing agent delegated-cgroup management remains legacy); no root decision; no registry, /data, release or claim reads. Boundary: the agent's own delegated cgroup subtree (including its scratch probe child), /proc/self, and pipes to and from its own parent, running as carlos.;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos (the flat start body): the same change as seedChild: ensureAdminTokenFor(ctx, rt, paths) for the token (the same flat path), the key's producer carrying the HA mint decision, and launchEnvLayer(ctx, rt) for the env and key layer the replica gate reads; a non-HA host's token, key and env are produced and read as before; +whole:Route; only adds refusals for HA hosts;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Use the verified generation/launch mode to remove CARLOS_DB after environment merges and omit the binary --db argument where applicable. Existing runtime, layout, secrets and exec gates remain; route reads are mode projection only.;rev3=census-ruling-edge-page-cache-1;basis=the control listener is now built with the whole route (edge.ListenControl(controlSocket, rt, ...)), the +whole:Route site; it computes the launch inputs once from the build it execs by path (a staged exe's caller-named build, or the gate-resolved pinned version; "" for an unpinned live link) and fileEnv it already read, keeps them on the childProc, and for a live-link spawn publishes them to the in-memory cache (NoteProcessInputs) beside the existing purge; no new file read;rev3=census-ruling-gvisor-demos;basis=Task 5: gate launch using startup-captured mode and existing route/role/layout before preparation or execution; migrate structured root start identity and reject mismatches. Unsupported gVisor paths refuse; native behavior and existing root authority checks retained. No new root read source. Merge2 e8a1ddde: retain main build parameter, pinned live identity, launchInputs from captured build/environment, and current-process input publication. edge.ListenControl now receives the whole Route as main requires (+whole:Route); no new filesystem or storage input. Branch sandboxLaunch remains before preparation and spawn; existing direct primitive gate unchanged.;rev3=census-ruling-security-review-mitigations;basis=Enforce the unchanged never-served resident refusal once at the shared flat/foreign primary binary spawn sink, before placement, live-link/token/env/control preparation or execution. Covers plain, generation and staged Service wakes; existing served/explicit-flat exemptions and other gates retained. No new filesystem/store source. file:Command@11357,registry:Host@12640,registry:Host@13001,registry:Host@13095,registry:Host@258,registry:Host@4214,registry:Host@4269,registry:Host@4349,registry:Host@4563,registry:Stateless@11288,whole:Route@11180,whole:Route@11329,whole:Route@11737,whole:Route@13392,whole:Route@13484,whole:Route@1527,whole:Route@189,whole:Route@1944,whole:Route@2305,whole:Route@287,whole:Route@4447,whole:Route@4757,whole:Route@476,whole:Route@6828,whole:Route@9093 62a25da95d4b4b98122648e98d7348f1159f50077e7cfb8d282d811627580dfd |
| internal/host/agent.go runAgent authority B,C,D,F rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): builds the box's lifetime judge once (newBoxJudge, nil with host claims on) and hands it to the seed placement, the moves and runs workers and every loop it starts; read sites unchanged, offsets moved; B,C,D,F authority retained; self-serve moves 1 Task 8: derives the box's lifetimes switch from the judge once (lifetimes := boxJudge != nil) and hands it to the edges file loop; read sites unchanged, offsets moved;rev3=census-ruling-plans-4d-lapse;basis=arms two more plans hooks from the same snapshot: e.SetPlanDisabledFor(planDisabledFor) beside SetPlanGovernedFor, and svc.SetDisabledFor(planDisabledRoute) beside SetMaxRunFor (plans 4d); the reads live in those units (plans-4d-units decision); read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 9b81d97b (with main's plan rate ceiling, edge request records, regional box names, self-serve moves plan 1, plans 4d-1 lapse and its other later changes under main's own census rulings) plus the rootfs placement wiring in the activator start: an agentRootfs built from eb.NestedOK, CARLOS_DEPLOYMENT_SINGLE_TENANT, CARLOS_POOLS, the claim flag, swapArming's answer, the control client's /ready/rootfs and, on a fleet box whose identity resolved, fleetOwnerCheck over the deploy store main already opens for the fleet label (fleetStore), then arm and armedRootfs.Store; this body reads nothing new itself; the closures it wires read later, at a rootfs wake and each status tick: GET /ready/rootfs over the control socket, NestedOK's checks, and release.FleetOwnerKey for the judged row's own account and this box's fleet from the deploy store;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Tasks 7 and 11, #329 plan 3 Task 7 and plan 1 Task 7's policy cache: the control client is built once and handed to eb.Control, to the status tick (egressStatus) and to a new egressNudgeLoop goroutine; armSizeSource(svc, "/sys/fs/cgroup") after the activator Service; armPolicyCache() after armChangeIndex; statusLoop takes egressStatus. The reads are those units' own (decision rows); this body reads nothing new: the same five sites, offsets moved, in the agent; B,C,D,F authority retained.;rev3=census-ruling-remote-instance-metrics;basis=builds the metrics loop's owners closure (metricsOwners over the agent's registry, the activator and cgm.Leftover) when an activator exists and hands it to metricsLoop; reads nothing new itself;rev3=census-ruling-edge-asset-cache-3;basis=adds file:Statfs. runAgent keeps its authority (B,C,D,F). The new site is assetcache.Statfs, an exported assetcache.FS interface value (var Statfs FS = statfsFS{}), not a function value and not a call in runAgent: the ready hook passes it to armEdgeAssetCache as the store's filesystem, and armEdgeAssetCache calls its Space method on the configured data directory (dataDir(): $CARLOS_DATA_DIR, else /data), which calls unix.Statfs there (statfsFS.Space, accepted legacy at census-ruling-edge-asset-cache-2). No request-supplied pathname reaches it.;rev3=census-ruling-remote-metrics-nested;basis=main's body (merged origin/main acfa4f80, under main's own census rulings) plus: snapshots the nested layout (snapshotNestedUnits over /sys/fs/cgroup/carlos.slice/carlos-instances.slice) once at start, before the activator, and hands the metrics loop a unitSources struct (stamped units, routeHostNames, that root and the snapshot); reads nothing new itself;rev3=census-ruling-region-ha-p1a;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): wires region HA P1a into the activator: cfg.Record = haRecordFacts(openDeployStore, boxJudge) (the box's lifetime judge this body already builds with newBoxJudge, nil with host claims on; CI fix) and cfg.Self = lease.CurrentSelf; eb.Lifetimes (the process's lifetime index), eb.Registry, eb.StartupSwept (seedSweptAtStart.Load), eb.FilesStore from newProductionFilesStore (now lease.NewFilesStore, rootaws-loaded, a log line on failure) and lease.SetObligationDir(<data>/.ha-owed) (logged on failure; HA acquires then refuse); this body reads nothing new itself, the same five sites; the reads are those units' own (haRecordFacts and lease's SetObligationDir are new rows on this card); merge of origin/main d7ae1d76: main's own later changes to this body are kept as main has them, under main's rulings (census-ruling-remote-instance-metrics: the metricsOwners closure for metricsLoop; census-ruling-edge-asset-cache-3: the +file:Statfs site, assetcache.Statfs handed to the asset ready hook); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b1;basis=region HA P1b-1: builds one termfence.Confirmer (Self from lease.CurrentSelf at each call, EC2 DescribeInstances method only, client from rootaws.LoadDefaultConfig with retries off, built lazily on first use) and sets eb.OwnerTerminated; this body reads nothing new itself, the same six sites;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 7: the startup Sweep literal hands its answer to startupSwept, which logs as before and, only on a clean sweep, marks rootfs admission swept (MarkRootfsSwept); same Sweep call, no read added;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): sets svc.Fleet = fleetWakeFor(os.Getenv, identity, identErr, fleetStore) from the identity it already resolves once and the deployment store the fleet loops already opened, and logs an ERROR naming the identity error when the box is on a fleet with an invalid identity. fleetWakeFor reads CARLOS_REGION and CARLOS_FLEET from the same environment. Read sites unchanged (6). Agent, not root; a platform box is unchanged.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 12: one call more beside armRunsPass, armInteractivePass(svc, reg, rolloutSink, boxJudge), in the same activator Configure hook, handing it the same box judge; fix round 1 (Astra P2, shutdown): after svc.Shutdown(ctx), shutdownInteractive(ctx) ends and joins every interactive session under the same shutdown budget; the worker's own reads are its units' (interactive.go); this body reads nothing new, the same six sites; merge of origin/main 6f1f6ca6: main's svc.Fleet = fleetWakeFor(...) and its invalid-identity ERROR line are kept as main has them (census-ruling-managed-fleets-1b); this branch's change is the same as above; read sites unchanged (6);rev3=census-ruling-fix-set-aside-exdev;basis=set-aside EXDEV fix: one field more on the agent ExecBackend literal, RawInstanceDir: layout.RawInstanceDir (a pure path join: <dataDir>/.instances/<InstanceID(host)>), so the start rule set-aside moves a copy out through the raw directory instead of through the nosymfollow bind; this body reads nothing new, the same six sites;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: one more assignment beside eb.FilesStore: eb.EscrowKey = haEscrowKey(os.Getenv("CARLOS_SECRETS_KEY")), the agent's own environment parsed by appconfig.ParsePrivateKey as the moves pass parses it (unset or unparseable: a log line and nil, and HA publication refuses on the box). No path is opened or read, no read site added; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 4: one more goroutine beside configSyncLoop: go escrowLoop(agentCtx, reg, svc), the escrow sweep every 30 s over the same registry and Service. This body reads nothing new itself; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 5: one more call beside eb.EscrowKey: wireRawSecretPages(eb, PageOperator, metricsBoxLabel(os.Getenv, readMachineID())), which sets eb.OnRawSecret to page an operator (alerting.Page through PageOperator, LevelIncident) on its own goroutine with a 20 s timeout; metricsBoxLabel and readMachineID are the reads this body already makes for the moves refusal log; no new read site; the same six sites, offsets moved; B,C,D,F authority retained. Merge of origin/main 90c4d3aa: main's own later changes to this body are kept as main has them, under main's rulings; this branch's change is the same as above. Merge of origin/main 00bf5b8c (fleet set-aside EXDEV fix): main's change to this body is kept as main has it, under its own census ruling; this branch's change is unchanged.;rev3=census-ruling-probe-burst-limit;basis=two more sink wirings beside setAnalyticsSink: setProtectionSink(e.SetProtectionRecordOnly) and setAssetOwnersSource(e.AssetOwners), function values the telemetry pass calls; this body reads nothing new, the same six sites; authority B,C,D,F retained; no new root read or write kind;rev3=census-ruling-region-ha-p1b3a;basis=Arm HA placement exactly once on the existing Service before activatorStart and edges publication, wiring AwakeApps and the PageOperator callback; existing six read sites unchanged, no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Final review I3: start the concrete coordinator's renewal worker with agent setup; existing closeReplicaCoordinator shutdown cancels and joins it before release. No new read sites or credentials. Merge origin/main c59715e7: retain main's armHAPlacement(svc, PageOperator) wiring beside the existing activator setup; stateless coordinator and shutdown wiring remain. Same read sites; no new root read or credential.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): in the edge-ready callback, calls act.SetHeldWakeHook(e.HeldWake) when act is non-nil (installing the non-blocking wake callback) and stores e.HeldStreamsForStatus in heldStreamsSource. Wiring of in-memory callbacks only; no read added.;rev3=census-ruling-region-ha-p1b3b-t;basis=Wire Service.SetDutyView to the live edge DutySnapshot in the ready callback. No new read; no new loop or cloud operation. B2 wires the registry as the persistent DutyStore before service startup; no new cloud or filesystem path. B3b: arm one journal-backed termination consumer before service startup using agentCtx and the shared confirmer; expose edge tick and join at edge shutdown. No new direct read sites.;rev3=census-ruling-agent-start-demo-1;basis=Passes the existing registry, data store and hibernation prefix into the demo worker, and the existing instance-control client into the demo before-exec hook. No alternate data store or polling loop. Merge resolution against origin/main 9bd45488 retains main's HA departure controller, lifecycle and duty wiring alongside the demo data store and worker; no read site added by the resolution.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: install closed fixed admission before every launch source, bind activator/backend and edge, wire the real termination Started lifecycle and role reader after the change index; close before cancellation/child shutdown. No new external reads or cloud authority. Fix R1: move bind/lifecycle/edge-option wiring into wireAgentAdmission and worker listing into runWorkerBootPassAfterAdmission. Worker boot waits for admission before listing then uses unchanged bounded wakes and per-host serialization; whole Route read moves to the helper. No new storage, cloud, or root execution authority. Preserve merged main's agent wiring and census basis; the branch removes one whole Route use by moving worker iteration to the helper, with no added read kind.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: arms a fleet-only worker using the existing registry, activator, backend and authenticated console transport. Owned worker stops and joins at shutdown. No new bucket reader. merge of origin/main 9b8b2c50: retain HA duty/departure lifecycle, wake-slot and existing agent wiring alongside the replica placement worker; no new read introduced by resolution. merge of origin/main 6be08467: Retain main demo configuration, admission, build and expiry wiring alongside the replica worker; merge-only body change, no additional read. merge of origin/main 7920cccf: Retain main box-role/group admission wiring and boot publication beside the owned replica worker and shutdown; main moves the boot registry List into runWorkerBootPassAfterAdmission, removing its inline whole Route site. No new read introduced by conflict resolution.;rev3=census-ruling-stateless-replicas-3;basis=Task 1 fix round 1 M3: retain the private snapshot source and cancel/join ownership, but use the replica-health-specific retry loop. It logs its first failure only and retains the existing exponential backoff capped at 30 seconds; unsupported builds return nil. Existing five direct read sites unchanged; no new credentials, bucket reader or app lifecycle action. Fix round 1 Q20: publish Edge.ReplicaSnapshots as a separate in-memory status source, leaving the tenant-visible Upstreams source unchanged. No new external reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Load root-written group marker/configuration, configure signed boot binding and agent receipt completer, wire cancellable admission into departure work and expose cached GroupReaderSnapshot. New indirect boot reads use protected root files; agent-owned receipt controls duplicate initial completion only, never root restart permission. Same five direct sites. Merge 45cebde4 retains the replica health socket lifecycle and setReplicaSource beside GroupReaderSnapshot; no extra read beyond main.;rev3=census-ruling-agent-start-demo-2;basis=agent.go:309-329 opens demo-traffic.db beside the operator-configured registry when a demo domain exists, closes it at shutdown and wires drain-before-purge; :1010-1019 shares the worker and write gate; :1164-1177 installs the fleet identity and closed-until-worker serving callback. One added whole Route pass; the new indirect filesystem/SQL reads are claimed in openDemoTraffic and worker/store units. No request chooses the database pathname.;rev3=census-ruling-region-ha-p1b3b-s;basis=Wire the service duty view to authoritative cached sidecar manifest placement in LifetimeIndex and the edge sidecar projection; missing policy denies duty. Existing instance duty wiring remains.;rev3=census-ruling-region-ha-g2-t3;basis=T3a: wire eb.Page = PageOperator beside OwnerTerminated before departures arm, so suspect-holder pages work if departure setup fails; no new read; existing nine sites and authority unchanged; pages through the existing sink. T3b: publish the same backend through an atomic pointer for the metrics observer, and clear it on return; no new external read or authority.;rev3=census-ruling-agent-start-demo-3;basis=Wire the claim activator and root snapshot client into the demo worker; pass moved readiness to status reporting. Census read-site delta: unchanged (9).;rev3=census-ruling-region-ha-g2-fixes;basis=Wire local pool evidence, live withdrawal activator, startup ingress scan and alias publication, and edge lookup; no new direct sites; new indirect record/claim reads use existing store/judge paths described in ingress helpers.;rev3=census-ruling-region-ha-g2r-fixes;basis=W3: starts the existing record-view backstop loop with a departure-inventory listener (non-blocking, coalesced signal) even without an armed RecordView; it requests the existing full pass (backstopFullDue) there. Same nine read sites; no new read or authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Derive one signal-time deadline with a 90-second budget; cap departure stop and startup/seed/service shutdown joins by it. No read added.;rev3=census-ruling-static-sweep-periodic;basis=in the edge-ready callback, publishes e.LargestStaticTree in staticTreeSource for the disk alert line (diskAlertFrac in the metrics loop); in-memory wiring only, no read added; read sites unchanged (9);rev3=census-ruling-edge-page-cache-1;basis=wires the exec backend's CurrentInputs into the edge cache (wireCurrentInputs) and, in the ready hook after armEdgeAssetCache (whose returned store it now keeps), calls armEdgePageCache, which does nothing unless CARLOS_PAGE_CACHE=1; read sites unchanged (9); no read added;rev3=census-ruling-gvisor-demos;basis=Capture sandbox resolution and refusal once; log errors once; gate route admission and BeforeExec before process launch. No new root read. Task 5: pass the once-captured sandbox effective mode/config error into ExecBackend, UnitBackend and the immutable Client expectation. Same startup environment/registry reads; swapArming declines gVisor before placement. Task 8: arm read-only status projection with the existing Client.SandboxStatus callback. Agent status now queries the existing root /ready endpoint; no new root authority or guest-file input. Merge2 e8a1ddde: retain main wireCurrentInputs and armEdgePageCache through the existing asset-store ready hook alongside branch once-captured sandbox mode, wake gates and root status wiring. No new direct read; main page-cache helpers retain their own census overlays.;rev3=census-ruling-region-ha-held-build;basis=wires the drain state: svc.SetDrainingSource(boxDrain.IsDraining), svc.SetPeerDrainView(e.PeerDraining), e.SetPeerDrainedHook(svc.DropHoldersNaming); in-memory only; no read added; region HA held-requests Task 5: on group members, starts the drain driver over the activator, the edge and boxDrain, and serves its root-only drain socket; no read added beyond the socket's own Branch review r1: the drain state follows the root start fence on group members (the fence reader is the existing fenceLocation.read, a root-owned fixed path); e.SetPeerUndrainedHook(svc.AllowHoldersNaming) beside the drained hook (memory only); the drain socket serves only the agent's own user. No read added.;rev3=census-ruling-security-review-mitigations;basis=Wire the cached operator flat-layout choice into the exec backend's new-resident refusal; no read source added, existing authority retained. file:Exec@20408,file:Open@2191,file:Statfs@52583,registry:App@13287,registry:Host@48605,whole:Route@13279,whole:Route@47011,whole:Route@48728,whole:Route@48790 bd72b307c6393eb4251ede6a4ff52c6d5116f318f55257ab80a8b8370ee2ba35 |
| internal/host/layoutleg.go mintLayoutIntentWith legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-security-review-mitigations;basis=Mint nested on nested-default, activator-armed, floor-capable boxes while isolation readiness is pending; wake still gates on readiness. Explicit flat and incapable-box compatibility unchanged; same intent/env/registry sources. whole:Route@762 e07b678da489350b4cecbfd4c22e6fcc64c42697b3e0e0c25c54c90fba4d5a8b |
| internal/activator/backend_exec.go ExecBackend.residentLayoutRefusal legacy accepted-legacy accepted-legacy;rev3=census-ruling-security-review-mitigations;basis=New agent-side refusal reads existing Route GoodVersion and ServingVersion and the route's stateless/resident shape; callback reads cached operator choice. No filesystem/store read, no new root action; served legacy residents and explicit flat remain supported. registry:GoodVersion@138,registry:ServingVersion@111,whole:Route@104 19df4cc383c98d67822d92d69ced57514c7d19473ae364afa473f879da829d7c |
| internal/provision/reconcile.go RouteFor authority C,E3 rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos); also root, in the claim root's landing registration (ClaimRootHTTP.rootLandingRoute) and the relocation install (relocationRecord): census-ruling-seeded-instances's body with two more fields from the record: the row's lifetime pair (rec.Incarnation, rec.MoveSeq), so a row minted outside a move takes the record's lifetime and its last move's sequence (0, 0 for a fieldless record with no move history); every caller gets it, the root ones included: the root callers (ClaimRootHTTP.rootLandingRoute, relocationRecord) now mint (0, move_seq) on a claims-on record, a non-zero sequence once that record has had an offline move (move_seq advances on claims-on offline moves too), which moves Fingerprint and SnapshotFingerprint once for that row; main's C,E3 authority retained; self-serve moves 1 Task 7 (fix round 1: root callers named);rev3=census-ruling-region-ha-p1a;basis=the agent's reconcile passes, and also root's callers (rootupdates.go, rootinventory_install.go and relocationinstall.go on HEAD): one more field copied from the record, HA: rec.HA, so a row minted from a record stamped HA carries the sticky born-HA mark; the record is the console-written instance record each caller already read; root's own code reads nothing of Route.HA, and Fingerprint does not include it (SnapshotFingerprint does, for a set mark); the same nine sites, no read added;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 2: the row is minted with the record's Runtime (the console-written instance record, guarded by WriteRecord's runtimeFixed); a rootfs row always gets the nested socket and db path under dataDir and no seed or seed source; the paths are computed from the host, not read from the record;rev3=census-ruling-fresh-box-446;basis=#446: a born-HA record mints the nested paths whatever nested says, as a rootfs row already does; same reads;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 2, rule 6): the route also carries Assigned = rec.FleetBoxAt and Moved = rec.FleetBoxMoved, copied from the record it is handed. Read sites unchanged (13). In the agent; in root's claim landing registration (ClaimRootHTTP.rootLandingRoute, shelved claims code) the canonical route gains these two copied fields, which no root check compares (the comparison at rootinventory.go and ValidateAgentInventory read neither). No new input to root.;rev3=census-ruling-agent-start-demo-1;basis=Reads the record descriptor, carries it onto the route, and gives demos nested paths; no new external read.;rev3=census-ruling-stateless-replicas-2;basis=Projects count, canonical boxes, revision, CreatedAt-derived lifetime and stateless hint from the supplied record. No store read; hint does not authorize a database bypass. merge of origin/main 6be08467: Retain main demo nested paths and descriptor stamping beside replica projection; merge-only composition.;rev3=census-ruling-agent-start-demo-3;basis=Translate bound source claim state into operation-owned hold/status and fresh seed state into the destination import gate. Census read-site delta: +registry:HoldOp, +registry:ImportGate, +registry:Seed, +registry:Status.;rev3=census-ruling-edge-page-cache-1;basis=sets the route's new PagesOff from the record (!rec.PagesOn(): true only when the record's optional pages field is present and false); a field of the record it already reads, no new read; also in root's claim landing and relocation install, where the row only carries the column; read sites unchanged (19); no read added;rev3=census-ruling-security-review-mitigations;basis=Read Stateless projected from a validated replica assignment so managed resident copies get nested paths when nested is selected. Canonical path functions only, explicit/external route paths unchanged; authority C,E3 retained. registry:Addr@3259,registry:Addrs@3268,registry:DBPath@1967,registry:DBPath@2755,registry:DBPath@3177,registry:Health@3278,registry:Hibernate@2682,registry:HoldOp@1846,registry:ImportGate@1730,registry:Seed@1771,registry:Seed@3223,registry:SeedSource@3232,registry:Socket@1929,registry:Socket@2717,registry:Socket@3140,registry:Stateless@2698,registry:Status@1835,whole:Route@1666,whole:Route@1692,whole:Route@3316 dec7088b197b904e113d1eefd27a046ff4cd2c920e33126146ef9cbeacad28ef |
| -internal/activator/backend_exec.go ExecBackend.Start legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-apps-2;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=a rootfs row (Runtime) goes through rootfsGates and startRootfsFromLive, never the layout switch; a binary row's path is unchanged; the new kind is registry:Runtime, one site; no root decision;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: haSpawnGate(rt) first (+whole:Route), refusing an HA-acquired host whose row is no longer contained; otherwise unchanged; only adds a refusal;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 N1 and Task 7: ctx to the rootfs gates; startRootfsFromLive now returns the staged identity (the version is passed on); a row with a runtime other than rootfs-v1 is refused before the binary path (refuseUnknownRuntime); adds a refusal only;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: add/recheck the local start prohibition on generation, worker, sidecar, command or root-control launch, including retained leases; preserve existing lease/ownership checks and fixed-unit exemptions. Whole Route passes to the in-memory predicate; no new filesystem/store read.;rev3=census-ruling-edge-page-cache-1;basis=passes an empty build to startChildAt's new build argument (the live link, whose build is not pinned); read sites unchanged (14); no read added;rev3=census-ruling-gvisor-demos;basis=Task 5: gate launch using startup-captured mode and existing route/role/layout before preparation or execution; migrate structured root start identity and reject mismatches. Unsupported gVisor paths refuse; native behavior and existing root authority checks retained. No new root read source. Merge2 e8a1ddde: keep main page-cache build argument (empty for the unpinned live link) and branch sandbox gate before dispatch. No new read source.;rev3=census-ruling-security-review-mitigations;basis=Pass the existing route to the new resident-layout refusal before flat exec. Adds whole Route read; only restricts never-served stateless resident launches when flat was not chosen. registry:Host@870,registry:Runtime@360,registry:Socket@1012,registry:Socket@527,registry:Socket@742,whole:Route@1008,whole:Route@119,whole:Route@209,whole:Route@245,whole:Route@313,whole:Route@432,whole:Route@523,whole:Route@607,whole:Route@667,whole:Route@738,whole:Route@927 4f9b02b7e63a04bfdf0e1db8987053dd9398cb4c1217076c63b47b2a952e9bc0 |
| -internal/activator/backend_exec.go ExecBackend.startGenFrom legacy accepted-legacy accepted-legacy;rev3=census-ruling-zddr4;basis=Census ruling zddr4: changed legacy row; the generation socket path is chosen through genLayout on the same row's Host, an over-long flat host is logged and keeps its canonical socket as a foreign row does, and the leftover canonical link is cleared for any spawn on the canonical socket. Boundary: agent-side, running as carlos; generation socket directories under the agent's own /run/carlos tree; no root decision; no registry, /data, release or claim read beyond what the unit read before.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Use the verified generation/launch mode to remove CARLOS_DB after environment merges and omit the binary --db argument where applicable. Existing runtime, layout, secrets and exec gates remain; route reads are mode projection only.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: add/recheck the local start prohibition on generation, worker, sidecar, command or root-control launch, including retained leases; preserve existing lease/ownership checks and fixed-unit exemptions. Whole Route passes to the in-memory predicate; no new filesystem/store read.;rev3=census-ruling-edge-page-cache-1;basis=keeps the staged identity's Version (id.Version, from the same StagedIdentity it already resolved) as flatBuild and passes it to startChildAt; read sites unchanged (16); no read added;rev3=census-ruling-gvisor-demos;basis=Task 5: gate launch using startup-captured mode and existing route/role/layout before preparation or execution; migrate structured root start identity and reject mismatches. Unsupported gVisor paths refuse; native behavior and existing root authority checks retained. No new root read source. Merge2 e8a1ddde: retain main staged identity Version as flatBuild passed to startChildAt. Keep branch sandbox refusal and gVisor generation-zero selection before preparation. No new read source.;rev3=census-ruling-security-review-mitigations;basis=Apply the same new-resident refusal before flat/foreign generation exec; adds whole Route read, retains all runtime/layout/root/gVisor refusals. registry:Host@1046,registry:Host@1445,registry:Host@2164,registry:Host@2326,registry:Host@741,registry:Host@797,registry:Socket@1581,registry:Socket@2070,registry:Socket@2200,registry:Socket@689,registry:Stateless@2499,whole:Route@1321,whole:Route@1510,whole:Route@193,whole:Route@2388,whole:Route@400,whole:Route@436,whole:Route@676 8b96bd0461bda0267cb57f9b2a068db10aa8b6bcbb0705c4ce7cd4185de13752 |
| -@coverage . 90d67141517a28ef8c3b0460712e5d9e176a4a990c3cecb324324a030cb8c9a6 |
| -@coverage internal/activator aa8bf86aa20a379e860ae0d6108567cdd16388764f19a9e9e2489f64e118b35f |
| +internal/activator/backend_exec.go ExecBackend.spawnChildFrom legacy accepted-legacy accepted-legacy;rev3=census-ruling-zddr3;basis=Census ruling zddr3: changed legacy row (comment-only change describing the shim placement); the same class as the accepted-legacy Manager.startIn and placementLive under fix1-merge-review (existing agent delegated-cgroup management remains legacy); no root decision; no registry, /data, release or claim reads. Boundary: the agent's own delegated cgroup subtree (including its scratch probe child), /proc/self, and pipes to and from its own parent, running as carlos.;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos (the flat start body): the same change as seedChild: ensureAdminTokenFor(ctx, rt, paths) for the token (the same flat path), the key's producer carrying the HA mint decision, and launchEnvLayer(ctx, rt) for the env and key layer the replica gate reads; a non-HA host's token, key and env are produced and read as before; +whole:Route; only adds refusals for HA hosts;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Use the verified generation/launch mode to remove CARLOS_DB after environment merges and omit the binary --db argument where applicable. Existing runtime, layout, secrets and exec gates remain; route reads are mode projection only.;rev3=census-ruling-edge-page-cache-1;basis=the control listener is now built with the whole route (edge.ListenControl(controlSocket, rt, ...)), the +whole:Route site; it computes the launch inputs once from the build it execs by path (a staged exe's caller-named build, or the gate-resolved pinned version; "" for an unpinned live link) and fileEnv it already read, keeps them on the childProc, and for a live-link spawn publishes them to the in-memory cache (NoteProcessInputs) beside the existing purge; no new file read;rev3=census-ruling-gvisor-demos;basis=Task 5: gate launch using startup-captured mode and existing route/role/layout before preparation or execution; migrate structured root start identity and reject mismatches. Unsupported gVisor paths refuse; native behavior and existing root authority checks retained. No new root read source. Merge2 e8a1ddde: retain main build parameter, pinned live identity, launchInputs from captured build/environment, and current-process input publication. edge.ListenControl now receives the whole Route as main requires (+whole:Route); no new filesystem or storage input. Branch sandboxLaunch remains before preparation and spawn; existing direct primitive gate unchanged.;rev3=census-ruling-security-review-mitigations;basis=Enforce the unchanged never-served resident refusal once at the shared flat/foreign primary binary spawn sink, before placement, live-link/token/env/control preparation or execution. Covers plain, generation and staged Service wakes; existing served/explicit-flat exemptions and other gates retained. No new filesystem/store source. file:Command@11357,registry:Host@12640,registry:Host@13001,registry:Host@13095,registry:Host@258,registry:Host@4214,registry:Host@4269,registry:Host@4349,registry:Host@4563,registry:Stateless@11288,whole:Route@11180,whole:Route@11329,whole:Route@11737,whole:Route@13392,whole:Route@13484,whole:Route@1527,whole:Route@189,whole:Route@1944,whole:Route@2305,whole:Route@287,whole:Route@4447,whole:Route@4757,whole:Route@476,whole:Route@6828,whole:Route@9093 62a25da95d4b4b98122648e98d7348f1159f50077e7cfb8d282d811627580dfd |
| +@coverage . a8a543b00d620367c1c8cd92405990fa80f17cb24f064272a73b3b0181f0c482 |
| +@coverage internal/activator 31d5d397a6e2137f2e5d1b66b2823e6302878be9415a4882afe41ffb4522a6fc |
| @coverage internal/host fe9701b64f3f99a1d875e1db22ec275734c810442fec4172dd20b36628f56352 |
| @coverage internal/provision a18e60c5f5e1369c16ffeb3ca53169110ff12c0cf11125d4698bd7f0ebb020b3 |