Repository navigation
fix(backup): preserve literal archive paths - #186746
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 changesPreserves leading and trailing whitespace in nonblank backup archive paths and restore destinations. Example: Run backup create with --output 'selected.tar.gz ' --verify.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current archive-path selection bug with a focused change and relevant CLI proof; no actionable defects were found, and exact-head CI remains pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherBackup CLI arguments flow through shared path resolution into archive publication, verification, and staging restore, producing archives or restored files and human-readable or JSON reports. flowchart TD
A[Backup CLI arguments] --> B[Archive path resolver]
B --> C[Archive creation]
B --> D[Archive verification]
B --> E[Staging restore]
C --> F[Filesystem artifacts]
D --> G[CLI reports]
E --> F
F --> G
Technical reviewBest possible solution: Land the shared archive-path correction once the existing exact-head checks pass. Do we have a high-confidence way to reproduce the issue? Current-main source directly shows argument trimming, and the supplied built-CLI comparison demonstrates the wrong filesystem selections; this read-only review ran no target code. Is this the best way to solve the issue? The smallest complete fix separates archive literal selection from repository trimming in the existing shared owner and updates every archive lifecycle caller. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d5f7d57eff50. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +15, Tests -6, Docs +3. Total +12 across 8 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes: No label 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 (1 earlier review cycle)
Reviewed October 28, 2026, 10:21 AM ET / 14:21 UTC (Revision 2). |
Node 24 built-CLI before/after proofPinned main
Readback independently stats literal and trimmed names, walks actual restored trees, parses the extracted The repair only consolidates the two existing resolver suites into one shared contract table (blank rejection, relative/absolute selection, effective-home expansion), retaining repository trimming versus archive literal semantics and the stronger real archive command regressions. No production change, archive-format change, baseline adjustment, or safety-policy change was needed. Focused validation: four real-owner suites 83 passed, 1 existing platform skip, 29.43 seconds; scoped lint reports 0 warnings/errors, and repository oxfmt/Bun parity check passes. Test consolidation reduces the PR test delta from +21 to −6 lines (no budget/baseline change); production stays +15 and docs +3 against the merge base. Discriminating committed restore regression copied onto pinned main: 1 intended failure, 18 unselected, 10.85 seconds: Final head: |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Thanks @obviyus for reviewing and merging this. Much appreciated! |
fix(backup): keep literal archive and destination paths in backup commands backup create, verify and restore trimmed the archive and destination paths they were given, so a path that starts or ends with a space chose a different file or directory, or couldn't reopen the archive just written. The commands now use the path as given. Home expansion, the default output when none is given, and the rejection of blank targets are unchanged. Evidence: built CLI on Node 24.22.1 (44 real calls). On main the trimmed archive or destination name was used, or the literal archive couldn't be reopened (twice); with this change every given path was kept (twice), confirmed by separate filesystem, manifest and config-byte readback. Ordinary round trips, home expansion, the blank-output default and blank-target rejection behave the same on both refs. Details: openclaw#186746 (comment). Thanks @Alix-007. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Quoted backup archive paths and restore targets lose leading/trailing spaces, selecting a different physical file or directory. Creation can report success at the wrong filename; verification/restore cannot reopen a valid literal archive.
User Impact
Nonblank archive paths now preserve their exact spelling across create, verify and restore, including home-relative output directories. Optional blank output retains its timestamped default; required blank paths remain errors. Generic Git, SQLite and schedule repository selectors retain their separate trimming contract.
Why This Change Was Made
One archive-specific resolver checks blankness without replacing the value, expands the existing home prefix, then resolves the literal path. All archive lifecycle callers use it before their existing publication, containment, capacity, tar validation, empty-target and extraction checks. No format, policy, config or migration change.
Evidence
#186746 (comment)
Normal-built public CLI on Linux Node 24.22.1, pinned main
7cbbb2548c8b900b211356ca9bd53e42008eede0versus contributor product head2261eda8d533f93679b4dff06b7f89d10e88444b: main twice and candidate twice, 44 real CLI calls. Final head740bf9e0700e198cbae18cbe463d83f73f3c5fadonly consolidates tests; production is unchanged from that measured product head.Merge Danger
Two-way code door: revert restores prior selection behavior without changing the archive format. Reverting does not rename archives or restored directories already created with literal whitespace; callers must continue quoting their actual paths. Blast radius is archive create/verify/restore path selection; existing filesystem safety and generic repository-path policy remain unchanged.