Repository navigation
fix(backup): handle AppleDouble metadata without losing SQLite validation - #140989
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 10, 2026, 10:26 PM ET / September 11, 2026, 02:26 UTC (Revision 9). ClawSweeper reviewWhat this changesExclude signature-confirmed AppleDouble metadata from backup database discovery and archives while preserving SQLite validation, with regression coverage and backup documentation. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: current main and v2026.9.3 retain the reported misclassification. Earlier findings are addressed, supplied runtime observations support the repair, and no blocking patch defect was found. Priority: P2 Review scores
Verification
How this fits togetherBackup creation inventories local OpenClaw state, prepares verified SQLite snapshots, and packages files into an archive. The shared classifier controls both database discovery and archive filtering. flowchart TD
A[State and agent files] --> B[Backup ownership inventory]
B --> C{SQLite candidate}
C --> D{AppleDouble signature}
D -->|Confirmed| E[Exclude metadata]
D -->|Absent| F[Verified SQLite snapshot]
B --> G[Ordinary archive files]
F --> H[Archive and verification]
G --> H
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +33, Tests +199, Docs +1. Total +233 across 4 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep metadata recognition in the shared backup classifier while retaining verified snapshots, canonical sanitization, and corruption failures for actual SQLite databases. Do we have a high-confidence way to reproduce the issue? Yes: the linked report provides an isolated AppleDouble fixture, and current-main source still sends that regular .sqlite file into database snapshot creation. This reviewer did not execute the reproduction. Is this the best way to solve the issue? Yes: content recognition after inventory admission fixes both discovery and archive filtering through their existing shared owner, without weakening verification or adding configuration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c91669493102. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
b46d0a7 to
e922a2e
Compare
Preserve inventory ownership and verified snapshots for real SQLite files and aliases. Use the existing pinned file reader for metadata probes and cover descriptor cleanup, replacement races, and archive integrity.
|
landpr-approve-unrelated-red |
|
Thanks @ericcaiwx-star! Proof: Public backup creation and separate verification passed with synthetic AppleDouble metadata, real same-name SQLite databases, and canonical global/agent aliases. Extracted archives retain durable rows and remove the expected transient data. Corrupt databases still refuse backup creation.
The repair passed 63 distinct focused cases, plus the four descriptor cases rerun after the test-type correction, and fresh exact-head review. Hosted validation: https://github.com/openclaw/openclaw/actions/runs/34554250418. The independent generic hardlink/live-WAL control failed on both pinned main and the candidate. That existing bug remains recorded in #144585; the passing canonical and closed-generic controls do not replace it. Linux proof does not claim a macOS filesystem run. All four contributor commits and their credit were preserved. Unrelated CI exception:
|
) Closes #144585 ## What Problem This Solves Fixes an issue where users backing up a live SQLite database with hardlink aliases could receive a successfully verified archive whose alias entries omitted committed data from the write-ahead log (WAL). ## Why This Change Was Made Generic database hardlinks now share one verified, compacted snapshot from the unambiguous WAL-owning pathname. Every admitted name receives a separate regular archive entry. Creation refuses competing WALs, unaccounted hardlinks, active rollback journals, and source-identity changes. Canonical global and agent databases retain their existing owner validation and sanitizers, with their alias identities checked immediately before capture. The new capture wrapper leaves source file handles to SQLite, preserving the live writer locks covered by its regression cases. ## User Impact Both names of a backed-up hardlinked database retain the same committed content. Uncertain journal ownership produces an explicit error without publishing an archive. The backup reference explains the required source coverage and recovery steps. The accepted compatibility boundary for this repair requires complete hardlink coverage, including closed databases with outside aliases. Every hardlink must be an included `.sqlite` file under the state directory or a configured agent root. An unavailable alias prevents proof of journal ownership, so creation refuses until the full inventory is included. ## Evidence - Retained public baseline: create with `--verify` and separate verify both succeeded, but the alias query failed with `no such table: acceptance_probe`. - Public commands on the corrected candidate: both filename orders retain `committed-in-wal` in both regular SQLite entries; each extracted database passes integrity checks. Competing WALs, incomplete hardlink coverage, a live rollback journal, and malformed SQLite all refuse without an archive. - Canonical global and agent controls preserve durable rows, remove transient leases and queues, and retain symbolic links. - 18 new integrated regressions and 25 focused existing backup cases pass. The incomplete canonical identity guard fails its mutation control by publishing an archive. The earlier file-handle implementation loses the writer's lock for both singleton and hardlink-pair cases; the correction retains it. - A fresh source-blind validator independently repeated all nine public scenarios on the corrected build, including direct proof that the committed schema exists only in WAL before backup. All nine pass. - Targeted formatting, lint, documentation syntax, native commit hooks, and the runtime build pass. Combined public validation uses the merged source from #140989 with this PR: state and agent metadata are excluded, ordinary workspace metadata remains, directory and symbolic-link controls survive, and the real SQLite hardlink and canonical controls pass. All ten combined scenarios pass. Public runtime proof uses synthetic files on Linux. Co-authored-by: Ayaan Zaidi <[email protected]>
…tion (openclaw#140989) ## What Problem This Solves Fixes an issue where `openclaw backup create` failed before producing an archive when state contained AppleDouble metadata named `._cron.sqlite`. ## Why This Change Was Made Exclude signature-confirmed `._*.sqlite` metadata after the existing state/agent inventory checks. The probe uses the existing safe file opener and closes its descriptor after every read outcome. Real databases and hardlink aliases retain verified snapshots, compaction, and canonical sanitization. ## User Impact Backups can include state copied from macOS without treating AppleDouble metadata as a database. Ordinary workspace files remain included, and corrupt SQLite databases still stop backup creation. ## Evidence - Pinned-main public `backup create --verify --json` failed actual SQLite validation for a 163-byte metadata fixture and produced no archive. - Independent candidate public create and separate verify passed. Extracted archives exclude state/agent metadata, retain workspace metadata and ordinary files, and preserve real same-name databases and canonical aliases with their ownership and sanitization. - 63 distinct focused backup and verifier cases passed, including real hardlinks, canonical WAL data, corruption, inventory scope, replacement symlinks, and descriptor cleanup. - Native formatting, lint, source guards, and the normal commit hook passed. Independent source review is clean. The exploratory generic hardlink/live-WAL case failed identically on pinned main and the candidate; it remains tracked separately in openclaw#144585. The passing canonical and closed-generic controls do not turn that existing failure into a pass. Proof uses synthetic files on Linux; it does not claim a macOS filesystem test. All four contributor commits are retained. Closes openclaw#140193. Co-authored-by: Ayaan Zaidi <[email protected]>
…claw#144624) Closes openclaw#144585 ## What Problem This Solves Fixes an issue where users backing up a live SQLite database with hardlink aliases could receive a successfully verified archive whose alias entries omitted committed data from the write-ahead log (WAL). ## Why This Change Was Made Generic database hardlinks now share one verified, compacted snapshot from the unambiguous WAL-owning pathname. Every admitted name receives a separate regular archive entry. Creation refuses competing WALs, unaccounted hardlinks, active rollback journals, and source-identity changes. Canonical global and agent databases retain their existing owner validation and sanitizers, with their alias identities checked immediately before capture. The new capture wrapper leaves source file handles to SQLite, preserving the live writer locks covered by its regression cases. ## User Impact Both names of a backed-up hardlinked database retain the same committed content. Uncertain journal ownership produces an explicit error without publishing an archive. The backup reference explains the required source coverage and recovery steps. The accepted compatibility boundary for this repair requires complete hardlink coverage, including closed databases with outside aliases. Every hardlink must be an included `.sqlite` file under the state directory or a configured agent root. An unavailable alias prevents proof of journal ownership, so creation refuses until the full inventory is included. ## Evidence - Retained public baseline: create with `--verify` and separate verify both succeeded, but the alias query failed with `no such table: acceptance_probe`. - Public commands on the corrected candidate: both filename orders retain `committed-in-wal` in both regular SQLite entries; each extracted database passes integrity checks. Competing WALs, incomplete hardlink coverage, a live rollback journal, and malformed SQLite all refuse without an archive. - Canonical global and agent controls preserve durable rows, remove transient leases and queues, and retain symbolic links. - 18 new integrated regressions and 25 focused existing backup cases pass. The incomplete canonical identity guard fails its mutation control by publishing an archive. The earlier file-handle implementation loses the writer's lock for both singleton and hardlink-pair cases; the correction retains it. - A fresh source-blind validator independently repeated all nine public scenarios on the corrected build, including direct proof that the committed schema exists only in WAL before backup. All nine pass. - Targeted formatting, lint, documentation syntax, native commit hooks, and the runtime build pass. Combined public validation uses the merged source from openclaw#140989 with this PR: state and agent metadata are excluded, ordinary workspace metadata remains, directory and symbolic-link controls survive, and the real SQLite hardlink and canonical controls pass. All ten combined scenarios pass. Public runtime proof uses synthetic files on Linux. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes an issue where
openclaw backup createfailed before producing an archive when state contained AppleDouble metadata named._cron.sqlite.Why This Change Was Made
Exclude signature-confirmed
._*.sqlitemetadata after the existing state/agent inventory checks. The probe uses the existing safe file opener and closes its descriptor after every read outcome. Real databases and hardlink aliases retain verified snapshots, compaction, and canonical sanitization.User Impact
Backups can include state copied from macOS without treating AppleDouble metadata as a database. Ordinary workspace files remain included, and corrupt SQLite databases still stop backup creation.
Evidence
backup create --verify --jsonfailed actual SQLite validation for a 163-byte metadata fixture and produced no archive.The exploratory generic hardlink/live-WAL case failed identically on pinned main and the candidate; it remains tracked separately in #144585. The passing canonical and closed-generic controls do not turn that existing failure into a pass.
Proof uses synthetic files on Linux; it does not claim a macOS filesystem test. All four contributor commits are retained.
Closes #140193.