Repository navigation
fix(backup): keep Git backups working after opening the repository in Finder - #162706
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 refreshes, prunes, commits, and restores only declared backup artifacts while preserving unrelated files, staging, and history. Example: An operator opens a Git backup repository in Finder, creating agents/.DS_Store, then runs openclaw backup git create --all.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it fixes a confirmed backup failure that remains on current main, follows the maintainer-approved ownership boundary, and has no actionable findings. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Git backup backend receives selected SQLite snapshots, serializes declared artifacts into Git commits, and reconstructs verified databases from historical refs into fresh targets. flowchart LR
A[Backup CLI] --> B[SQLite snapshot owner]
B --> C[Manifest and table codec]
C --> D[Artifact preflight and refresh]
D --> E[Private Git index and commit]
E --> F[Historical ref materialization]
F --> G[Schema admission and fresh restore]
Technical reviewBest possible solution: Land the approved artifact ownership implementation with historical restore admission delegated to the existing schema owners. Do we have a high-confidence way to reproduce the issue? Current-main source shows agents/.DS_Store reaching the scope refusal, corroborated by obviyus's recorded supported-CLI reproduction; this review ran no target code. Is this the best way to solve the issue? Artifact ownership addresses the destructive directory boundary directly, preserves degraded-agent retention, and follows the recorded maintainer decision without introducing Finder-format heuristics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bac32528c891. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +317, Tests +444, Docs +25, Other -1. Total +785 across 8 files. Added test files: 1. View PR surface stats
Review metrics
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 HistoryReview history (8 earlier review cycles)
Reviewed October 12, 2026, 8:30 PM ET / October 13, 2026, 00:30 UTC (Revision 9). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Maintainer verification found a data-safety decision and a legacy-restore gap; this is not ready for landing under a Finder-metadata-only scope. Tested the supported On current main
The global fixture was initialized through Open decision: is the exact basename |
|
Pushed Current isolated validation: 35 tests passed, 1 Windows-only test skipped; core types, type-aware lint, formatting, and diff checks passed. Both global and agent legacy round trips and namesake refusal/preservation are covered. Updated the PR description with test timings, review reasoning, and the additional shipped-CLI attempt's container service-manager limitation. @clawsweeper re-review |
|
Published Updated the PR body with exact-head validation: 33 passing focused tests, one Windows-only skip, assertion safety/types/type-aware lint/format checks, fresh scoped independent review, and the supported qaRuntime build. Supported current-schema CLI creation, refresh, pruning, exact staging/working-file preservation, and prior-ref plus current global/agent verification/restoration all passed in secretless isolation with synthetic data. The requested latest-stable compatibility exercise uncovered real remaining failures. A backup actually created by published 2026.10.2 using its own global v20/agent v24 database owners fails candidate direct verification: global @RomneyDa: deferring to your artifact-boundary design. Should the historical restore path validate the original stable schema before a separate migration, or should the schema owner perform a supported upgrade while preserving the original manifest/hash contract? I have left the historical backup unchanged and have not broadened restore semantics merely to make proof pass. The explicit manifest-only ownership decision and stable-schema compatibility remain open before merge. A review of the new head is already running automatically, so I am not sending a duplicate re-review command. No workflows were manually rerun for green. |
|
Maintainer scope decision: accept artifact ownership for this PR. Manage only manifest-declared artifacts and preserve every unrelated working file, exact operator staging, and existing committed history, including Finder metadata and ordinary documents in legacy refs. This deliberately replaces whole-directory ownership; it is not just approval of Finder-content classification. Keep actual artifact-collision checks, unfinished Git-operation refusal, database identity/version admission, hashes/counts/integrity, fresh-target publication, dedicated-repository guidance, and the non-backup-ancestry push restriction. The correction at |
… Finder (openclaw#162706) * fix(backup): keep Git backups working after opening the repository in Finder * fix(backup): remove committed Finder metadata without disturbing operator staging * fix(backup): identify Finder metadata and restore legacy refs * test(snapshot): keep Finder coverage within file size limit * fix(backup): refresh only manifest-owned Git artifacts * fix(backup): narrow filesystem errors without unchecked casts * fix(backup): shrink retired assertion allowance * fix(backup): validate restored agents at their recorded schema * fix(backup): normalize historical agent indexes in staging * fix(backup): satisfy artifact assertion safety checks * fix(backup): admit historical global snapshots without current indexes --------- Co-authored-by: Richard O’Shaughnessy <[email protected]> Co-authored-by: Dallin Romney <[email protected]>
What Problem This Solves
backup git create --alltreats every entry underagents/as a database scope and replaces entire scope directories. Finder's.DS_Storetherefore trips the ownership check, while ordinary documents inside a valid scope can be deleted or committed by broad replacement/staging.This fixes the ownership boundary rather than adding a Finder-format exception.
User Impact
Users can refresh and prune Git backups without losing unrelated documents, Finder metadata, or their exact staging. Old refs with extra files remain directly verifiable/restorable, including repositories produced by the current stable release. Historical restores keep their recorded supported schema; normal runtime/Doctor migration owns adoption by the current runtime.
Maintainer Decision
Accept artifact ownership. This intentionally replaces whole-scope ownership: manage only the manifest, schema, and declared tables, while preserving all unrelated working files, staging, and committed history, including Finder metadata and ordinary documents in legacy refs. This is the accepted scope of the maintainer-directed correction, not merely approval of Finder-content classification.
Actual artifact collisions, regular-file checks, pending Git-operation refusal, database identity/version admission, table hashes/counts, SQLite integrity, and fresh-target publication remain. Dedicated-repository guidance and the existing non-backup-ancestry push restriction remain. No history scrubbing is performed.
Why This Change Was Made
Current stable-data proof exposed two existing restore-codec problems: applying current global indexes to historical columns, and using current-only agent maintenance admission for old snapshots. Restore now uses the maintained historical schema-owner admission without migrating historical table data or version markers. Only canonical derived agent indexes are normalized in private staging. Current-runtime/source-copy admission is unchanged; normal runtime/Doctor owns upgrades.
There are no new dependencies, configuration, CLI options, schema definitions, or serialized backup-format changes.
CI Attribution
The original
b9e178ebaseline-ratchet failure was feature-owned, not inherited: two unchecked error assertions moved into newgit-backup-artifacts.ts, exceeding its zero allowance. The job's actual base was438e06c68838bbc304c5552ba1e371b243677a7c.Contributor
9db7bccc533dreplaced them withhasNodeErrorCodeand removed the obsoletegit-backup.tsallowance. Contributor64e707500187integrated current main and retained its reduced baseline. Both exact commits remain ancestors; no budgets were increased and no gates were exempted.Evidence
Validated head:
e2b0edf3d72bd2372e7f64e587b5916b9bb4e1ad, retaining the contributor's merge of main73f640e406ce47c5dfface0f3bcec45519de7c53. The residual compatibility correction against64e707500187is three files.Secretless Linux ARM64 Docker, Node 24.21.0, pnpm 12.9.0; synthetic state only, no live Gateway or host secrets. The current normal
pnpm openclawwrapper retains source-CLI admission.The registry's current
latest,[email protected](b8952d4), creates complete global-20 / agent-24 data through its shipped setup, public SQLite SDK owner, and backup CLI. It successfully creates a backup, then reproduces the.DS_Storerefusal after committed extras and different staged/working revisions are added. The candidate directly verifies/restores that unchanged historical ref before any current refresh.Selected proof-driver assertions after supported CLI commands (full redacted terminal and independent observer are linked below):
9223372036854775806and blob000102ff, recorded versions, and integrity. Historical refs were not rewritten.pnpm build qaRuntime, production types, affected canonical test types, seven-file type-aware lint, formatting, and scoped correction ratchets pass. Source hashes bind these results to the committed head.Reproducible, sanitized evidence: Manifest and SHA-256 inventory, reproduction README, redacted supported-CLI terminal. Downloaded readback matches all eight tested files byte-for-byte. Signed links expire around 2026-10-20 00:10 UTC; essential results are retained inline.
Native macOS/Windows and full release packaging were not run. Metadata-named files contain opaque bytes; this is artifact admission/preservation proof, not native Finder UI or binary-format recognition. Required hosted CI, ClawSweeper, and human review remain separate exact-head gates. The old stable-compatibility blocker recorded in the previous body is now reproduced and corrected, not waived.