carlos / platform Public

sqlite-integrity-safe: Astra review brief, round 3

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev f4c42f31a7be004f9c13f720de2276e9a20c36c0 parent 3cef0c8
1 file changed, +75 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-sqlite-integrity-safe-R3.md +75 −0

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-p9rTfm
.amadan/test-gate.sh
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 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/crypto/x509roots/fallback v0.0.0-20260209214922-2f26647a795e
go: downloading golang.org/x/net v0.62.0
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/prometheus/client_golang v1.17.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/ec2 v1.324.0
go: downloading github.com/aws/aws-sdk-go-v2/service/route53 v1.64.1
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/oschwald/maxminddb-golang v1.13.1
go: downloading github.com/pion/logging v0.2.4
go: downloading github.com/pion/stun/v3 v3.1.5
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/sesv2 v1.66.6
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/klauspost/compress v1.20.2
go: downloading github.com/wlynxg/anet v0.0.5
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 modernc.org/memory v1.11.0
go: downloading github.com/google/uuid v1.6.0
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading modernc.org/memory v1.11.0
go: downloading github.com/google/uuid v1.6.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
go: downloading github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec

amadan: job cancelled — a newer push superseded it
diff --git a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-sqlite-integrity-safe-R3.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-sqlite-integrity-safe-R3.md
new file mode 100644
index 000000000..5f8ca3a46
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-sqlite-integrity-safe-R3.md
@@ -0,0 +1,75 @@
+# Review brief: sqlite-integrity-safe branch diff + census, round 3 of 3
+
+Repo carlos/platform, branch `sqlite-integrity-safe`, commit 3cef0c8b603b7e4e6156016a05226d239c6bfc2c.
+Under review: the diff `origin/main...3cef0c8b603b7e4e6156016a05226d239c6bfc2c` (merge base 991bbe800), and the
+census card `docs/superpowers/notes/census-proposal-sqlite-integrity-safe.md`.
+Authorities: `AGENTS.md` ("The census: the reviewer decides", "Stopping
+rules"), the build brief `docs/superpowers/notes/BUILD-BRIEF-sqlite-integrity-safe.md`,
+and Paul's ruling on amadan #1673. Do not review against unmerged branches.
+
+You are an independent reviewer. Read the diff, then the code it touches,
+and check every claim against that code.
+
+## Fixed: do not re-argue
+
+- Scope (Paul, #1673): only (1) an LTX file cut short never panics and
+ premature end is classified in one place at the ltx decoder's input,
+ (2) the box drill never counts unknown freshness as current, (3) a doc
+ comment. The drill's failed-vs-unverified classification, the S1 alarm
+ and request trims are out of scope.
+- In WAL mode, freshness is reported "unknown"; the counter-based STALE
+ verdict is unchanged.
+
+## What to check
+
+1. **ltx decoder** (`third_party/ltx/decoder.go`): can a healthy LTX file
+ (any size, any page count, lz4 frames, page index, trailer) now fail?
+ Is every strict prefix `io.ErrUnexpectedEOF` and every non-EOF read
+ error preserved? Any path where a premature end still reads as a normal
+ end, or a panic remains (Close, page data, index, trailer)? Effect on
+ every caller: restore, compaction (`third_party/litestream`), console
+ seed, drills, moves, `dbdoor`.
+2. **Freshness and RestoreVerify** (`internal/ops/freshness.go`,
+ `litestream.go`, `hibernate_verify.go`): only affirmative evidence counts
+ as current; exit status unchanged; the hibernate drill's mapping of the
+ new unknowns, and the empty-path guard change.
+3. **Tests**: do they fail when the behaviour is removed, and go through
+ the real paths? Zero new S3 requests.
+4. **Census**: give a verdict for every unit and every re-pinned envelope
+ on the card, per AGENTS.md's census rules, citing the lines you read.
+
+## Round 3 (the last)
+
+Earlier rounds: `CODEX-FINDINGS-sqlite-integrity-safe-R1.md`, `...-R2.md`. Paul's ruling
+after R2 (stopping rule 2, #1673): each R2 invariant is enforced in ONE place with a
+guard test at the caller boundary (`inputReader.readFull` for held read errors;
+`lease.ReadHeader` for the full 16-byte signature). Both behaviours pre-existed on main.
+If this round still finds a P1 in those two families, say whether dropping the fix
+(reverting to main's behaviour for that case) removes it.
+
+First give one line per R2 P1: resolved, partly, or not. Carry unresolved findings
+forward, then add new findings. Re-give census verdicts only for units and envelopes that
+changed since 08856d2 (the card lists them, including the deleted `sourceHeader` and the
+new `ReadHeader`). The summary wording is in copy review with Paul; do not raise it.
+
+## Severity
+
+- **P1**: unsafe, would not compile, a test fails, or it would not work.
+ Blocks merge.
+- **P2**: wrong or missing. Fixed without reopening this review.
+- **P3**: clarity or polish. Follow-up list only.
+
+A P1 states its failure scenario and the evidence (file:line). Do not
+raise a P2 to P1 to keep the review open.
+
+## Output
+
+Findings ranked P1, P2, P3, each with the problem, evidence (file:line,
+verified), failure scenario, a concrete fix and its invariant. Then a
+census table: unit or envelope, APPROVE or REJECT, the lines read. End with
+exactly one verdict: **READY**, **READY AFTER FIXES** (no P1; listed P2s
+fixed without another round), or **NOT READY** (P1s listed).
+
+Do not edit files. Do not spawn Anthropic-model reviewers or subagents of
+your own. Do not run the full test suites (targeted `go test -run` on
+one package is fine; leave GOCACHE at its default).