reviews: G6 fence branch round 2 (Astra READY AFTER FIXES)
docs/superpowers/reviews/CODEX-FINDINGS-G6-FENCE-BRANCH-R2.md+57 −0
CI cancelled — superseded by a newer push — run details
Intent
<task-notification> <task-id>brbhl7ait</task-id> <tool-use-id>toolu_01M2BJATrXBFAxFfPw3bHdMB</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/1be65f1d-61c8-4308-afb1-2c756edd9c6e/tasks/brbhl7ait.output</output-file> <status>completed</status> <summary>Background command "Wait for fence branch round 2" completed (exit code 0)</summary> </task-notification>
Attributed to this commit: 10.8 g CO₂e (1,376,020 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/reviews/CODEX-FINDINGS-G6-FENCE-BRANCH-R2.md b/docs/superpowers/reviews/CODEX-FINDINGS-G6-FENCE-BRANCH-R2.md| new file mode 100644 |
| index 000000000..b309b5dd1 |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/CODEX-FINDINGS-G6-FENCE-BRANCH-R2.md |
| @@ -0,0 +1,57 @@ |
| +Reviewed tip `8115130696bc728576ad9fe08e6c79c8e42c270c`. |
| + |
| +R1 dispositions: |
| + |
| +- **Astra P1 — resolved.** `stateMu` orders the fence against finalization. A fence that marks first poisons the cached result; a finalization that decides first prevents the event. Neither holds the state lock across I/O. |
| +- **Astra P2-2 — resolved.** Finalization closes the replica gate before its forced sync. The revised deadline test holds fence time at step zero and checks cancellation, the owed marker and subsequent retry. |
| +- **Astra P2-3 — deferred-by-ruling; acceptable.** The cancelled-wake refusal gap remains documented. It affects response timing and headers, without granting another holder storage authority. |
| +- **Fable P2-1 — resolved.** The fence starts at most one additional sync at a time, after five seconds and only with captured data outstanding. Its calls remain gated and untagged. The new test uses the real monitor and ticker. |
| +- **Fable P2-2 — deferred-by-ruling; acceptable.** Residual (d) and the revised idle drill describe the checkpoint-triggered fence. Checkpoint behaviour is unchanged. |
| +- **Fable P2-3 — resolved for valid WAL headers.** The scan distinguishes uncommitted spills from committed transactions. A new malformed-header defect is listed below. |
| +- **Fable P2-4 — resolved.** Coverage is not consulted when `DB.Pos` failed; the new queue test exercises that case. |
| + |
| +**New finding: P2 — An invalid WAL page size can discharge an obligation without proof.** |
| + |
| +**Location:** [fencerun.go:205–223](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-fence/internal/lease/fencerun.go:205), [fence.go:189–215](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-fence/internal/lease/fence.go:189). |
| + |
| +**Verified evidence:** `walFrameSize` returns zero for an invalid page size. `readCoverage` nevertheless yields the first frame header, then terminates its iterator because `stride == 0`. If that frame has matching salts and no commit, `walCovered` reaches its success return. `failed` remains false. |
| + |
| +**Failure scenario:** The WAL’s page-size field is corrupt, while its salts still match the captured LTX header. An uncommitted frame follows the captured end, followed by a commit frame. The scan reads only the first frame and reports coverage at the old `MaxTXID`. With that transaction already stored, the queue discards the obligation despite never examining the committed tail. The current tests cover short headers but not invalid page sizes. |
| + |
| +**Fix:** Return “not covered” when the frame stride is invalid. Add a regression with matching salts, an invalid page size, an uncommitted frame and a later commit; assert that coverage fails and the obligation remains. |
| + |
| +**Fault family:** discharge without proof, recurring from R1. Enforce the validity requirement at one guard with a witness test. This is a P2 malformed-input gap, not grounds for another whole-branch review round; check the storage change and refreshed census within the existing budget. |
| + |
| +No P1 or new P3 findings. The deferred task minors need no additional merge fix: Task 1’s tests exist; Task 2’s hook concern remains a follow-up; Task 3 follows the accepted ruling; Task 4’s dry-run refusal follows the rail’s existing ordering. |
| + |
| +The census verdict below concerns root-read authority. The WAL defect still needs fixing, but it adds no root execution, pathname selection or input authority. The five new `legacy / accepted-legacy` dispositions fit their agent-side reads. Approval applies to the card recording seal `a4d50694ba3e50c963f6c872071bc7b15b7fef45a6260fef22094676d9b7ba30`. |
| + |
| +| Unit or envelope | Verdict | Lines read | |
| +|---|---|---| |
| +| `Service.doWakeOnce` | Approve | [activator.go:3414–3453](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-fence/internal/activator/activator.go:3414) | |
| +| `Service.installProcLocked` | Approve | [activator.go:3586–3608](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-fence/internal/activator/activator.go:3586) | |
| +| `Service.wake` | Approve | `activator.go:2195–2211, 2277–2301, 2346–2408` | |
| +| `type Service` | Approve | `activator.go:1715–1728` | |
| +| `Service.haLeaseRefusalLocked` | Approve | [haleaseloss.go:95–135](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-fence/internal/activator/haleaseloss.go:95) | |
| +| `Held.Replicate` | Approve | [lease.go:417–456](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-fence/internal/lease/lease.go:417) | |
| +| `runRouteReplication` | Approve | [cli.go:2060–2085](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-fence/cli.go:2060) | |
| +| `replicationHARail` | Approve | `cli.go:2120–2133` | |
| +| `Replicator.fenceSample` | Approve | [fencerun.go:118–133](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-fence/internal/lease/fencerun.go:118) | |
| +| `Replicator.newestL0Header` | Approve | `fencerun.go:238–257` | |
| +| `readAtMost` | Approve | `fencerun.go:227–234` | |
| +| `readCoverage`, changed in this wave | Approve authority; P2 above remains | `fencerun.go:185–224` | |
| +| Envelope `.` | Approve | CLI ranges above; `route_replication_test.go:336–425` | |
| +| Envelope `internal/activator` | Approve | Ranges above; `writefence.go:1–105`, `stateless.go:256–274`, `swapadmit.go:85–105`, `writefence_test.go:1–802` | |
| +| Envelope `internal/lease` | Approve | `fence.go:1–216`, `fencerun.go:1–257`, `fencegate.go:1–168`; lease/release changes and added tests | |
| +| Wave: `fenceQueue.step` | Approve | `fence.go:83–134` | |
| +| Wave: `walCovered`, `walFrameSize` | Approve authority; P2 above remains | `fence.go:174–216` | |
| +| Wave: `Replicator.runFence` | Approve | `fencerun.go:63–114` | |
| +| Wave: `Replicator.tripFence` | Approve | `fencerun.go:147–174` | |
| +| Wave: `type Replicator` | Approve | `lease.go:539–562` | |
| +| Wave: `Replicator.finalize`, `Replicator.decideFinal` | Approve | [release.go:252–311](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/g6-fence/internal/lease/release.go:252) | |
| + |
| +Main’s marker rules remain intact: fenced releases clear `Clean` and `Finalized`, never set `Settled`, and therefore retain the lease-term wait. Healthy finalizations retain the clean/files-only handover path. |
| + |
| +`git diff --check` passed. Targeted Go tests could not start because the read-only sandbox prevented creation of Go’s build directory; no runtime or census-test pass is claimed. No files were edited, subagents spawned, or full suites run. |
| + |
| +**READY AFTER FIXES** |
| \ No newline at end of file |