fix(backup): don't stage targets for skipped missing-source items - #29
Merged
Conversation
_git_commit appended it.target to the git-add list for every non-secret manifest item, even when the item's source was absent and therefore skipped during copy (§4-7). The target was never written, so `git add` aborted the whole backup with `pathspec '<target>' did not match any files`. This bites any time the live agent lacks a path the bundled manifest declares — e.g. a hermes-2026.5.4 manifest against a 2026.5.7 Hermes build that has no ~/.hermes/scripts/ or whatsapp/. Stage only targets that actually exist on disk after the copy phase. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
argit backupaborts with:_git_commitstagedit.targetfor every non-secret manifest item, including items whose source was absent on the agent and therefore skipped during the copy phase (§4–7). The destination was never written, sogit addfailed and took down the whole backup.This triggers whenever the running agent lacks a path the bundled manifest declares — e.g. the
hermes-2026.5.4-1manifest declaresscripts/,whatsapp/,memory_store.db,workspace/, but a2026.5.7Hermes build doesn't create them. Found while wiring argit into Hermes provisioning (bot-provisioning-poc#12) — the systemd backup unit failed on first run and left a.argit/in-progressmarker that blocked every retry.Fix
Stage only targets that actually exist on disk after the copy phase:
General and version-agnostic — a manifest will never perfectly match every Hermes patch release, so backup should tolerate declared-but-absent paths (it already logs and skips them during copy; this aligns staging with that).
Test
Adds
test_git_commit_skips_items_with_missing_targettotests/unit/test_backup_review_staging.py— a present-target item is staged, a missing-target item is not. Full unit suite green.🤖 Generated with Claude Code