carlos / platform Public

lease: an invalid WAL page size never proves coverage (R2 P2)

Astra branch review round 2, P2: with a page size SQLite does not write,
walFrameSize is 0 and readCoverage yielded only the first frame header
past the captured end; an uncommitted one there made walCovered answer
covered while a committed tail went unread. walCovered now answers not
covered for an invalid stride before it asks for any frame (the one
guard; readCoverage, the only walFrameSize caller, steps by the same
value). Regression: matching salts, page sizes 0, 1000 and 131072, an
uncommitted frame then a commit; not covered, and the obligation stays
(trips at 31). Spec rule C states it. Census re-proposed: readCoverage
(comment only), seal e8e44e5c.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev b55b8ea7d7b56c7fa6d25ca1ca5a0db4031e0c3c parent 035de8f
8 files changed, +69 −8
  • docs/superpowers/notes/census-proposal-g6-fence.md +1 −1
  • docs/superpowers/specs/2026-11-11-g6-write-fence-design.md +3 −1
  • internal/lease/fence.go +11 −1
  • internal/lease/fence_queue_test.go +14 −0
  • internal/lease/fencerun.go +4 −1
  • internal/lease/fencerun_test.go +32 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-g6-fence.tsv +3 −3

CI passed — run details

Intent

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

