carlos / platform Public

census: re-propose sqlite-integrity-safe after the R2 fixes

make census-propose NAME=sqlite-integrity-safe with claims for every
unit against main: RestoreVerify (unchanged since approval),
Decoder.Close and inputReader.Read (R2 P1-1: readFull returns a held
read error), the new lease.ReadHeader (R2 P1-2: whole 16-byte
signature; replaces the branch-only ops.sourceHeader), and
ChangeCounter, whose read moved into ReadHeader. No new path.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 3cef0c8b603b7e4e6156016a05226d239c6bfc2c parent a67d0b4
3 files changed, +20 −16
  • docs/superpowers/notes/census-proposal-sqlite-integrity-safe.md +6 −5
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-sqlite-integrity-safe.tsv +13 −10

CI cancelled — superseded by a newer push — run details

CI log
=== gate ===
go: downloading go1.26.10 (linux/arm64)
go version go1.26.10 linux/arm64
opentofu: arm64, tofu 1.13.9, aws 6.73.0, archive 2.8.1
  tofu: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/tofu_1.13.9_linux_arm64.tar.gz
  tofu: downloaded, digest verified
  aws: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/terraform-provider-aws_6.73.0_linux_arm64.zip
  aws: downloaded, digest verified
  archive: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/terraform-provider-archive_2.8.1_linux_arm64.zip
  archive: downloaded, digest verified
  installed in /tmp/carlos-opentofu-Zw5kpx
.amadan/test-gate.sh
go: downloading golang.org/x/net v0.62.0
go: downloading github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.68.0
go: downloading github.com/aws/aws-sdk-go-v2/service/costexplorer v1.67.5
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/aws/aws-sdk-go-v2/service/iam v1.58.2
go: downloading github.com/aws/aws-sdk-go-v2/service/s3 v1.105.0
go: downloading golang.org/x/sys v0.49.0
go: downloading golang.org/x/crypto v0.58.0
go: downloading golang.org/x/mod v0.41.0
go: downloading github.com/aws/aws-sdk-go-v2/service/acm v1.45.0
go: downloading github.com/aws/aws-sdk-go-v2/service/ec2 v1.324.0
go: downloading github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.37.0
go: downloading github.com/aws/aws-sdk-go-v2/service/sesv2 v1.66.6
go: downloading github.com/pion/turn/v4 v4.1.4
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading github.com/aws/aws-sdk-go-v2/service/ssm v1.74.0
go: downloading google.golang.org/protobuf v1.36.10
go: downloading github.com/pion/dtls/v3 v3.1.4
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/wlynxg/anet v0.0.5
go: downloading github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.31
go: downloading github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.23
go: downloading golang.org/x/text v0.43.0
go: downloading github.com/klauspost/compress v1.20.2
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading modernc.org/libc v1.74.1
go: downloading modernc.org/libc v1.74.1
go: downloading github.com/google/uuid v1.6.0
go: downloading modernc.org/memory v1.11.0
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec

