carlos / platform Public

fix: ordinary root start path unchanged by demo check

codex agent, operated by paul@keymail.dev pushed by claude agent, operated by paul@keymail.dev 6bafbb337389e5b042a339d1756415531b5f5f38 parent 2eec87e
13 files changed, +145 −27
  • docs/superpowers/notes/census-agent-start-demo-1-claims.md +4 −1
  • docs/superpowers/notes/census-proposal-agent-start-demo-1.md +6 −2
  • internal/console/apidemo.go +7 −2
  • internal/console/demo_jobs_test.go +5 −0
  • internal/host/claimstop_registry_test.go +27 −0
  • internal/host/claimstop_run.go +3 −0
  • internal/host/egress_source.go +5 −0
  • internal/host/egress_source_test.go +18 −0
  • internal/instancectl/demo_policy.go +3 −5
  • internal/instancectl/demo_policy_test.go +50 −11
  • internal/instancectl/egress.go +7 −0
  • internal/provision/testdata/plan14-root-reads-agent-start-demo-1.tsv +9 −5
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1

CI passed — run details

Intent

Human

<task-notification> <task-id>bs7kuuqqo</task-id> <tool-use-id>toolu_011LwMRUGz1dJPy9wejnwNtn</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/cd1b6de2-ac77-426f-a77d-fc5436969c88/tasks/bs7kuuqqo.output</output-file> <status>completed</status> <summary>Background command "Wait for fix wave" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>b81na1em1</task-id> <tool-use-id>toolu_01YRVcDQ5VVc672bqx8Rmspt</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/cd1b6de2-ac77-426f-a77d-fc5436969c88/tasks/b81na1em1.output</output-file> <status>completed</status> <summary>Background command "Wait for wave, then launch R23b follow-up" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>a1054b381ea1d0884</task-id> <tool-use-id>toolu_01RHoRNuCEsSPDEam6apo1ai</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/cd1b6de2-ac77-426f-a77d-fc5436969c88/tasks/a1054b381ea1d0884.output</output-file> <status>completed</status> <summary>Agent "Scoped re-review of whole-branch fix wave" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>All ten round-1 items are addressed and the fix diff has no new P1 or P2, so the verdict is READY. The one open item is CI: no run of 2eec87e9 has happened yet. The full report is at `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/agent-start-demo-1/.superpowers/sdd/2026-11-02-agent-start-demo-1-anonymous-apps/branch-review-r2.md`. - **console P2-1** (serial bump every pass): ADDRESSED. The bump now runs only after `delivered=1` commits, plus once after the purge commits (demo_expiry.go, inside `if !r.Delivered`, and `finishDemoPurge`). - **console P2-2** (live checks fatal at boot): ADDRESSED. The fleet and claims checks moved to `validateDemoLiveConfig` (apidemo.go:118-158), which runs inside the cached admission verdict (apidemo.go:173) with a 10 s timeout. Failures are cached and refuse admission. Boot ignores the error (server.go:1806-1810). The static checks stay fatal. Admission stays fail-closed. - **console P2-3** (budgets charged before worker/lease readiness): ADDRESSED. `demoPublishReady` (apidemo.go:674-723) runs before `SpendDemoCreate` and `SpendDemoUpdate`. It only reads, and the charge still always follows it. So a pre-check cannot be raced into real work that charges nothing. The checks after validation remain. - **console P2-4 / R25** (reply contract, client header): ADDRESSED. Create and update return `jobId`, `name`, `statusUrl` and `expiresAt`. Create alone adds `claimAvailable:false`, `claimToken` and `claimUrl`. Status returns `jobId` and `state`. `X-Carlos-Client` is stored, trimmed to 100 bytes (demo_store.go:248-251), with no User-Agent fallback. The README matches. - **root P2-1** (agent and root demo mode can disagree): ADDRESSED on both sides. - Agent: `demoPolicyHook` calls root `ReadyDemo` on every demo-mode spawn. It refuses without `Carlos-Demo-Box: 1`, on a stale build, or when root is not ready (client.go:460-473). That is one control-socket GET per spawn, not polling. - Root: in ordinary mode, a `/start` for a host whose row has any demo marker, or whose row can't be read, gets a 409 (instancectl/demo_policy.go:31-36). - Ordinary boxes: the agent side is unchanged. The root side changes slightly; see P3-1 below. - **wire P2-1** (README lacks the ingress tuple): ADDRESSED. README.md:637 now covers the ingress tuple. The e2e test now proves an ingress without the tuple refuses the demo host. - **Task 8 P3-10** (stale readiness on reconnect): ADDRESSED. `clearReady` runs when Connect starts and as its last cleanup (host/demo_jobs.go). The console accepts the empty readiness message (apidemobox.go:120,158). - **Task 8 P3-11** (retirement on the read loop, 30 s budget): ADDRESSED. Retirements now run on their own one-at-a-time worker, with one queue entry per verified demo ID. The budget is 60 s, and Connect waits for the worker before returning (host/demo_jobs.go, demo_cleanup.go). - **CI R24** (DEMO-CHECK-FAILED copy): ADDRESSED. The text is now "Could not check this demo. Try again shortly." and the copy deck notes the change (apidemo.go:49). - **CI R23b** (e2e private-closure download): ADDRESSED in code. The test downloads the locked modules online, checks both sums against the lock, then builds offline (demo_e2e_test.go:512-531, 1078-1090). It has not passed CI on a cold module cache yet. New P3s from the fix diff: - **P3-1:** an ordinary root now starts a registry read child on every `/start`. A read error shows as `DEMO-POLICY` for an ordinary app. - **P3-2:** when another console holds the writer lease, or the lease read fails, an anonymous request that is refused costs one S3 GET and no budget. Nothing limits how often that can repeat. The read error is also not logged. - **P3-3:** `expiresAt` is computed as `CreatedAt + 86400` instead of read from the app's stored expiry. The two agree today. - **P3-4:** `demoPolicyHook` takes `control any` and checks for `ReadyDemo` at runtime, so a wrapped control client would silently refuse every demo spawn. **Census:** APPROVE `runAgent`, `demoPolicyHook` and `Server.demoHandler` (its two route reads only refuse). APPROVE the re-pinned `internal/host` and `internal/instancectl` envelopes. The overlay seal is 39197c39…5033 and the chain tail is updated. `TestPlan14RootReadCensus` and `TestCensusScopeIsTheRootBinary` pass at 2eec87e9; I ran them. **Verdict:** READY</result> <usage><subagent_tokens>202406</subagent_tokens><tool_uses>53</tool_uses><duration_ms>621923</duration_ms></usage> </task-notification>

