Skip to content

fix(#1409): record the install scope so a skills-only install stops drifting - #1467

Merged
admarble merged 3 commits into
mainfrom
feature/1409-fix-sync-a-only-skills-install-warns-n-file-s-diff
Oct 16, 2026
Merged

admarble merged 3 commits into
mainfrom
feature/1409-fix-sync-a-only-skills-install-warns-n-file-s-diff

Conversation

@admarble

@admarble admarble commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Fix: .sequant-manifest.json now records the install scope in an optional groups field, which src/lib/manifest.ts owns.

    • Read through getInstallScope.
    • Written through createManifest(…, { groups }) and updateManifest({ addGroup | full }).
    • init --manifest-only writes groups: []. sync --only skills adds "skills". A full sync removes the field, recording a full install. sync --only never adds the field to a manifest that lacks it, so it can't narrow a full install.
  • Drift: computeContentDrift filters the template changes to the recorded scope (filterToInstallScope). A manifest without the field reads as a full install, so the behaviour there is unchanged.

  • Remedy: scopedRemedy() in sync.ts is now the one place that builds the remedy for a partial install. It gives sync --only skills --force for content drift and sync --only skills for a version mismatch. Three places use it:

    • the warning from checkAndWarnSkillsOutdated
    • the remediation in getSkillsInstallStatus (used by the serve stderr line and sequant://install)
    • the report-only path when you run sync --only skills and the version is already current

    A full install keeps the old text.

  • Spec open questions:

    • OQ-1 (version-mismatch remedy): done for sync.ts and version-preflight.ts; doctor.ts is not changed.
    • OQ-2 (plain sync defaulting to the recorded scope): not done.
    • OQ-3 (update on a scoped install): not done; needs a follow-up issue.
  • Docs: ADR-0015 (docs/adr/0015-install-scope-recorded-in-manifest.md; renumbered from 0014, which fix(#1405): a fresh machine starts a PR branch worktree from origin/<branch> #1468 also adds) plus its index row, and a CHANGELOG Fixed entry.

Pre-PR AC Verification

AC Source Status Evidence

AC mapping

AC Status Evidence
AC-1 Met sync.install-scope.integration.test.ts › AC-1 runs a real init --manifest-only + sync --only skills in a temp repo. runVersionPreflight("status") returns clean twice (the second from the drift cache), and contentDrift is 0
AC-2 Met › AC-2: one edited SKILL.md gives drift 1, and the printed remedy is … sync --only skills --force. Running that remedy changes nothing outside .claude/skills/**, the manifest and .claude/.sequant/. The constitution is byte-identical, and no hooks, agents, settings.json or scripts/dev appear
AC-3 Met The existing drift tests in sync.test.ts and version-preflight.test.ts pass with no assertion changes
AC-4 Met as written › AC-4 (4 cases): the manifest records groups: ["skills"]. A manifest with no field reads as a full install. sync --only never narrows a full install. A full sync records a full install

Runner check: npx vitest run over sync.install-scope.integration.test.ts, sync.test.ts, init.test.ts and version-preflight.test.ts gave 124/124 passed. Full-suite evidence is CI's.

Mutation verification

  • Mutation-verified: AC-1 — made computeContentDrift count the whole template set again; the AC-1 test failed (AC-2 too, since drift was no longer 1); restored. (exec)
  • Mutation-verified: AC-2 — made scopedRemedy always return null, so the old full-install remedy prints; only sync.install-scope.integration.test.ts > #1409 skills-only install scope > AC-2: … failed; restored. (re-run by the runner)
  • Mutation-verified: AC-4 — made init --manifest-only write no groups; the AC-4 record test failed, along with AC-1, AC-2 and two init.test.ts cases; restored. (exec)
  • Mutation-verified: AC-4 — made a missing groups field read as skills-only; only the AC-4 legacy-manifest test failed; restored. (exec)

Open for the owner (before merge)

  • Repos adopted before this change aren't fixed by it. That includes the issue's field case. Their manifest has no groups field, so AC-4 reads it as a full install, and sync --only skills never narrows a full install. QA reproduced it with the built CLI: the warning and the sync --force remedy stay.
  • Spec OQ-1..3 still need an end state:
    • doctor's version-mismatch remedy (doctor.ts:537-565)
    • plain sync on a scoped install (sync.ts:578)
    • update, which installs every group but leaves groups unchanged (update.ts:373)

Fixes #1409


🤖 Generated with Claude Code

…l scope

A skills-only install (init --manifest-only + sync --only skills) counted every hook, agent, scripts/dev file and settings.json it never installed as drift, and its remedy (sync --force) overwrote the constitution. The manifest now records the install scope in an optional groups field owned by src/lib/manifest.ts; drift and the remedy (sync --only skills --force) are scoped to it. A manifest without the field is a full install. ADR-0014.

Entire-Checkpoint: afbcf3d7b9ec
@admarble admarble changed the title fix(#1409): a --only skills install warns 'N file(s) differ' forever, and the suggested sync --force overwrites the repo's constitution fix(#1409): record the install scope so a skills-only install stops drifting Oct 16, 2026
#1405's PR (#1468) also adds an ADR-0014; it is on the graph's critical path and keeps the number.

Entire-Checkpoint: 49f1b32b29bc
…-a-only-skills-install-warns-n-file-s-diff

# Conflicts:
#	docs/adr/README.md
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): a --only skills install warns 'N file(s) differ' forever, and the suggested sync --force overwrites the repo's constitution

1 participant