Repository navigation
Conversation
areSkillsOutdated/checkAndWarnSkillsOutdated (used by the preAction hook in bin/cli.ts before most commands) compared only the .sequant-version marker, so a tree at the matching version with drifted bundled content (the #708 scenario) reported outdated:false — no warning, drift invisible to every other command. - areSkillsOutdated now returns a contentDrift count: on a version match it runs the same computeTemplateChanges diff sync uses (#708/#710 source of truth), counting new+modified and excluding local-override/unchanged so customized files (#711) don't warn on every command. Version mismatch skips the diff (already stale → copy path) to keep the per-command pre-flight cheap (AC-5). - checkAndWarnSkillsOutdated warns on content drift; warn-only — never copies, never sets process.exitCode. Accepts a pre-computed status to avoid a double scan on the hook hot path. - preAction hook: version mismatch → auto-sync (copy) as before; version match + drift → warn only. Auto-sync stays gated on version bumps so in-place customizations aren't clobbered (AC-3). - Docs (plugin-updates.md) + CHANGELOG document the decision; unit tests cover contentDrift detection, exclusions, fast-path skip, and warn-only/exit-0. Closes #713 Entire-Checkpoint: d954cbdb7aec
5 tasks
…t fix it The pre-flight content-drift warning recommended bare 'sequant sync', but at a matching version sync is report-only (reports drift and exits non-zero, does not copy). Point users at the commands that actually resolve in-place drift — 'sync --force' or 'update' — mirroring syncCommand's own drift message and satisfying AC-2's 'consistent with sync's own drift message'. Drop the 'skill' qualifier since computeTemplateChanges covers all bundled templates, not just skills. Entire-Checkpoint: 38bd202180af
Address the two QA gaps on the content-drift pre-flight:
1. Performance (AC-5): the full read+render+diff template scan (~15ms) ran on
every command for up-to-date installs, since the existing gate only skipped
on a version *mismatch* (the common case is a match). Add an opt-in stat-only
fingerprint cache: a SHA-1 over the package version plus the mtime/absence of
each bundled template, its installed counterpart, any `.claude/.local/`
override, and the config/manifest. On a fingerprint match the cached drift
count is returned without scanning (~4ms vs ~15ms, measured ~5x faster). A
per-file hash (not max-mtime) ensures editing an older file still invalidates,
so a real drift is never missed; `sync`/`update` rewrites bump mtimes so the
cache self-invalidates. Opt-in via `areSkillsOutdated({ cache: true })` from
the hot preAction path only — `doctor`/`sync` stay uncached for fresh truth.
Degrades gracefully: any fingerprint/cache error falls back to a fresh scan.
2. UX: exclude `update` from the preAction pre-flight (alongside `init`/`sync`).
`update` is itself the command that resolves drift, so the warn-only
"run sync/update" message was a circular nag right before it ran.
Adds 4 cache tests (hit/miss/default-uncached/graceful-fallback) and updates the
plugin-updates doc + CHANGELOG. Build + lint + 57 sync/doctor tests green.
admarble
deleted the
feature/713-fix-sync-areskillsoutdated-checkandwarnskillsoutda
branch
June 4, 2026 05:38
This was referenced Oct 16, 2026
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
Follow-up from #708 (PR #710). The content-truth fix corrected
sync's own up-to-date decision, but the sibling pre-flight path other commands rely on (areSkillsOutdated/checkAndWarnSkillsOutdated, invoked from thepreActionhook inbin/cli.ts) was still version-only and under-reported real content drift. A tree at the matching version but with drifted bundled content (the #708 scenario) reportedoutdated: false, so no warning surfaced and the driftsequant syncnow flags stayed invisible to every other command.Changes
areSkillsOutdatednow returns acontentDriftcount. On a version match it runs the samecomputeTemplateChangesdiffsyncuses (single source of truth from fix(update/sync): sync reports 'up to date' on content drift; update overwrites in-place customizations (constitution) #708/fix(#708): content-truth for update/sync; protect in-place customizations #710), countingnew+modifiedand excludinglocal-override/unchangedso customized files (e.g. constitution, bug(customization): .claude/.local/skills (and likely hooks) never load — documented override layer is non-functional #711) don't warn on every command. A version mismatch skips the diff entirely (already stale → copy path) to keep the per-command pre-flight cheap.checkAndWarnSkillsOutdatedwarns on content drift at a matching version — warn-only: never copies files, never setsprocess.exitCode. Accepts a pre-computed status to avoid a double scan on the hook hot path.preActionhook: version mismatch → auto-sync (copy) as before; version match + drift → warn only. Auto-sync (copy) stays gated on version bumps only so in-place customizations aren't clobbered.docs/internal/plugin-updates.md) + CHANGELOG document the AC-3 decision.Acceptance Criteria
areSkillsOutdatedcontent-aware (reflects content drift, not just version)contentDriftfromcomputeTemplateChanges, excludeslocal-override/unchangedpreActionwarns on content drift at matching versionexitCodechange, command exits normallyplugin-updates.md+ hook commentcomputeTemplateChanges(no parallel comparison)Test plan
npm run build— passesnpm run lint— passes (0 warnings)npm test(sync, doctor, cli.integration) — 65 tests passcontentDrifton new/modified, exclusion oflocal-override/unchanged, version-mismatch fast-path skip, diff-failure tolerance, andcheckAndWarnSkillsOutdatedwarn-only/exit-0 behavior.Coordination
main.bin/cli.tsnearpreAction— coordinate at merge (merge, don't rebase).Closes #713