Attributed to this commit: 12.3 g CO₂e (1,563,604 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on agent-start-demo-1, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/docs/superpowers/notes/census-agent-start-demo-1-claims.md b/docs/superpowers/notes/census-agent-start-demo-1-claims.md
index 5eb450e4f..91da32c79 100644
--- a/docs/superpowers/notes/census-agent-start-demo-1-claims.md
+++ b/docs/superpowers/notes/census-agent-start-demo-1-claims.md
@@ -67,7 +67,7 @@ internal/host/units/carlos-demo-builds.slice:external New aggregate compiler bud
internal/instancectl/demo_build.go:Client.DemoBuildReadiness Reads bounded root readiness and verifies capability, slots, digest and service build identity.
internal/instancectl/demo_cleanup.go:Server.purgeDemoWithJobs Checks root config and current registry identity/hold; reads derived unit/cgroup/exe/drop-in state, stops and proves emptiness before no-follow removal. Fix round 1: passes the descriptor host to the root build-scratch cleaner; same registry, cgroup and derived path reads.
internal/instancectl/demo_policy.go:Server.demoCgroup Reads memory.max, cpu.weight, cpu.max and io.weight beneath root cgroupfs using platform-generated slice/unit names; checks both slice and unit before reporting started.
-internal/instancectl/demo_policy.go:Server.demoHandler Serializes demo-mode starts with demo purge; ordinary starts retain their existing unit locking. Uses the existing HostDemo callback to read the fixed service registry for a valid requested host in ordinary mode too; read errors and any demo-marked row refuse that start. Demo mode retains missing/non-demo/held-row refusals. No caller-named filesystem path is opened.
+internal/instancectl/demo_policy.go:Server.demoHandler R26: HostDemo and the demo start/purge lock run only in demo mode. Ordinary starts do not read HostDemo or gain its read-error refusal. Demo-mode missing/non-demo/held-row and read-error refusals remain.
internal/instancectl/demo_versions.go:Server.purgeDemoVersions Derives account/app from root config and host; reads registry/live/generation pins and staged entries; deletes only unreferenced demo app files. Fix round 1: logs and skips ENOENT resolving another live link; other errors still refuse, same pin and symlink reads.
internal/instancectl/gen.go:Server.handleParent Reads fixed DemoBox and clamps the existing parent memory writer to small.
internal/instancectl/rootfs.go:Server.runRootfsProbe Reads DemoBox and refuses before preparing or launching a rootfs probe; ordinary probe behavior unchanged.
@@ -94,3 +94,6 @@ internal/registry/registry.go:upsertRoute Existing SQL now compares all four dem
# make census-card reports only the internal/demobuild source envelope.
# internal/demobuild/diagnostics.go changed its approval comment in 3247de43;
# copy text and comments only, no new reads. No changed reader needs a new claim.
+internal/host/claimstop_run.go:instanceRegistryHostRuntime R26: reads IsDemo from the registry row already fetched for rootfs runtime validation; refuses any demo marker. Existing registry read errors and missing-row behavior unchanged; no new read.
+internal/host/egress_source.go:registrySource.policyFrom R26: reads IsDemo from the existing egress registry snapshot; returns a closed DEMO-POLICY for any demo marker before interpreting allow entries. No added registry child or file read.
+# Envelope-only internal/instancectl/egress.go:EgressAsserter.assert: R26: ordinary-root start refuses a DEMO-POLICY returned by a successful existing source read. Source read failures retain the existing cache/closed-policy fallback and refusal rules; no added source read.
diff --git a/docs/superpowers/notes/census-proposal-agent-start-demo-1.md b/docs/superpowers/notes/census-proposal-agent-start-demo-1.md
index b956a2876..32e3a5b36 100644
--- a/docs/superpowers/notes/census-proposal-agent-start-demo-1.md
+++ b/docs/superpowers/notes/census-proposal-agent-start-demo-1.md
@@ -15,7 +15,9 @@ Ruling `census-ruling-agent-start-demo-1`. The independent reviewer approves or
| `internal/host/agent.go` `runAgent` | body | unchanged (6) | 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. |
| `internal/host/bootstrap.go` `bootstrapWith` | body | unchanged (3) | Uses demo settings from the existing host.env parser; refuses malformed demo config and installs the fixed template drop-ins. |
| `internal/host/claimstop_run.go` `RunInstanceControl` | body | unchanged (0) | Wires demo registry views and existing root release/adoption guard into instance control. |
+| `internal/host/claimstop_run.go` `instanceRegistryHostRuntime` | body | unchanged (2) | R26: reads IsDemo from the registry row already fetched for rootfs runtime validation; refuses any demo marker. Existing registry read errors and missing-row behavior unchanged; no new read. |
| `internal/host/claimunit.go` `readClaimUnitSettings` | body | unchanged (3) | Reads worker/concurrency/toolchain settings from the existing host.env parser; requires box mode and refuses claims coexistence. |
+| `internal/host/egress_source.go` `registrySource.policyFrom` | body | unchanged (12) | R26: reads IsDemo from the existing egress registry snapshot; returns a closed DEMO-POLICY for any demo marker before interpreting allow entries. No added registry child or file read. |
| `internal/host/systemapply.go` `systemApplier.installUnits` | body | unchanged (6) | Renders the staged build slice against live root host configuration; preserves it when settings cannot be parsed. |
| `internal/host/systemunits.go` `ensureSystemUnits` | body | unchanged (5) | Body unchanged; consumes the enlarged embedded file list through the existing root installer. |
| `internal/instancectl/gen.go` `Server.handleParent` | body | unchanged (1) | Reads fixed DemoBox and clamps the existing parent memory writer to small. |
@@ -57,7 +59,9 @@ 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.
- `internal/host/bootstrap.go` `bootstrapWith`: authority, task A,C,G,J4. Basis: root-input;kept=A,C,G;scope=protected-decision-only;rev3=census-ruling-region-ha-p1a;basis=root (carlos bootstrap, cloud-init or an operator; also the staging-root and -plan-json path system apply's stagePlan runs): after the units are written, calls retireUnits(root, retiredUnits) (retiredunits.go, a new unit on this card) to disable, stop and remove carlos-system-join.path and .service, which an earlier build installed; an error there fails the bootstrap; enabledUnits (a var, not a census unit) no longer lists carlos-system-join.path; the same two sites, no read added in this body;rev3=census-ruling-fresh-box-446;basis=#446: a live bootstrap runs systemd-tmpfiles --create /etc/tmpfiles.d/carlos.conf (the conf it just wrote, a fixed path) after the credentials repair and before arming units; a failure fails the bootstrap; the staging run prints the same step
- `internal/host/claimstop_run.go` `RunInstanceControl`: authority, task C,D,G. Basis: rev3=PROPOSED-p3;run=24;identity=root claim/adopt/update controller uid 0;basis=production root startup builds authenticated execution and launch handlers then uses activateClaimRoot for recovery, the registered census launch verifier and lifecycle start;rev3=census-ruling-rootfs-apps-2;basis=the claims-off path serves through instancectl.RunWithRegistryView with HostRuntime: instanceRegistryHostRuntime beside the same instanceRegistryHostApp(nil); the new read is instanceRegistryHostRuntime's own (a decision row in rootfs-apps-2-new); no read added in this body;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Tasks 4 and 6: the claims-off branch hands RunWithRegistryView the pre-claim egress asserter (newEgressAsserter over registryEgressSource and registryEgressHosts, which read the agent-written registry read-only, beside the instanceRegistryHostApp read it already had); the claims branch builds its runtime resources in instanceControlClaimResources, adding the claims asserter (claimsEgressSource writes no allow; the registry is read only to name slices), and serves through runClaimControl, which passes RunWithClaim the same handler, held-release route and host lookup plus that asserter. No read site in the unit, none added.
+- `internal/host/claimstop_run.go` `instanceRegistryHostRuntime`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=instance control (/opt/carlos/carlos instance-control, carlos-instance-control.service, root), through RunInstanceControl's RegistryView;basis=root-route (J1, as instanceRegistryHostApp, its twin; Astra recommends authority C,G,J1 and the Opus reviewer recommends J1: the census owner chooses): new (rootfs Plan 2 Task 5): opens the registry read-only (openServiceRegistryReadOnly, as its twin) and returns the host's Route.Runtime. The agent (carlos) writes the registry, so a box agent can set any row's runtime; the read-only open protects the file, it does not authenticate the value. A positive answer admits a new privileged operation: root opens and hashes the staged image, reads its manifest, lays out a rootfs layout and has PID 1 mount that tenant-produced squashfs as the unit's root (validateStagedImage, ensureRootfsExe, RootImage=). What bounds it: root opens only release.VersionPath for the account and app the twin reads, at the version the request names, beneath the version store with no symlink, checks the bytes against root's own staged manifest and refuses a manifest that is not a rootfs one (RFS-2-C07); an app's kind is fixed at its first ship, so a runtime forged on a binary app's row finds no rootfs manifest and root refuses it; a runtime forged on a row cannot pick another account's or app's image, which come from the twin. root's binary validator (validateStagedExe) does not read the runtime or the manifest's kind, and nestedGate is the agent's refusal, not root's. Why C and G fixtures do not cover it: this reader is wired only on RunInstanceControl's claims-off branch; on a claim-armed box the control service's legacy verbs, rootfs ones included, answer 503 (claimAwareLegacy) and its view has no HostRuntime, so no C or G fixture reaches it, and an authority disposition would need a fixture family of its own
- `internal/host/claimunit.go` `readClaimUnitSettings`: authority, task C,E3,G,J4. Basis: rev3=PROPOSED-p3;identity=root claim/adoption controller uid 0;basis=retains exact no-census unit settings; a claims-enabled complete census prepares the root-owned retry directory before the hardened controller starts
+- `internal/host/egress_source.go` `registrySource.policyFrom`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-instance-egress-sizes-328-329;identity=instance control (/opt/carlos/carlos instance-control, carlos-instance-control.service, root), on the claims-off branch only;basis=root-route (J1, as instanceRegistryHostRuntime; kept legacy J1 by the coordinator's ruling, 2026-10-26): new (#328 plan 2 Task 5, final review F2 and F3): finds the asked host's row in the snapshot and answers its policy: no row or no EgressAllow is none; else the rail once per snapshot (boxWhollyNested then railEvidence) may close it EgressNotNested, a PolicyExpiresAt missing, not positive or not after now closes it EgressExpired, and otherwise EgressAllow split on spaces with the row's Account and App. A root decision from the agent-written registry: the agent fills the columns only from a policy it verified with the release key, and root does not re-verify the signature. Root's own limits on what it applies: the rail (boxWhollyNested and railEvidence), the recorded expiry, each address parsed by egressaddr, the box's own addresses refused, the MaxAllow cap (instancectl/egress.go), and no wiring under host claims (claimsEgressSource closes every allow)
- `internal/host/systemapply.go` `systemApplier.installUnits`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input
- `internal/host/systemunits.go` `ensureSystemUnits`: authority, task F,J4. Basis: rev3=PROPOSED-activation-tools;run=27;basis=automated offline transaction removed; retains preceding integrated classification: root-input;kept=F;scope=protected-decision-only;rev3=census-ruling-db-region-forward-1;identity=root (the adopt pass);basis=installs carlos-dbread.socket and carlos-dbread@.service with the other system units, asks one more is-active and arms the socket, never the service template; read sites unchanged, offsets moved; main's F authority retained; round 1: arms carlos-dbread.socket only when the installed host.env arms db reads (dbReadsSocketWanted reads its six db-reads keys through readClaimUnitFile, which the scanner does not name), and stops and disables it elsewhere;rev3=census-ruling-retire-join-units-on-adopt;basis=root (the hourly carlos adopt pass, carlos-adopt.timer, and the -config-only/-stage-only passes; never -restart-only): after the apply lock is taken and systemctl has answered, and before the already-armed early return, calls retireUnitsIn(<etc>/systemd/system, retiredUnits, its own systemctl seam) to disable --now, then remove, the units an earlier build installed and this one no longer ships (the compiled-in exact names carlos-system-join.path and carlos-system-join.service); an error is logged and never stops the arming; under a running apply (lock held) or a silent systemctl nothing is retired; no read added in this body (the reads are in retireUnitsIn) (#454)
- `internal/instancectl/gen.go` `Server.handleParent`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J2,J4;basis=root-input;rev3=census-ruling-instance-egress-sizes-328-329;basis=#329 plan 3 Task 5: holds the host's slice lock (lockSliceWrites) around its one set-property, so /parent and /size never interleave on one slice. Its one site is still r.URL.Query() of the agent's request (counted as file:Query). The checks in this body are unchanged, though cgroup.ValidParentLimit, which it calls, now accepts one size or the sum of any two from the four-row table (up to 4 GiB, was 2 GiB); no read added.
@@ -125,7 +129,7 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/instancectl/demo_build.go:Client.DemoBuildReadiness`: reads +file:ReadAll; written legacy, accepted-legacy, frozen
- new `internal/instancectl/demo_cleanup.go:Server.purgeDemoWithJobs`: reads +file:Lstat, +file:ReadDir, +registry:Account, +registry:App, +registry:DemoExpiresAt, +registry:DemoHost, +registry:DemoID, +registry:DemoLifetime, +registry:HoldOp, +registry:Status, +whole:Route ×2; written legacy, accepted-legacy, frozen
- new `internal/instancectl/demo_policy.go:Server.demoCgroup`: reads +file:ReadFile; written legacy, accepted-legacy, frozen
-- new `internal/instancectl/demo_policy.go:Server.demoHandler`: reads +file:Query ×2, +registry:Status, +whole:Route ×2; written legacy, accepted-legacy, frozen
+- new `internal/instancectl/demo_policy.go:Server.demoHandler`: reads +file:Query ×2, +registry:Status, +whole:Route; written legacy, accepted-legacy, frozen
- new `internal/instancectl/demo_versions.go:Server.purgeDemoVersions`: reads +file:EvalSymlinks, +file:ReadDir ×2, +registry:Account, +registry:App, +registry:Host, +whole:Route ×7; written legacy, accepted-legacy, frozen
- new `internal/provision/demo_policy.go:PolicyCache.AssertDemoRoute`: reads +registry:Account ×2, +registry:App ×2, +registry:DemoExpiresAt, +registry:DemoHost, +registry:DemoID, +registry:DemoLifetime ×2, +registry:Host ×2, +registry:Kind, +registry:Moved, +registry:Region, +registry:Replica, +registry:Replicas, +registry:Runtime, +registry:Seed, +registry:SeedSource, +registry:Socket, +registry:Unit; written legacy, accepted-legacy, frozen
- new `internal/provision/demo_policy.go:stampDemoRoute`: reads +registry:DemoExpiresAt, +registry:DemoHost, +registry:DemoID, +registry:DemoLifetime; written legacy, accepted-legacy, frozen
@@ -141,6 +145,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- reads `internal/registry/registry.go:routeArgs`: +registry:DemoExpiresAt, +registry:DemoHost, +registry:DemoID, +registry:DemoLifetime; keeps authority, task E3
- reads `internal/registry/registry.go:scanRoute`: +registry:DemoExpiresAt, +registry:DemoHost, +registry:DemoID, +registry:DemoLifetime; keeps legacy, task accepted-legacy
-Seal: `c61b055182bf84e822fab92199432bd2d462c268c03ead17c3cfa18f09bd82cd` → `39197c39b76e49a8e06c46a8b42c091d842710ffed16fa67cdd283fd93da5033`.
+Seal: `c61b055182bf84e822fab92199432bd2d462c268c03ead17c3cfa18f09bd82cd` → `ccf8a0e5e838decf6ef5b2738fa10309537c1b2cdcbeea71ccab53e691352fa8`.
Overlay: `internal/provision/testdata/plan14-root-reads-agent-start-demo-1.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/console/apidemo.go b/internal/console/apidemo.go
index e58118a54..c910a7933 100644
--- a/internal/console/apidemo.go
+++ b/internal/console/apidemo.go
@@ -306,6 +306,7 @@ func (s *Server) handleDemoPublish(w http.ResponseWriter, r *http.Request) {
}
var err error
var update *DemoRow
+ var expiresAt int64
// Presence, not validity, selects update. Duplicate or empty credentials
// cannot fall through to anonymous create.
if auth, present := r.Header["Authorization"]; present {
@@ -340,7 +341,10 @@ func (s *Server) handleDemoPublish(w http.ResponseWriter, r *http.Request) {
return
}
update = &row
- err = s.withDemoLocked(r.Context(), row.ID, func(row DemoRow, _ AppLife) error { return s.store.SpendDemoUpdate(r.Context(), row.ID, time.Now()) })
+ err = s.withDemoLocked(r.Context(), row.ID, func(row DemoRow, life AppLife) error {
+ expiresAt = life.ExpiresAt
+ return s.store.SpendDemoUpdate(r.Context(), row.ID, time.Now())
+ })
} else {
if err := s.store.CheckDemoLiveCeiling(r.Context(), s.cfg.Demo); err != nil {
demoError(w, err)
@@ -413,6 +417,7 @@ func (s *Server) handleDemoPublish(w http.ResponseWriter, r *http.Request) {
sum := sha256.Sum256(src.Archive)
in := DemoAdmission{Config: s.cfg.Demo, IP: s.clientIP(r), Now: time.Now(), SourceSHA256: sum, Client: r.Header.Get("X-Carlos-Client")}
in.job = func(ctx context.Context, tx *sql.Tx, d DemoRow, life AppLife) error {
+ expiresAt = life.ExpiresAt
_, err := s.insertDemoJob(ctx, tx, d, life, src)
return err
}
@@ -429,7 +434,7 @@ func (s *Server) handleDemoPublish(w http.ResponseWriter, r *http.Request) {
demoError(w, err)
return
}
- response := map[string]any{"jobId": job.ID, "name": row.Name, "statusUrl": strings.TrimRight(s.cfg.Origin, "/") + "/api/demo/jobs/" + job.ID, "expiresAt": row.CreatedAt + 86400}
+ response := map[string]any{"jobId": job.ID, "name": row.Name, "statusUrl": strings.TrimRight(s.cfg.Origin, "/") + "/api/demo/jobs/" + job.ID, "expiresAt": expiresAt}
if update == nil {
response["claimAvailable"] = false
response["claimToken"] = identity.Token
diff --git a/internal/console/demo_jobs_test.go b/internal/console/demo_jobs_test.go
index edcf2d750..99463435f 100644
--- a/internal/console/demo_jobs_test.go
+++ b/internal/console/demo_jobs_test.go
@@ -1313,6 +1313,11 @@ func TestDemoAnonymousWireContract(t *testing.T) {
if _, err := s.store.db.Exec(`UPDATE demo_apps SET active_job_id='' WHERE demo_id=?`, d.ID); err != nil {
t.Fatal(err)
}
+ // Keep the stored expiry unchanged, but make recomputing it from
+ // creation time give a different answer for the update reply.
+ if _, err := s.store.db.Exec(`UPDATE demo_apps SET created_at=created_at-60 WHERE demo_id=?`, d.ID); err != nil {
+ t.Fatal(err)
+ }
}
})
}
diff --git a/internal/host/claimstop_registry_test.go b/internal/host/claimstop_registry_test.go
index 753e818c3..9134d2060 100644
--- a/internal/host/claimstop_registry_test.go
+++ b/internal/host/claimstop_registry_test.go
@@ -6,6 +6,7 @@ import (
"path/filepath"
"testing"
+ "github.com/carlosframework/platform/internal/demo"
"github.com/carlosframework/platform/internal/registry"
)
@@ -32,3 +33,29 @@ func TestInstanceRegistryHostAppReusesClaimRegistry(t *testing.T) {
t.Fatalf("lookup closed shared registry: %v", err)
}
}
+
+func TestInstanceRegistryHostRuntimeRefusesDemo(t *testing.T) {
+ for _, marker := range []registry.Route{{}, {DemoID: "id"}, {DemoHost: "shop.example.com"}, {DemoLifetime: "life"}, {DemoExpiresAt: 1}} {
+ t.Run("marker", func(t *testing.T) {
+ dd := t.TempDir()
+ t.Setenv("CARLOS_DATA_DIR", dd)
+ reg, err := registry.Open(filepath.Join(dd, "registry.db"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer reg.Close()
+ marker.Host, marker.App, marker.Runtime = "shop.example.com", "shop", registry.RuntimeRootfsV1
+ if err := reg.Upsert(marker); err != nil {
+ t.Fatal(err)
+ }
+ runtime, err := instanceRegistryHostRuntime(marker.Host)
+ if marker.IsDemo() {
+ if !errors.Is(err, demo.ErrPolicy) {
+ t.Fatalf("demo runtime=%q err=%v", runtime, err)
+ }
+ } else if err != nil || runtime != marker.Runtime {
+ t.Fatalf("ordinary runtime=%q err=%v", runtime, err)
+ }
+ })
+ }
+}
diff --git a/internal/host/claimstop_run.go b/internal/host/claimstop_run.go
index 0f970f7a9..415f22200 100644
--- a/internal/host/claimstop_run.go
+++ b/internal/host/claimstop_run.go
@@ -191,6 +191,9 @@ func instanceRegistryHostRuntime(host string) (string, error) {
if row == nil {
return "", os.ErrNotExist
}
+ if row.IsDemo() {
+ return "", demo.ErrPolicy
+ }
return row.Runtime, nil
}
diff --git a/internal/host/egress_source.go b/internal/host/egress_source.go
index a28622841..2f66d2993 100644
--- a/internal/host/egress_source.go
+++ b/internal/host/egress_source.go
@@ -27,6 +27,7 @@ import (
"time"
"github.com/carlosframework/platform/internal/activator"
+ "github.com/carlosframework/platform/internal/demo"
"github.com/carlosframework/platform/internal/instancectl"
"github.com/carlosframework/platform/internal/layout"
"github.com/carlosframework/platform/internal/provision"
@@ -257,6 +258,10 @@ func (s *registrySource) policyFrom(ctx context.Context, snap *egressSnapshot, h
p.Account, p.App = row.Account, row.App
return p
}
+ // Ordinary roots reuse this snapshot to refuse former demo rows.
+ if row.IsDemo() {
+ return who(instancectl.EgressPolicy{Closed: demo.ErrPolicy.Error()}), time.Time{}
+ }
if strings.TrimSpace(row.EgressAllow) == "" {
return who(instancectl.EgressPolicy{}), time.Time{}
}
diff --git a/internal/host/egress_source_test.go b/internal/host/egress_source_test.go
index 3772ec691..a5a79957b 100644
--- a/internal/host/egress_source_test.go
+++ b/internal/host/egress_source_test.go
@@ -918,3 +918,21 @@ func TestRootEgressReadsARegistryWithoutTheHAColumn(t *testing.T) {
}
wantPolicy(t, readPolicy(t, testEgressSource(t, dd, clock.Now), "shop-a.example.com"), instancectl.EgressPolicy{Allow: []string{"10.0.5.20"}})
}
+
+func TestRegistryEgressSourceRefusesFormerDemo(t *testing.T) {
+ for _, marker := range []registry.Route{{DemoID: "id"}, {DemoHost: "shop.example.com"}, {DemoLifetime: "life"}, {DemoExpiresAt: 1}} {
+ marker.Host = "shop.example.com"
+ reads := 0
+ src := newRegistrySource(t.TempDir(), time.Now, func() ([]registry.Route, error) {
+ reads++
+ return []registry.Route{marker}, nil
+ }, func(context.Context, ...string) (string, error) {
+ t.Fatal("demo row reached systemd rail")
+ return "", nil
+ })
+ pol, err := src.read(t.Context(), marker.Host)
+ if err != nil || pol.Closed != "DEMO-POLICY" || len(pol.Allow) != 0 || reads != 1 {
+ t.Fatalf("policy=%+v err=%v registry reads=%d", pol, err, reads)
+ }
+ }
+}
diff --git a/internal/instancectl/demo_policy.go b/internal/instancectl/demo_policy.go
index 3946b4051..36fbb5046 100644
--- a/internal/instancectl/demo_policy.go
+++ b/internal/instancectl/demo_policy.go
@@ -23,14 +23,12 @@ func (s *Server) demoHandler(next http.Handler) http.Handler {
http.Error(w, demo.ErrPolicy.Error(), http.StatusForbidden)
return
}
- if r.Method == "POST" && r.URL.Path == "/start" && provision.ValidHostShape(r.URL.Query().Get("host")) {
+ if s.DemoBox && r.Method == "POST" && r.URL.Path == "/start" && provision.ValidHostShape(r.URL.Query().Get("host")) {
host := r.URL.Query().Get("host")
- if s.DemoBox {
- defer s.lockDemo(host)()
- }
+ defer s.lockDemo(host)()
if s.HostDemo != nil {
rt, err := s.HostDemo(host)
- if err != nil || (s.DemoBox && (rt == nil || !rt.IsDemo() || registry.IsHold(rt.Status))) || (!s.DemoBox && rt != nil && rt.IsDemo()) {
+ if err != nil || rt == nil || !rt.IsDemo() || registry.IsHold(rt.Status) {
http.Error(w, "DEMO-POLICY", 409)
return
}
diff --git a/internal/instancectl/demo_policy_test.go b/internal/instancectl/demo_policy_test.go
index f683ffe65..d31339f50 100644
--- a/internal/instancectl/demo_policy_test.go
+++ b/internal/instancectl/demo_policy_test.go
@@ -5,7 +5,6 @@ import (
"errors"
"fmt"
"github.com/carlosframework/platform/internal/registry"
- "net/http"
"net/http/httptest"
"os"
"path/filepath"
@@ -185,20 +184,60 @@ func TestDemoPolicyNamespaceReadback(t *testing.T) {
}
}
+func TestDemoOrdinaryRootStartUsesExistingRead(t *testing.T) {
+ for _, tc := range startPathCases() {
+ if !strings.HasPrefix(tc.path, "/start?") {
+ continue
+ }
+ for _, readFailure := range []bool{false, true} {
+ t.Run(fmt.Sprintf("%s/readFailure=%v", tc.name, readFailure), func(t *testing.T) {
+ ctl := tc.ctl()
+ extraReads, existingReads := 0, 0
+ status, body, _ := runStartPath(t, tc, ctl, func(s *Server) {
+ s.HostDemo = func(string) (*registry.Route, error) {
+ extraReads++
+ if readFailure {
+ return nil, errors.New("registry unavailable")
+ }
+ return &registry.Route{}, nil
+ }
+ s.Egress = startPathAsserter((&egressLayer{next: ctl.run}).run, func(context.Context, string) (EgressPolicy, error) {
+ existingReads++
+ if readFailure {
+ return EgressPolicy{}, errors.New("registry unavailable")
+ }
+ return EgressPolicy{}, nil
+ })
+ })
+ if status != 200 || extraReads != 0 || existingReads != 1 {
+ t.Fatalf("status=%d extra reads=%d existing reads=%d body=%s", status, extraReads, existingReads, body)
+ }
+ })
+ }
+ }
+}
+
func TestDemoOrdinaryRootRefusesMarkedStart(t *testing.T) {
- for _, gen := range []string{"", "&gen=7"} {
- for _, marker := range []registry.Route{{DemoID: "id"}, {DemoHost: "shop.example.com"}, {DemoLifetime: "life"}, {DemoExpiresAt: 1}} {
- s := &Server{HostDemo: func(string) (*registry.Route, error) { return &marker, nil }}
- reached := false
- handler := s.demoHandler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { reached = true; w.WriteHeader(204) }))
- w := httptest.NewRecorder()
- handler.ServeHTTP(w, httptest.NewRequest("POST", "/start?host=shop.example.com&role=run"+gen, nil))
- if w.Code != 409 || reached {
- t.Fatalf("ordinary root accepted demo: status=%d reached=%v", w.Code, reached)
- }
+ for _, tc := range startPathCases() {
+ if !strings.HasPrefix(tc.path, "/start?") {
+ continue
}
+ t.Run(tc.name, func(t *testing.T) {
+ ctl := tc.ctl()
+ status, body, _ := runStartPath(t, tc, ctl, func(s *Server) {
+ s.HostDemo = func(string) (*registry.Route, error) {
+ t.Error("extra demo registry read")
+ return nil, nil
+ }
+ s.Egress = startPathAsserter((&egressLayer{next: ctl.run}).run, staticSource(EgressPolicy{Closed: "DEMO-POLICY"}, nil))
+ })
+ if status != 502 || !strings.Contains(body, "DEMO-POLICY") || callIndex(strings.Split(ctl.joined(), "\n"), tc.start) >= 0 {
+ t.Fatalf("former-demo root: status=%d body=%s calls=%s", status, body, ctl.joined())
+ }
+ })
}
}
+
func TestDemoReadyReportsRootMode(t *testing.T) {
for _, mode := range []bool{false, true} {
s := &Server{DemoBox: mode, probed: true, report: ProbeReport{Ready: true}}
diff --git a/internal/instancectl/egress.go b/internal/instancectl/egress.go
index 3899a8111..fe7debb40 100644
--- a/internal/instancectl/egress.go
+++ b/internal/instancectl/egress.go
@@ -56,6 +56,7 @@ import (
"sync/atomic"
"time"
+ "github.com/carlosframework/platform/internal/demo"
"github.com/carlosframework/platform/internal/egressaddr"
"github.com/carlosframework/platform/internal/provision"
)
@@ -215,6 +216,12 @@ func (e *EgressAsserter) assert(ctx context.Context, host string, start bool) er
var rep EgressReport
pol, err := e.readSource(ctx, host)
+ // Demo boxes do not use this asserter. On an ordinary root, only a
+ // successful existing registry read adds the demo refusal; read errors
+ // retain the ordinary fallback below.
+ if start && err == nil && pol.Closed == demo.ErrPolicy.Error() {
+ return demo.ErrPolicy
+ }
if err != nil {
rep.State, rep.Detail = EgressUnreadable, err.Error()
cached, ok := e.cached(host)
diff --git a/internal/provision/testdata/plan14-root-reads-agent-start-demo-1.tsv b/internal/provision/testdata/plan14-root-reads-agent-start-demo-1.tsv
index f0d27c4b5..e2291721f 100644
--- a/internal/provision/testdata/plan14-root-reads-agent-start-demo-1.tsv
+++ b/internal/provision/testdata/plan14-root-reads-agent-start-demo-1.tsv
@@ -1,5 +1,5 @@
# Census overlay agent-start-demo-1, written by census-propose (#369). census-ruling-agent-start-demo-1, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-agent-start-demo-1.md.
-# 24 body, 11 sites, 13 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 26 body, 11 sites, 13 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
# 56 new dispositions: 8 reads re-frozen at their disposition with the claim, 47 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 1 other.
@legacy c5a85aee81843486b0c42403cafcdfba3a2c03f41b306b961db5f395be8f3677 internal/activator/backend_exec.go ExecBackend.HasSidecar legacy accepted-legacy accepted-legacy;rev3=J1,J4;basis=route-and-input;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 N1: a row with a runtime has no binary sidecar, answered before the sidecar env Stat; reads Runtime; Stats less;rev3=census-ruling-agent-start-demo-1;basis=Reads IsDemo and returns false before the sidecar env stat. file:Stat@147,registry:Runtime@99,whole:Route@166 869b1d2560b837945a9e551af87a6da78d423574061d6f7b8efdc4ea812ebbe3
@legacy 163e792ff066e89073c61a8fd11d441c43324aafc145da75c9f964707d0cc536 internal/activator/backend_exec.go ExecBackend.Seed legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: haSpawnGate(rt) first (+whole:Route), which for a host this backend acquired HA re-runs the containment admission (nested layout, not unit-backed, nestedReady) and refuses otherwise; a non-HA host passes untouched; only adds a refusal;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 N1: refuses a row with a runtime before any binary launch (refuseRuntimeBinaryLaunch); adds a refusal only;rev3=census-ruling-agent-start-demo-1;basis=Reads IsDemo and refuses before seed work. registry:Host@441,registry:Host@503,whole:Route@154,whole:Route@213,whole:Route@264,whole:Route@332,whole:Route@488 718d5e8ff4a8f9f3f51941d7527166cf4087fe9e34ff1c3db282df44f9b5db57
@@ -9,6 +9,8 @@
@legacy 233bedd239c2e04ae8070734ec3a305e8c4e99e88248399c122ff8151923e008 internal/activator/size.go SizedLimit legacy accepted-legacy accepted-legacy;rev3=census-ruling-instance-egress-sizes-328-329;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), through the activator's tier and GenTier; and, only with host claims on (shelved, Paul 2026-10-25), instance control (/opt/carlos/carlos instance-control, carlos-instance-control.service, root) through claimBoundSnapshot in the bound-launch snapshot (claimproduction.go, r.Mode != agent);basis=root-route (J1, as ExecBackend.tier): new (#329 plan 3 Task 3): converts a route's size name (rt.Size, the agent-written registry column, which the agent's reconcile fills from the signed app policy) into a platform memory limit: the size table's row of that name, else the caller's fallback tier for an empty or unknown name (an unknown name logs once per host and value, rt.Host and rt.Size keying an in-memory map). No file and no root call of its own. In the agent the limit reaches root only as a start's or /parent's memory_max, which root checks against its own size table (now any of the four rows, 256 MiB to 2 GiB, and /parent any row or the sum of two, up to 4 GiB: the widened validators, spec section 5.3). In the shelved claim mode root itself takes the limit from the agent-written column, within the same table (claimroleassembly, claimlaunch_root);rev3=census-ruling-agent-start-demo-1;basis=Reads Route.IsDemo before ordinary size selection; returns the existing small table row for any demo marker. registry:Host@303,registry:Host@437,registry:Size@160,registry:Size@228,registry:Size@318,registry:Size@446 c4a515016bfd9b6879efbbb751493bd91eb670ca03618a004fc1859b25ce1180
@legacy 87da2cee3267c034937ecab189ea780624b3f3c4428fa4eb7553533246f032ba internal/edge/edge.go RunWithActivatorReady legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-certwarm-wake;basis=registers the cert warm's nudge on OnReload and on the home map's new served-hosts wake (#386); nudge only sends on a buffered channel; no read added, same 5 sites;rev3=census-ruling-edge-roll-blip;basis=the :80/:443 (and dev) listeners are bound on the calling goroutine with net.Listen via listen()/listenAddr (same empty-address defaults as ListenAndServe) before the serve goroutines, which now call Serve/ServeTLS on them, and one log line names the bound addresses; no read added, same 5 sites;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): the inline home-map arming (newHomeMap, one boot Refresh, Store, run) moves unchanged into the new Edge.ArmHomeMap and is called here as e.ArmHomeMap(); same refresh, same timeout, same order. The reads are moved, none added.;rev3=census-ruling-agent-start-demo-1;basis=Logs the combined explicit wildcard parents through demoWildcardDomains; no new watcher or read loop. data-literal@129,data-literal@148,data-literal@284,data-literal@417,file:Open@1013 396bda0907b03093236b6022463bcc80781a689f6fcea28341d2d34c1176ae0d
@legacy 32399a36edfa2b07281165e745b4550fbd5944b14b6717c3dba2f2812db1acf6 internal/edge/wildcard.go newWildcardFromEnv legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-agent-start-demo-1;basis=Includes the configured demo domain in the existing wildcard manager's explicit parent input. registry:Host@6490,whole:WildcardDomain@6437,whole:WildcardDomain@6463 3ac9e1f8e14eefa124b8e56b64ffafac34392989e85fab89f9e2397768e70e3e
+@legacy 45f0c1de328d0552318069fc5070a33f9b908f9cf88bd6765f8a007aeb428920 internal/host/claimstop_run.go instanceRegistryHostRuntime legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=instance control (/opt/carlos/carlos instance-control, carlos-instance-control.service, root), through RunInstanceControl's RegistryView;basis=root-route (J1, as instanceRegistryHostApp, its twin; Astra recommends authority C,G,J1 and the Opus reviewer recommends J1: the census owner chooses): new (rootfs Plan 2 Task 5): opens the registry read-only (openServiceRegistryReadOnly, as its twin) and returns the host's Route.Runtime. The agent (carlos) writes the registry, so a box agent can set any row's runtime; the read-only open protects the file, it does not authenticate the value. A positive answer admits a new privileged operation: root opens and hashes the staged image, reads its manifest, lays out a rootfs layout and has PID 1 mount that tenant-produced squashfs as the unit's root (validateStagedImage, ensureRootfsExe, RootImage=). What bounds it: root opens only release.VersionPath for the account and app the twin reads, at the version the request names, beneath the version store with no symlink, checks the bytes against root's own staged manifest and refuses a manifest that is not a rootfs one (RFS-2-C07); an app's kind is fixed at its first ship, so a runtime forged on a binary app's row finds no rootfs manifest and root refuses it; a runtime forged on a row cannot pick another account's or app's image, which come from the twin. root's binary validator (validateStagedExe) does not read the runtime or the manifest's kind, and nestedGate is the agent's refusal, not root's. Why C and G fixtures do not cover it: this reader is wired only on RunInstanceControl's claims-off branch; on a claim-armed box the control service's legacy verbs, rootfs ones included, answer 503 (claimAwareLegacy) and its view has no HostRuntime, so no C or G fixture reaches it, and an authority disposition would need a fixture family of its own;rev3=census-ruling-agent-start-demo-1;basis=R26: reads IsDemo from the registry row already fetched for rootfs runtime validation; refuses any demo marker. Existing registry read errors and missing-row behavior unchanged; no new read. registry:Runtime@372,whole:Route@270 1f09e59dfefa1813e2d284ad43ec298243bd46d3ff94fb911b671070beb11496
+@legacy 95225105ba442ed4163d7db74e673c726f0a16ab3183331620621410ea3b922d internal/host/egress_source.go registrySource.policyFrom legacy accepted-legacy accepted-legacy;rev3=census-ruling-instance-egress-sizes-328-329;identity=instance control (/opt/carlos/carlos instance-control, carlos-instance-control.service, root), on the claims-off branch only;basis=root-route (J1, as instanceRegistryHostRuntime; kept legacy J1 by the coordinator's ruling, 2026-10-26): new (#328 plan 2 Task 5, final review F2 and F3): finds the asked host's row in the snapshot and answers its policy: no row or no EgressAllow is none; else the rail once per snapshot (boxWhollyNested then railEvidence) may close it EgressNotNested, a PolicyExpiresAt missing, not positive or not after now closes it EgressExpired, and otherwise EgressAllow split on spaces with the row's Account and App. A root decision from the agent-written registry: the agent fills the columns only from a policy it verified with the release key, and root does not re-verify the signature. Root's own limits on what it applies: the rail (boxWhollyNested and railEvidence), the recorded expiry, each address parsed by egressaddr, the box's own addresses refused, the MaxAllow cap (instancectl/egress.go), and no wiring under host claims (claimsEgressSource closes every allow);rev3=census-ruling-agent-start-demo-1;basis=R26: reads IsDemo from the existing egress registry snapshot; returns a closed DEMO-POLICY for any demo marker before interpreting allow entries. No added registry child or file read. registry:Account@502,registry:App@515,registry:EgressAllow@2111,registry:EgressAllow@732,registry:Host@205,registry:PolicyExpiresAt@1567,whole:Route@1032,whole:Route@193,whole:Route@210,whole:Route@236,whole:Route@248,whole:Route@276 c9b9731b41b019da1a6bc67312a42d715cbd25947532cffdc5b1ca10cb0b8697
@legacy 7dc88989efe155dc8c79d9f61f04463f277994335006dddc1ab884c0a8d07ab0 internal/host/systemapply.go systemApplier.installUnits legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-agent-start-demo-1;basis=Renders the staged build slice against live root host configuration; preserves it when settings cannot be parsed. file:ReadDir@1201,file:ReadFile@1708,file:ReadFile@4743,file:ReadFile@725,file:Stat@2366,file:Stat@3659 f823c991e707652f945b4d7bfe70b052e2aade95d849abb96d913286be4d1bb1
@legacy 6052cbca09e3ec177e05c97d8df5519a775eceb461b7d65573fd7a918e23d0f5 internal/instancectl/gen.go Server.handleParent legacy accepted-legacy accepted-legacy;rev3=J2,J4;basis=root-input;rev3=census-ruling-instance-egress-sizes-328-329;basis=#329 plan 3 Task 5: holds the host's slice lock (lockSliceWrites) around its one set-property, so /parent and /size never interleave on one slice. Its one site is still r.URL.Query() of the agent's request (counted as file:Query). The checks in this body are unchanged, though cgroup.ValidParentLimit, which it calls, now accepts one size or the sum of any two from the four-row table (up to 4 GiB, was 2 GiB); no read added.;rev3=census-ruling-agent-start-demo-1;basis=Reads fixed DemoBox and clamps the existing parent memory writer to small. file:Query@78 7f015658b178c1aaef513d80134bfe2e7afcf628c2e8bcd9d8ae0c3658d0a672
@legacy 7b6516260e76654b421ae8fe7bf3b3c4c9bc60cb125bbdc507a0c37986c9253c internal/instancectl/rootfs.go Server.runRootfsProbe legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=instance control (/opt/carlos/carlos instance-control, carlos-instance-control.service, root);basis=root-input (J2,J4, as Server.RunProbe): new (rootfs Plan 2 Task 7): builds the probe image once per service start, hashes it (fileSHA256), lays out the _probe rootfs exe layout and its box-addrs, starts carlos-instance-rootfs-probe.service and ReadFiles its report from /run/carlos-control/rootfs-probe.out, which PID 1 writes from the probe's stdout; the probe runs the platform binary from root's own probe image, no tenant code; the report only decides readiness, and without an ok root-image line it is never ready, whatever it says;rev3=census-ruling-agent-start-demo-1;basis=Reads DemoBox and refuses before preparing or launching a rootfs probe; ordinary probe behavior unchanged. file:ReadFile@1904 2e6fe461a411de96d20c78141c2278ba8164a1950e0dccc8cad95c039e3a1262
@@ -60,7 +62,7 @@
@legacy 55a2544feb1eabb563f276b13b3d999620adc9648638b70fa5d8ab847bf81428 internal/instancectl/demo_build.go Client.DemoBuildReadiness legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Reads bounded root readiness and verifies capability, slots, digest and service build identity. file:ReadAll@709 abbb7980212aff48b695260c0f140d63327517e493d00a76f41fb2fe86597507
@legacy 8920df20f3899d376436182a97352567f5bf7c512c872919850e958052ea27f4 internal/instancectl/demo_cleanup.go Server.purgeDemoWithJobs legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Checks root config and current registry identity/hold; reads derived unit/cgroup/exe/drop-in state, stops and proves emptiness before no-follow removal. Fix round 1: passes the descriptor host to the root build-scratch cleaner; same registry, cgroup and derived path reads. file:Lstat@1638,file:ReadDir@2477,registry:Account@833,registry:App@871,registry:DemoExpiresAt@798,registry:DemoHost@676,registry:DemoID@655,registry:DemoLifetime@701,registry:HoldOp@762,registry:Status@734,whole:Route@1374,whole:Route@625 bbed24fd2c6a68a1a0038ef7b13817bb87b97564c15582401a4b61b4ea1fd316
@legacy bc75f2049bd5711df22315f192ca14e9e820605a946b09da6fd323aabb00fcb7 internal/instancectl/demo_policy.go Server.demoCgroup legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Reads memory.max, cpu.weight, cpu.max and io.weight beneath root cgroupfs using platform-generated slice/unit names; checks both slice and unit before reporting started. file:ReadFile@395 734de40e9daa0756d5f1b9586aaa7c5810591e5525595e9bd888e7681dd2ca2b
-@legacy bbfe666a7b0b7e14d9f367911b9e414fb2ea599addeff2ee94074c55f51f5f0c internal/instancectl/demo_policy.go Server.demoHandler legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Serializes demo-mode starts with demo purge; ordinary starts retain their existing unit locking. Uses the existing HostDemo callback to read the fixed service registry for a valid requested host in ordinary mode too; read errors and any demo-marked row refuse that start. Demo mode retains missing/non-demo/held-row refusals. No caller-named filesystem path is opened. file:Query@450,file:Query@490,registry:Status@707,whole:Route@662,whole:Route@738 201bc63347bee7b1bc354e11820e12e427b1573aa6fdf551ca43b6a66965e418
+@legacy 243c7d6ed5dc49324b9abbb8cb02cc085ddd6719d774a45e51a92aabcd57d081 internal/instancectl/demo_policy.go Server.demoHandler legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=R26: HostDemo and the demo start/purge lock run only in demo mode. Ordinary starts do not read HostDemo or gain its read-error refusal. Demo-mode missing/non-demo/held-row and read-error refusals remain. file:Query@463,file:Query@503,registry:Status@681,whole:Route@636 d2a425d9a0e187a7d36f5d98ca4c43457c2bf347beacf71cfc1ce0cb9560ad6d
@legacy 4534a0ff26a3ed84cd3647fde754f25924730a0c269709bd36a90a21fcd22730 internal/instancectl/demo_versions.go Server.purgeDemoVersions legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Derives account/app from root config and host; reads registry/live/generation pins and staged entries; deletes only unreferenced demo app files. Fix round 1: logs and skips ENOENT resolving another live link; other errors still refuse, same pin and symlink reads. file:EvalSymlinks@1980,file:ReadDir@1387,file:ReadDir@1850,registry:Account@2336,registry:App@2361,registry:Host@885,whole:Route@1221,whole:Route@2321,whole:Route@842,whole:Route@871,whole:Route@908,whole:Route@924,whole:Route@932 e7d139663a400bb09ef051ff764396000923fe321fb7a4c86bb697bd3f28d9de
@legacy 2b4f69b592efd2d8e01f6f02e7f1d60d1979ea6e654cbefd017e203077589132 internal/provision/demo_policy.go PolicyCache.AssertDemoRoute legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Reads route identity/runtime/placement, box configuration and verified cache entry under its mutex; refuses absent/expired/mismatched policy with no store request. registry:Account@656,registry:Account@870,registry:App@668,registry:App@882,registry:DemoExpiresAt@604,registry:DemoHost@553,registry:DemoID@536,registry:DemoLifetime@576,registry:DemoLifetime@685,registry:Host@374,registry:Host@676,registry:Kind@231,registry:Moved@386,registry:Region@462,registry:Replica@273,registry:Replicas@287,registry:Runtime@211,registry:Seed@308,registry:SeedSource@325,registry:Socket@348,registry:Unit@256 b8be2f735322dcd628e52e508d57644107fc3f7cf5c77568dd5252f9cc832dea
@legacy f7e471f6d9b9c791517fa8a1dc4c7e47d81bb0eb466c64775e515afdb6fe19a3 internal/provision/demo_policy.go stampDemoRoute legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Copies public descriptor fields from the already-read record into the route; no new external read. registry:DemoExpiresAt@130,registry:DemoHost@100,registry:DemoID@89,registry:DemoLifetime@113 bdea1bb5b22514d290b278ce4d4fb6025c5145c4c8d02c84da1f7bfb9079ecce
@@ -93,7 +95,9 @@ internal/edge/wildcard.go newWildcardFromEnv legacy accepted-legacy accepted-leg
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-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. file:Exec@17790,file:Open@1150,file:Statfs@45991,registry:App@11502,whole:Route@11494,whole:Route@29576 ffc11cc147b9fb3afb787f02e7aba1e00dbd2e07e1b7d98ed30042fe01e7c964
internal/host/bootstrap.go bootstrapWith authority A,C,G,J4 root-input;kept=A,C,G;scope=protected-decision-only;rev3=census-ruling-region-ha-p1a;basis=root (carlos bootstrap, cloud-init or an operator; also the staging-root and -plan-json path system apply's stagePlan runs): after the units are written, calls retireUnits(root, retiredUnits) (retiredunits.go, a new unit on this card) to disable, stop and remove carlos-system-join.path and .service, which an earlier build installed; an error there fails the bootstrap; enabledUnits (a var, not a census unit) no longer lists carlos-system-join.path; the same two sites, no read added in this body;rev3=census-ruling-fresh-box-446;basis=#446: a live bootstrap runs systemd-tmpfiles --create /etc/tmpfiles.d/carlos.conf (the conf it just wrote, a fixed path) after the credentials repair and before arming units; a failure fails the bootstrap; the staging run prints the same step;rev3=census-ruling-agent-start-demo-1;basis=Uses demo settings from the existing host.env parser; refuses malformed demo config and installs the fixed template drop-ins. file:Command@11482,file:ReadFile@552,file:ReadFile@6958 a55f9f90065579c13a4cb4dfe73b4e4d44b76d69d6e500fc9d024d51f2e469df
internal/host/claimstop_run.go RunInstanceControl authority C,D,G rev3=PROPOSED-p3;run=24;identity=root claim/adopt/update controller uid 0;basis=production root startup builds authenticated execution and launch handlers then uses activateClaimRoot for recovery, the registered census launch verifier and lifecycle start;rev3=census-ruling-rootfs-apps-2;basis=the claims-off path serves through instancectl.RunWithRegistryView with HostRuntime: instanceRegistryHostRuntime beside the same instanceRegistryHostApp(nil); the new read is instanceRegistryHostRuntime's own (a decision row in rootfs-apps-2-new); no read added in this body;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Tasks 4 and 6: the claims-off branch hands RunWithRegistryView the pre-claim egress asserter (newEgressAsserter over registryEgressSource and registryEgressHosts, which read the agent-written registry read-only, beside the instanceRegistryHostApp read it already had); the claims branch builds its runtime resources in instanceControlClaimResources, adding the claims asserter (claimsEgressSource writes no allow; the registry is read only to name slices), and serves through runClaimControl, which passes RunWithClaim the same handler, held-release route and host lookup plus that asserter. No read site in the unit, none added.;rev3=census-ruling-agent-start-demo-1;basis=Wires demo registry views and existing root release/adoption guard into instance control. 75aa3bf336c68d4859f5d0f4c49d44e23d672be99599fec58f7b91c083def5e7
+internal/host/claimstop_run.go instanceRegistryHostRuntime legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-2;identity=instance control (/opt/carlos/carlos instance-control, carlos-instance-control.service, root), through RunInstanceControl's RegistryView;basis=root-route (J1, as instanceRegistryHostApp, its twin; Astra recommends authority C,G,J1 and the Opus reviewer recommends J1: the census owner chooses): new (rootfs Plan 2 Task 5): opens the registry read-only (openServiceRegistryReadOnly, as its twin) and returns the host's Route.Runtime. The agent (carlos) writes the registry, so a box agent can set any row's runtime; the read-only open protects the file, it does not authenticate the value. A positive answer admits a new privileged operation: root opens and hashes the staged image, reads its manifest, lays out a rootfs layout and has PID 1 mount that tenant-produced squashfs as the unit's root (validateStagedImage, ensureRootfsExe, RootImage=). What bounds it: root opens only release.VersionPath for the account and app the twin reads, at the version the request names, beneath the version store with no symlink, checks the bytes against root's own staged manifest and refuses a manifest that is not a rootfs one (RFS-2-C07); an app's kind is fixed at its first ship, so a runtime forged on a binary app's row finds no rootfs manifest and root refuses it; a runtime forged on a row cannot pick another account's or app's image, which come from the twin. root's binary validator (validateStagedExe) does not read the runtime or the manifest's kind, and nestedGate is the agent's refusal, not root's. Why C and G fixtures do not cover it: this reader is wired only on RunInstanceControl's claims-off branch; on a claim-armed box the control service's legacy verbs, rootfs ones included, answer 503 (claimAwareLegacy) and its view has no HostRuntime, so no C or G fixture reaches it, and an authority disposition would need a fixture family of its own;rev3=census-ruling-agent-start-demo-1;basis=R26: reads IsDemo from the registry row already fetched for rootfs runtime validation; refuses any demo marker. Existing registry read errors and missing-row behavior unchanged; no new read. registry:Runtime@372,whole:Route@270 1f09e59dfefa1813e2d284ad43ec298243bd46d3ff94fb911b671070beb11496
internal/host/claimunit.go readClaimUnitSettings authority C,E3,G,J4 rev3=PROPOSED-p3;identity=root claim/adoption controller uid 0;basis=retains exact no-census unit settings; a claims-enabled complete census prepares the root-owned retry directory before the hardened controller starts;rev3=census-ruling-agent-start-demo-1;basis=Reads worker/concurrency/toolchain settings from the existing host.env parser; requires box mode and refuses claims coexistence. data-literal@140,data-literal@2064,data-literal@2648 d79f51da7979daeab8202510db8cf032a9b8ca154cf32df8f4e63c32683d6363
+internal/host/egress_source.go registrySource.policyFrom legacy accepted-legacy accepted-legacy;rev3=census-ruling-instance-egress-sizes-328-329;identity=instance control (/opt/carlos/carlos instance-control, carlos-instance-control.service, root), on the claims-off branch only;basis=root-route (J1, as instanceRegistryHostRuntime; kept legacy J1 by the coordinator's ruling, 2026-10-26): new (#328 plan 2 Task 5, final review F2 and F3): finds the asked host's row in the snapshot and answers its policy: no row or no EgressAllow is none; else the rail once per snapshot (boxWhollyNested then railEvidence) may close it EgressNotNested, a PolicyExpiresAt missing, not positive or not after now closes it EgressExpired, and otherwise EgressAllow split on spaces with the row's Account and App. A root decision from the agent-written registry: the agent fills the columns only from a policy it verified with the release key, and root does not re-verify the signature. Root's own limits on what it applies: the rail (boxWhollyNested and railEvidence), the recorded expiry, each address parsed by egressaddr, the box's own addresses refused, the MaxAllow cap (instancectl/egress.go), and no wiring under host claims (claimsEgressSource closes every allow);rev3=census-ruling-agent-start-demo-1;basis=R26: reads IsDemo from the existing egress registry snapshot; returns a closed DEMO-POLICY for any demo marker before interpreting allow entries. No added registry child or file read. registry:Account@502,registry:App@515,registry:EgressAllow@2111,registry:EgressAllow@732,registry:Host@205,registry:PolicyExpiresAt@1567,whole:Route@1032,whole:Route@193,whole:Route@210,whole:Route@236,whole:Route@248,whole:Route@276 c9b9731b41b019da1a6bc67312a42d715cbd25947532cffdc5b1ca10cb0b8697
internal/host/systemapply.go systemApplier.installUnits legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-agent-start-demo-1;basis=Renders the staged build slice against live root host configuration; preserves it when settings cannot be parsed. file:ReadDir@1201,file:ReadFile@1708,file:ReadFile@4743,file:ReadFile@725,file:Stat@2366,file:Stat@3659 f823c991e707652f945b4d7bfe70b052e2aade95d849abb96d913286be4d1bb1
internal/host/systemunits.go ensureSystemUnits authority F,J4 rev3=PROPOSED-activation-tools;run=27;basis=automated offline transaction removed; retains preceding integrated classification: root-input;kept=F;scope=protected-decision-only;rev3=census-ruling-db-region-forward-1;identity=root (the adopt pass);basis=installs carlos-dbread.socket and carlos-dbread@.service with the other system units, asks one more is-active and arms the socket, never the service template; read sites unchanged, offsets moved; main's F authority retained; round 1: arms carlos-dbread.socket only when the installed host.env arms db reads (dbReadsSocketWanted reads its six db-reads keys through readClaimUnitFile, which the scanner does not name), and stops and disables it elsewhere;rev3=census-ruling-retire-join-units-on-adopt;basis=root (the hourly carlos adopt pass, carlos-adopt.timer, and the -config-only/-stage-only passes; never -restart-only): after the apply lock is taken and systemctl has answered, and before the already-armed early return, calls retireUnitsIn(<etc>/systemd/system, retiredUnits, its own systemctl seam) to disable --now, then remove, the units an earlier build installed and this one no longer ships (the compiled-in exact names carlos-system-join.path and carlos-system-join.service); an error is logged and never stops the arming; under a running apply (lock held) or a silent systemctl nothing is retired; no read added in this body (the reads are in retireUnitsIn) (#454);rev3=census-ruling-agent-start-demo-1;basis=Body unchanged; consumes the enlarged embedded file list through the existing root installer. file:OpenFile@265,file:ReadFile@4114,file:ReadFile@4247,file:ReadFile@5651,file:Stat@4023 1e61e205aeabae934ded7acea433db2ba44ec93ad32ad0f2139fdd1e686eace7
internal/instancectl/gen.go Server.handleParent legacy accepted-legacy accepted-legacy;rev3=J2,J4;basis=root-input;rev3=census-ruling-instance-egress-sizes-328-329;basis=#329 plan 3 Task 5: holds the host's slice lock (lockSliceWrites) around its one set-property, so /parent and /size never interleave on one slice. Its one site is still r.URL.Query() of the agent's request (counted as file:Query). The checks in this body are unchanged, though cgroup.ValidParentLimit, which it calls, now accepts one size or the sum of any two from the four-row table (up to 4 GiB, was 2 GiB); no read added.;rev3=census-ruling-agent-start-demo-1;basis=Reads fixed DemoBox and clamps the existing parent memory writer to small. file:Query@78 7f015658b178c1aaef513d80134bfe2e7afcf628c2e8bcd9d8ae0c3658d0a672
@@ -147,7 +151,7 @@ internal/host/units/carlos-demo-builds.slice external legacy accepted-legacy acc
internal/instancectl/demo_build.go Client.DemoBuildReadiness legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Reads bounded root readiness and verifies capability, slots, digest and service build identity. file:ReadAll@709 abbb7980212aff48b695260c0f140d63327517e493d00a76f41fb2fe86597507
internal/instancectl/demo_cleanup.go Server.purgeDemoWithJobs legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Checks root config and current registry identity/hold; reads derived unit/cgroup/exe/drop-in state, stops and proves emptiness before no-follow removal. Fix round 1: passes the descriptor host to the root build-scratch cleaner; same registry, cgroup and derived path reads. file:Lstat@1638,file:ReadDir@2477,registry:Account@833,registry:App@871,registry:DemoExpiresAt@798,registry:DemoHost@676,registry:DemoID@655,registry:DemoLifetime@701,registry:HoldOp@762,registry:Status@734,whole:Route@1374,whole:Route@625 bbed24fd2c6a68a1a0038ef7b13817bb87b97564c15582401a4b61b4ea1fd316
internal/instancectl/demo_policy.go Server.demoCgroup legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Reads memory.max, cpu.weight, cpu.max and io.weight beneath root cgroupfs using platform-generated slice/unit names; checks both slice and unit before reporting started. file:ReadFile@395 734de40e9daa0756d5f1b9586aaa7c5810591e5525595e9bd888e7681dd2ca2b
-internal/instancectl/demo_policy.go Server.demoHandler legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Serializes demo-mode starts with demo purge; ordinary starts retain their existing unit locking. Uses the existing HostDemo callback to read the fixed service registry for a valid requested host in ordinary mode too; read errors and any demo-marked row refuse that start. Demo mode retains missing/non-demo/held-row refusals. No caller-named filesystem path is opened. file:Query@450,file:Query@490,registry:Status@707,whole:Route@662,whole:Route@738 201bc63347bee7b1bc354e11820e12e427b1573aa6fdf551ca43b6a66965e418
+internal/instancectl/demo_policy.go Server.demoHandler legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=R26: HostDemo and the demo start/purge lock run only in demo mode. Ordinary starts do not read HostDemo or gain its read-error refusal. Demo-mode missing/non-demo/held-row and read-error refusals remain. file:Query@463,file:Query@503,registry:Status@681,whole:Route@636 d2a425d9a0e187a7d36f5d98ca4c43457c2bf347beacf71cfc1ce0cb9560ad6d
internal/instancectl/demo_versions.go Server.purgeDemoVersions legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Derives account/app from root config and host; reads registry/live/generation pins and staged entries; deletes only unreferenced demo app files. Fix round 1: logs and skips ENOENT resolving another live link; other errors still refuse, same pin and symlink reads. file:EvalSymlinks@1980,file:ReadDir@1387,file:ReadDir@1850,registry:Account@2336,registry:App@2361,registry:Host@885,whole:Route@1221,whole:Route@2321,whole:Route@842,whole:Route@871,whole:Route@908,whole:Route@924,whole:Route@932 e7d139663a400bb09ef051ff764396000923fe321fb7a4c86bb697bd3f28d9de
internal/provision/demo_policy.go PolicyCache.AssertDemoRoute legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Reads route identity/runtime/placement, box configuration and verified cache entry under its mutex; refuses absent/expired/mismatched policy with no store request. registry:Account@656,registry:Account@870,registry:App@668,registry:App@882,registry:DemoExpiresAt@604,registry:DemoHost@553,registry:DemoID@536,registry:DemoLifetime@576,registry:DemoLifetime@685,registry:Host@374,registry:Host@676,registry:Kind@231,registry:Moved@386,registry:Region@462,registry:Replica@273,registry:Replicas@287,registry:Runtime@211,registry:Seed@308,registry:SeedSource@325,registry:Socket@348,registry:Unit@256 b8be2f735322dcd628e52e508d57644107fc3f7cf5c77568dd5252f9cc832dea
internal/provision/demo_policy.go stampDemoRoute legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-1;basis=Copies public descriptor fields from the already-read record into the route; no new external read. registry:DemoExpiresAt@130,registry:DemoHost@100,registry:DemoID@89,registry:DemoLifetime@113 bdea1bb5b22514d290b278ce4d4fb6025c5145c4c8d02c84da1f7bfb9079ecce
@@ -178,10 +182,10 @@ internal/provision/reconcile.go RouteFor authority C,E3 rev3=census-ruling-self-
@coverage internal/demobuild c01e441fb181ec2ed2671874d32d4db0291c5197d366c1744e9f7df02442fbb2
@coverage internal/domains 2e1fcc08678178e4b0fca9a1bf1b8e25cb7d17720f68f596e0af6b8e365fb3c0
@coverage internal/edge f43ea4eef8001f42945c1608d7e33e94fa0af57bae1a9810f99dd6ce7ab5df70
-@coverage internal/host 524a92580e7544b2a2fa685e795b6c7120ba513bedd02803925de838e9d5d22b
+@coverage internal/host 03ad30b99ebf8794208be0c6b983a7693998179c8b9f92c0c108099890f6b98e
@coverage internal/host/demo_units c6c9477377076760c308b460eee45f42f275476a3a919ada7f743fb68aac05c2
@coverage internal/host/units b1160033f0a1511ef378de68191240e89e9f2b54cb9c24e27bb8e675d5762035
-@coverage internal/instancectl b0e7221db94b3768bc0baf4f38af30cfde9d1883c3fb5768ec304799f05565bf
+@coverage internal/instancectl 1623eabcbfc99332887b0d8536ba05a6991b5a0e081ab325b686d5e885e29add
@coverage internal/provision aac23b6b9652d341c8098ff642aad56e085ce1ed00ca76c88b474caf0fd56b44
@coverage internal/registry b771760cec4f5814a844c447a453da6ed3bbcd3dd64cc9ab75feee72de4beaab
@coverage internal/release 9ba0535f01abd88e60c598593362d92e6c9fe33a675bfa1d939ca9b9db2ba511
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index c2603d5a7..1be2a69e0 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -60,4 +60,4 @@ plan14-root-reads-region-ha-p1b3a.tsv 5d20b3777026e43906bfba301186bce0ae58daa9d8
plan14-root-reads-stateless-replicas-1.tsv df8bf8056d80b9d78edc957fe7f2adbc75885e15f581e58167768346c4e05771
plan14-root-reads-domain-registration-1.tsv 8e7126042fef8cc99899a29e9e06c22763a24b6677110144035ec57fcc2de23e
plan14-root-reads-edge-held-streams.tsv c61b055182bf84e822fab92199432bd2d462c268c03ead17c3cfa18f09bd82cd
-plan14-root-reads-agent-start-demo-1.tsv 39197c39b76e49a8e06c46a8b42c091d842710ffed16fa67cdd283fd93da5033
+plan14-root-reads-agent-start-demo-1.tsv ccf8a0e5e838decf6ef5b2738fa10309537c1b2cdcbeea71ccab53e691352fa8