Skip to content

fix: preserve caller-replaced SQLite targets on Windows - #116284

Merged
steipete merged 1 commit into
mainfrom
fix/windows-sqlite-cleanup-forward
Jul 30, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/windows-sqlite-cleanup-forward

Conversation

@steipete

@steipete steipete commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where Windows snapshot publication cleanup could delete a replacement target created by the caller after publication. NTFS can reuse the deleted file identity while the original target handle remains pinned, so inode/file-index ownership alone is not sufficient for cleanup.

Why This Change Was Made

Failure cleanup now always requires the complete size, mtime, ctime, and birthtime fingerprint before unlinking the published pathname. The now-redundant pinned-ownership bookkeeping is removed. This is the exact forward-port of the beta.6 release fix.

User Impact

Windows snapshot and restore failures preserve a caller-owned replacement database instead of deleting it during cleanup.

Evidence

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Jul 30, 2026
@steipete steipete self-assigned this Jul 30, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 30, 2026
@clawsweeper

clawsweeper Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 30, 2026, 3:28 AM ET / 07:28 UTC.

ClawSweeper review

What this changes

This PR removes inode-only ownership bookkeeping from SQLite snapshot cleanup and requires a full file fingerprint before deleting a failed published target on Windows.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 3 items remain

Keep this maintainer-labeled PR open for normal maintainer review. The focused patch addresses a credible Windows data-preservation failure path and no concrete defect is visible in the supplied diff, but the PR body currently provides regression-test/CI evidence rather than after-fix Windows runtime proof.

Priority: P1
Reviewed head: d5d325680c02b20b5278c14ca633670831655b24

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The implementation signal is narrow and plausible, but the required real Windows behavior proof has not yet been supplied.
Proof confidence 🧂 unranked krab (1/6) Needs real behavior proof before merge: The PR cites an existing regression and pending hosted Windows CI, but it does not yet provide after-fix real Windows runtime evidence showing that a caller-replaced target survives cleanup; redact private paths and identifiers in any terminal output or logs. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR cites an existing regression and pending hosted Windows CI, but it does not yet provide after-fix real Windows runtime evidence showing that a caller-replaced target survives cleanup; redact private paths and identifiers in any terminal output or logs. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 3 items Focused cleanup change: The supplied PR diff removes the pinned-identity boolean and changes failure cleanup to rely on the published target fingerprint, matching the stated goal of preserving a caller-replaced Windows target.
Existing regression coverage: The PR body identifies the focused regression named preserves a target replaced by the caller after publication in the SQLite snapshot test suite; this is relevant coverage but is not after-fix runtime proof by itself.
Review-policy context: The supplied full root AGENTS.md treats persisted-state and cleanup behavior as compatibility-sensitive and requires proof across affected paths; the PR is also labeled maintainer, so it remains for explicit maintainer handling.
Findings None None.
Security None None.

How this fits together

SQLite snapshot publication replaces a target database with verified staged content and returns a guard for later failure cleanup. That cleanup must remove only the file published by this operation, not a replacement database the caller created afterward.

flowchart LR
  A[Staged SQLite snapshot] --> B[Publish verified target]
  B --> C[Record published file fingerprint]
  C --> D[Return publication guard]
  D --> E[Caller may replace target]
  E --> F[Failure cleanup]
  F --> G[Unlink only matching published target]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR cites an existing regression and pending hosted Windows CI, but it does not yet provide after-fix real Windows runtime evidence showing that a caller-replaced target survives cleanup; redact private paths and identifiers in any terminal output or logs. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The stricter full-fingerprint cleanup must still remove the originally published target when it remains in place, while never deleting a caller-created replacement; pending Windows CI does not by itself show that runtime outcome.
  • Complete next step (P2) - This maintainer-labeled PR needs a maintainer decision on whether the pending Windows CI plus the requested runtime evidence is sufficient; there is no discrete repair finding to dispatch.
Agent review details

Security

None.

PR surface

Source -8. Total -8 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 3 11 -8
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 3 11 -8

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Prove both cleanup outcomes on Windows (recommended)
    Before merge, capture redacted Windows evidence that cleanup deletes an unchanged published target but preserves a target replaced by the caller.
  2. Accept CI-only validation
    A maintainer may accept the existing regression and exact-head Windows CI as sufficient if the beta.6 provenance is independently confirmed.

Technical review

Best possible solution:

Retain one canonical fingerprint-based cleanup rule, validate it on Windows for both unchanged and caller-replaced targets, then merge the narrow forward-port if both outcomes are demonstrated.

Do we have a high-confidence way to reproduce the issue?

Unclear: the supplied regression name and patch describe a concrete Windows replacement scenario, but this review could not independently execute or inspect a current-head Windows reproduction.

Is this the best way to solve the issue?

Yes, provisionally: replacing inode-only ownership with a complete published-file fingerprint directly addresses NTFS identity reuse without adding a new compatibility surface; the unchanged-target cleanup path still needs Windows evidence.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against ad1dc602594b.

Labels

