Repository navigation
Conversation
…eCustomizable from force
`sync` set copyTemplates({ force: true }) unconditionally, and copyDir wrote
every template with no existence/diff/customizable check — it never consulted
isCustomizableFile. So a plain `sequant sync` silently rewrote the constitution
back to the template, destroying in-place edits with no --force required.
Separate the two conflated notions of "force":
- copyTemplates gains `overwriteCustomizable`, distinct from `force`. `force`
refreshes the managed skills/agents/hooks trees; overwriteCustomizable gates
clobbering user-owned CUSTOMIZABLE_FILES. Only an explicit `sync --force` sets it.
- copyDir preserves an existing, differing customizable file unless opted in,
and returns the preserved set.
- Plain sync reports each preserved file; sync --force announces the overwrite
on stdout before writing. A missing file is still created on fresh install.
- --dry-run preview mirrors the preserved/overwritten split so it can't diverge
from the apply path (#722).
- docs/guides/customization.md documents the real --force semantics.
Written against the CUSTOMIZABLE_FILES list, not the single constitution path.
Entire-Checkpoint: d68cad9bd2ac
7 tasks
…write; pin tree-refresh in preservation test
…plain-sync-overwrites-customizable-files- # Conflicts: # CHANGELOG.md
3 tasks
6 tasks
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
Plain
sequant syncsilently overwrote.claude/memory/constitution.md(and anyCUSTOMIZABLE_FILESentry) with the rendered template, destroying in-place project edits — no--forcerequired.syncsetcopyTemplates({ force: true })unconditionally, andcopyDirwrote every template file with no existence/diff/customizable check — it never consultedisCustomizableFile(whose sole consumer was the diff path). #708 fixed this forupdatebut leftsyncdestructive.copyTemplatesgainsoverwriteCustomizable, distinct fromforce.forcerefreshes the managed skills/agents/hooks trees;overwriteCustomizablegates clobbering user-owned files. Only an explicitsync --forcesets it.copyDirpreserves an existing, differing customizable file unless opted in, and returns the preserved set. Plainsyncreports each preserved file (preserved: … — run \sync --force` to replace);sync --force` announces the overwrite on stdout before writing.--dry-runpreview mirrors the preserved/overwritten split so it can't diverge from the apply path (update: --dry-run reports "0 modified" but apply rewrites every SKILL.md (dry-run vs apply divergence) #722).Pre-PR AC Verification
templates.tscopyDir guard; testpreserves an in-place customized constitutioncopyTemplatesopt-in separate fromforceoverwriteCustomizableoption; testoverwrites … only when overwriteCustomizable is set — not forcesync --forceoverwrites and says so on stdout before writingsync.tsforce-announce; testannounces customizable overwrites on stdout before copying under --forcesync.tspreserved report; testreports preserved customizable files on stdout under a plain synccreates a missing constitution on a fresh installpins the round trip: plain copy preserves, opt-in replacesdocs/guides/customization.mdstates real--forcesemanticsTest plan
npm run build— passesnpm run lint— passesnpx vitest run src/lib/templates.test.ts src/commands/sync.test.ts— 57 passedsrc/lib src/commandssuites — pass (one pre-existing, unrelatedprompt-wait.test.tstimer flake, fails on base too)Closes #814
🤖 Generated with Claude Code