Repository navigation
refactor: consolidate SQLite flip-proof harness - #118502
Conversation
f75a12d to
c401fa0
Compare
|
Codex review: needs real behavior proof before merge. Reviewed August 3, 2026, 1:28 AM ET / 05:28 UTC. ClawSweeper reviewWhat this changesThis PR consolidates repeated fixture setup, gateway-client construction, polling, archive inventory, and read-only SQLite inspection in the SQLite sessions/transcripts flip-proof test helper. Merge readinessKeep this PR open for normal maintainer review. It is a focused, test-only consolidation that preserves the existing 22-checkpoint SQLite lifecycle contract, and current Priority: P3 Review scores
Verification
How this fits togetherThe SQLite flip-proof harness runs gateway and doctor lifecycle scenarios against an isolated state directory, then records checkpoints from JSONL archives and SQLite tables. Its report is consumed by E2E tests and a dedicated CI lane to detect regressions in session and transcript migration, cleanup, and lifecycle behavior. flowchart LR
A[Gateway and doctor scenarios] --> B[SQLite flip-proof harness]
B --> C[Fixture and client setup]
C --> D[Lifecycle checkpoints]
D --> E[Read-only SQLite inspection]
E --> F[E2E assertions and CI proof]
Before merge
Agent review detailsSecurityNone. PR surfaceTests -300. Total -300 across 1 file. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the refactor only after rebasing or refreshing against current Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refactors the existing proof harness rather than reporting a user-facing failure. The current E2E test provides a concrete contract for preserving the 22 checkpoint sequence and its assertions. Is this the best way to solve the issue? Yes. Consolidating repeated test-helper policy behind shared functions is the maintainable path, and the branch preserves the existing report entrypoint and contract consumers rather than creating a parallel harness. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fd10614a482b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Rank-up move status:
|
|
Merged via squash.
|
What Problem This Solves
The SQLite sessions/transcripts flip proof duplicated fixture construction, gateway client setup, child-output capture, read-only database lifecycles, and polling policy across one large E2E helper. That made the proof harder to audit and easier for equivalent lifecycle checks to drift.
Why This Change Was Made
Consolidates those repeated test-helper seams while preserving the exact 22-checkpoint execution order, 60-second operation budgets, continuous 1.5-second deletion-absence checks, shared-session reference semantics, and SQLite-only persistence assertions. No production code, schema, schema version, or runtime behavior changes.
Production LOC delta: 0. Test-helper delta: +391/-691 (net -300).
User Impact
No user-visible behavior change. Maintainers get a smaller, more coherent SQLite migration/lifecycle proof with one canonical implementation for repeated fixture, client, polling, child-process, and database-read operations.
Evidence
test/scripts/sqlite-sessions-transcripts-flip-proof.e2e.test.ts— 1/1 passed in 81.38s (tbx_01kz30s9jjashv420k9295yjee).tbx_01kz30smrddk4577mervcc5njv).origin/main: clean, no accepted/actionable findings, score 0.99.git diff --check: clean.