Repository navigation
fix(ci): repair snapshot ownership proof after native cutover - #161271
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 29, 2026, 1:28 PM ET / 17:28 UTC (Revision 4). ClawSweeper reviewWhat this changesThe branch updates the SQLite snapshot ownership test to record physical token-child processes and check session reuse, directory cleanup, and child exit. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep open. Current main still uses a caller-realm spawn spy that cannot observe the native child, while the pinned test-merge result contains the focused replacement. The earlier MCP fixture conflict is absent, and I found no actionable patch defect. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw stages temporary SQLite snapshots for read-only work. A native child holds the snapshot tokens; the staging owner returns directories to callers and joins their cleanup before releasing the child. flowchart LR
A[Snapshot requests] --> B[Staging owner]
B --> C{Reuse native session?}
C --> D[Read-only child]
D --> E[Token-held directories]
E --> F[Joined cleanup]
F --> G[Child exits]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +18. Total +18 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one physical-process ownership regression at the staging boundary, with joined retirement and separate fail-closed allocation coverage. Do we have a high-confidence way to reproduce the issue? Yes. Current main's host spawn spy cannot observe the child launched by the native resource; the ownership test is a focused reproduction path. This read-only review did not execute it. Is this the best way to solve the issue? Yes. Observing the physical child through its real launch arguments repairs the test at the relevant boundary, while separate native-resource cases preserve the missing-receipt policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f7741c38ce7c. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
e68f9eb to
1d48703
Compare
Co-authored-by: steipete <[email protected]>
1d48703 to
0d5361a
Compare
|
Merged via squash.
|
Co-authored-by: steipete <[email protected]>
Related: #160946, #161074, #160922
What Problem This Solves
The snapshot ownership test spies on caller-realm process creation even though token processes now launch inside the native owner, causing CI to fail.
User Impact
No production behavior change. Restore the regression test while preserving its one-physical-process budget, concurrent/nested lifetimes, off-host SQLite requirement, and joined cleanup.
Why This Change Was Made
A scoped Node preload records startup only inside matching physical SQLite session processes. The test still requires exactly one real token child across three concurrent allocations and a nested fourth allocation. It checks every directory and verifies the recorded process is alive while held and gone after child-before-parent cleanup. A Worker-handle count does not substitute for this evidence.
The deliberately unreceipted allocation is separated from this healthy-lifetime scenario: the canonical native-resource tests already require cleanup to fail closed unless native not-started proof exists. That production policy is unchanged. Every successful sibling allocation retains cleanup custody, and scoped environment restoration follows joined cleanup. All 14 ownership cases remain.
Main independently landed the MCP fixture repair in
1d0efa48d3a84. This PR keeps that implementation unchanged and drops its superseded MCP commit, resolving the overlap. Onlysrc/infra/sqlite-snapshot-staging.ownership.test.tsnow differs from main.Evidence
The original ownership file reproduced the CI failure locally: 1 failed, 13 passed. Temporary diagnostics, restored afterward, exposed the obsolete host count (zero) masked by intentional missing-receipt cleanup refusal. Main’s separate module-reload cleanup fix did not fix the stale observation.
The revised healthy case passed with one actual token child and joined process exit. A temporary production mutation disabled session reuse: the test failed at the intended four physical PIDs versus one assertion. Production was restored byte-for-byte; no fake PID count, shortened timeout, or new production hook supplies the proof.
Before conflict resolution, 66 tests passed across six files, with one existing Windows-only skip, including both canonical missing-receipt/not-started cases. Full changed-file checks passed: types, typed lint, formatting, guards, and all three dead-export scans. Independent P0–P2 review was scoped-clean.
Conflict resolution replays only the snapshot commit onto
114c92cb458dd8bda09670950f85302dc0293d4a;git range-diffconfirms that this remaining patch is identical. New head:0d5361a98507cc21a0f64de2c5eaf2877985e296. Current-head validation passed 37 tests: all 14 snapshot ownership cases, 20 MCP migration cases using main’s retained implementation, and all 3 lint-suppression cases (72.09 s combined wrapper, including cold worker preparation). Current formatting, typed lint andgit diff --checkpass. The earlier full static checks, sibling tests, negative control and independent review are reused for the unchanged remaining patch; they are not relabeled as newly executed.Prior CI 36596233011, attempt 1 failed on the original snapshot case and cancelled 19 jobs. Subsequent head
1d48703…received no CI run while conflicting with main’s MCP repair; its completed ClawSweeper review found no code defect but required conflict resolution and retention of the physical-PID witness. Neither cancelled coverage nor the absent run is represented as green. New-head hosted gates remain required.Current-head CI 36604065213, attempt 1 passed: 17 successful jobs, 26 scoped skips, no failed or cancelled CI jobs. Actual tested merge
adeaa4a2a473d2246c1a2bce142094617a357794combines basec4735dd1b1169862df1f9b7c03772d617c07bf4fwith head0d5361a98507cc21a0f64de2c5eaf2877985e296. Ownership 14/14 passed: physical-process case 513 ms, file Vitest 10.65 s, supported wrapper 12.39 s. Boundary siblings: 140 tests / 12 files passed. These are observed costs, not a speedup claim. Exact-head ClawSweeper completed cleanly at 17:28 UTC; both enforced CI gate projections are green.Worked on by
Work sessions
View the OpenClaw team session