Repository navigation
Description
Found during graph-2026-10-freeze-c planning (Phase 0 of node A); not a graph node.
It lands after freeze-c node A, which rewrites the outdated branch of the same check (doctor.ts:649) to use the scoped remedy.
Problem
doctor's Skills Version check (src/commands/doctor.ts:643-657) reads only areSkillsOutdated().outdated, which compares version markers. At a matching version it always passes with Up to date. areSkillsOutdated already returns contentDrift, the count of installed files that differ from the bundle inside the install scope (src/commands/sync.ts:306-335). doctor ignores it.
Every other consumer of the same status reads both fields:
- the pre-flight banner (
checkAndWarnSkillsOutdated,sync.ts:944-958); runVersionPreflight(version-preflight.ts:82);getSkillsInstallStatus, which backssequant://installand theservewarning (version-preflight.ts:133).
Reproduced 2026-10-17 (main @ de03af8, dev CLI, temp git repo):
sequant init --manifest-only --yes, thensequant sync --only skills(version 2.19.0,groups: ["skills"]).- One line appended to
.claude/skills/spec/SKILL.md. The drift cache was deleted. sequant doctor(andsequant doctor -q) printed:It exited 0. The banner and the check in the same run contradict each other, and the check list, the summary and the exit code omit the drift.! Version current, but 1 file(s) differ from bundled content Run: sequant sync --only skills --force ... ✔ Skills Version: Up to date (2.19.0) ... Passed: 14/20 Warnings: 6
sequant status printed the same banner. The banner comes from the CLI pre-action hook, not from doctor's checks.
Acceptance Criteria
- AC-1: At a matching version with content drift above 0,
doctor's Skills Version check is a warning. It states the number of differing files and names the remedy the pre-flight banner prints for that install (scopedRemedy(scope, cli, false)on a partial install; the full-install drift text otherwise). Evidence:npx vitest run src/commands/doctor.test.ts -t "Skills Version reports content drift"reports ≥ 2 passed (one partial, one full install), 0 failed, mutation-verified by making the check read onlyoutdatedagain. - AC-2: At a matching version with no content drift, the check still passes with
Up to date (<version>). Evidence:npx vitest run src/commands/doctor.test.ts -t "Skills Version passes with no drift"reports ≥ 1 passed, 0 failed. - AC-3: The drift remedy text has one producer. The banner and
doctorget it from the same function, so the two can't name different commands. Evidence:npx vitest run src/commands/doctor.test.ts -t "Skills Version reports content drift"asserts that the check's remedy equals whatcheckAndWarnSkillsOutdatedprints for the same status, mutation-verified by changing only the banner's full-install drift text (exactly that assertion fails).
Prior fixes / producers
-
Prior fixes:
- fix(update/sync): sync reports 'up to date' on content drift; update overwrites in-place customizations (constitution) #708 (PR fix(#708): content-truth for update/sync; protect in-place customizations #710) made
sync's own up-to-date decision content-aware. - fix(sync): areSkillsOutdated/checkAndWarnSkillsOutdated pre-flight is version-only — misses content drift (sibling of #708) #713 (closed 2026-06-04) fixed the same defect in the pre-flight: "the sibling pre-flight warning path other commands rely on is still version-only". It added
contentDrifttoareSkillsOutdated, butdoctornever read the new field. - fix(sync): a --only skills install warns 'N file(s) differ' forever, and the suggested sync --force overwrites the repo's constitution #1409 (PR fix(#1409): record the install scope so a skills-only install stops drifting #1467) scoped the drift count and the remedy.
git log -S 'Skills Version' -- src/commands/doctor.ts: one commit, 7be998a (2026-02-02, fix: Align ScopeAssessmentSettings with ScopeAssessmentConfig for custom thresholds #249), which added the check.git log -S 'contentDrift' -- src/commands/doctor.ts: none.
Three fixes in this class, each on a different surface.
- fix(update/sync): sync reports 'up to date' on content drift; update overwrites in-place customizations (constitution) #708 (PR fix(#708): content-truth for update/sync; protect in-place customizations #710) made
-
Readers of
contentDrift(git grep -n contentDrift -- 'src/*.ts' ':!*.test.ts'):sync.ts:944(banner);version-preflight.ts:82,:133,:165;doctor.ts: none. This issue adds the last reader.
-
Producers of the drift remedy text:
sync.ts:953-955(banner) andversion-preflight.ts:145(remediation). Their full-install fallbacks already differ: the banner namessync --force (or update),remediationnamesupdate. AC-3 states the outcome fordoctorand the banner. Aligningremediationis out of scope (see Non-Goals).
May touch
src/commands/doctor.ts (Skills Version check), src/commands/sync.ts (only to export the shared remedy text), src/commands/doctor.test.ts, CHANGELOG.md.
Non-Goals
- The remedy on the outdated branch (
doctor.ts:649). Freeze-c node A owns it. - How
contentDriftis computed, or the drift cache. - The full-install remedy in
getSkillsInstallStatus(version-preflight.ts:145,update), which differs from the banner's. - Changing
doctor's exit code. A warning keeps exit 0, as every other warning does today. - The Skills Committed check and phase skill sources (feat(doctor): report each phase skill's source; narrow the committed-skills guards (ADR-0012 follow-up 3) #1399).
- Any edit under
plugin/,.claude/skills/ortemplates/skills/(plugin freeze). - A release.
Activity
admarble commentedon Oct 18, 2026
Complexity: Standard (3 ACs, 2 directories)
AC Quality Check
All three ACs are single-line with
Evidence:clauses. Two findings:doctor.test.tsreplaces./sync.jswholesale withvi.mock(lines 49-60: onlyareSkillsOutdatedand a stubscopedRemedyare exported).checkAndWarnSkillsOutdateddoes not exist in that mock, and the stubscopedRemedynever returns the real full-install text. The "equals what the banner prints" assertion therefore has to usevi.importActual("./sync.js")for the banner side. It cannot compare against the mock. This is a test-design constraint, not an AC change.-t "Skills Version reports content drift"and-t "Skills Version passes with no drift"filters match no test today, so both commands report 0 passed and fail the≥ N passedbar. AC-2's behaviour already holds on current code, so AC-2 gates only that the new branch does not regress the pass path.Scope Assessment
Non-Goals: present in the issue (outdated-branch remedy, drift computation,
version-preflightremediation, exit code, plugin/skill dirs, release).src/commands) + CHANGELOGVerdict: ✅ SCOPE_OK
Acceptance Criteria
AC-1: drift at matching version → warning with count and banner remedy
Verification: Unit Test
Scenario: Given
areSkillsOutdatedreturnsoutdated:false, contentDrift:2→ WhendoctorCommand()runs → Then the Skills Version check iswarn, its message contains2 file(s)and the remedy. Two cases: partial scope →sync --only skills --force; full scope →sync --force (or … update).Assumptions: the warning counts toward
Warnings:and exit stays 0 (Non-Goal).AC-2: no drift → still passes
Verification: Unit Test
Scenario: Given
outdated:false, contentDrift:0→ ThenUp to date (<version>)pass. Note that the existing default mock omitscontentDrift, so the check must treatundefinedas 0 (> 0does).AC-3: one producer for the drift remedy
Verification: Unit Test
Scenario: Given a drift status → When doctor formats its message and
checkAndWarnSkillsOutdatedprints → Then the remedy substrings are equal. Mutation: change only the banner's full-install text → this assertion fails.Implementation Plan
Phase 1: shared producer (
src/commands/sync.ts)formatSkillsDriftRemedy(scope, cli)returningscopedRemedy(scope, cli, false) ?? \${cli} sync --force (or ${cli} update)`. Replace the inline expression atsync.ts:~953-955incheckAndWarnSkillsOutdated` with a call to it. The banner's own text and output stay identical.Phase 2: doctor (
src/commands/doctor.ts)formatSkillsDriftMessage(status, cli)next toformatSkillsOutdatedMessage(~line 553):${n} file(s) differ from bundled content (version ${v}) - run: ${remedy}, usingformatSkillsDriftRemedy.else if ((skillsStatus.contentDrift ?? 0) > 0)branch pushing awarn, ahead of the pass branch.Phase 3: tests and changelog
doctor.test.ts, adddescribe("Skills Version reports content drift")(partial + full cases) anddescribe("Skills Version passes with no drift"). Extend the./sync.jsmock to delegateformatSkillsDriftRemedyto the actual module viavi.importActual, and add the AC-3 parity test importing the realcheckAndWarnSkillsOutdatedfromimportActual(captureconsole.log).outdated→ AC-1 tests fail; (b) change only the banner full-install text → the AC-3 test fails. RecordMutation-verified:markers in the PR body with thesrc/commands/doctor.test.ts > …path format.CHANGELOG.mdentry.Design Review
sync.ts(it already ownsscopedRemedyand the banner). The doctor check is a consumer.else if. Rejected: having doctor callcheckAndWarnSkillsOutdated(it prints and returns a boolean, which would double-print and break theWarnings:count, cf. fix(onboarding): first-run papercuts from a stranger smoke test — doctor contradicts the README install, init omits the commit step, warning count and phase timer are off #1387 AC-3). Rejected: also unifyingversion-preflight.ts:145(Non-Goal).outdatedbut notcontentDrift". Prior fixes: fix(update/sync): sync reports 'up to date' on content drift; update overwrites in-place customizations (constitution) #708, fix(sync): areSkillsOutdated/checkAndWarnSkillsOutdated pre-flight is version-only — misses content drift (sibling of #708) #713, fix(sync): a --only skills install warns 'N file(s) differ' forever, and the suggested sync --force overwrites the repo's constitution #1409 — three, each on a different surface. This is the class's last known reader (git grep contentDriftshows doctor is the only status consumer without it). The class is closed by AC-3's shared producer for doctor and banner.version-preflight.ts:145is deliberately left divergent per Non-Goals, so file a follow-up for it. Recording:deliberately local for remediation, reason: Non-Goal, class tracked in follow-up.version-preflight'sremediationin too?" Answer: Non-Goal, it changessequant://installoutput.areSkillsOutdatedstatus: consumers aresync.tsbanner,version-preflight.ts(:82, :133, :165) anddoctor.ts. The single producer isareSkillsOutdated. Remedy-text producers:sync.tsbanner andversion-preflight.ts:145. After this change doctor and the banner share one.Feature Quality Planning
All standard checks pass. Notable:
areSkillsOutdated()with no options), so the count is fresh.contentDriftis absent in the default mock, so keep the?? 0guard.plugin/,.claude/skills/ortemplates/skills/edits (freeze).Open Questions
version-preflight.ts:145remedy divergence? — Recommendation: yes, file after merge. Impact: the divergence stays unfiled otherwise.Recommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: small single-file bug fix with Unit Test evidence on a
buglabel. testgen skipped (bug-only, targeted tests are in the plan). No UI, so notestphase.Label Review
Current: bug
Recommended: bug, planned
Quality Loop: won't auto-enable (SCOPE_OK).
admarble commentedon Oct 18, 2026
QA Verdict: AC_MET_BUT_NOT_A_PLUS
AC coverage: 3/3 met
Gaps:
Suggestions:
run: (.*)match from the wholedoctoroutput. If an earlier check's message ever containsrun:, the test would compare the wrong line. Scoping the match to theSkills Version:line would make it robust.test(#1490): scope the AC-3 parity assertion to the Skills Version line