Skip to content

test(sqlite): inject recorded checkpoint failure in integrity fixture - #170292

Merged
steipete merged 1 commit into
mainfrom
dbasync/redmain-integrity-fixture-publication
Oct 12, 2026
Merged

steipete merged 1 commit into
mainfrom
dbasync/redmain-integrity-fixture-publication

Conversation

@steipete

@steipete steipete commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The integrity lease fixture modeled a failed checkpoint by making walMaintenance.close() return false. After delegated close changed in ebb360e17901cdc1b730cf3ab1fe7b3c8253b3a4 (#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. 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 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: 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.

@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 12, 2026
@clawsweeper

clawsweeper Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR injects a checkpoint preparation error and verifies recorded WAL health before exercising database closure.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent test-only repair supported by matching tested source and verified job success, with no actionable finding.
Proof confidence 🐚 platinum hermit (4/6) Only a test fixture changes, so no shipped-entry-point demonstration is required; the supplied native-database harness evidence is scoped to checkpoint health and close certification.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: The integrity regression fixture mistakes a healthy delegated close for a failed checkpoint and reports a false failure.
Reason: The correction preserves meaningful failure coverage without changing production code, storage formats, defaults, or public contracts.

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
Reviewed head: 4743da172d268448dbee28ab414d77d514093510

Before merge

None.

Findings

None.

Agent review details

How this fits together

Agent 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]
Loading

Technical review

Best 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

  • Checkpoint-failure fixture keeps the original intent (6584af0: Clean-restart verification must not survive failed checkpoint or native cleanup.)
  • Delegated native-close certification keeps the original intent (ebb360e: Worker retirement owns explicit checkpointing, while healthy native last-close may certify an empty WAL.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit ebb360e adds src/state/openclaw-agent-db-close.ts:29 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ebb360e17901; files: src/state/openclaw-agent-db-close.ts)

PR surface

Tests +9. Total +9 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 10 1 +9
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 10 1 +9

Labels

Label changes:

  • add P3: This is a focused test-fixture repair with no shipped behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is a focused test-fixture repair with no shipped behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 12, 2026, 6:03 PM ET / 22:03 UTC.

@steipete
steipete merged commit 08be9ea into main Oct 12, 2026
103 checks passed
@steipete
steipete deleted the dbasync/redmain-integrity-fixture-publication branch October 12, 2026 22:15
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant