carlos / platform Public

G6 fence: re-propose the census after the branch review fixes

readCoverage's body changed (Fable P2-3): it now reads the 24-byte
frame headers past the captured end, one at a time, bounded by the
stat's size, from the same -wal it already opened. Claim updated in
the task's claims file; seal a4d50694. Census tests pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 43a021d39e72732560c61abf9327df92a34a7e5d parent f4166df
3 files changed, +5 −5
  • docs/superpowers/notes/census-proposal-g6-fence.md +1 −1
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-g6-fence.tsv +3 −3

CI cancelled — superseded by a newer push — run details

diff --git a/docs/superpowers/notes/census-proposal-g6-fence.md b/docs/superpowers/notes/census-proposal-g6-fence.md
index 5e8f2fd98..eb9034808 100644
--- a/docs/superpowers/notes/census-proposal-g6-fence.md
+++ b/docs/superpowers/notes/census-proposal-g6-fence.md
@@ -34,6 +34,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- 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: `bc138ce5435f3ab37f6adff46656eea1c20f48168c569550fe94e390c69ba309` → `cc7c898fdbd317facc8fd385f115a21ac9e750487230cb5fdc2cfec74447b6ca`.
+Seal: `bc138ce5435f3ab37f6adff46656eea1c20f48168c569550fe94e390c69ba309` → `a4d50694ba3e50c963f6c872071bc7b15b7fef45a6260fef22094676d9b7ba30`.
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 238fd6544..0d24c7c58 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -199,4 +199,4 @@ plan14-root-reads-stateless-replicas-4-r28.tsv 55d66980f8db645c762b56e20b5eabba0
plan14-root-reads-stateless-replicas-4-merge-main3.tsv 55d66980f8db645c762b56e20b5eabba09d8e1f2ab79de5e089ff087ad677bc3
plan14-root-reads-ha-unclean-marker-waits.tsv 821598970e60a776d4a62138d5adbfa393cd30bc1ec1f266d290e5b6d4e12c42
plan14-root-reads-ha-unclean-files-only.tsv bc138ce5435f3ab37f6adff46656eea1c20f48168c569550fe94e390c69ba309
-plan14-root-reads-g6-fence.tsv cc7c898fdbd317facc8fd385f115a21ac9e750487230cb5fdc2cfec74447b6ca
+plan14-root-reads-g6-fence.tsv a4d50694ba3e50c963f6c872071bc7b15b7fef45a6260fef22094676d9b7ba30
diff --git a/internal/provision/testdata/plan14-root-reads-g6-fence.tsv b/internal/provision/testdata/plan14-root-reads-g6-fence.tsv
index 045b0e787..219c51989 100644
--- a/internal/provision/testdata/plan14-root-reads-g6-fence.tsv
+++ b/internal/provision/testdata/plan14-root-reads-g6-fence.tsv
@@ -10,7 +10,7 @@
@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 e1fb51f3bc98c6ca3484b20a65831cec1f6a2756481569a742990e2e275835e6 internal/lease/fencerun.go readCoverage legacy accepted-legacy accepted-legacy;rev3=census-ruling-g6-fence;basis=G6 F-C Task 2, new; branch review R1 (Fable P2-3): the agent as carlos opens the instance's own -wal and reads its 32-byte header, then the 24-byte frame headers past the newest L0 LTX file's captured end, one at a time at the WAL header's frame stride and never past the size the sample's stat saw, stopping at the first commit frame, stale frame or end of file, so walCovered can decide whether the WAL is all captured. Same file, same opener, more of the same reads; local files litestream itself reads; no root read; no store request. file:Open@324 b8a61901303d894e287e4b88046ce586cd8a4b75256d650c35b978bfd0452350
@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
@@ -22,8 +22,8 @@ cli.go replicationHARail legacy accepted-legacy accepted-legacy;rev3=census-ruli
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
+internal/lease/fencerun.go readCoverage legacy accepted-legacy accepted-legacy;rev3=census-ruling-g6-fence;basis=G6 F-C Task 2, new; branch review R1 (Fable P2-3): the agent as carlos opens the instance's own -wal and reads its 32-byte header, then the 24-byte frame headers past the newest L0 LTX file's captured end, one at a time at the WAL header's frame stride and never past the size the sample's stat saw, stopping at the first commit frame, stale frame or end of file, so walCovered can decide whether the WAL is all captured. Same file, same opener, more of the same reads; local files litestream itself reads; no root read; no store request. file:Open@324 b8a61901303d894e287e4b88046ce586cd8a4b75256d650c35b978bfd0452350
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 59b9442721ca40e26e200c49bf266b62e267a292380ffc7130c6ac9b38bd4708
-@coverage internal/lease 1c272db1ab6db8c69f90d2af375ad8d3e2f9f253b1c694427feebb7d8c3362ef
+@coverage internal/lease 55e2c05b87d137a19af23ba4a37ae71533972f41d1ad67c78b2971f088368877