Repository navigation
fix(#722): add sync --dry-run so the sync preview can't under-report the apply - #723
Merged
admarble merged 1 commit intoJun 9, 2026
Conversation
…the apply The reported `update --dry-run` "0 modified" vs apply-rewrites-everything divergence does not reproduce on `update`: it derives its summary and write-set from one `computeTemplateChanges()` call, and that already classifies a header-missing SKILL.md as `modified` (verified against a pre-2.6.2-marker fixture — `update --dry-run` reports 17 modified, never 0). The real gap is `sync`: on a `.sequant-version` mismatch it runs `copyTemplates(force:true)` and rewrites the whole tree (+AGENTS.md) with no preview and no `--dry-run`, so an operator/CI had no trustworthy way to see pending work. Add `sync --dry-run` / `-d`, reusing the same source of truth to report the exact set the apply writes — new + modified + local-override (the force copy overwrites in-place customizations, so they are counted, never under-reported) — mutating nothing and exiting non-zero when work is pending so the preview can gate automation. The override classifier stays keyed on a real `.claude/.local/` twin, not the in-band marker. Regression tests lock all three ACs (sync.test.ts, templates.test.ts). Entire-Checkpoint: a39a1f216e80
admarble
deleted the
feature/722-update-dry-run-reports-0-modified-but-apply-rewrit
branch
June 9, 2026 03:56
4 tasks done
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
update --dry-run"0 modified" vs apply-rewrites-everything divergence does not reproduce onupdate. It derives its summary and write-set from a singlecomputeTemplateChanges()call, which already classifies a header-missingSKILL.mdasmodified. Verified against a pre-2.6.2-marker fixture:update --dry-runreports 17 modified, never0.sync: on a.sequant-versionmismatch (e.g. an install predating the bug(customization): .claude/.local/skills (and likely hooks) never load — documented override layer is non-functional #711 / 2.6.2<!-- sequant:local-override -->overlay header)syncrunscopyTemplates(force:true)and silently rewrites the whole tree (+AGENTS.md) with no preview and no--dry-run— the untrustworthy-preview surface the issue is really about (the reporter's apply wassync, and/ornpxversion skew).sequant sync --dry-run/-d. It reuses the same source of truth to report the exact set the apply would write —new+modified+local-override(the force copy overwrites in-place customizations, so they are counted, never under-reported), mutates nothing, and exits non-zero when work is pending so the preview can gate CI/automation. The override classifier stays keyed on a real.claude/.local/twin, not the in-band marker.Scope respected the spec non-goals: no change to
update, tocomputeTemplateChanges, or to the apply write-set itself.Pre-PR AC Verification
sync --dry-runpreview = 18 files, real apply changed 18. Tests insync.test.ts..claude/.local/twin, not the markertemplates.ts:231-234(unchanged); locked by new test intemplates.test.ts.Modifiedin previewtemplates.test.ts; reproduced live (17 modified).Files changed
src/commands/sync.ts—dryRunoption + preview guard beforecopyTemplatesbin/cli.ts— register-d, --dry-runonsyncsrc/commands/sync.test.ts— AC-1 dry-run testssrc/lib/templates.test.ts— AC-2 / AC-3 regression testsCHANGELOG.md,docs/reference/cheat-sheet.md— document the flagTest plan
npm run build— passesnpm run lint— passes (0 warnings)npx vitest runon sync/templates/update-integration/doctor/cli-integration — 102 passedsync --dry-runreports the full write-set, mutates nothing, exits 1; preview count equals real apply countCloses #722