Label changes:

  • add P1: The reported failure can delete a caller-owned replacement SQLite database during a Windows snapshot or restore failure path.
  • add merge-risk: 🚨 compatibility: The PR changes the ownership predicate used by existing SQLite snapshot cleanup, so an incorrect predicate could alter preservation or removal behavior for current users.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR cites an existing regression and pending hosted Windows CI, but it does not yet provide after-fix real Windows runtime evidence showing that a caller-replaced target survives cleanup; redact private paths and identifiers in any terminal output or logs. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P1: The reported failure can delete a caller-owned replacement SQLite database during a Windows snapshot or restore failure path.
  • merge-risk: 🚨 compatibility: The PR changes the ownership predicate used by existing SQLite snapshot cleanup, so an incorrect predicate could alter preservation or removal behavior for current users.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR cites an existing regression and pending hosted Windows CI, but it does not yet provide after-fix real Windows runtime evidence showing that a caller-replaced target survives cleanup; redact private paths and identifiers in any terminal output or logs. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Focused cleanup change: The supplied PR diff removes the pinned-identity boolean and changes failure cleanup to rely on the published target fingerprint, matching the stated goal of preserving a caller-replaced Windows target. (src/infra/sqlite-snapshot.ts:563, d5d325680c02)
  • Existing regression coverage: The PR body identifies the focused regression named preserves a target replaced by the caller after publication in the SQLite snapshot test suite; this is relevant coverage but is not after-fix runtime proof by itself. (src/infra/sqlite-snapshot.test.ts, d5d325680c02)
  • Review-policy context: The supplied full root AGENTS.md treats persisted-state and cleanup behavior as compatibility-sensitive and requires proof across affected paths; the PR is also labeled maintainer, so it remains for explicit maintainer handling. (AGENTS.md, ad1dc602594b)

Likely related people:

  • steipete: The available PR metadata attributes the focused repair commit to steipete and describes it as a forward-port of a beta release fix; current-main history could not be independently inspected in this read-only execution environment. (role: recent SQLite snapshot contributor; confidence: low; commits: d5d325680c02; files: src/infra/sqlite-snapshot.ts, src/infra/sqlite-snapshot.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add a redacted Windows terminal capture or runtime log showing a replacement target survives failure cleanup.
  • Show the companion unchanged-target case still removes the file this publication created.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit d5f8be3 into main Jul 30, 2026
137 of 143 checks passed
@steipete
steipete deleted the fix/windows-sqlite-cleanup-forward branch July 30, 2026 07:40
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Jul 30, 2026
…n-dedupe

* origin/main: (25 commits)
  fix(qqbot): use Gateway timezone for reminders (#116294)
  test(openai): cover out-of-order named mark acks
  docs(openai): clarify cumulative playback marks
  test(openai): cover sustained unnamed mark acknowledgements
  fix(openai): preserve playback acknowledgement order
  test(openai): verify bounded playback acknowledgements
  fix(openai): bound realtime playback marks
  test(agents): mock incremental registry persistence (#116307)
  fix(memory-core): MEMORY.md compaction deletes user notes written under a promotion-style heading (#116180)
  feat(reply): annotate recent history images (#100866)
  chore(ios): refresh native i18n inventory
  fix(ios): isolate capability router handlers
  docs(ios): cut 2026.7.22 release notes
  docs(hooks): document validation responses
  test(qa): assert hook account rejection reasons
  fix(gateway): validate hook delivery accounts
  perf(gateway): bound prepared runtime startup work (#116261)
  fix(agents): prevent registry stalls during large fan-outs (#116286)
  fix(sqlite): preserve replaced snapshot targets on Windows (#116284)
  fix(ci): load frozen shard runner without repository fetch (#116273)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 31, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 31, 2026
…n-dedupe

* origin/main: (25 commits)
  fix(qqbot): use Gateway timezone for reminders (openclaw#116294)
  test(openai): cover out-of-order named mark acks
  docs(openai): clarify cumulative playback marks
  test(openai): cover sustained unnamed mark acknowledgements
  fix(openai): preserve playback acknowledgement order
  test(openai): verify bounded playback acknowledgements
  fix(openai): bound realtime playback marks
  test(agents): mock incremental registry persistence (openclaw#116307)
  fix(memory-core): MEMORY.md compaction deletes user notes written under a promotion-style heading (openclaw#116180)
  feat(reply): annotate recent history images (openclaw#100866)
  chore(ios): refresh native i18n inventory
  fix(ios): isolate capability router handlers
  docs(ios): cut 2026.7.22 release notes
  docs(hooks): document validation responses
  test(qa): assert hook account rejection reasons
  fix(gateway): validate hook delivery accounts
  perf(gateway): bound prepared runtime startup work (openclaw#116261)
  fix(agents): prevent registry stalls during large fan-outs (openclaw#116286)
  fix(sqlite): preserve replaced snapshot targets on Windows (openclaw#116284)
  fix(ci): load frozen shard runner without repository fetch (openclaw#116273)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant