Repository navigation
refactor(sync): fold computeDriftFingerprint's templates→.claude mapping into templateDestination (#1045) - #1047
Merged
admarble merged 4 commits intoSep 11, 2026
Conversation
Entire-Checkpoint: 521a30718b1d
… into templateDestination (#1045) - computeDriftFingerprint now derives install paths via the exported templateDestination() instead of a private templates/->.claude/ replace, matching the skip pattern computeTemplateChanges already uses for excluded templates (opencode/, relay/, mcp.json). - Guard the .local override-path check with localPath.startsWith(".claude/") since templateDestination can also return non-.claude/ paths (scripts/dev/...). - Add a fingerprint test proving an excluded template contributes nothing to the cache key (mutation-verified). - Document the retired-file drift-detection blind spot in docs/reference/cheat-sheet.md. Entire-Checkpoint: 7746fbc46dce
… no override line QA note: the non-.claude branch of the fingerprint (scripts/dev templates) shipped untested. The pre-#1045 override derivation was a no-op string replacement on scripts/dev paths, so the same path was stat'd twice as a bogus o: line; the test asserts exactly one stat and no .local ghost. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_0147heJNRw8wBBujPGMqxDpR
…-sync-fold-computedriftfingerprint-s-templ
admarble
deleted the
feature/1045-refactor-sync-fold-computedriftfingerprint-s-templ
branch
September 11, 2026 05:35
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
computeDriftFingerprint(src/commands/sync.ts) now derives install paths via the exportedtemplateDestination()fromsrc/lib/templates.tsinstead of its own privatetemplates/→.claude/string replace — the same root-cause pattern fix(sync): dry-run lists files apply never writes — the template walk maps templates/opencode/** to .claude/opencode/** (phantom drift nag in serve; update plants unrendered {{PHASE}} files) #1030 fixed forcomputeTemplateChanges. An excluded template (templates/opencode/**,templates/relay/**,templates/mcp.json) contributes nothing to the fingerprint's cache key, matching the write path's own skip..claude/.local/override-path check withlocalPath.startsWith(".claude/"), sincetemplateDestinationcan also returnscripts/dev/...paths (fortemplates/scripts/**) that have no.localoverride concept.sync's drift check, since the walk is template-driven) indocs/reference/cheat-sheet.md.Acceptance Criteria
computeDriftFingerprintderives install paths viatemplateDestination, no privatetemplates/→.claude/replacegrep -n 'replace("templates/"' src/commands/sync.ts→ only the unrelated on-disk-path strip remains;npx vitest run src/commands/sync.test.ts -t "content-drift cache"→ 5/5 green, including the new excluded-template casegrep -rc "retired" docs/reference/*.md→cheat-sheet.md:1npm run build && npm run lintpass;npm test→ 6326 passed, 3 failed in files untouched by this change (batch-executor.test.ts,relay-hook.integration.test.ts,prompt-wait.test.ts— confirmed viagit diff --statagainst those paths showing zero change)Mutation-verified: AC-1 — reverted
templateDestination(normalized)back to the privatenormalized.replace("templates/", ".claude/");src/commands/sync.test.ts > sync command > areSkillsOutdated content-drift cache (AC-5) > an excluded template (templates/opencode/**) contributes nothing to the fingerprint (AC-1, #1045)failed; restored.Test plan
npm run buildnpm run lintnpm test(full suite; 3 pre-existing unrelated failures noted above)Closes #1045
Post-QA (AC_MET_BUT_NOT_A_PLUS) — runner notes, f3412e9
replace("templates/", "")); amended on the issue togrep -c 'replace("templates/", ".claude/")'→0, which the requirement clause actually means..claudebranch (scripts/dev templates) was untested. Added one case: atemplates/scripts/x.shtemplate is stat'd exactly once (itsl:line) and never as a.localghost. The pre-refactor(sync): fold computeDriftFingerprint's templates→.claude mapping into templateDestination; document the retired-file limitation #1045 override derivation was a no-op replacement onscripts/dev/..., so the same path was stat'd twice as a boguso:line — the latent cache-staleness QA named.Mutation-verified: AC-1 — restored the unconditional
.claude/→.claude/.local/override derivation for every install path;src/commands/sync.test.ts > a scripts template contributes its scripts/dev install path and no .claude/.local override line (#1045 QA)failed; restored.