Repository navigation
test: own SQLite flip proof resource lifetimes - #136291
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 8:30 AM ET / 12:30 UTC. ClawSweeper reviewWhat this changesThe PR gives the SQLite session/transcript flip proof explicit ownership and ordered teardown for its Gateway clients, child processes, databases, environment, and temporary state. Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep open. This is a coherent maintainer-owned test-lifecycle repair, current main still has the older direct-finalizer structure, and the branch introduces no product, schema, or dependency-version change. Priority: P3 Review scores
Verification
How this fits togetherThe SQLite flip proof starts an isolated Gateway and mock provider, exercises session migration and lifecycle flows against temporary SQLite state, and emits checkpointed evidence. The changed harness now releases acquired resources before it destroys that temporary state. flowchart LR
A[Temporary SQLite state] --> B[Gateway and mock provider]
B --> C[Session and doctor lifecycle proof]
C --> D[Checkpointed proof report]
C --> E[Owned cleanup registry]
E --> F[Clients and child processes stopped]
E --> G[Databases and temporary state released]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +66. Total +66 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Retain one explicit ownership path for every acquired proof resource and validate it through the existing source and built-CLI E2E entrypoints before merge. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR repairs an internal test harness rather than a reported user issue. The PR body supplies a targeted remote E2E run for the changed harness, while source inspection establishes the lifetime boundary. Is this the best way to solve the issue? Yes. Registering each resource immediately after acquisition and draining those owners before state deletion fixes the failure window that current main's nested direct finalizers leave open. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3c6169c63628. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
The real SQLite session/transcript flip proof can leave a lock-holding child or an acquired client alive after an intermediate failure. Its local child stopper also leaves the losing two-second sleep timer referenced after successful shutdown.
Why This Change Was Made
Give the proof context ownership of every acquired child, client and concurrent request group. Register ownership before the next fallible operation, join cleanup before deleting state, and preserve both the original failure and any cleanup failure. Failed cleanup retains its state directory for diagnosis. Use the canonical child stopper and an abortable close deadline instead of the local timer race.
The existing two complete E2E tours, all 47 assertion sites, 21 checkpoints, concurrency and real timeout/lock/absence windows remain unchanged. Production delta is zero; test-support delta is +377/-311 (net +66, chiefly explicit resource ownership with surrounding lifetime indentation).
User Impact
More reliable internal validation and prompt process exit after cleanup. There is no product, database schema or persistence behavior change. Failed acquisition inside the shared connector before it returns a client remains a separate owner-level follow-up.
Evidence
Canonical real E2E runs passed both cases before, after and after restoring the original. Case-body totals were 56.48 s, 55.07 s and 54.77 s respectively; no whole-suite speedup is claimed. Cold artifact preparation differs between runs.
Private failure probes reproduced the original busy-child leak, mock-readiness leak and acquired-client leak, then passed against the candidate. Additional probes verified that a failed child stop retains state and both errors, and that all concurrent requests settle before cleanup. Native process observations confirmed the referenced losing timer fell from one to zero; natural exit after proof completion fell from 2065.9 ms to 57.2 ms.
The remote proof run completed with all named outer process groups and captured direct children joined, 53 source guards restored, temporary proof files removed and the exact Testbox stopped. This is evidence for those observed owners, not a blanket claim about escaped descendants. The published candidate adds only a mechanical block body to the proved Promise executor to satisfy lint.
Formatting, type-aware lint, diff checks and Codex P0 review passed. Exact-head CI remains the integration gate.