Repository navigation
test(sqlite): inject recorded checkpoint failure in integrity fixture - #170292
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. What this changesThis PR injects a checkpoint preparation error and verifies recorded WAL health before exercising database closure. Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR: it repairs a stale failure fixture while preserving both no-certification assertions and production integrity policy. No actionable defect was found. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherAgent database handles use WAL maintenance and a lease owner to publish clean-close verification; the fixture checks that checkpoint or native-close failures prevent certification. flowchart LR
A[Integrity fixture] --> B[WAL checkpoint owner]
B --> C[Recorded error health]
C --> D[Agent handle closer]
D --> E[Lease verification owner]
E --> F[No clean certification]
Technical reviewBest possible solution: Retain the explicit checkpoint-error injection and merge the focused fixture correction through the normal checks. Do we have a high-confidence way to reproduce the issue? Current main retains the old close-return mock, while the production closer can certify a healthy delegated native close despite that false return; source establishes the fixture mismatch, and no tests were run during this read-only review. Is this the best way to solve the issue? The change exercises the real checkpoint error recorder instead of mocking the close decision, then restores normal database preparation before checking the independent certification outcome. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bc9765989862. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +9. Total +9 across 1 file. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 12, 2026, 6:03 PM ET / 22:03 UTC. |
…openclaw#170292) ## What Problem This Solves The integrity lease fixture modeled a failed checkpoint by making `walMaintenance.close()` return `false`. After delegated close changed in `f4202000f1fc48963c026e8913cc1d6741e48d55` (openclaw#169983), that return can also mean a healthy delegated close; the last native close may correctly certify an empty WAL. The test expected no verification record but received `clean_close = 1`. ## User Impact This is a fixture correction. Production integrity policy and both existing no-certification assertions remain unchanged. No production SQLite calls, SQL requests, schema, security checks, SDK, or update behavior change; no SQL or T1 saving is claimed. A published-driver update cell is not required. ## Why This Change Was Made Inject a one-shot database preparation error, exercise the actual checkpoint operation, and assert the recorded health error before closing. Restore the spy before testing closure. This distinguishes failed checkpoint behavior from successful delegated close without weakening the native-close assertion. The reviewed source is `780c860b54367c72d2744e5344f4c6e5f25f0d88`: one test file, +10/−1 lines. The original scheduled-main assertion is retained in [run 38298274614, job 114974958634](https://github.com/openclaw/openclaw/actions/runs/38298274614/job/114974958634). Attribution uses the parent-relative source change and observed assertion; no new bisect or inverse test is claimed. ## Evidence At publication head `4743da172d268448dbee28ab414d77d514093510`, [run 38313966750, target job 115026423600](https://github.com/openclaw/openclaw/actions/runs/38313966750/job/115026423600) passed all **18/18** named cases in `src/state/openclaw-agent-db.integrity-lease.test.ts`. The changed failed-checkpoint/native-close case passed in **114 ms**. The single-file CI invocation took **11.26 s in Vitest and 13.48 s including the repository test wrapper**; these are CI timings, not a new local execution. That exact-head PR workflow completed successfully: **18 jobs passed, 29 were skipped, and none failed**. Selected source-contract, architecture/guard, additional-boundary, baseline-ratchet, test-type (`core-3`), lint, changed-test and `openclaw/ci-gate` checks passed. Build artifacts and the update cell were not selected; this fixture changes no production build or update implementation. This is the scoped PR workflow, not a scheduled full-main result. Knip was not selected on this PR. Its unchanged import/export graph supports scoped reuse of [V28 dependency job 115019807997](https://github.com/openclaw/openclaw/actions/runs/38311910220/job/115019807997): that scan failed only on three Team-scale exports subsequently removed by base commit `2531250f65253f9d6466ee7f2d50c80184b41e42`, which is included here. This is a source-qualified disposition, not a claim that the historical Knip scan or a new final-head scan passed. The unchanged graph also reuses [V28 topology job 115019805821](https://github.com/openclaw/openclaw/actions/runs/38311910220/job/115019805821), which reported zero runtime and Madge cycles. One isolated Codex review was scoped-clean. Focused formatting, lint, whitespace checks, normal commit hooks, and source-extraction checks passed; no extra review was run for the unchanged reviewed delta.
What Problem This Solves
The integrity lease fixture modeled a failed checkpoint by making
walMaintenance.close()returnfalse. After delegated close changed inebb360e17901cdc1b730cf3ab1fe7b3c8253b3a4(#169983), that return can also mean a healthy delegated close; the last native close may correctly certify an empty WAL. The test expected no verification record but receivedclean_close = 1.User Impact
This is a fixture correction. Production integrity policy and both existing no-certification assertions remain unchanged. No production SQLite calls, SQL requests, schema, security checks, SDK, or update behavior change; no SQL or T1 saving is claimed. A published-driver update cell is not required.
Why This Change Was Made
Inject a one-shot database preparation error, exercise the actual checkpoint operation, and assert the recorded health error before closing. Restore the spy before testing closure. This distinguishes failed checkpoint behavior from successful delegated close without weakening the native-close assertion.
The reviewed source is
780c860b54367c72d2744e5344f4c6e5f25f0d88: one test file, +10/−1 lines. The original scheduled-main assertion is retained in run 38298274614, job 114974958634. Attribution uses the parent-relative source change and observed assertion; no new bisect or inverse test is claimed.Evidence
At publication head
4743da172d268448dbee28ab414d77d514093510, run 38313966750, target job 115026423600 passed all 18/18 named cases insrc/state/openclaw-agent-db.integrity-lease.test.ts. The changed failed-checkpoint/native-close case passed in 114 ms. The single-file CI invocation took 11.26 s in Vitest and 13.48 s including the repository test wrapper; these are CI timings, not a new local execution.That exact-head PR workflow completed successfully: 18 jobs passed, 29 were skipped, and none failed. Selected source-contract, architecture/guard, additional-boundary, baseline-ratchet, test-type (
core-3), lint, changed-test andopenclaw/ci-gatechecks passed. Build artifacts and the update cell were not selected; this fixture changes no production build or update implementation. This is the scoped PR workflow, not a scheduled full-main result.Knip was not selected on this PR. Its unchanged import/export graph supports scoped reuse of V28 dependency job 115019807997: that scan failed only on three Team-scale exports subsequently removed by base commit
36e78f215f1f058af15919da8a60c06797a759e8, which is included here. This is a source-qualified disposition, not a claim that the historical Knip scan or a new final-head scan passed. The unchanged graph also reuses V28 topology job 115019805821, which reported zero runtime and Madge cycles.One isolated Codex review was scoped-clean. Focused formatting, lint, whitespace checks, normal commit hooks, and source-extraction checks passed; no extra review was run for the unchanged reviewed delta.