Skip to content

fix(#1485): plain sync and doctor still steer a skills-only install into a full install — sync ignores the recorded scope, doctor names bare sync - #1498

Merged
admarble merged 3 commits into
mainfrom
feature/1485-fix-sync-plain-sync-and-doctor-still-steer-a-skill
Oct 18, 2026
Merged

admarble merged 3 commits into
mainfrom
feature/1485-fix-sync-plain-sync-and-doctor-still-steer-a-skill

Conversation

@admarble

@admarble admarble commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Plain sync now keeps a skills-only scope, and doctor and the sync fast path name the scoped fix. Exec's change is 6d85d29ce. The runner's fixes after QA are f55b0a901 and 19e19f545 (see Runner fix after QA).

Changes

  • src/commands/sync.ts:
    • skillsOnly is resolved once after the manifest is read, from --only skills or a manifest with groups including "skills". That one decision now covers the fast path, the dry-run preview, the apply filter and the manifest write.
    • copyTemplates also gets the effective scope. Before this, the raw only flag was passed through and hooks would still have been written.
    • The fast-path remedy goes through scopedRemedy.
    • A kept scope prints one line: "Install scope: skills only (widen with sequant init)".
    • A manifest with no groups, or groups: [], still gets a full sync.
  • src/commands/doctor.ts: the Skills Version check uses scopedRemedy. A manifest with no groups and no .claude/hooks, .claude/settings.json or .claude/agents gets an advisory naming the "groups": ["skills"] hand edit. getInstallScope is untouched.
  • src/mcp/server.ts: the sequant://install description no longer says "run sequant update".
  • ADR-0015: the Decision section now says a plain sync keeps a partial scope and sequant init widens it. The sed … | grep -c "sequant init" check prints 1.
  • CHANGELOG.md: added an entry for this fix and corrected the unreleased fix(sync): a --only skills install warns 'N file(s) differ' forever, and the suggested sync --force overwrites the repo's constitution #1409 line that said a full sync removes the scope.
  • Tests: I rewrote the fix(sync): a --only skills install warns 'N file(s) differ' forever, and the suggested sync --force overwrites the repo's constitution #1409 test "a full sync on a skills-only install records a full install" to the new outcome. I added tests for AC-1, AC-4 and AC-5 in sync.install-scope.integration.test.ts, and for AC-2 and AC-3 in doctor.test.ts.

Checks

  • npm run build and npm run lint pass.
  • Affected set, 8 test files: npx vitest run --changed origin/main plus the named test files, the update tests, src/mcp and scripts/qa/tautology-detector-cli.test.ts. 235 tests passed.
  • The vi.mock list of manifest.js needed no change: doctor never calls getInstallScope.
  • doctor.ts now also exports formatSkillsOutdatedMessage. doctor.test.ts mocks ./sync.js, so its AC-2 test exercises the call site and not the real scopedRemedy.

Mutation results
Each mutation was applied on top of the committed change, the test failed, and I restored it.

  • AC-5: deriving skillsOnly from --only alone failed two tests, "plain sync keeps a skills-only scope" and its --dry-run variant.
  • AC-1: restoring the unscoped fast-path change set failed "plain sync on a skills-only install counts drift only inside the scope".
  • AC-4: making scopedRemedy's partial branch return the full-install text failed "no remedy widens a partial install".
  • AC-2: replacing the scope with undefined in the doctor call failed "names sync --only skills on a skills-only install".
  • AC-3: disabling the advisory's groups check failed "advises the groups edit when hooks, settings and agents are all absent".

Runner fix after QA

QA returned AC_NOT_MET (5/6). AC-4 requires its test to check every per-install producer through scopedRemedy, and doctor was missing: doctor.test.ts mocks scopedRemedy, and the integration test never ran doctor's message. The QA run also cut off the AC-4 marker and never wrote the AC-5 one.

  • f55b0a901: doctor's Skills Version warning moved into an exported formatSkillsOutdatedMessage(status, cli) in doctor.ts, and doctorCommand calls it. The AC-4 test now pushes that message (outdated variant, real areSkillsOutdated and the real scopedRemedy) into the checked lines. It asserts - run: sequant sync is present, so the doctor line can't drop out silently.
  • I ran each mutation on top of f55b0a901, with the test filter, then the whole file, and restored afterwards (15/15 pass):

Mutation-verified: AC-4 — scopedRemedy's partial branch returns the full-install text; "no remedy widens a partial install" failed (1 failed, 14 skipped; the whole file had 3 failed, AC-1 and #1409 AC-2 among them); restored.
Mutation-verified: AC-4 (doctor only) — formatSkillsOutdatedMessage passes undefined as the scope; "no remedy widens a partial install" failed, and it was the only failure in the file; restored.
Mutation-verified: AC-5 — skillsOnly derived from --only alone; "plain sync keeps a skills-only scope" and its --dry-run variant failed; restored.
Mutation-verified: AC-2 — re-run on f55b0a901: scope replaced with undefined in formatSkillsOutdatedMessage; "names sync --only skills on a skills-only install" failed; restored.

Evidence commands, run verbatim on f55b0a901: AC-1 1 passed; AC-2 2 passed; AC-3 3 passed; AC-4 1 passed; AC-5 3 passed (0 failed in all five); AC-6 printed 1. npx tsc --noEmit is clean. The freeze grep printed nothing.

QA re-run on f55b0a901: NEEDS_VERIFICATION, 6/6 met. The only blocker was CI still pending. QA also dropped one finding as cosmetic: a plain sync that kept the skills-only scope ended with "Skills have been updated (--only skills: …)", naming a flag the user never passed. That line gives the wrong cause of the scoping, so I fixed it:

  • 19e19f545: the summary now names the actual cause: --only skills when the flag was passed, and skills-only install when the manifest's scope was kept. The new test "plain sync keeps a skills-only scope: the summary names the recorded scope, not a flag the user never passed" is under the AC-5 filter.

Mutation-verified: AC-5 (summary text) — the summary hardcodes --only skills again; the new summary test failed (1 failed, 15 passed); restored, 16/16 pass.

Fixes #1485


🤖 Generated by sequant run

…t path name the scoped remedy

Entire-Checkpoint: b626638b5c2c
…eal scopedRemedy

Entire-Checkpoint: 3f553fdb0011
…ays --only skills was passed

Entire-Checkpoint: 59b8ee651d1a
@admarble
admarble merged commit e803532 into main Oct 18, 2026
10 checks passed
@admarble
admarble deleted the feature/1485-fix-sync-plain-sync-and-doctor-still-steer-a-skill branch October 18, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(sync): plain sync and doctor still steer a skills-only install into a full install — sync ignores the recorded scope, doctor names bare sync

1 participant