Repository navigation
feat: back up only files agent-sync did not write, doctor checks the agent on PATH, --budget on sync and apply (v1.11.0) - #31
Merged
Conversation
…agent on PATH, --budget on sync and apply (v1.11.0) The adoption backup rule was "first differing overwrite, once", so the first sync that changed the file (any fold, or any store change on the deterministic path) backed up agent-sync's own earlier output as <file>.orig on every target, and a hand edit made after that was overwritten with no backup, which the README's safety promise did not allow. agent-sync now remembers what it wrote to each target (~/.config/agent-sync/distributed/) and skips the backup while the file is still that; a hand edit still gets one, and revert restores it. doctor checks that the `agent` on PATH is agent-sync at all: Cursor's CLI installer also creates an `agent` command, so a hook or cron line saying `agent sync` can start Cursor instead without a word of complaint. Another build of agent-sync on PATH is only noted. The colour suite's terminal runner now pins PATH like every other runner, which the check exposed. --budget BYTES on sync and apply, the flag compact already had, so the budget pass at the end of a sync can be set for one run, as the README already described. The man page synopsis lists compact, the target-filter flags are documented for compact, the README passes markdownlint and gains a note on the Cursor name clash, and the walkthrough is re-captured from this binary in its own order: the fold makes no backups, the heal after a hand edit does, and revert restores exactly that one. Co-Authored-By: Claude Fable 5.1 <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.
Summary
One PR for every follow-up from the last two, as asked.
<file>.origon every target, and a hand edit made after that was overwritten with no backup, contrary to the README's safety promise. agent-sync now remembers what it wrote to each target under~/.config/agent-sync/distributed/and skips the backup while the file is still that; a hand edit still gets one, andrevertrestores it. Existing.origfiles are left alone.doctorchecks theagentonPATH. Cursor's CLI installer also creates anagentcommand, so a hook or cron line sayingagent synccan start Cursor instead without a word of complaint. A program that is not agent-sync is a problem; another agent-sync build (a checkout beside a brew install) is only noted.--budget BYTESonsyncandapply, the flagcompactalready had, validated up front; the README had described it that way already.compact; the target-filter flags are documented forcompact; the README passes markdownlint (a##code span and one long line) and gains a Notes row on the Cursor name clash; the walkthrough is re-captured from this binary in its own order, so the fold makes no backups, the heal after a hand edit does, andrevertrestores exactly that one; the zsh completion learns--budgetonsyncandapply.VERSION1.11.0 and the changelog entry: a new flag and a new doctor check make it a minor release.Left alone on purpose: the deterministic import prints two blank lines between store entries inside an import block. Fixing that changes the block's bytes and therefore every recorded fold fingerprint, which would re-fold every block once at a model call per agent, for a cosmetic gain inside text that the fold removes anyway.
Validation
make testpasses locally. ShellCheck was not run locally (not installed here) and is covered by CI.AGENT_BIN, the amended sync suite fails atagent-sync backed up its own earlier output: .../.codex/AGENTS.md.orig; with this change it passes, and the new doctor cases cover a non-agent-syncagent(problem), this program under that name (nothing) and another agent-sync build (note).run_agent_termran with the ambient PATH; on a machine whereagentis Cursor's CLI the new check fired inside the test. It now pinsPATH="$SAFE_PATH"like every other runner.bin/agentat this commit against throwawayAGENT_SYNC_HOMEfixtures with realclaude(fable, low) calls, in the document's own order: deterministic sync, fold (no.origlines), no-op sync, drift, heal (gemini.orig),apply,revert(gemini and the.bakonly).docs/agent.1is regenerated from the.scdwith scdoc 1.11.5.markdownlint-cli2is clean on the README and the walkthrough and adds nothing to the changelog's two pre-existing findings in released entries.compatworkflow was dispatched by hand and passed for all five CLIs, so the synthesizer-flag assertions added on 2026-09-04 have now run against the real packages.🤖 Generated with Claude Code