Skip to content

fix(sqlite): disable WAL on network filesystems - #93454

Merged
vincentkoc merged 2 commits into
mainfrom
audit/sqlite-wal-current
Jun 16, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
audit/sqlite-wal-current

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Jun 16, 2026 •

Copy link
Copy Markdown
Member

Summary

  • centralize plugin-owned SQLite connection setup on the existing core WAL maintenance policy
  • fall back to rollback journaling for NFS, SMB/CIFS, Windows UNC paths, and mapped Windows network drives
  • migrate Workboard off its duplicate hard-coded WAL pragmas and harden rollback journal sidecars
  • ratchet the public Plugin SDK total export budget by exactly one for the centralized helper
  • keep scope limited to journal-mode selection; this does not claim SQLite databases are generally safe over network filesystems

Linked context

Related #90491
Related #91247

Requested as a maintainer follow-up audit of the centralized SQLite WAL handling.

AI-assisted implementation; maintainer-run local, Testbox, and native Windows proof completed.

Real behavior proof (required for external PRs)

  • Behavior or issue addressed: network-backed SQLite databases could still enter WAL mode through SMB/CIFS paths or the Workboard plugin.
  • Real environment tested: Linux Node 24 on Blacksmith Testbox through Crabbox; native Windows Server Node 24 on Azure Crabbox.
  • Exact steps or command run after this patch:
    • corepack pnpm build
    • OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 CI=1 corepack pnpm check:changed
    • native Windows PowerShell probe creating a local SMB share, mapping it to Z:, and reading the mapped/local paths with fs.realpathSync.native
  • Evidence after fix:
    • Testbox build passed.
  • Testbox changed gate passed before the final upstream-only rebase; targeted tests and SDK guards passed after resolving the one-line budget conflict.
    • Native Windows probe returned a UNC canonical path for Z:\openclaw.sqlite, a local canonical path for \\?\C:\..., and normalized //server/share/... to UNC form.
  • Observed result after fix: detected network-backed paths select journal_mode=DELETE; local paths retain WAL.
  • What was not tested: concurrent access against a physical remote NAS.
  • Proof limitations or environment constraints: rollback journaling is a mitigation for unsupported WAL semantics, not a guarantee that arbitrary SQLite-over-network deployments are safe.

Tests and validation

  • node scripts/run-vitest.mjs test/scripts/plugin-sdk-surface-report.test.ts — 4 tests passed
  • node scripts/run-vitest.mjs src/plugins/contracts/plugin-sdk-subpaths.test.ts src/infra/sqlite-wal.test.ts extensions/workboard/src/store.test.ts — 119 tests passed
  • targeted oxfmt and oxlint checks passed
  • Plugin SDK surface budget, export sync, subpath export, extension boundary, and API baseline checks passed
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main — clean, no accepted/actionable findings
  • Blacksmith Testbox through Crabbox build/initial changed gate: tbx_01kv6x2pdn129hht9bz157yxnh
  • Blacksmith Testbox through Crabbox final rebased changed gate: tbx_01kv6zyqp96yjatej9qs6w9xz1, Actions run https://github.com/openclaw/openclaw/actions/runs/27587371007
  • Azure Crabbox native Windows: cbx_df62177060b6, proof run run_35db2fb63055

Risk checklist

  • Did user-visible behavior change? Yes
  • Did config, environment, or migration behavior change? No
  • Did security, auth, secrets, network, or tool execution behavior change? No
  • Highest-risk area: incorrectly classifying local versus network-backed Windows paths.
  • Mitigation: explicit UNC and drive-path normalization tests, conservative rollback fallback on Windows classification failure, official Node/libuv and Win32 contract review, and native Windows proof.

Current review state

Ready for exact-head CI and maintainer review. No known proof gaps beyond physical NAS concurrency.

@vincentkoc vincentkoc self-assigned this Jun 16, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation plugin: workboard size: M labels Jun 16, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review June 16, 2026 01:06
@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Jun 16, 2026
@blacksmith-sh

This comment has been minimized.

@vincentkoc
vincentkoc force-pushed the audit/sqlite-wal-current branch from 523720f to 0bf4dff Compare June 16, 2026 01:27
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Jun 16, 2026
@vincentkoc
vincentkoc force-pushed the audit/sqlite-wal-current branch from 0bf4dff to b568556 Compare June 16, 2026 01:31
@vincentkoc

Copy link
Copy Markdown
Member Author

Land-ready proof for b568556363dd63d4f92c7ee56b97cc457230cf6c:

Known proof gap: concurrent access against a physical remote NAS was not tested. Rollback journaling mitigates unsupported WAL semantics; it does not claim arbitrary SQLite-over-network deployments are safe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR plugin: workboard scripts Repository scripts size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant