carlos / platform Public

G6 fence: census card and overlay (g6-fence)

make census-propose NAME=g6-fence: 7 changed units (activator
doWakeOnce, installProcLocked, wake, type Service,
haLeaseRefusalLocked; lease Held.Replicate; cli runRouteReplication)
and 5 new ones (replicationHARail; fencerun fenceSample,
newestL0Header, readAtMost, readCoverage). Agent-side code in the root
binary; no root read added. The fence reads the instance's own -wal and
litestream's local LTX files, as litestream does. Envelopes re-pinned:
., internal/activator, internal/lease. Seal ca2a9b1f. The reviewer
decides (#280). Re-propose with the same NAME after Task 6.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev dffabecff01cd343e75280ee7360a15b94fab954 parent b7438d5
3 files changed, +69 −0
  • docs/superpowers/notes/census-proposal-g6-fence.md +39 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0
  • internal/provision/testdata/plan14-root-reads-g6-fence.tsv +29 −0
diff --git a/docs/superpowers/notes/census-proposal-g6-fence.md b/docs/superpowers/notes/census-proposal-g6-fence.md
new file mode 100644
index 000000000..e5ccf26de
--- /dev/null
+++ b/docs/superpowers/notes/census-proposal-g6-fence.md
@@ -0,0 +1,39 @@
+# Census approval: g6-fence
+
+Ruling `census-ruling-g6-fence`. The independent reviewer approves or rejects every change below, 5 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+
+| unit | change | read sites | what changed |
+|---|---|---|---|
+| `internal/activator/activator.go` `Service.doWakeOnce` | body | unchanged (114) | G6 F-C Task 3, the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): right after retainDatabase returns, attaches the write-fence watcher under a.mu (watchWriteFenceLocked, in memory). retainDatabase is called through a retainDB test seam that is nil in production. No read added; no root call; existing acquire, restore, publisher and cleanup order unchanged. |
+| `internal/activator/activator.go` `Service.installProcLocked` | body | unchanged (1) | G6 F-C Task 3, the agent as carlos: calls watchWriteFenceLocked(e, e.rep), which starts the write-fence watcher for an armed HA replica not already watched (idempotent, in memory). No read added. |
+| `internal/activator/activator.go` `Service.wake` | body | unchanged (16) | G6 F-C Task 3, the agent as carlos: a wakeReturned test seam (nil in production) after doWake; on a failed wake of an entry the write fence marked (e.writeFenced, in memory) e.err wraps ErrHALeaseUnavailable; at the awake transition a marked entry begins the existing StopLeaseLost stop before e.ready closes. Only refuses and stops more; no read added; no kill, no root call. |
+| `internal/activator/activator.go` `type Service` | body | unchanged (0) | G6 F-C Task 3, the agent as carlos: four fields, fenceWatchers (sync.WaitGroup of running write-fence watchers) and three test seams nil in production (fenceWatchStarted, retainDB, wakeReturned). Declaration only, no read. |
+| `internal/activator/haleaseloss.go` `Service.haLeaseRefusalLocked` | body | unchanged (12) | G6 F-C Task 3 fix round 1, the agent as carlos: a waking entry the write fence marked (e.writeFenced, in memory) answers ErrHALeaseUnavailable at once, latching and beginning nothing, so the failed wake's cleanup stays the one stop owner. Only refuses more; no I/O. |
+| `internal/lease/lease.go` `Held.Replicate` | body | unchanged (1) | G6 F-C Task 2, the agent as carlos: for an HA lease at sync interval 0 only, wraps db.Replica.Client in the write fence's gate (fenceGate: cancels and refuses replica calls after the event, except the finalization's) before store.Open, and starts the fence goroutine (runFence) on db.WALPath(), the instance's own -wal; the Replicator gains done and fenced channels. The one site unchanged; no root read added; store setup, its steps and the transfer unchanged. |
+| `cli.go` `runRouteReplication` | sites | +registry:Host, +whole:Route | G6 F-C Task 4: calls replicationHARail(rt, class) right after replicationRail, before the "already" check, so carlos route --replication refuses batched and daily on an HA route. Adds a refusal only; +registry:Host and +whole:Route are the route already read here, handed to the rail; writes nothing more. |
+
+Envelopes re-pinned: `.`, `internal/activator`, `internal/lease`.
+
+Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner.
+
+Recorded dispositions, which each change must still satisfy:
+
+- `internal/activator/activator.go` `Service.doWakeOnce`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: The former doWake body, not deleted logic: refresh/admit/fence/layout checks remain. Select and verify the actual staged identity before serving Acquire; use canonical mode to call doStatelessWake. Keep SQLite acquire/restore/seed/marker/replicate only in the stateful arm, with the post-acquisition selection recheck and existing cleanup proofs. Fix 3a round 1 I1/I3a: admit config directly only for stateless and mark runtime ownership refusals. Stateful Acquire/Restore precede selection and pending publication; canonical mode inspection is separate, replan precedes settlement. Fix round 2 N2/N3: retain the original route/pin projection for post-lease declaration checks; reuse the unplanned capture so a live-link repoint cannot change the selected build. Stateful capture and changed-copy errors remain start failures after Acquire/Restore. A failed preliminary verification supplies no cached mode observation. No new file path or database authority. Final review C1/R26: unprojected stateful wakes capture and materialize the live link only after Acquire and Restore. Retain original route/generation/pin stateless evidence on the context across fallback, so missing stateless evidence cannot take stateful recovery inference. Known good stateful identity skips canonical declaration lookup. Existing pre-exec verification remains. R28 final fix 2: carry whether this wake has a plan in attempt-local context; no new read here; route, generation and pin stateless projection remains intact.;rev3=census-ruling-agent-start-demo-1;basis=Reads IsDemo and demo admission/capability state; chooses local lease retention, skips seed upload and sidecar selection. Existing stop and under-lease ordering retained.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: refuse tenant starts under the existing service lock before main's demoWakeRefusal, and recheck before backend Acquire. Retain main's demo refusal and all lease, restore and serialization checks. Two added whole Route uses feed the in-memory admission predicate; no new filesystem or store read.;rev3=census-ruling-stateless-replicas-2;basis=P14: after verified storage-mode selection, before clearing the projected hint or acquiring a database lease, a set row still on the stateful branch returns ErrFenced. Reads the existing route FleetBoxes field only. Verified stateless wakes take their existing branch; legacy rows remain unchanged. No new file, registry query or bucket read. merge of origin/main 9b8b2c50: retain wake-slot and HA duty logic alongside the replica stateful-start refusal; no gate removed. merge of origin/main 6be08467: Keep main demo lease, local database and KeepLocal path; never equate replication-disabled demos with stateless generations. Merge-only body/read-site change. merge of origin/main 7920cccf: Retain main tenant admission and startOwnedLocked gates alongside the replica stateful-start refusal; whole Route passed to main admission checks, no new path or store read.;rev3=census-ruling-agent-start-demo-3;basis=Route claim seeds through seed restore/admission; do not fall back to empty boot or ordinary import behavior. Census read-site delta: +registry:SeedSource, +whole:Route.;rev3=census-ruling-region-ha-g2-fixes;basis=Bound recovery Acquire by its attempt deadline; existing acquire/restore/start ordering remains; no new read.
+- `internal/activator/activator.go` `Service.installProcLocked`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 8: the one place a process, its generation and the lease replica are installed on an entry; a resident is put under its lease watch (watchResidentLeaseLocked) at that moment; reads only the entry's route;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a (Call A1, Astra R1 P1-1): the lease watch is installed for every rootfs row (e.route.Rootfs()), not only a resident, so a hibernating rootfs row's run or session is reached at the lease's loss; the same one read of the entry's route; installs nothing else;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Install the local lifecycle channel with the actual generation. The serving-lease watch remains separate and is skipped for stateless generations; command/worker/stop ownership remains local.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): when the installed generation number differs from the current one, calls a.cancelHeldLegsLocked(e, e.gen.N) under a.mu before the switch, cancelling only the legs admitted on the generation that stops being current. Cancel funcs only; no read added.
+- `internal/activator/activator.go` `Service.wake`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-carlos-run;basis=Re-digested at the pre-land merge: the body includes main's own change under census ruling 292, with no further change from this branch. the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body; the stop now carries its reason for a run it interrupts (beginStopLocked's why argument); read sites unchanged, offsets moved;rev3=census-ruling-wake-latency-1;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=logs that timer's breakdown to the journal after a successful wake (w.steps.String(), e.host, w.wakeTook); no read added;rev3=census-ruling-plans-4d-lapse;basis=cancels a wake whose row the turned-off hook names, like a fence, unless it is a move's active probe (plans 4d). One more whole-row read: the row handed to the hook (a.disabled). Only refuses.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: a refusal before the lease is reported once per change (noteRootfsRefusal) instead of a wake-failure event; the proc, generation and replica are installed through installProcLocked (which puts a resident under its lease watch before the fence); residency notes the outcome (noteResidentWakeLocked); same generation values;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R [pf R3.5]: the wake's context ceiling is wakeCeilingFor(e.route): the old 5 minutes for a binary row, 5 minutes plus runs.MaxTimeout for a rootfs row (room for a release inside the wake); new site +whole:Route (e.route to wakeCeilingFor, which reads Runtime only); no other change;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (branch review R1 P1-1): the wake's context is also cancelled before doWake when RetireExcept has marked the entry retired (e.retired, in memory under a.mu), as it is for a fence or a shutdown. Read sites unchanged (13). Agent, not root; it only refuses more.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Carry successful hold preparation into its wake, preserve actual mode in the generation and OnWake projection, and project serving version/mode through the narrow registry writer before releasing wake waiters. Final review I1: SetServingMode only for non-worker successful wakes with a nonempty spawned version and either a stateless generation or a mode transition from the route. Ordinary stateful wakes leave rollout status and the wake critical path unchanged.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): adds a.cancelHeldLegsLocked(e, 0) on the failed-wake path before the entry is deleted, and after close(e.ready) on success calls a.noteHeldAdmissible(e.host), the non-blocking held wake callback, outside a.mu. No read added.;rev3=census-ruling-wake-storm-cap;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): waits for a box-wide wake slot (acquireWakeSlot, an in-memory buffered channel) before doWake; the fence/shutdown/retired/disabled refusals move into refuseWakeLocked and are asked again after admission (one fewer direct whole-Route read here: a.disabled(e.route) now runs inside refuseWakeLocked, same value); e.wakeStart is set at admission and e.admitted marks it. Only waits and refuses more; no new read.;rev3=census-ruling-region-ha-p1b3b-t;basis=Install the successful-acquire observer and restrict due, worker and resident starts before doWake, off a.mu. Add a whole-route argument to restriction; refused work has known-no-start evidence.;rev3=census-ruling-region-ha-g2-fixes;basis=Bind recovery wakes to the service lifetime; no new read.;rev3=census-ruling-edge-page-cache-1;basis=the generation-current call is now noteCurrent(e) instead of noteCurrent(e.host, e.gen.N), so the new noteCurrent can also publish the process's page cache launch inputs; read sites unchanged (16); no read added;rev3=census-ruling-fix-silent-start-kill-861;basis=#861: a failed wake that journalledWakeFailure counts as a real failure is logged through logWakeFailure (rate-limited per host, in memory); a successful wake calls clearWakeFailure. Agent, not root; reads the error already in hand; no read added;rev3=census-ruling-stateless-replicas-4-task5;basis=Task 5 first commit (#511 F11 log dedupe): before a failed wake's member event, noteHeldWake (in-memory, per host, under the leaf wakeFailMu) tells whether the failure is held by a release attempt with no backoff and is the same (attempt ID, error class) as the host's last one; a repeat writes no event, a first or changed one writes one journal line and the event. Reads only the error in hand; no read site added.;rev3=census-ruling-stateless-replicas-4-merge-main;basis=Merge of main 5fac2ff1: both sides changed it. Main (27d3f501, activator-settle-wait) adds the background counter increment and deferred decrement at entry; this branch (Task 5) keeps its own changes. Both kept as-is; no read added.
+- `internal/activator/activator.go` `type Service`: authority, task B,C,D,F,J4. Basis: rev3=PROPOSED-seed; existing activator lifecycle and due-wake state plus owned seed exclusion and incarnation-keyed diagnostics; normal refusal and preparation ordering remain authoritative; PROPOSED-plans-2-box-limits adds the idleFor hook field, which only narrows idle windows;rev3=census-ruling-plans-4c-box-throttle;basis=gains the maxRunFor hook field beside idleFor (plans 4c). No read added.;rev3=census-ruling-plans-4d-lapse;basis=gains the disabledFor hook field beside maxRunFor (plans 4d). No read added.;rev3=census-ruling-remote-instance-metrics;basis=gains tenancySeq, hostTenants and hostMixed, in-memory fields for Tenancies; no read added;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: one more field, markers (markerRetry: an atomic running flag and the last log time) for retryOwedMarkers; no read added; merge of origin/main d7ae1d76: main's fields are kept as main has them (census-ruling-remote-instance-metrics: tenancySeq, hostTenants, hostMixed); this branch's change is the same as above;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: new fields for rootfs admission (rootfsArmed, rootfsSwept), the per-host gate ask and refusal memo, and residency state (lister, backoff, start ceiling, cursor, test seam); no read;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R: one new field, releaseOps (host to the in-memory release record, under a.mu); no read;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W: one new field, leaseNow (a clock seam for a worker start's headroom against the lease deadline, nil is the real clock); no read;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2: gains the holder cache and its single-flight state; no read;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): one field, Fleet (activator.FleetWake: the box's fleet state, not on a fleet by default, on a fleet with a known label and a record reader, or on a fleet with an invalid identity), set by the agent before Start and read only by routeCurrentUnderLease. No read in the declaration. Agent, not root.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a fix round 1: one field, drainBudget (time.Duration), which New copies from residentDrainBudget and a rootfs entry's lease watch reads in its place, so a test's change of the package var never races a watch goroutine; declaration only, reads nothing; merge of origin/main 6f1f6ca6: main's one field, Fleet (activator.FleetWake), is kept as main has it (census-ruling-managed-fleets-1b); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b3a;basis=Add bounded placement peer and diagnostic state and the over-capacity callback; no read in this declaration and no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Add coordinator, existing-record observation callback and per-host preparation locks; no read in the declaration. Task 3a: Add optional canonical storage-selection and durable deploy-ID callbacks; declaration only, no read or authority in these fields.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): adds the heldLegs map to actEntry (legs by id, under a.mu) and heldWakeHook (atomic pointer to a callback) and heldLegSeq (atomic counter) to Service. State only, in memory; no read of tenant, app or box-agent-writable input.;rev3=census-ruling-wake-storm-cap;basis=the agent as carlos: one field, wakeSlots (chan struct{}, the wake semaphore made by New from Config.WakeSlots, default 4); declaration only, no read.;rev3=census-ruling-region-ha-p1b3b-t;basis=Add the B2 DutyStore interface field and process-local duty view, suppression and invalidation state. No read added. B2 adds the verified-successor identity callback; no read in the declaration. B3b adds a nonblocking departure-suspicion callback, invoked only after an accepted holder-forward failure and after cache locks release; it cannot authorize a take.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: immutable callbacks installed before Start for tenant admission, local start permission, fixed route exemptions and shutdown closure; nil callbacks preserve switch-off behavior; no new reads. Fix R1: add an immutable startup-phase callback for response copy, set before service startup. No new read or execution authority.;rev3=census-ruling-region-ha-g2-fixes;basis=Add in-memory HA loss state and pool withdrawal jobs; no new read.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 1: one new field, drain (drainSources: two atomic func pointers for this box's and peers' drain state); no read added. region HA held-requests Task 2: one new field, moves (moveTable: per-host move state, hold counts and admission tickets in memory, under mu); no read added;rev3=census-ruling-held-move-speed;basis=the agent as carlos: one new field, moveStreams (per-host in-memory set of edge.StreamEnd for requests in flight, own mutex), for the move's early stream cut; actEntry gains drainRelease (bool, under a.mu), set by DrainStop; declarations only, no read added;rev3=census-ruling-fix-silent-start-kill-861;basis=#861: two fields, wakeFailMu and wakeFailLogged (per-host in-memory note of the last journalled wake failure); declaration only, no read;rev3=census-ruling-w6-ingress-drain;basis=new field TenantStartsClosed func() bool; when it answers true tenantStartRefusal refuses every start, exempt routes included. Wired only by fixedAdmission.bind to the ingress drain's closed flag. Struct field only; no read added.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: one field, replicaPolicies (host to the newest observed replica deploy and this box label, under mu), set only by SetReplicaDeploy; declaration only, no read.;rev3=census-ruling-stateless-replicas-4-task2-fix1;basis=Task 2 fix round 1: one more in-memory field, replicaFailed (host to the permit whose successor failed here, under mu), so that step only proves what it kept; declaration only, no read.;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix round 3 (#511 F11): two hook fields, MarkReplicaRelease and ReplicaReleaseMark (the failure book's per-host release mark on this box's disk). No read site.;rev3=census-ruling-stateless-replicas-4-task5;basis=Task 5 first commit (#511 F11): one in-memory field, heldSeen (host to the last held release attempt, error class and when it was met), under the existing wakeFailMu. Declaration only, no read.;rev3=census-ruling-stateless-replicas-4-merge-main;basis=Merge of main 5fac2ff1: both sides changed it. Main (27d3f501) adds the background atomic.Int64 field that tests wait on; this branch keeps its replica fields. Both kept as-is; no read added.;rev3=census-ruling-stateless-replicas-4-final;basis=#511 final wave item 3: adds replicaSwitched, an in-memory map of the permit each set row switched under (host -> permit key, time, resident flag); no read added; #511 micro-fix P1b: adds replicaNoGen, an in-memory map (host -> permit key and when first seen) that is only the bound's clock for a restarted permit holder with no generation; no read added;rev3=census-ruling-stateless-replicas-4-drill1;basis=#511 drill 1 R20 bound (round 1: clock with start and last seen): one in-memory field, releaseConfigWaits (per host, a stateless release's config wait), under mu; no read;rev3=census-ruling-stateless-replicas-4-r28;basis=R28 review round 2 (#511): one field, retiringCopy, an atomic pointer to the edge's in-memory retired-copy check, handed over by edge.New (SetRetiringCopy); no read, no root decision
+- `internal/activator/haleaseloss.go` `Service.haLeaseRefusalLocked`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-region-ha-g2-fixes;basis=Inspect cached entry health and startup obligations; on an ineligible box discard only startup-only losses with no old entry, recovery or running worker, and skip relatching them. Real entry losses retain refusal; owed release retry remains independent; no I/O.
+- `internal/lease/lease.go` `Held.Replicate`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: the Replicator it returns also carries the handle's ha flag, marker base and region, so an HA replicator releases through the marker only; the store setup, its five steps and the transfer are unchanged; the one site unchanged, no read added
+- `cli.go` `runRouteReplication`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 3 FPR-C01: the write error goes through refuseForwardWrite, so a forward row that took the host after the read also answers FPR-C01 (+registry:Host, the host it names). A refusal only; reads the agent-written row to refuse, writes nothing more.
+
+New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff:
+
+- new `cli.go:replicationHARail`: reads +registry:HA, +registry:Host; written legacy, accepted-legacy, frozen
+- new `internal/lease/fencerun.go:Replicator.fenceSample`: reads +file:Stat; written legacy, accepted-legacy, frozen
+- new `internal/lease/fencerun.go:Replicator.newestL0Header`: reads +file:Open; written legacy, accepted-legacy, frozen
+- new `internal/lease/fencerun.go:readAtMost`: reads +file:ReadAt; written legacy, accepted-legacy, frozen
+- new `internal/lease/fencerun.go:readCoverage`: reads +file:Open; written legacy, accepted-legacy, frozen
+
+Seal: `55d66980f8db645c762b56e20b5eabba09d8e1f2ab79de5e089ff087ad677bc3` → `ca2a9b1fc24a51311c8d50febcb8d362f181ed39b64e861e60dc4b849ff30152`.
+
+Overlay: `internal/provision/testdata/plan14-root-reads-g6-fence.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index ee4b1b063..d3017d882 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -197,3 +197,4 @@ plan14-root-reads-stateless-replicas-4-merge-main2.tsv 5889e1513a21733385ef3926d
plan14-root-reads-stateless-replicas-4-drill3.tsv d0773df1895af8ab5e402e9caceb90e571ea300eb19fd3b50abb2041783d1d08
plan14-root-reads-stateless-replicas-4-r28.tsv 55d66980f8db645c762b56e20b5eabba09d8e1f2ab79de5e089ff087ad677bc3
plan14-root-reads-stateless-replicas-4-merge-main3.tsv 55d66980f8db645c762b56e20b5eabba09d8e1f2ab79de5e089ff087ad677bc3
+plan14-root-reads-g6-fence.tsv ca2a9b1fc24a51311c8d50febcb8d362f181ed39b64e861e60dc4b849ff30152
diff --git a/internal/provision/testdata/plan14-root-reads-g6-fence.tsv b/internal/provision/testdata/plan14-root-reads-g6-fence.tsv
new file mode 100644
index 000000000..78c96077b
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-g6-fence.tsv
@@ -0,0 +1,29 @@
+# Census overlay g6-fence, written by census-propose (#369). census-ruling-g6-fence, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-g6-fence.md.
+# 6 body, 1 sites, 3 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 5 new dispositions: 0 reads re-frozen at their disposition with the claim, 5 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other.
+@legacy 1580f79e4d3fba3a1ddb58276108985dd65b7a862e22e80cd76949e8c7923fbb internal/activator/activator.go Service.doWakeOnce legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: The former doWake body, not deleted logic: refresh/admit/fence/layout checks remain. Select and verify the actual staged identity before serving Acquire; use canonical mode to call doStatelessWake. Keep SQLite acquire/restore/seed/marker/replicate only in the stateful arm, with the post-acquisition selection recheck and existing cleanup proofs. Fix 3a round 1 I1/I3a: admit config directly only for stateless and mark runtime ownership refusals. Stateful Acquire/Restore precede selection and pending publication; canonical mode inspection is separate, replan precedes settlement. Fix round 2 N2/N3: retain the original route/pin projection for post-lease declaration checks; reuse the unplanned capture so a live-link repoint cannot change the selected build. Stateful capture and changed-copy errors remain start failures after Acquire/Restore. A failed preliminary verification supplies no cached mode observation. No new file path or database authority. Final review C1/R26: unprojected stateful wakes capture and materialize the live link only after Acquire and Restore. Retain original route/generation/pin stateless evidence on the context across fallback, so missing stateless evidence cannot take stateful recovery inference. Known good stateful identity skips canonical declaration lookup. Existing pre-exec verification remains. R28 final fix 2: carry whether this wake has a plan in attempt-local context; no new read here; route, generation and pin stateless projection remains intact.;rev3=census-ruling-agent-start-demo-1;basis=Reads IsDemo and demo admission/capability state; chooses local lease retention, skips seed upload and sidecar selection. Existing stop and under-lease ordering retained.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: refuse tenant starts under the existing service lock before main's demoWakeRefusal, and recheck before backend Acquire. Retain main's demo refusal and all lease, restore and serialization checks. Two added whole Route uses feed the in-memory admission predicate; no new filesystem or store read.;rev3=census-ruling-stateless-replicas-2;basis=P14: after verified storage-mode selection, before clearing the projected hint or acquiring a database lease, a set row still on the stateful branch returns ErrFenced. Reads the existing route FleetBoxes field only. Verified stateless wakes take their existing branch; legacy rows remain unchanged. No new file, registry query or bucket read. merge of origin/main 9b8b2c50: retain wake-slot and HA duty logic alongside the replica stateful-start refusal; no gate removed. merge of origin/main 6be08467: Keep main demo lease, local database and KeepLocal path; never equate replication-disabled demos with stateless generations. Merge-only body/read-site change. merge of origin/main 7920cccf: Retain main tenant admission and startOwnedLocked gates alongside the replica stateful-start refusal; whole Route passed to main admission checks, no new path or store read.;rev3=census-ruling-agent-start-demo-3;basis=Route claim seeds through seed restore/admission; do not fall back to empty boot or ordinary import behavior. Census read-site delta: +registry:SeedSource, +whole:Route.;rev3=census-ruling-region-ha-g2-fixes;basis=Bound recovery Acquire by its attempt deadline; existing acquire/restore/start ordering remains; no new read.;rev3=census-ruling-g6-fence;basis=G6 F-C Task 3, the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): right after retainDatabase returns, attaches the write-fence watcher under a.mu (watchWriteFenceLocked, in memory). retainDatabase is called through a retainDB test seam that is nil in production. No read added; no root call; existing acquire, restore, publisher and cleanup order unchanged. registry:DBPath@2071,registry:DBPath@2087,registry:DBPath@2214,registry:DBPath@2225,registry:FleetBoxes@12064,registry:GoodVersion@18354,registry:Host@1900,registry:Host@1975,registry:Host@2053,registry:Host@2205,registry:Host@2539,registry:Host@4556,registry:Host@6813,registry:Host@949,registry:Replication@16981,registry:Replication@17110,registry:Replication@17129,registry:Replication@17210,registry:Replication@33283,registry:Seed@22049,registry:SeedSource@34743,registry:Socket@2100,registry:Socket@2116,registry:Socket@2239,registry:Socket@2250,registry:Stateless@10124,registry:Stateless@10410,registry:Stateless@11782,registry:Stateless@12112,registry:Stateless@20763,registry:Stateless@9667,registry:Stateless@9758,whole:Route@10196,whole:Route@10355,whole:Route@10734,whole:Route@10832,whole:Route@10923,whole:Route@11055,whole:Route@11178,whole:Route@11232,whole:Route@11504,whole:Route@11680,whole:Route@11684,whole:Route@12471,whole:Route@12746,whole:Route@13064,whole:Route@142,whole:Route@14525,whole:Route@15202,whole:Route@16083,whole:Route@16961,whole:Route@17212,whole:Route@18557,whole:Route@19148,whole:Route@19313,whole:Route@1998,whole:Route@20249,whole:Route@21045,whole:Route@21320,whole:Route@22150,whole:Route@22221,whole:Route@2434,whole:Route@2439,whole:Route@24633,whole:Route@2493,whole:Route@2499,whole:Route@2565,whole:Route@2573,whole:Route@2629,whole:Route@26491,whole:Route@27137,whole:Route@28444,whole:Route@28598,whole:Route@29097,whole:Route@29167,whole:Route@29754,whole:Route@30839,whole:Route@31270,whole:Route@31478,whole:Route@31532,whole:Route@32461,whole:Route@32646,whole:Route@333,whole:Route@33446,whole:Route@33517,whole:Route@34235,whole:Route@34284,whole:Route@34678,whole:Route@34860,whole:Route@3591,whole:Route@36112,whole:Route@36207,whole:Route@3685,whole:Route@37048,whole:Route@3752,whole:Route@4446,whole:Route@6182,whole:Route@6441,whole:Route@6703,whole:Route@6708,whole:Route@6765,whole:Route@6771,whole:Route@6840,whole:Route@6848,whole:Route@7164,whole:Route@7225,whole:Route@729,whole:Route@7323,whole:Route@8288,whole:Route@9271,whole:Route@934,whole:Route@9495,whole:Route@9559,whole:Route@9603 e5b4329cb5776f90db870f240b00f8035a0a31e055028d77b32237ac19b4c912
+@legacy d4dab6d3b1d7982176fb43f7230f80c263a94b2b95481d499169f7541879ce5a internal/activator/activator.go Service.installProcLocked legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 8: the one place a process, its generation and the lease replica are installed on an entry; a resident is put under its lease watch (watchResidentLeaseLocked) at that moment; reads only the entry's route;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a (Call A1, Astra R1 P1-1): the lease watch is installed for every rootfs row (e.route.Rootfs()), not only a resident, so a hibernating rootfs row's run or session is reached at the lease's loss; the same one read of the entry's route; installs nothing else;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Install the local lifecycle channel with the actual generation. The serving-lease watch remains separate and is skipped for stateless generations; command/worker/stop ownership remains local.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): when the installed generation number differs from the current one, calls a.cancelHeldLegsLocked(e, e.gen.N) under a.mu before the switch, cancelling only the legs admitted on the generation that stops being current. Cancel funcs only; no read added.;rev3=census-ruling-g6-fence;basis=G6 F-C Task 3, the agent as carlos: calls watchWriteFenceLocked(e, e.rep), which starts the write-fence watcher for an armed HA replica not already watched (idempotent, in memory). No read added. whole:Route@515 a1cee25e2e3e7792f9ff7b6bb490b711c4083eb1d66d270b362c41acce68675a
+@legacy 2fa29d1065cffe4361cac36f9627231fc0c7393dff93b3e0db9933d080e6edf9 internal/activator/activator.go Service.wake legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=Re-digested at the pre-land merge: the body includes main's own change under census ruling 292, with no further change from this branch. the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body; the stop now carries its reason for a run it interrupts (beginStopLocked's why argument); read sites unchanged, offsets moved;rev3=census-ruling-wake-latency-1;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=logs that timer's breakdown to the journal after a successful wake (w.steps.String(), e.host, w.wakeTook); no read added;rev3=census-ruling-plans-4d-lapse;basis=cancels a wake whose row the turned-off hook names, like a fence, unless it is a move's active probe (plans 4d). One more whole-row read: the row handed to the hook (a.disabled). Only refuses.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: a refusal before the lease is reported once per change (noteRootfsRefusal) instead of a wake-failure event; the proc, generation and replica are installed through installProcLocked (which puts a resident under its lease watch before the fence); residency notes the outcome (noteResidentWakeLocked); same generation values;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R [pf R3.5]: the wake's context ceiling is wakeCeilingFor(e.route): the old 5 minutes for a binary row, 5 minutes plus runs.MaxTimeout for a rootfs row (room for a release inside the wake); new site +whole:Route (e.route to wakeCeilingFor, which reads Runtime only); no other change;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (branch review R1 P1-1): the wake's context is also cancelled before doWake when RetireExcept has marked the entry retired (e.retired, in memory under a.mu), as it is for a fence or a shutdown. Read sites unchanged (13). Agent, not root; it only refuses more.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Carry successful hold preparation into its wake, preserve actual mode in the generation and OnWake projection, and project serving version/mode through the narrow registry writer before releasing wake waiters. Final review I1: SetServingMode only for non-worker successful wakes with a nonempty spawned version and either a stateless generation or a mode transition from the route. Ordinary stateful wakes leave rollout status and the wake critical path unchanged.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): adds a.cancelHeldLegsLocked(e, 0) on the failed-wake path before the entry is deleted, and after close(e.ready) on success calls a.noteHeldAdmissible(e.host), the non-blocking held wake callback, outside a.mu. No read added.;rev3=census-ruling-wake-storm-cap;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): waits for a box-wide wake slot (acquireWakeSlot, an in-memory buffered channel) before doWake; the fence/shutdown/retired/disabled refusals move into refuseWakeLocked and are asked again after admission (one fewer direct whole-Route read here: a.disabled(e.route) now runs inside refuseWakeLocked, same value); e.wakeStart is set at admission and e.admitted marks it. Only waits and refuses more; no new read.;rev3=census-ruling-region-ha-p1b3b-t;basis=Install the successful-acquire observer and restrict due, worker and resident starts before doWake, off a.mu. Add a whole-route argument to restriction; refused work has known-no-start evidence.;rev3=census-ruling-region-ha-g2-fixes;basis=Bind recovery wakes to the service lifetime; no new read.;rev3=census-ruling-edge-page-cache-1;basis=the generation-current call is now noteCurrent(e) instead of noteCurrent(e.host, e.gen.N), so the new noteCurrent can also publish the process's page cache launch inputs; read sites unchanged (16); no read added;rev3=census-ruling-fix-silent-start-kill-861;basis=#861: a failed wake that journalledWakeFailure counts as a real failure is logged through logWakeFailure (rate-limited per host, in memory); a successful wake calls clearWakeFailure. Agent, not root; reads the error already in hand; no read added;rev3=census-ruling-stateless-replicas-4-task5;basis=Task 5 first commit (#511 F11 log dedupe): before a failed wake's member event, noteHeldWake (in-memory, per host, under the leaf wakeFailMu) tells whether the failure is held by a release attempt with no backoff and is the same (attempt ID, error class) as the host's last one; a repeat writes no event, a first or changed one writes one journal line and the event. Reads only the error in hand; no read site added.;rev3=census-ruling-stateless-replicas-4-merge-main;basis=Merge of main 5fac2ff1: both sides changed it. Main (27d3f501, activator-settle-wait) adds the background counter increment and deferred decrement at entry; this branch (Task 5) keeps its own changes. Both kept as-is; no read added.;rev3=census-ruling-g6-fence;basis=G6 F-C Task 3, the agent as carlos: a wakeReturned test seam (nil in production) after doWake; on a failed wake of an entry the write fence marked (e.writeFenced, in memory) e.err wraps ErrHALeaseUnavailable; at the awake transition a marked entry begins the existing StopLeaseLost stop before e.ready closes. Only refuses and stops more; no read added; no kill, no root call. registry:Socket@9213,registry:Socket@9374,registry:Stateless@11082,registry:Stateless@11830,whole:Route@11073,whole:Route@11128,whole:Route@11832,whole:Route@1811,whole:Route@3420,whole:Route@3693,whole:Route@3850,whole:Route@515,whole:Route@7475,whole:Route@9166,whole:Route@9215,whole:Route@9376 980d3976d7eb770e1454d22ab02ba47f23624a58d3b4d50e661ac858aedabe4d
+@legacy 618dcb71a6fcb456c240d28e574076d70bd8f2f1be0b688fe36c6a140b469117 internal/activator/haleaseloss.go Service.haLeaseRefusalLocked legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-g2-fixes;basis=Inspect cached entry health and startup obligations; on an ineligible box discard only startup-only losses with no old entry, recovery or running worker, and skip relatching them. Real entry losses retain refusal; owed release retry remains independent; no I/O.;rev3=census-ruling-g6-fence;basis=G6 F-C Task 3 fix round 1, the agent as carlos: a waking entry the write fence marked (e.writeFenced, in memory) answers ErrHALeaseUnavailable at once, latching and beginning nothing, so the failed wake's cleanup stays the one stop owner. Only refuses more; no I/O. registry:HA@390,registry:Host@1307,registry:Host@742,registry:Host@82,registry:Host@840,registry:Host@873,registry:Host@962,whole:Route@1051,whole:Route@1331,whole:Route@1338,whole:Route@392,whole:Route@711 59829e16e5a8fa4c32d475378a966093a97014205047c410df38f0cd587a6261
+@legacy 86105f8e9ea88e2d0d6030ef42c340839775ab9becf67937b154baa4f7e40ee9 internal/lease/lease.go Held.Replicate legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: the Replicator it returns also carries the handle's ha flag, marker base and region, so an HA replicator releases through the marker only; the store setup, its five steps and the transfer are unchanged; the one site unchanged, no read added;rev3=census-ruling-g6-fence;basis=G6 F-C Task 2, the agent as carlos: for an HA lease at sync interval 0 only, wraps db.Replica.Client in the write fence's gate (fenceGate: cancels and refuses replica calls after the event, except the finalization's) before store.Open, and starts the fence goroutine (runFence) on db.WALPath(), the instance's own -wal; the Replicator gains done and fenced channels. The one site unchanged; no root read added; store setup, its steps and the transfer unchanged. file:Open@785 34f34c99b2bf7c33578cf903cc6ee8b1ceed4b4cf730cd60098531caa8ad3f57
+@legacy 30fff700b590741f73b8cafe17e33d290454cd79fbbe3a569a5b4cb498cd5450 cli.go replicationHARail legacy accepted-legacy accepted-legacy;rev3=census-ruling-g6-fence;basis=G6 F-C Task 4, new: reads the route's HA and Host fields (already in hand) to refuse batched and daily on an HA route with a COPY-PENDING message. A refusal only; no file, store or registry read beyond the row passed in; writes nothing. registry:HA@68,registry:Host@206 786c8bfcfa25d7b5a9bae330ca5ed6a30cbc6c990ccaa2b8aa46b9c53fae73d9
+@legacy 1005316e6423c665740d0df426f3133b17b798d3b7826046a80b634d8f67c2ed internal/lease/fencerun.go Replicator.fenceSample legacy accepted-legacy accepted-legacy;rev3=census-ruling-g6-fence;basis=G6 F-C Task 2, new, the agent as carlos: once a second, litestream's in-memory positions (DB.Pos, Replica.Pos) and one os.Stat of the instance's own -wal (the path litestream's DB.WALPath gives for the database this replicator owns). A missing file is a state. No root read; no store request. file:Stat@215 9c1527035e87f9f96eaf15cfd00de15904cd115d0f0be8f20642c1bbb4579b37
+@legacy deb0eac5564d42fa2d62088ca8e0bf56e7a267b04e6097c7647af961402c8dce internal/lease/fencerun.go Replicator.newestL0Header legacy accepted-legacy accepted-legacy;rev3=census-ruling-g6-fence;basis=G6 F-C Task 2, new, the agent as carlos: opens litestream's own newest local L0 LTX file (db.LTXPath from db.MaxLTX) and decodes only its header, as litestream already does for DB.Pos. No root read; no store request. file:Open@190 8fd156b22a809031adea376b88f7934c5b428ea10c31e95035a18221d8750bec
+@legacy 671411df8c65926a8267589577b4e9d580524181c2eaf02560865a7ad83722d9 internal/lease/fencerun.go readAtMost legacy accepted-legacy accepted-legacy;rev3=census-ruling-g6-fence;basis=G6 F-C Task 2, new: ReadAt of up to n bytes on a file readCoverage has already opened (the instance's -wal); EOF short of n is not an error. No path of its own. file:ReadAt@98 23fd7a6f2dc966a1e729638d60252c4c3569b70d8399419e67c193bb995e535f
+@legacy bea0d6e21881236fa5bf0ca47ea60ea2d591d4f5ed343a646ffaf0c6d60e8d50 internal/lease/fencerun.go readCoverage legacy accepted-legacy accepted-legacy;rev3=census-ruling-g6-fence;basis=G6 F-C Task 2, new, the agent as carlos: opens the instance's own -wal and reads its 32-byte header and 24 bytes at the newest L0 LTX file's captured end, to decide whether the WAL is all captured (walCovered). Local files litestream itself reads; no root read; no store request. file:Open@324 a1b07fd6f90b23e5ccd442438099022fec864ef3c054aa65eeaf828134718c69
+@legacy c989da0f1c588dbbcfe89a4a38175eedf374e4f392d8061304c64a4bd641df91 cli.go runRouteReplication legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 3 FPR-C01: the write error goes through refuseForwardWrite, so a forward row that took the host after the read also answers FPR-C01 (+registry:Host, the host it names). A refusal only; reads the agent-written row to refuse, writes nothing more.;rev3=census-ruling-g6-fence;basis=G6 F-C Task 4: calls replicationHARail(rt, class) right after replicationRail, before the "already" check, so carlos route --replication refuses batched and daily on an HA route. Adds a refusal only; +registry:Host and +whole:Route are the route already read here, handed to the rail; writes nothing more. registry:Host@170,registry:Host@271,registry:Host@473,registry:Host@561,registry:Host@647,registry:Host@721,registry:Replication@377,registry:Replication@746,whole:Route@122,whole:Route@216 161cf922d59668b9e0b06f59bae08502577e0a2bcc15f7c94709477c252b5702
+internal/activator/activator.go Service.doWakeOnce legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: The former doWake body, not deleted logic: refresh/admit/fence/layout checks remain. Select and verify the actual staged identity before serving Acquire; use canonical mode to call doStatelessWake. Keep SQLite acquire/restore/seed/marker/replicate only in the stateful arm, with the post-acquisition selection recheck and existing cleanup proofs. Fix 3a round 1 I1/I3a: admit config directly only for stateless and mark runtime ownership refusals. Stateful Acquire/Restore precede selection and pending publication; canonical mode inspection is separate, replan precedes settlement. Fix round 2 N2/N3: retain the original route/pin projection for post-lease declaration checks; reuse the unplanned capture so a live-link repoint cannot change the selected build. Stateful capture and changed-copy errors remain start failures after Acquire/Restore. A failed preliminary verification supplies no cached mode observation. No new file path or database authority. Final review C1/R26: unprojected stateful wakes capture and materialize the live link only after Acquire and Restore. Retain original route/generation/pin stateless evidence on the context across fallback, so missing stateless evidence cannot take stateful recovery inference. Known good stateful identity skips canonical declaration lookup. Existing pre-exec verification remains. R28 final fix 2: carry whether this wake has a plan in attempt-local context; no new read here; route, generation and pin stateless projection remains intact.;rev3=census-ruling-agent-start-demo-1;basis=Reads IsDemo and demo admission/capability state; chooses local lease retention, skips seed upload and sidecar selection. Existing stop and under-lease ordering retained.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: refuse tenant starts under the existing service lock before main's demoWakeRefusal, and recheck before backend Acquire. Retain main's demo refusal and all lease, restore and serialization checks. Two added whole Route uses feed the in-memory admission predicate; no new filesystem or store read.;rev3=census-ruling-stateless-replicas-2;basis=P14: after verified storage-mode selection, before clearing the projected hint or acquiring a database lease, a set row still on the stateful branch returns ErrFenced. Reads the existing route FleetBoxes field only. Verified stateless wakes take their existing branch; legacy rows remain unchanged. No new file, registry query or bucket read. merge of origin/main 9b8b2c50: retain wake-slot and HA duty logic alongside the replica stateful-start refusal; no gate removed. merge of origin/main 6be08467: Keep main demo lease, local database and KeepLocal path; never equate replication-disabled demos with stateless generations. Merge-only body/read-site change. merge of origin/main 7920cccf: Retain main tenant admission and startOwnedLocked gates alongside the replica stateful-start refusal; whole Route passed to main admission checks, no new path or store read.;rev3=census-ruling-agent-start-demo-3;basis=Route claim seeds through seed restore/admission; do not fall back to empty boot or ordinary import behavior. Census read-site delta: +registry:SeedSource, +whole:Route.;rev3=census-ruling-region-ha-g2-fixes;basis=Bound recovery Acquire by its attempt deadline; existing acquire/restore/start ordering remains; no new read.;rev3=census-ruling-g6-fence;basis=G6 F-C Task 3, the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): right after retainDatabase returns, attaches the write-fence watcher under a.mu (watchWriteFenceLocked, in memory). retainDatabase is called through a retainDB test seam that is nil in production. No read added; no root call; existing acquire, restore, publisher and cleanup order unchanged. registry:DBPath@2071,registry:DBPath@2087,registry:DBPath@2214,registry:DBPath@2225,registry:FleetBoxes@12064,registry:GoodVersion@18354,registry:Host@1900,registry:Host@1975,registry:Host@2053,registry:Host@2205,registry:Host@2539,registry:Host@4556,registry:Host@6813,registry:Host@949,registry:Replication@16981,registry:Replication@17110,registry:Replication@17129,registry:Replication@17210,registry:Replication@33283,registry:Seed@22049,registry:SeedSource@34743,registry:Socket@2100,registry:Socket@2116,registry:Socket@2239,registry:Socket@2250,registry:Stateless@10124,registry:Stateless@10410,registry:Stateless@11782,registry:Stateless@12112,registry:Stateless@20763,registry:Stateless@9667,registry:Stateless@9758,whole:Route@10196,whole:Route@10355,whole:Route@10734,whole:Route@10832,whole:Route@10923,whole:Route@11055,whole:Route@11178,whole:Route@11232,whole:Route@11504,whole:Route@11680,whole:Route@11684,whole:Route@12471,whole:Route@12746,whole:Route@13064,whole:Route@142,whole:Route@14525,whole:Route@15202,whole:Route@16083,whole:Route@16961,whole:Route@17212,whole:Route@18557,whole:Route@19148,whole:Route@19313,whole:Route@1998,whole:Route@20249,whole:Route@21045,whole:Route@21320,whole:Route@22150,whole:Route@22221,whole:Route@2434,whole:Route@2439,whole:Route@24633,whole:Route@2493,whole:Route@2499,whole:Route@2565,whole:Route@2573,whole:Route@2629,whole:Route@26491,whole:Route@27137,whole:Route@28444,whole:Route@28598,whole:Route@29097,whole:Route@29167,whole:Route@29754,whole:Route@30839,whole:Route@31270,whole:Route@31478,whole:Route@31532,whole:Route@32461,whole:Route@32646,whole:Route@333,whole:Route@33446,whole:Route@33517,whole:Route@34235,whole:Route@34284,whole:Route@34678,whole:Route@34860,whole:Route@3591,whole:Route@36112,whole:Route@36207,whole:Route@3685,whole:Route@37048,whole:Route@3752,whole:Route@4446,whole:Route@6182,whole:Route@6441,whole:Route@6703,whole:Route@6708,whole:Route@6765,whole:Route@6771,whole:Route@6840,whole:Route@6848,whole:Route@7164,whole:Route@7225,whole:Route@729,whole:Route@7323,whole:Route@8288,whole:Route@9271,whole:Route@934,whole:Route@9495,whole:Route@9559,whole:Route@9603 e5b4329cb5776f90db870f240b00f8035a0a31e055028d77b32237ac19b4c912
+internal/activator/activator.go Service.installProcLocked legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 8: the one place a process, its generation and the lease replica are installed on an entry; a resident is put under its lease watch (watchResidentLeaseLocked) at that moment; reads only the entry's route;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a (Call A1, Astra R1 P1-1): the lease watch is installed for every rootfs row (e.route.Rootfs()), not only a resident, so a hibernating rootfs row's run or session is reached at the lease's loss; the same one read of the entry's route; installs nothing else;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Install the local lifecycle channel with the actual generation. The serving-lease watch remains separate and is skipped for stateless generations; command/worker/stop ownership remains local.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): when the installed generation number differs from the current one, calls a.cancelHeldLegsLocked(e, e.gen.N) under a.mu before the switch, cancelling only the legs admitted on the generation that stops being current. Cancel funcs only; no read added.;rev3=census-ruling-g6-fence;basis=G6 F-C Task 3, the agent as carlos: calls watchWriteFenceLocked(e, e.rep), which starts the write-fence watcher for an armed HA replica not already watched (idempotent, in memory). No read added. whole:Route@515 a1cee25e2e3e7792f9ff7b6bb490b711c4083eb1d66d270b362c41acce68675a
+internal/activator/activator.go Service.wake legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=Re-digested at the pre-land merge: the body includes main's own change under census ruling 292, with no further change from this branch. the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body; the stop now carries its reason for a run it interrupts (beginStopLocked's why argument); read sites unchanged, offsets moved;rev3=census-ruling-wake-latency-1;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=logs that timer's breakdown to the journal after a successful wake (w.steps.String(), e.host, w.wakeTook); no read added;rev3=census-ruling-plans-4d-lapse;basis=cancels a wake whose row the turned-off hook names, like a fence, unless it is a move's active probe (plans 4d). One more whole-row read: the row handed to the hook (a.disabled). Only refuses.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: a refusal before the lease is reported once per change (noteRootfsRefusal) instead of a wake-failure event; the proc, generation and replica are installed through installProcLocked (which puts a resident under its lease watch before the fence); residency notes the outcome (noteResidentWakeLocked); same generation values;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R [pf R3.5]: the wake's context ceiling is wakeCeilingFor(e.route): the old 5 minutes for a binary row, 5 minutes plus runs.MaxTimeout for a rootfs row (room for a release inside the wake); new site +whole:Route (e.route to wakeCeilingFor, which reads Runtime only); no other change;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (branch review R1 P1-1): the wake's context is also cancelled before doWake when RetireExcept has marked the entry retired (e.retired, in memory under a.mu), as it is for a fence or a shutdown. Read sites unchanged (13). Agent, not root; it only refuses more.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Carry successful hold preparation into its wake, preserve actual mode in the generation and OnWake projection, and project serving version/mode through the narrow registry writer before releasing wake waiters. Final review I1: SetServingMode only for non-worker successful wakes with a nonempty spawned version and either a stateless generation or a mode transition from the route. Ordinary stateful wakes leave rollout status and the wake critical path unchanged.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): adds a.cancelHeldLegsLocked(e, 0) on the failed-wake path before the entry is deleted, and after close(e.ready) on success calls a.noteHeldAdmissible(e.host), the non-blocking held wake callback, outside a.mu. No read added.;rev3=census-ruling-wake-storm-cap;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): waits for a box-wide wake slot (acquireWakeSlot, an in-memory buffered channel) before doWake; the fence/shutdown/retired/disabled refusals move into refuseWakeLocked and are asked again after admission (one fewer direct whole-Route read here: a.disabled(e.route) now runs inside refuseWakeLocked, same value); e.wakeStart is set at admission and e.admitted marks it. Only waits and refuses more; no new read.;rev3=census-ruling-region-ha-p1b3b-t;basis=Install the successful-acquire observer and restrict due, worker and resident starts before doWake, off a.mu. Add a whole-route argument to restriction; refused work has known-no-start evidence.;rev3=census-ruling-region-ha-g2-fixes;basis=Bind recovery wakes to the service lifetime; no new read.;rev3=census-ruling-edge-page-cache-1;basis=the generation-current call is now noteCurrent(e) instead of noteCurrent(e.host, e.gen.N), so the new noteCurrent can also publish the process's page cache launch inputs; read sites unchanged (16); no read added;rev3=census-ruling-fix-silent-start-kill-861;basis=#861: a failed wake that journalledWakeFailure counts as a real failure is logged through logWakeFailure (rate-limited per host, in memory); a successful wake calls clearWakeFailure. Agent, not root; reads the error already in hand; no read added;rev3=census-ruling-stateless-replicas-4-task5;basis=Task 5 first commit (#511 F11 log dedupe): before a failed wake's member event, noteHeldWake (in-memory, per host, under the leaf wakeFailMu) tells whether the failure is held by a release attempt with no backoff and is the same (attempt ID, error class) as the host's last one; a repeat writes no event, a first or changed one writes one journal line and the event. Reads only the error in hand; no read site added.;rev3=census-ruling-stateless-replicas-4-merge-main;basis=Merge of main 5fac2ff1: both sides changed it. Main (27d3f501, activator-settle-wait) adds the background counter increment and deferred decrement at entry; this branch (Task 5) keeps its own changes. Both kept as-is; no read added.;rev3=census-ruling-g6-fence;basis=G6 F-C Task 3, the agent as carlos: a wakeReturned test seam (nil in production) after doWake; on a failed wake of an entry the write fence marked (e.writeFenced, in memory) e.err wraps ErrHALeaseUnavailable; at the awake transition a marked entry begins the existing StopLeaseLost stop before e.ready closes. Only refuses and stops more; no read added; no kill, no root call. registry:Socket@9213,registry:Socket@9374,registry:Stateless@11082,registry:Stateless@11830,whole:Route@11073,whole:Route@11128,whole:Route@11832,whole:Route@1811,whole:Route@3420,whole:Route@3693,whole:Route@3850,whole:Route@515,whole:Route@7475,whole:Route@9166,whole:Route@9215,whole:Route@9376 980d3976d7eb770e1454d22ab02ba47f23624a58d3b4d50e661ac858aedabe4d
+internal/activator/activator.go type Service authority B,C,D,F,J4 rev3=PROPOSED-seed; existing activator lifecycle and due-wake state plus owned seed exclusion and incarnation-keyed diagnostics; normal refusal and preparation ordering remain authoritative; PROPOSED-plans-2-box-limits adds the idleFor hook field, which only narrows idle windows;rev3=census-ruling-plans-4c-box-throttle;basis=gains the maxRunFor hook field beside idleFor (plans 4c). No read added.;rev3=census-ruling-plans-4d-lapse;basis=gains the disabledFor hook field beside maxRunFor (plans 4d). No read added.;rev3=census-ruling-remote-instance-metrics;basis=gains tenancySeq, hostTenants and hostMixed, in-memory fields for Tenancies; no read added;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: one more field, markers (markerRetry: an atomic running flag and the last log time) for retryOwedMarkers; no read added; merge of origin/main d7ae1d76: main's fields are kept as main has them (census-ruling-remote-instance-metrics: tenancySeq, hostTenants, hostMixed); this branch's change is the same as above;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: new fields for rootfs admission (rootfsArmed, rootfsSwept), the per-host gate ask and refusal memo, and residency state (lister, backoff, start ceiling, cursor, test seam); no read;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R: one new field, releaseOps (host to the in-memory release record, under a.mu); no read;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W: one new field, leaseNow (a clock seam for a worker start's headroom against the lease deadline, nil is the real clock); no read;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2: gains the holder cache and its single-flight state; no read;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): one field, Fleet (activator.FleetWake: the box's fleet state, not on a fleet by default, on a fleet with a known label and a record reader, or on a fleet with an invalid identity), set by the agent before Start and read only by routeCurrentUnderLease. No read in the declaration. Agent, not root.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a fix round 1: one field, drainBudget (time.Duration), which New copies from residentDrainBudget and a rootfs entry's lease watch reads in its place, so a test's change of the package var never races a watch goroutine; declaration only, reads nothing; merge of origin/main 6f1f6ca6: main's one field, Fleet (activator.FleetWake), is kept as main has it (census-ruling-managed-fleets-1b); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b3a;basis=Add bounded placement peer and diagnostic state and the over-capacity callback; no read in this declaration and no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Add coordinator, existing-record observation callback and per-host preparation locks; no read in the declaration. Task 3a: Add optional canonical storage-selection and durable deploy-ID callbacks; declaration only, no read or authority in these fields.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): adds the heldLegs map to actEntry (legs by id, under a.mu) and heldWakeHook (atomic pointer to a callback) and heldLegSeq (atomic counter) to Service. State only, in memory; no read of tenant, app or box-agent-writable input.;rev3=census-ruling-wake-storm-cap;basis=the agent as carlos: one field, wakeSlots (chan struct{}, the wake semaphore made by New from Config.WakeSlots, default 4); declaration only, no read.;rev3=census-ruling-region-ha-p1b3b-t;basis=Add the B2 DutyStore interface field and process-local duty view, suppression and invalidation state. No read added. B2 adds the verified-successor identity callback; no read in the declaration. B3b adds a nonblocking departure-suspicion callback, invoked only after an accepted holder-forward failure and after cache locks release; it cannot authorize a take.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: immutable callbacks installed before Start for tenant admission, local start permission, fixed route exemptions and shutdown closure; nil callbacks preserve switch-off behavior; no new reads. Fix R1: add an immutable startup-phase callback for response copy, set before service startup. No new read or execution authority.;rev3=census-ruling-region-ha-g2-fixes;basis=Add in-memory HA loss state and pool withdrawal jobs; no new read.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 1: one new field, drain (drainSources: two atomic func pointers for this box's and peers' drain state); no read added. region HA held-requests Task 2: one new field, moves (moveTable: per-host move state, hold counts and admission tickets in memory, under mu); no read added;rev3=census-ruling-held-move-speed;basis=the agent as carlos: one new field, moveStreams (per-host in-memory set of edge.StreamEnd for requests in flight, own mutex), for the move's early stream cut; actEntry gains drainRelease (bool, under a.mu), set by DrainStop; declarations only, no read added;rev3=census-ruling-fix-silent-start-kill-861;basis=#861: two fields, wakeFailMu and wakeFailLogged (per-host in-memory note of the last journalled wake failure); declaration only, no read;rev3=census-ruling-w6-ingress-drain;basis=new field TenantStartsClosed func() bool; when it answers true tenantStartRefusal refuses every start, exempt routes included. Wired only by fixedAdmission.bind to the ingress drain's closed flag. Struct field only; no read added.;rev3=census-ruling-stateless-replicas-4-task2;basis=Task 2: one field, replicaPolicies (host to the newest observed replica deploy and this box label, under mu), set only by SetReplicaDeploy; declaration only, no read.;rev3=census-ruling-stateless-replicas-4-task2-fix1;basis=Task 2 fix round 1: one more in-memory field, replicaFailed (host to the permit whose successor failed here, under mu), so that step only proves what it kept; declaration only, no read.;rev3=census-ruling-stateless-replicas-4-task3f;basis=Task 3F fix round 3 (#511 F11): two hook fields, MarkReplicaRelease and ReplicaReleaseMark (the failure book's per-host release mark on this box's disk). No read site.;rev3=census-ruling-stateless-replicas-4-task5;basis=Task 5 first commit (#511 F11): one in-memory field, heldSeen (host to the last held release attempt, error class and when it was met), under the existing wakeFailMu. Declaration only, no read.;rev3=census-ruling-stateless-replicas-4-merge-main;basis=Merge of main 5fac2ff1: both sides changed it. Main (27d3f501) adds the background atomic.Int64 field that tests wait on; this branch keeps its replica fields. Both kept as-is; no read added.;rev3=census-ruling-stateless-replicas-4-final;basis=#511 final wave item 3: adds replicaSwitched, an in-memory map of the permit each set row switched under (host -> permit key, time, resident flag); no read added; #511 micro-fix P1b: adds replicaNoGen, an in-memory map (host -> permit key and when first seen) that is only the bound's clock for a restarted permit holder with no generation; no read added;rev3=census-ruling-stateless-replicas-4-drill1;basis=#511 drill 1 R20 bound (round 1: clock with start and last seen): one in-memory field, releaseConfigWaits (per host, a stateless release's config wait), under mu; no read;rev3=census-ruling-stateless-replicas-4-r28;basis=R28 review round 2 (#511): one field, retiringCopy, an atomic pointer to the edge's in-memory retired-copy check, handed over by edge.New (SetRetiringCopy); no read, no root decision;rev3=census-ruling-g6-fence;basis=G6 F-C Task 3, the agent as carlos: four fields, fenceWatchers (sync.WaitGroup of running write-fence watchers) and three test seams nil in production (fenceWatchStarted, retainDB, wakeReturned). Declaration only, no read. 4ed4d14ae83cc6b54b012b7e4785a6da6f0e02968944599b5c801aa4c9ccb875
+internal/activator/haleaseloss.go Service.haLeaseRefusalLocked legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-g2-fixes;basis=Inspect cached entry health and startup obligations; on an ineligible box discard only startup-only losses with no old entry, recovery or running worker, and skip relatching them. Real entry losses retain refusal; owed release retry remains independent; no I/O.;rev3=census-ruling-g6-fence;basis=G6 F-C Task 3 fix round 1, the agent as carlos: a waking entry the write fence marked (e.writeFenced, in memory) answers ErrHALeaseUnavailable at once, latching and beginning nothing, so the failed wake's cleanup stays the one stop owner. Only refuses more; no I/O. registry:HA@390,registry:Host@1307,registry:Host@742,registry:Host@82,registry:Host@840,registry:Host@873,registry:Host@962,whole:Route@1051,whole:Route@1331,whole:Route@1338,whole:Route@392,whole:Route@711 59829e16e5a8fa4c32d475378a966093a97014205047c410df38f0cd587a6261
+internal/lease/lease.go Held.Replicate legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: the Replicator it returns also carries the handle's ha flag, marker base and region, so an HA replicator releases through the marker only; the store setup, its five steps and the transfer are unchanged; the one site unchanged, no read added;rev3=census-ruling-g6-fence;basis=G6 F-C Task 2, the agent as carlos: for an HA lease at sync interval 0 only, wraps db.Replica.Client in the write fence's gate (fenceGate: cancels and refuses replica calls after the event, except the finalization's) before store.Open, and starts the fence goroutine (runFence) on db.WALPath(), the instance's own -wal; the Replicator gains done and fenced channels. The one site unchanged; no root read added; store setup, its steps and the transfer unchanged. file:Open@785 34f34c99b2bf7c33578cf903cc6ee8b1ceed4b4cf730cd60098531caa8ad3f57
+cli.go replicationHARail legacy accepted-legacy accepted-legacy;rev3=census-ruling-g6-fence;basis=G6 F-C Task 4, new: reads the route's HA and Host fields (already in hand) to refuse batched and daily on an HA route with a COPY-PENDING message. A refusal only; no file, store or registry read beyond the row passed in; writes nothing. registry:HA@68,registry:Host@206 786c8bfcfa25d7b5a9bae330ca5ed6a30cbc6c990ccaa2b8aa46b9c53fae73d9
+internal/lease/fencerun.go Replicator.fenceSample legacy accepted-legacy accepted-legacy;rev3=census-ruling-g6-fence;basis=G6 F-C Task 2, new, the agent as carlos: once a second, litestream's in-memory positions (DB.Pos, Replica.Pos) and one os.Stat of the instance's own -wal (the path litestream's DB.WALPath gives for the database this replicator owns). A missing file is a state. No root read; no store request. file:Stat@215 9c1527035e87f9f96eaf15cfd00de15904cd115d0f0be8f20642c1bbb4579b37
+internal/lease/fencerun.go Replicator.newestL0Header legacy accepted-legacy accepted-legacy;rev3=census-ruling-g6-fence;basis=G6 F-C Task 2, new, the agent as carlos: opens litestream's own newest local L0 LTX file (db.LTXPath from db.MaxLTX) and decodes only its header, as litestream already does for DB.Pos. No root read; no store request. file:Open@190 8fd156b22a809031adea376b88f7934c5b428ea10c31e95035a18221d8750bec
+internal/lease/fencerun.go readAtMost legacy accepted-legacy accepted-legacy;rev3=census-ruling-g6-fence;basis=G6 F-C Task 2, new: ReadAt of up to n bytes on a file readCoverage has already opened (the instance's -wal); EOF short of n is not an error. No path of its own. file:ReadAt@98 23fd7a6f2dc966a1e729638d60252c4c3569b70d8399419e67c193bb995e535f
+internal/lease/fencerun.go readCoverage legacy accepted-legacy accepted-legacy;rev3=census-ruling-g6-fence;basis=G6 F-C Task 2, new, the agent as carlos: opens the instance's own -wal and reads its 32-byte header and 24 bytes at the newest L0 LTX file's captured end, to decide whether the WAL is all captured (walCovered). Local files litestream itself reads; no root read; no store request. file:Open@324 a1b07fd6f90b23e5ccd442438099022fec864ef3c054aa65eeaf828134718c69
+cli.go runRouteReplication legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 3 FPR-C01: the write error goes through refuseForwardWrite, so a forward row that took the host after the read also answers FPR-C01 (+registry:Host, the host it names). A refusal only; reads the agent-written row to refuse, writes nothing more.;rev3=census-ruling-g6-fence;basis=G6 F-C Task 4: calls replicationHARail(rt, class) right after replicationRail, before the "already" check, so carlos route --replication refuses batched and daily on an HA route. Adds a refusal only; +registry:Host and +whole:Route are the route already read here, handed to the rail; writes nothing more. registry:Host@170,registry:Host@271,registry:Host@473,registry:Host@561,registry:Host@647,registry:Host@721,registry:Replication@377,registry:Replication@746,whole:Route@122,whole:Route@216 161cf922d59668b9e0b06f59bae08502577e0a2bcc15f7c94709477c252b5702
+@coverage . 607fbe6761c24649171c05c398fba70b241735e762a11db24cc28a93628241b9
+@coverage internal/activator 756ca5173594fcf7866ddb92d92e08be4106eb78c396f38792528346a02dcace
+@coverage internal/lease f3f39d5856fa829b95f291e259698a503fccef26ba1e360852174dae86583784