diff --git a/docs/superpowers/notes/census-proposal-g6-fence.md b/docs/superpowers/notes/census-proposal-g6-fence.md
index eb9034808..fc2a57819 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` → `a4d50694ba3e50c963f6c872071bc7b15b7fef45a6260fef22094676d9b7ba30`.
+Seal: `bc138ce5435f3ab37f6adff46656eea1c20f48168c569550fe94e390c69ba309` → `e8e44e5c166cba4d5f94c53bafbb4f758166fae5e485cb7fed6a3f70461f3542`.
Overlay: `internal/provision/testdata/plan14-root-reads-g6-fence.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/docs/superpowers/specs/2026-11-11-g6-write-fence-design.md b/docs/superpowers/specs/2026-11-11-g6-write-fence-design.md
index 4e409bbc5..2508e947b 100644
--- a/docs/superpowers/specs/2026-11-11-g6-write-fence-design.md
+++ b/docs/superpowers/specs/2026-11-11-g6-write-fence-design.md
@@ -196,7 +196,9 @@ holds writes not yet proven stored, each `{t, txid, known}`:
- the WAL ends at or before the captured end: covered at `MaxTXID`;
- otherwise the frame headers past the captured end are read in order,
one at a time, at the frame stride the WAL header's page size gives,
- never past the `stat`'s size. The first one that is short (end of
+ never past the `stat`'s size. A page size SQLite does not write (not a
+ power of two from 512 to 65536) gives no stride: not covered, with no
+ frame read (Astra branch R2 P2). The first one that is short (end of
file) or carries other salts (left from before a WAL restart) ends the
scan. A frame of this generation whose commit size (bytes 4..7) is not
zero is a transaction not yet captured: not covered. If the scan ends
diff --git a/internal/lease/fence.go b/internal/lease/fence.go
index ba4bcbb13..e2d45f4ce 100644
--- a/internal/lease/fence.go
+++ b/internal/lease/fence.go
@@ -183,7 +183,17 @@ func walCovered(w walState, walHdr []byte, pastEnd iter.Seq[[]byte], h *ltx.Head
if salt1 != h.WALSalt1 || salt2 != h.WALSalt2 {
return 0, false // the WAL restarted since the capture: its frames are unproven
}
- if w.size <= h.WALOffset+h.WALSize || pastEnd == nil {
+ if w.size <= h.WALOffset+h.WALSize {
+ return uint64(h.MaxTXID), true
+ }
+ if walFrameSize(walHdr) == 0 {
+ // No page size SQLite writes, so no stride to find the frames
+ // past the captured end by: nothing proves they commit nothing
+ // (Astra branch R2 P2). The one guard: readCoverage steps by
+ // the same walFrameSize and is never asked for a frame here.
+ return 0, false
+ }
+ if pastEnd == nil {
return uint64(h.MaxTXID), true
}
for frame := range pastEnd {
diff --git a/internal/lease/fence_queue_test.go b/internal/lease/fence_queue_test.go
index 1e62b2f4d..7d8558ea3 100644
--- a/internal/lease/fence_queue_test.go
+++ b/internal/lease/fence_queue_test.go
@@ -347,6 +347,13 @@ func walHeader(salt1, salt2 uint32) []byte {
return b
}
+// withPageSize is a copy of a WAL header with its page size set.
+func withPageSize(hdr []byte, ps uint32) []byte {
+ b := slices.Clone(hdr)
+ binary.BigEndian.PutUint32(b[8:], ps)
+ return b
+}
+
// frameHeader is a frame header that ends no transaction (commit size 0).
func frameHeader(salt1, salt2 uint32) []byte {
b := make([]byte, 24)
@@ -402,6 +409,13 @@ func TestWalCovered(t *testing.T) {
{"uncommitted frames, then a commit", framed, cur, frames(frameHeader(h.WALSalt1, h.WALSalt2), frameHeader(h.WALSalt1, h.WALSalt2), commitHeader(h.WALSalt1, h.WALSalt2)), h, 0, false},
{"uncommitted frames, then stale ones", framed, cur, frames(frameHeader(h.WALSalt1, h.WALSalt2), commitHeader(1, 2)), h, 12, true},
{"a stale frame, then a commit with the current salts", framed, cur, frames(commitHeader(1, 2), commitHeader(h.WALSalt1, h.WALSalt2)), h, 12, true},
+ // Astra branch R2 P2: no valid page size, no stride: not covered,
+ // whatever the frames say.
+ {"page size 0", framed, withPageSize(cur, 0), frames(frameHeader(h.WALSalt1, h.WALSalt2), commitHeader(h.WALSalt1, h.WALSalt2)), h, 0, false},
+ {"page size not a power of two", framed, withPageSize(cur, 1000), frames(frameHeader(h.WALSalt1, h.WALSalt2)), h, 0, false},
+ {"page size past 65536", framed, withPageSize(cur, 131072), frames(frameHeader(h.WALSalt1, h.WALSalt2)), h, 0, false},
+ {"page size 0, no frame read", framed, withPageSize(cur, 0), nil, h, 0, false},
+ {"page size 0, WAL ends at the captured end", walState{exists: true, size: end}, withPageSize(cur, 0), nil, h, 12, true},
}
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
diff --git a/internal/lease/fencerun.go b/internal/lease/fencerun.go
index 84a092f1b..decb75dbf 100644
--- a/internal/lease/fencerun.go
+++ b/internal/lease/fencerun.go
@@ -212,7 +212,10 @@ func readCoverage(walPath string, w walState, l uint64, header func() (*ltx.Head
return
}
if !yield(frame) || len(frame) < walFrameHeaderSize || stride == 0 {
- return // walCovered has decided, the file ended, or no stride to step by
+ // walCovered has decided, or the file ended. (walCovered
+ // answers an invalid stride itself without asking for a
+ // frame; stride == 0 only keeps this loop finite.)
+ return
}
}
}
diff --git a/internal/lease/fencerun_test.go b/internal/lease/fencerun_test.go
index abb7b3f6a..da1e4c475 100644
--- a/internal/lease/fencerun_test.go
+++ b/internal/lease/fencerun_test.go
@@ -1,11 +1,13 @@
package lease
import (
+ "encoding/binary"
"errors"
"fmt"
"os"
"path/filepath"
"testing"
+ "time"
"github.com/superfly/ltx"
)
@@ -132,6 +134,36 @@ func TestReadCoverage(t *testing.T) {
}
})
+ // Astra branch R2 P2: matching salts, an invalid page size, an
+ // uncommitted frame at the captured end and a commit one stride (at
+ // 4096-byte pages) later. With no stride the tail cannot be walked,
+ // so it is not covered, and the obligation the WAL change made stays.
+ t.Run("an invalid page size proves nothing", func(t *testing.T) {
+ for _, ps := range []uint32{0, 1000, 131072} {
+ content := upToEnd(append(spill(1), fullFrame(h.WALSalt1, h.WALSalt2)...))
+ binary.BigEndian.PutUint32(content[8:], ps)
+ path, w := file(t, content)
+ hdr, _ := headerIs(h, nil)
+ if got, ok := readCoverage(path, w, l, hdr); ok {
+ t.Fatalf("page size %d: (%d, true), want not covered", ps, got)
+ }
+ q := &fenceQueue{}
+ cov := func() (uint64, bool) { return readCoverage(path, w, l, hdr) }
+ first := -1
+ for k := 0; k <= 60 && first < 0; k++ {
+ if q.step(fenceT0.Add(time.Duration(k)*time.Second), fenceSample{L: l, lOK: true, R: l, W: w}, cov) {
+ first = k
+ }
+ if k == 0 && !q.anyUnknown() {
+ t.Fatalf("page size %d: the first look's obligation was discharged", ps)
+ }
+ }
+ if first != 31 {
+ t.Fatalf("page size %d: first trip at %d, want 31 (the obligation stays)", ps, first)
+ }
+ }
+ })
+
t.Run("a read error", func(t *testing.T) {
dir := t.TempDir() // reads of a directory fail with EISDIR
hdr, _ := headerIs(h, nil)
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 0d24c7c58..a0475bd1e 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 a4d50694ba3e50c963f6c872071bc7b15b7fef45a6260fef22094676d9b7ba30
+plan14-root-reads-g6-fence.tsv e8e44e5c166cba4d5f94c53bafbb4f758166fae5e485cb7fed6a3f70461f3542
diff --git a/internal/provision/testdata/plan14-root-reads-g6-fence.tsv b/internal/provision/testdata/plan14-root-reads-g6-fence.tsv
index 219c51989..fe09f2eb3 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 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 ca9770ed82ef3c1b44d20972d2605a7faf9d366e5b04912deab808ea53fb2360 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. Branch review R2 (Astra P2): a comment only; walCovered now answers not covered for an invalid WAL page size before asking readCoverage for any frame header past the captured end, so with no stride no frame is read. file:Open@324 fa49ace5a73eeea10392d469b5fe5fe7d45c7fbb904b2a3977c690fab515a77b
@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; 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
+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. Branch review R2 (Astra P2): a comment only; walCovered now answers not covered for an invalid WAL page size before asking readCoverage for any frame header past the captured end, so with no stride no frame is read. file:Open@324 fa49ace5a73eeea10392d469b5fe5fe7d45c7fbb904b2a3977c690fab515a77b
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 55e2c05b87d137a19af23ba4a37ae71533972f41d1ad67c78b2971f088368877
+@coverage internal/lease b5093f561e5d5773721ba1b1f5ed05d73e0ef16397c0635139712b98aeebfaeb