amadan: job cancelled — a newer push superseded it
diff --git a/docs/superpowers/notes/census-proposal-sqlite-integrity-safe.md b/docs/superpowers/notes/census-proposal-sqlite-integrity-safe.md
index 6c112764f..85420f2fa 100644
--- a/docs/superpowers/notes/census-proposal-sqlite-integrity-safe.md
+++ b/docs/superpowers/notes/census-proposal-sqlite-integrity-safe.md
@@ -1,13 +1,13 @@
# Census approval: sqlite-integrity-safe
-Ruling `census-ruling-sqlite-integrity-safe`. The independent reviewer approves or rejects every change below, 2 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+Ruling `census-ruling-sqlite-integrity-safe`. The independent reviewer approves or rejects every change below, 3 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
| unit | change | read sites | what changed |
|---|---|---|---|
| `internal/ops/litestream.go` `RestoreVerify` | body | unchanged (1) | Output and counting only: prints restore result and freshness separately and counts current vs could-not-judge; exit status unchanged. No read added or changed; restore call and its one retry unchanged. |
-| `third_party/ltx/decoder.go` `Decoder.Close` | body | unchanged (1) | Reads through inputReader; a tail shorter than 8 bytes returns io.ErrUnexpectedEOF instead of panicking on a negative slice bound; lz4 end-frame error keeps its cause. Astra R1 P1-1: first returns an error the input already delivered with earlier bytes (held by inputReader) before reading the raw tail. No read added; same LTX object the restore already opened. |
+| `third_party/ltx/decoder.go` `Decoder.Close` | body | unchanged (1) | Reads through inputReader; a tail shorter than 8 bytes returns io.ErrUnexpectedEOF instead of panicking on a negative slice bound; lz4 end-frame error keeps its cause. Astra R1 P1-1: first returns an error the input already delivered with earlier bytes (held by inputReader, reported as a read reports it) before reading the raw tail. No read added; same LTX object the restore already opened. |
-Envelopes re-pinned: `.`, `internal/ops`, `third_party/ltx`.
+Envelopes re-pinned: `.`, `internal/lease`, `internal/ops`, `third_party/ltx`.
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.
@@ -18,9 +18,10 @@ Recorded dispositions, which each change must still satisfy:
New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff:
-- new `internal/ops/freshness.go:sourceHeader`: reads +file:Open; written legacy, accepted-legacy, frozen
+- new `internal/lease/check.go:ReadHeader`: reads +file:Open; written legacy, accepted-legacy, frozen
- new `third_party/ltx/decoder.go:inputReader.Read`: reads +file:Read ×2; written legacy, accepted-legacy, frozen
+- quiet `internal/lease/check.go:ChangeCounter`: reads nothing now; retired while it reads nothing (or its row keeps no sites)
-Seal: `dc00dc6bab094e8c81ab4e083a0b6a122ea886a70f8dca4885b5cf8a2bc3b177` → `c8217bb84289a4773e35a3210fbff98d68f5b78c0f323f9463ef5fe04d04217b`.
+Seal: `dc00dc6bab094e8c81ab4e083a0b6a122ea886a70f8dca4885b5cf8a2bc3b177` → `69fc038fd570d1d7fe5e3cd6a733bacbcf6708499785e5d2c55a9c2c09c58806`.
Overlay: `internal/provision/testdata/plan14-root-reads-sqlite-integrity-safe.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 1fbf9f6ce..3acdb7214 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -334,4 +334,4 @@ plan14-root-reads-alias-with-mint-1653.tsv ce9536904e10de3f5e5c582061f130f870515
plan14-root-reads-private-store-scan-1653.tsv ce9536904e10de3f5e5c582061f130f870515ae0999de2946658ea49e4a17bf8
plan14-root-reads-canary-retire-orphan-1634.tsv 83cd5238dcd073e8fc89934a72f9c60b96081f15054f32a168f6cd594c88f49c
plan14-root-reads-backhaul-streams-1535.tsv dc00dc6bab094e8c81ab4e083a0b6a122ea886a70f8dca4885b5cf8a2bc3b177
-plan14-root-reads-sqlite-integrity-safe.tsv c8217bb84289a4773e35a3210fbff98d68f5b78c0f323f9463ef5fe04d04217b
+plan14-root-reads-sqlite-integrity-safe.tsv 69fc038fd570d1d7fe5e3cd6a733bacbcf6708499785e5d2c55a9c2c09c58806
diff --git a/internal/provision/testdata/plan14-root-reads-sqlite-integrity-safe.tsv b/internal/provision/testdata/plan14-root-reads-sqlite-integrity-safe.tsv
index 88c18acc8..d95e46817 100644
--- a/internal/provision/testdata/plan14-root-reads-sqlite-integrity-safe.tsv
+++ b/internal/provision/testdata/plan14-root-reads-sqlite-integrity-safe.tsv
@@ -1,14 +1,17 @@
# Census overlay sqlite-integrity-safe, written by census-propose (#369). census-ruling-sqlite-integrity-safe, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-sqlite-integrity-safe.md.
-# 2 body, 0 sites, 3 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
-# 2 new dispositions: 0 reads re-frozen at their disposition with the claim, 2 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other.
+# 2 body, 0 sites, 4 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 3 new dispositions: 0 reads re-frozen at their disposition with the claim, 2 new units frozen accepted-legacy, 1 quiet units retired while they read nothing, 0 other.
@legacy c109695ab92e5cc735ade2d02bcd7447f7042dd1ec9bdf3ef3e95eb372776de8 internal/ops/litestream.go RestoreVerify legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-sqlite-integrity-safe;basis=Output and counting only: prints restore result and freshness separately and counts current vs could-not-judge; exit status unchanged. No read added or changed; restore call and its one retry unchanged. file:ReadFile@79 6c892a8d1dbcf5b6c6bc00a322e366133c12a24e11ab713065afa5a938907d24
-@legacy 6151873a3d72e15537deb1cb1ede8feb04894ce8adec13f42f25e569cbd9e0d7 third_party/ltx/decoder.go Decoder.Close legacy accepted-legacy accepted-legacy;rev3=census-ruling-litestream-pin-1443;basis=vendored byte-for-byte from upstream ltx v0.5.1 (until now compiled into root from the module cache, outside the census); no read added or changed. Only acquireReadLock (BeginTx context) and ltx Compactor.Compact (header error returned) differ from upstream (#1443);rev3=census-ruling-sqlite-integrity-safe;basis=Reads through inputReader; a tail shorter than 8 bytes returns io.ErrUnexpectedEOF instead of panicking on a negative slice bound; lz4 end-frame error keeps its cause. Astra R1 P1-1: first returns an error the input already delivered with earlier bytes (held by inputReader) before reading the raw tail. No read added; same LTX object the restore already opened. file:ReadAll@659 7c3ce9c262deefda32975a406437af5a6ecdd8350ad45cf907d3ed3f2757c163
-@legacy c1b9ece5df9992ac59958b8ca72deb3cad1fd3cfb42b17390cb1c297a242f02c internal/ops/freshness.go sourceHeader legacy accepted-legacy accepted-legacy;rev3=census-ruling-sqlite-integrity-safe;basis=New helper replacing the ChangeCounter call in replicaFreshnessCounter: opens the same source path from the generated litestream config and reads the first 28 header bytes (counter plus journal-mode bytes 18-19, returned as a pair so only (1,1) earns current, Astra R1 P1-2) in one read. Same file, same open, no new path. file:Open@86 50c340a8a178a71e5fc32c3b4c111cbb1e0cdf0ab0b0a2b632fd9acbca8bbfc9
-@legacy 8a5f8cfe82fc07c56f9162223c22a1cb755bc1c1a60430a38e6a62a7ff237c04 third_party/ltx/decoder.go inputReader.Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-sqlite-integrity-safe;basis=New wrapper around the decoder input reader: maps a premature io.EOF to io.ErrUnexpectedEOF; passes other errors through, and (Astra R1 P1-1) holds a non-EOF error that arrives with bytes and returns it on every later read so io.ReadFull cannot drop it. Reads only the LTX stream the decoder already reads. file:Read@106,file:Read@23 500600c032b15ebb4b35b2acece650771d1c9331dafb74c75567f16366da9c0b
+@legacy cf776eed75e16bf95d5a160e3cbe5858b961782b257bf852b85452b67b98dd69 third_party/ltx/decoder.go Decoder.Close legacy accepted-legacy accepted-legacy;rev3=census-ruling-litestream-pin-1443;basis=vendored byte-for-byte from upstream ltx v0.5.1 (until now compiled into root from the module cache, outside the census); no read added or changed. Only acquireReadLock (BeginTx context) and ltx Compactor.Compact (header error returned) differ from upstream (#1443);rev3=census-ruling-sqlite-integrity-safe;basis=Reads through inputReader; a tail shorter than 8 bytes returns io.ErrUnexpectedEOF instead of panicking on a negative slice bound; lz4 end-frame error keeps its cause. Astra R1 P1-1: first returns an error the input already delivered with earlier bytes (held by inputReader, reported as a read reports it) before reading the raw tail. No read added; same LTX object the restore already opened. file:ReadAll@657 fa3142109739b475a4bf861d2bdcd12f7d0704e73043dadcd6253c0421a427c9
+@legacy 480b8e9e115805bb5984da4998bdd1119b86656a93b6f2d0bc025b81b44df1cf internal/lease/check.go ReadHeader legacy accepted-legacy accepted-legacy;rev3=census-ruling-sqlite-integrity-safe;basis=New shared helper (Astra R2 P1-2) replacing ChangeCounter body and the branch-only ops sourceHeader: opens the same path ChangeCounter and the freshness check opened (the restored copy, the source named by the generated litestream config or the hibernating route DBPath) and reads the same first 28 bytes in one read; requires the whole 16-byte signature SQLite format 3\0 (was 15 bytes) before returning the counter and journal-mode bytes 18-19. Stricter check, no new path. file:Open@58 ca99d9ee8683ca05b5537f16eeacba264456f4592c8c3566d26600f4247d206d
+@legacy bed37dd28b080fc42b7e6f154e98a777854d68ea8b80e550e275efcb95d487e6 third_party/ltx/decoder.go inputReader.Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-sqlite-integrity-safe;basis=New wrapper around the decoder input reader: maps a premature io.EOF to io.ErrUnexpectedEOF and passes other errors through. Astra R1 P1-1: holds an error that arrives with bytes and returns it on every later read. Astra R2 P1-1: readFull, where DecodeHeader and DecodePage read their fields, returns a held non-EOF error once the field is complete, so a call that stops there (genselect.checkRoot) never succeeds over it; io.EOF after a complete header stays valid. Reads only the LTX stream the decoder already reads. file:Read@110,file:Read@23 954c0708ed4b3ec444c2133db082367e5dc9c16e5549d8cd8c10ac6879c9212f
internal/ops/litestream.go RestoreVerify legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-sqlite-integrity-safe;basis=Output and counting only: prints restore result and freshness separately and counts current vs could-not-judge; exit status unchanged. No read added or changed; restore call and its one retry unchanged. file:ReadFile@79 6c892a8d1dbcf5b6c6bc00a322e366133c12a24e11ab713065afa5a938907d24
-third_party/ltx/decoder.go Decoder.Close legacy accepted-legacy accepted-legacy;rev3=census-ruling-litestream-pin-1443;basis=vendored byte-for-byte from upstream ltx v0.5.1 (until now compiled into root from the module cache, outside the census); no read added or changed. Only acquireReadLock (BeginTx context) and ltx Compactor.Compact (header error returned) differ from upstream (#1443);rev3=census-ruling-sqlite-integrity-safe;basis=Reads through inputReader; a tail shorter than 8 bytes returns io.ErrUnexpectedEOF instead of panicking on a negative slice bound; lz4 end-frame error keeps its cause. Astra R1 P1-1: first returns an error the input already delivered with earlier bytes (held by inputReader) before reading the raw tail. No read added; same LTX object the restore already opened. file:ReadAll@659 7c3ce9c262deefda32975a406437af5a6ecdd8350ad45cf907d3ed3f2757c163
-internal/ops/freshness.go sourceHeader legacy accepted-legacy accepted-legacy;rev3=census-ruling-sqlite-integrity-safe;basis=New helper replacing the ChangeCounter call in replicaFreshnessCounter: opens the same source path from the generated litestream config and reads the first 28 header bytes (counter plus journal-mode bytes 18-19, returned as a pair so only (1,1) earns current, Astra R1 P1-2) in one read. Same file, same open, no new path. file:Open@86 50c340a8a178a71e5fc32c3b4c111cbb1e0cdf0ab0b0a2b632fd9acbca8bbfc9
-third_party/ltx/decoder.go inputReader.Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-sqlite-integrity-safe;basis=New wrapper around the decoder input reader: maps a premature io.EOF to io.ErrUnexpectedEOF; passes other errors through, and (Astra R1 P1-1) holds a non-EOF error that arrives with bytes and returns it on every later read so io.ReadFull cannot drop it. Reads only the LTX stream the decoder already reads. file:Read@106,file:Read@23 500600c032b15ebb4b35b2acece650771d1c9331dafb74c75567f16366da9c0b
+third_party/ltx/decoder.go Decoder.Close legacy accepted-legacy accepted-legacy;rev3=census-ruling-litestream-pin-1443;basis=vendored byte-for-byte from upstream ltx v0.5.1 (until now compiled into root from the module cache, outside the census); no read added or changed. Only acquireReadLock (BeginTx context) and ltx Compactor.Compact (header error returned) differ from upstream (#1443);rev3=census-ruling-sqlite-integrity-safe;basis=Reads through inputReader; a tail shorter than 8 bytes returns io.ErrUnexpectedEOF instead of panicking on a negative slice bound; lz4 end-frame error keeps its cause. Astra R1 P1-1: first returns an error the input already delivered with earlier bytes (held by inputReader, reported as a read reports it) before reading the raw tail. No read added; same LTX object the restore already opened. file:ReadAll@657 fa3142109739b475a4bf861d2bdcd12f7d0704e73043dadcd6253c0421a427c9
+internal/lease/check.go ReadHeader legacy accepted-legacy accepted-legacy;rev3=census-ruling-sqlite-integrity-safe;basis=New shared helper (Astra R2 P1-2) replacing ChangeCounter body and the branch-only ops sourceHeader: opens the same path ChangeCounter and the freshness check opened (the restored copy, the source named by the generated litestream config or the hibernating route DBPath) and reads the same first 28 bytes in one read; requires the whole 16-byte signature SQLite format 3\0 (was 15 bytes) before returning the counter and journal-mode bytes 18-19. Stricter check, no new path. file:Open@58 ca99d9ee8683ca05b5537f16eeacba264456f4592c8c3566d26600f4247d206d
+third_party/ltx/decoder.go inputReader.Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-sqlite-integrity-safe;basis=New wrapper around the decoder input reader: maps a premature io.EOF to io.ErrUnexpectedEOF and passes other errors through. Astra R1 P1-1: holds an error that arrives with bytes and returns it on every later read. Astra R2 P1-1: readFull, where DecodeHeader and DecodePage read their fields, returns a held non-EOF error once the field is complete, so a call that stops there (genselect.checkRoot) never succeeds over it; io.EOF after a complete header stays valid. Reads only the LTX stream the decoder already reads. file:Read@110,file:Read@23 954c0708ed4b3ec444c2133db082367e5dc9c16e5549d8cd8c10ac6879c9212f
+@remove internal/lease/check.go ChangeCounter
+@removed internal/lease/check.go ChangeCounter H3 census-ruling-sqlite-integrity-safe;basis=Now returns ReadHeader(path).Counter: same path, same bytes, the full 16-byte signature check. Its own read moved into ReadHeader.
@coverage . 66d3445f86ea99dd88e2209717e7f0c357e1507923b07426993c10b6cf8df03e
-@coverage internal/ops 42c990c49025533b34592b73cf4276c914ec8cda4f972b910751d7d7d7aedbc0
-@coverage third_party/ltx 5fafd968d55daccc9eae9caca02579ffb81693125f5305f62c1cedbd7def1659
+@coverage internal/lease 4297b1c70109e23c6998b3a6b7ae773b6cc268dd67aa6d6d69ae0d8c784096da
+@coverage internal/ops 733709742484121794ba2b4076e5ba5d3a7de935a89d47283c9b84fb2e6fed7b
+@coverage third_party/ltx 8af0b57d2cce0488fc0b52ae408d7e2598004c6701fecb8588243fec9be8b7bf