carlos / platform Public

Record proven no-start when resident isolation refuses execution

claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 528595f0371e03744ad6b045e9a6d8a4537b13bc parent 4fb2910
7 files changed, +148 −20
  • docs/superpowers/notes/census-proposal-security-review-mitigations.md +1 −1
  • docs/superpowers/reviews/REVIEW-BRIEF-security-review-mitigations.md +6 −0
  • internal/activator/backend_exec.go +7 −3
  • internal/activator/resident_layout_converge_linux_test.go +95 −0
  • internal/activator/resident_layout_test.go +35 −12
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-security-review-mitigations.tsv +3 −3

CI cancelled — superseded by a newer push — 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 6c2cda66e..c34fa90bc 100644
--- a/docs/superpowers/notes/census-proposal-security-review-mitigations.md
+++ b/docs/superpowers/notes/census-proposal-security-review-mitigations.md
@@ -23,6 +23,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- 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` → `c2e46d97699e450c924388780b2cae392e16e64334e5013063a03d50a84b0862`.
+Seal: `250e3ba91e1bc5fcd6be5cc2bafce4c7d6645d2d2f0c080913b99f01b1d19129` → `d0f9e4412c80fd81f1264a38d70df5e0ed4bbcb3a4cb848388da8ad1d4661a1e`.
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 e9dbec191..15f767bbf 100644
--- a/docs/superpowers/reviews/REVIEW-BRIEF-security-review-mitigations.md
+++ b/docs/superpowers/reviews/REVIEW-BRIEF-security-review-mitigations.md
@@ -37,3 +37,9 @@ Merged main is b1bf1e02ba6c3071456a53912b491ab86b9a819d; final diff supplied by
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.
+
+### Fourth-review disposition and requested P2 completion
+
+Opus at 4fb2910820422cb1eec7c1669e520b7f19f8025b returned READY AFTER FIXES: R3 isolation P1 closed, every census unit/envelope approved, one availability P2. The author applied the exact requested return `launchRefused{ErrFenced}` at the pre-exec refusal, preserving predicate and user text. A real Service regression now proves StopUncertain is false; Linux external tests use the actual layout.Pass.Converge and real Service fence to verify migration when the required DB exists. Those tests failed with plain ErrFenced and passed with launchRefused. The named census is regenerated; read sources/dispositions are unchanged.
+
+No optional-database/root-storage behavior was added. A no-DB regression confirms that case still refuses safely, and the comment no longer promises automatic migration. Supported no-DB/foreign recovery is explicitly tracked as #774, the reviewer-permitted known residual. No fifth review was opened. Final-tip CI remains the merge gate.
diff --git a/internal/activator/backend_exec.go b/internal/activator/backend_exec.go
index 57cb759dc..0fa4851f3 100644
--- a/internal/activator/backend_exec.go
+++ b/internal/activator/backend_exec.go
@@ -2173,9 +2173,13 @@ func (b *ExecBackend) Start(ctx context.Context, rt registry.Route) (Proc, strin
// staging, or a replica assignment), so its paths were minted as an
// unflagged socket route's; started flat it would run with the agent's
// uid beside its nested siblings. Refused, it is asleep, so the layout pass
-// moves it nested without an awake grace and it starts as a unit. A
+// can move it nested without an awake grace, after which it starts as a
+// unit; that needs the row's database to exist on this box, so a row with
+// no database (or a foreign one) stays refused until an operator acts. A
// resident that has served (every row that ran before this rule, and its
-// restarts) is not touched. It uses the existing maintenance-fence refusal.
+// restarts) is not touched. It uses the existing maintenance-fence refusal,
+// marked launchRefused: the refusal is before any exec, so the Service
+// records "not started", not an uncertain stop that would defer the move.
func (b *ExecBackend) residentLayoutRefusal(rt registry.Route, l Layout) error {
if !statelessResident(rt) || rt.ServingVersion != "" || rt.GoodVersion != "" {
return nil
@@ -2186,7 +2190,7 @@ func (b *ExecBackend) residentLayoutRefusal(rt registry.Route, l Layout) error {
if b.FlatLayoutChosen != nil && b.FlatLayoutChosen() {
return nil
}
- return ErrFenced
+ return launchRefused{ErrFenced}
}
// StartGen is Start for generation n (zero-downtime spec §7.1). perGen false
diff --git a/internal/activator/resident_layout_converge_linux_test.go b/internal/activator/resident_layout_converge_linux_test.go
new file mode 100644
index 000000000..59cf6ee0d
--- /dev/null
+++ b/internal/activator/resident_layout_converge_linux_test.go
@@ -0,0 +1,95 @@
+//go:build linux
+
+package activator_test
+
+import (
+ "context"
+ "os"
+ "path/filepath"
+ "testing"
+ "time"
+
+ "github.com/carlosframework/platform/internal/activator"
+ "github.com/carlosframework/platform/internal/layout"
+)
+
+func residentPass(t *testing.T) (*layout.Pass, *activator.Service, string) {
+ t.Helper()
+ svc, reg, eb, rt := activator.ResidentRefusalFixture(t)
+ // The refusal is a start that did not happen, not an uncertain stop.
+ if svc.StopUncertain(rt.Host) {
+ t.Fatal("the refused resident wake left an uncertain stop on record")
+ }
+ p := &layout.Pass{Registry: reg, Fence: svc, DataDir: eb.DataDir, SocketDir: eb.RunDirOverride,
+ SocketsGID: -1, Now: time.Now, DeferAwake: true, Logf: t.Logf}
+ return p, svc, rt.Host
+}
+
+// The recovery the refusal promises, against the real Service and the real
+// layout pass: the refused resident is migrated nested and unfenced.
+// This is migration coverage, not a privileged unit-launch test.
+func TestConvergeMigratesARefusedNewResident(t *testing.T) {
+ p, svc, host := residentPass(t)
+ rt, err := p.Registry.Get(host)
+ if err != nil || rt == nil {
+ t.Fatal(err)
+ }
+ if err := os.MkdirAll(filepath.Dir(rt.DBPath), 0o700); err != nil {
+ t.Fatal(err)
+ }
+ if err := os.WriteFile(rt.DBPath, []byte("db"), 0o600); err != nil {
+ t.Fatal(err)
+ }
+ var res layout.Result
+ for _, r := range p.Converge(context.Background(), layout.ModeNested) {
+ if r.Host == host {
+ res = r
+ }
+ }
+ if res.Outcome != "migrated" {
+ t.Fatalf("result = %+v", res)
+ }
+ if svc.Fenced(host) || svc.StopUncertain(host) {
+ t.Fatalf("fenced %v, uncertain %v after the pass", svc.Fenced(host), svc.StopUncertain(host))
+ }
+ plan, err := layout.PlanFor(p.DataDir, p.SocketDir, host, layout.ModeNested)
+ if err != nil {
+ t.Fatal(err)
+ }
+ got, err := p.Registry.Get(host)
+ if err != nil || got == nil {
+ t.Fatal(err)
+ }
+ if got.DBPath != plan.To.DB || got.Socket != plan.To.Socket {
+ t.Fatalf("row = db %q socket %q, want %q %q", got.DBPath, got.Socket, plan.To.DB, plan.To.Socket)
+ }
+}
+
+// With no database on this box the pass refuses the row as it always has:
+// the flat paths stay and nothing launches. A known recovery limitation.
+func TestConvergeKeepsARefusedNewResidentWithoutADatabaseFlat(t *testing.T) {
+ p, svc, host := residentPass(t)
+ before, err := p.Registry.Get(host)
+ if err != nil || before == nil {
+ t.Fatal(err)
+ }
+ var res layout.Result
+ for _, r := range p.Converge(context.Background(), layout.ModeNested) {
+ if r.Host == host {
+ res = r
+ }
+ }
+ if res.Outcome != "refused" {
+ t.Fatalf("result = %+v", res)
+ }
+ got, err := p.Registry.Get(host)
+ if err != nil || got == nil {
+ t.Fatal(err)
+ }
+ if got.DBPath != before.DBPath || got.Socket != before.Socket {
+ t.Fatalf("paths moved: %+v -> %+v", before, got)
+ }
+ if svc.StopUncertain(host) {
+ t.Fatal("uncertain stop recorded")
+ }
+}
diff --git a/internal/activator/resident_layout_test.go b/internal/activator/resident_layout_test.go
index b3caa1618..90e9871b6 100644
--- a/internal/activator/resident_layout_test.go
+++ b/internal/activator/resident_layout_test.go
@@ -216,13 +216,22 @@ func (b *realStagedBackend) launches() ([]error, int) {
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) {
+// ResidentRefusalFixture is the real-Service fixture of the resident-wake
+// regression, exported for the external layout test (which cannot be in this
+// package: layout imports activator). It returns the Service whose resident
+// wake of a never-served flat stateless row has already been refused (one
+// settled resident tick through the real StartStaged), its registry (holding
+// the staged row) and the real ExecBackend and row. Nothing is started.
+func ResidentRefusalFixture(t *testing.T) (*Service, *registry.Registry, *ExecBackend, registry.Route) {
+ svc, reg, eb, rt, spy := residentRefusalFixture(t)
+ tickSettled(t, svc)
+ if errs, procs := spy.launches(); len(errs) == 0 || procs != 0 {
+ t.Fatalf("fixture: refusals %v, processes %d", errs, procs)
+ }
+ return svc, reg, eb, rt
+}
+
+func residentRefusalFixture(t *testing.T) (*Service, *registry.Registry, *ExecBackend, registry.Route, *realStagedBackend) {
r := newWakeRelRig(t)
wireStatelessRig(r)
eb := testExecBackend(t)
@@ -235,7 +244,7 @@ func TestResidentWakeRefusesANewFlatBinaryResident(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- defer reg.Close()
+ t.Cleanup(func() { 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 {
@@ -277,8 +286,18 @@ func TestResidentWakeRefusesANewFlatBinaryResident(t *testing.T) {
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 }
+ return r.a, reg, eb, r.rt, spy
+}
- tickSettled(t, r.a)
+// 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) {
+ a, _, eb, rt, spy := residentRefusalFixture(t)
+ tickSettled(t, a)
errs, procs := spy.launches()
if len(errs) == 0 {
t.Fatal("the resident wake never reached ExecBackend.StartStaged")
@@ -288,8 +307,12 @@ func TestResidentWakeRefusesANewFlatBinaryResident(t *testing.T) {
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))
+ if procs != 0 || a.hasEntry(rt.Host) {
+ t.Fatalf("a flat child ran: %d process(es), entry %v", procs, a.hasEntry(rt.Host))
+ }
+ // Refused before any exec: a start that did not happen, not an uncertain stop.
+ if a.StopUncertain(rt.Host) {
+ t.Fatal("the refused resident wake left an uncertain stop on record")
}
- noLaunchArtifacts(t, eb, r.rt, 1)
+ noLaunchArtifacts(t, eb, rt, 1)
}
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 017781e3a..b7c4f5ec1 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -141,4 +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
+plan14-root-reads-security-review-mitigations.tsv d0f9e4412c80fd81f1264a38d70df5e0ed4bbcb3a4cb848388da8ad1d4661a1e
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 e27a06100..960d9e9a7 100644
--- a/internal/provision/testdata/plan14-root-reads-security-review-mitigations.tsv
+++ b/internal/provision/testdata/plan14-root-reads-security-review-mitigations.tsv
@@ -2,14 +2,14 @@
# 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 9d22341e4041f9a1f873f62a33158513b4e64ccc37b6dab053069c4e919727e7 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; served legacy residents and explicit flat remain supported. R4-requested launchRefused marker proves this pre-exec refusal started nothing, allowing existing stop-proof recovery; predicate and sources unchanged. registry:GoodVersion@138,registry:ServingVersion@111,whole:Route@104 eab300984a3579fcb162e5d34530b5d1ae96f1c35e775e9d56cca6967e654f21
@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/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; served legacy residents and explicit flat remain supported. R4-requested launchRefused marker proves this pre-exec refusal started nothing, allowing existing stop-proof recovery; predicate and sources unchanged. registry:GoodVersion@138,registry:ServingVersion@111,whole:Route@104 eab300984a3579fcb162e5d34530b5d1ae96f1c35e775e9d56cca6967e654f21
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.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/activator e70ae33ab4b4fc57bada29629ddb3b3292a98265f28e861406f63e62be616755
@coverage internal/host fe9701b64f3f99a1d875e1db22ec275734c810442fec4172dd20b36628f56352
@coverage internal/provision a18e60c5f5e1369c16ffeb3ca53169110ff12c0cf11125d4698bd7f0ebb020b3