Repository navigation
refactor(backup): unify required path resolution - #128132
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
348d32b to
52eeac6
Compare
52eeac6 to
594c549
Compare
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 23, 2026, 2:45 AM ET / 06:45 UTC. ClawSweeper reviewWhat this changesThe PR replaces four duplicate backup-path validators with one shared resolver used by Git backup, SQLite snapshot, archive restore, and scheduled-backup commands. Merge readinessNo blocking findings. This maintainer-authored, maintainer-labeled cleanup remains open for the normal merge decision once exact-head checks complete. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherBackup CLI commands receive operator-supplied filesystem paths before handing them to Git, SQLite snapshot, archive-restore, or Gateway scheduling operations. The shared helper now owns the common required-value check, trimming, home expansion, and absolute-path resolution. flowchart LR
A[Backup CLI paths] --> B[Shared required-path resolver]
B --> C[Git backup commands]
B --> D[SQLite snapshot commands]
B --> E[Archive restore]
B --> F[Scheduled backup setup]
Decision needed
Why: The protected maintainer label requires explicit maintainer handling even though source review found no correctness blocker. Before merge
Agent review detailsSecurityNone. PR surfaceSource -16, Tests +37. Total +21 across 6 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Land the single canonical resolver after exact-head CI confirms the already-reviewed behavior-preserving refactor. Do we have a high-confidence way to reproduce the issue? Not applicable: this refactor has no reported defect; equivalence is directly established from the former wrappers and the canonical path-resolver contract. Is this the best way to solve the issue? Yes. A single helper at the shared backup boundary removes four copies while preserving the prior validation and resolution behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 33abd6273131. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Maintainer decision: mark ready and keep the reviewed head unchanged.
ClawSweeper rank-up move handled: I am not rebasing solely for unrelated main movement because that would rewrite the exact head after full proof. The unchanged touched blobs plus clean current-main merge tree provide the requested merge-head refresh without invalidating exact-head evidence. |
|
Merged via squash.
|
What Problem This Solves
Backup commands independently normalized required repository, target, snapshot, and scratch paths. The duplicate policy could drift across Git backup, SQLite backup, whole-archive restore, and scheduled backup flows.
Why This Change Was Made
backup-shared.tsnow owns required backup path validation and user-path resolution. All four command surfaces call that canonical helper in their existing order, preserving exact missing-value errors, whitespace trimming, effective-home expansion, relative-path resolution, and absolute paths.This removes four local wrappers without changing CLI, configuration, storage, or backup behavior. Production delta: +37/-53 (net -16).
User Impact
No intended user-visible change. Backup path handling remains consistent while the duplicated policy is removed.
Evidence
node scripts/run-vitest.mjs src/commands/backup-shared.test.ts- 7 passednode scripts/run-vitest.mjs src/commands/backup-git.test.ts- 8 passednode scripts/run-vitest.mjs src/commands/backup-sqlite.test.ts- 10 passednode scripts/run-vitest.mjs src/commands/backup-restore.test.ts- 7 passednode scripts/run-vitest.mjs src/commands/backup-schedule.test.ts- 9 passedoxfmtandgit diff --checkpassedcheck-changedpassed its source guards, formatting, dead-export scan, core typecheck, and lint. Its core-test typecheck stopped on missing shared-install UI dependencies (@panzoom/panzoomandpakotypings), unrelated to these backup command files; repository policy forbids dependency installation inside this GWT.