Skip to content

update: --dry-run reports "0 modified" but apply rewrites every SKILL.md (dry-run vs apply divergence) #722

Closed

Description

@admarble

Summary

sequant update --dry-run and the actual sequant update (apply) disagree about what will change. In a downstream project whose installed skills predate the <!-- sequant:local-override --> overlay header (added to every bundled SKILL.md in #711 / 2.6.2), --dry-run reports nothing to do, but the apply then rewrites all 17 SKILL.md files (plus AGENTS.md).

Repro

  1. Have a project whose .claude/skills/.sequant-version predates 2.6.2 and whose SKILL.md files do not yet contain the <!-- sequant:local-override --> header (i.e. last synced before bug(customization): .claude/.local/skills (and likely hooks) never load — documented override layer is non-functional #711 landed).
  2. Run sequant update --dry-run:
    Summary:
      New files: 0
      Modified: 0
      ✓ Unchanged: 48
      Local overrides: 0
    ✔ Everything is up to date!
    
  3. Run sequant update --yes. It reports the same "Everything is up to date!" summary — but the working tree now shows 22 modified files: every SKILL.md gained the 2-line override header, .sequant-version + .sequant-manifest.json bumped, and AGENTS.md refreshed.
  4. Re-run sequant update --dry-run → now correctly reports Modified: 0 (converged).

So the first dry-run under-reported by 22 files: it claimed Modified: 0 / Local overrides: 0 while real, applicable template changes were pending.

Impact

Hypothesis (lead, not confirmed)

The 2.6.2 templates now ship the <!-- sequant:local-override --> marker in-band. computeTemplateChanges likely keys on that marker to classify a file as local-override/skip when counting Modified, so the dry-run summary excludes files that the apply path (copyTemplates) still writes. The dry-run summary count and the apply write-set need to be reconciled to a single source of truth (the #708/#710 intent), and the override-classifier should distinguish "template ships the marker" from "user added a local override."

Suggested fix direction

  • Make the --dry-run summary count the exact set copyTemplates would write.
  • Ensure the local-override classifier triggers on a real .claude/.local/skills/<name>/overrides.md presence (the supported mechanism), not on the marker comment embedded in the managed SKILL.md template itself.
  • Add a regression test: installed file missing the override header vs template containing it must surface as Modified in --dry-run.

Related: #708, #710, #711, #713.

Activity

  1. added
    bug
    on Jun 4, 2026
  2. admarble commented on Jun 6, 2026

    @admarble
    ContributorAuthor

    Complexity: Simple (3 implied ACs, 2 directories: src/commands/, src/lib/)

    ⚠️ Reproduction finding (read first)

    I traced both paths and could not reproduce the literal repro against current main (2.6.2 HEAD). Two structural facts make the described update --dry-run vs update --apply divergence impossible as written:

    1. update shares one source of truth. updateCommand derives its summary and its write-set from a single computeTemplateChanges() call (src/commands/update.ts:169). The apply loop writes only applySet = newFiles + modifiedFiles (update.ts:184-260). The dry-run prints those same counts. They cannot disagree within a run, and --dry-run writes nothing (locked by update.integration.test.ts:212), so a second invocation sees identical state.
    2. computeTemplateChanges already classifies a header-missing SKILL.md as modified. I reproduced this directly: template-with-header vs installed-without-header → status: "modified", not unchanged. So update --dry-run does surface it.
    3. The override classifier already keys on a real .claude/.local/ twin, not the in-band marker (templates.ts:231-234 checks fileExists(localOverridePath)). The issue's suggested-fix docs: Add pre-release checklist #2 is already satisfied in current code.

    Most likely real mechanism (the apply in the repro refreshed AGENTS.md and rewrote every SKILL.md — neither is something update does; update has no copyTemplates/AGENTS.md call):

    • The apply was sync, not update. sync at a mismatched (pre-2.6.2) version marker skips the content-diff short-circuit and copyTemplates(force:true) rewrites everything + regenerates AGENTS.md (sync.ts:291-360). There is no sync --dry-run and the mismatch path emits no per-file preview — so a preceding update --dry-run (which uses fresh content-diff) and a sync apply (which uses the version marker) legitimately disagree.
    • Or npx version skew: the dry-run ran a cached older CLI whose bundled templates lacked the override header (→ unchanged), while the apply ran @latest whose templates carry it.

    Recommendation: exec must reproduce first (install a pre-2.6.2-marker fixture, run the exact two commands) to confirm which path diverges, then fix that path. Do not blind-patch computeTemplateChanges — it is already correct on the axes the issue names. See feedback: evaluate whether a gap can actually occur before writing code.


    AC Quality Check

    The issue has no - [ ] checklist; ACs are derived from "Suggested fix direction". Derived ACs are concrete/measurable. One latent assumption flagged in AC-1.

    Scope Assessment

    Non-Goals: ⚠️ none stated. Recommend bounding to: no behavioral change to the apply write-set itself; no new sync --dry-run surface unless repro proves it necessary.

    Metric Value Status
    Feature count 1 (preview/apply reconciliation + regression tests) ✅
    AC items 3 ✅
    Directory spread 2 (src/commands, src/lib) ✅

    Verdict: ✅ SCOPE_OK


    Acceptance Criteria

    AC-1: A preview never under-reports the apply write-set

    Verification: Integration Test
    Scenario: Given a project whose installed SKILL.md files lack the <!-- sequant:local-override --> header while the bundled templates contain it → When the preview path runs (update --dry-run, and — if repro implicates it — the sync mismatch path) → Then the reported Modified/to-write count equals the exact set the subsequent apply writes (non-zero).
    Assumptions (validate in repro): the divergence is reproducible on a pre-2.6.2 marker with a single, consistent CLI version. If it only reproduces under npx version skew, the fix is documentation/guard, not logic.

    AC-2: Local-override classification is driven by a real .claude/.local/ override, not the in-band marker

    Verification: Unit Test (on computeTemplateChanges)
    Scenario: Given a managed SKILL.md that drifted from the template AND no .claude/.local/skills/<name>/ twin → When classified → Then modified (not local-override); Given the same with a .claude/.local/ twin present → Then local-override.
    Note: current code already passes this; the test locks the invariant against regression.

    AC-3: Regression test — header-missing installed file vs header-bearing template surfaces as Modified in preview

    Verification: Integration Test
    Scenario: Given installed qa/SKILL.md without the override header and bundled template with it → When the preview runs → Then that file appears in the Modified set (count ≥ 1), and a same-state apply writes exactly that file.


    Implementation Plan

    Phase 1: Reproduce & localize (gate)

    1. Build a fixture project: .claude/skills/.sequant-version = a pre-2.6.2 value, SKILL.md files stripped of the override header; point the CLI at current bundled templates.
    2. Run the exact two commands from the issue for both update and sync. Capture which command's preview-vs-apply diverges. If neither diverges with a single CLI version, document the version-skew root cause and pivot AC-1 to a guard/doc fix.

    Phase 2: Fix the confirmed divergence

    • If sync: give the version-mismatch path a truthful pre-apply preview (reuse computeTemplateChanges to print the write-set before copyTemplates), and/or add sync --dry-run so the documented preview surface exists. Reconcile the printed set with copyTemplates' actual write-set as the single source of truth.
    • If version skew: add a CLI-version line to preview output and/or a guard so a stale cached CLI can't silently preview "up to date".
    • If a genuine update bug surfaces: reconcile at the applySet/summary level only.

    Phase 3: Lock with tests

    • Add AC-1/AC-2/AC-3 tests (extend update.integration.test.ts and templates.test.ts; mirror in sync.test.ts if sync is implicated).

    Design Review

    1. Where does this logic belong? The diff/classification source of truth is src/lib/templates.ts (computeTemplateChanges/copyTemplates); the preview surfaces live in src/commands/{update,sync}.ts. Any fix should keep computeTemplateChanges as the one set both preview and apply consult — extend the consuming command, not duplicate diff logic.
    2. Simplest correct approach? Don't touch the already-correct update path or computeTemplateChanges classification. Add the regression tests that prove the invariant, and fix only the surface the repro implicates (most likely: sync preview gap). Rejected: rewriting the override classifier to read the marker — that would re-introduce the exact coupling the issue warns against and break in-place customization protection.

    Open Questions

    1. Is the reporter's apply actually sync, not update? — Recommendation: assume yes until repro shows otherwise (AGENTS.md refresh + full-tree rewrite are sync-only). Impact if wrong: Phase 2 targets the wrong command.
    2. Should sync gain a --dry-run? — Recommendation: add it only if repro confirms sync is the diverging path; it's the cleanest way to make sync's preview trustworthy (parity with update --dry-run). Impact: small new surface + tests.
    3. Was this just npx version skew? — Recommendation: rule it out explicitly in Phase 1 by pinning one CLI version across both commands. Impact: changes the fix class from logic → guard/doc.

    Recommended Workflow

    Phases: exec → qa
    Quality Loop: disabled (focused bug; ≤3 ACs)
    Reasoning: CLI/logic bug with integration-test verification. testgen is optional — the three ACs map to a small, well-understood set of integration/unit tests that exec can author inline. Gate exec on Phase 1 reproduction: if the literal bug doesn't reproduce, the deliverable may be regression tests + a sync preview fix rather than an update patch.


    Label Review

    Current: bug
    Recommended: bug (add needs-repro if your workflow uses it)
    Reason: Plan is reproduction-gated; the literal update divergence does not reproduce on current main, so confirm the real path before coding.
    Quality Loop: Won't auto-enable (SCOPE_OK, ≤8 ACs).

  3. added
    planned
    on Jun 6, 2026
  4. admarble commented on Jun 6, 2026

    @admarble
    ContributorAuthor

    /exec progress — implemented (PR #723)

    Phase 1 (reproduction gate) — done

    Built a pre-2.6.2-marker fixture (header-missing SKILL.md, .sequant-version = 2.6.1) and ran the real code paths:

    • update does NOT diverge. computeTemplateChanges classifies all 17 header-missing SKILL.md as modified, so update --dry-run reports 17 modified, 0 new (+1 protected local-override = constitution) — never the issue's "0 modified". update's summary and write-set come from one call; they can't disagree.
    • sync is the real gap. On a version mismatch, sync skips the content-diff short-circuit and runs copyTemplates(force:true) — rewriting the whole tree (+AGENTS.md) — with no --dry-run and no per-file preview. This matches the repro's symptoms (full-tree rewrite + AGENTS.md refresh are sync-only). The reporter's "apply" was sync, and/or npx version skew gave the preceding dry-run older (header-less) templates.

    Phase 2 (fix)

    Added sequant sync --dry-run / -d: reuses computeTemplateChanges (single source of truth) to report the exact set the apply writes — new + modified + local-override (the force copy overwrites in-place customizations, so they're counted, never under-reported) — mutates nothing, and exits non-zero when work is pending so the preview can gate CI. Did not touch update, computeTemplateChanges, or the apply write-set (spec non-goals).

    Phase 3 (tests)

    • sync.test.ts — AC-1 dry-run tests (preview = write-set, no mutation, exit code, local-override counting)
    • templates.test.ts — AC-2 (override keyed on real .claude/.local/ twin, not the marker) + AC-3 (header-missing vs header-bearing → modified)

    AC coverage

    AC Status
    AC-1 Preview never under-reports apply write-set ✅ live verify: preview 18 = apply 18
    AC-2 Override classification via real .claude/.local/ twin ✅ already correct; locked by test
    AC-3 Header-missing → Modified in preview ✅ test + live repro

    Checks

    • npm run build ✅ · npm run lint ✅ (0 warnings) · npx vitest run (sync/templates/update-integration/doctor/cli-integration) ✅ 102 passed

    Files changed

    src/commands/sync.ts, bin/cli.ts, src/commands/sync.test.ts, src/lib/templates.test.ts, CHANGELOG.md, docs/reference/cheat-sheet.md

    PR: #723 · Next: /qa 722

  5. admarble commented on Jun 6, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #722 (PR #723)

    Reviewed inline (worktree diff, 269 lines / ~67 lines of real logic). Reproduction-gated bug — QA independently re-ran the Phase 1 fixture and confirmed the spec's call.

    AC Coverage

    AC Source Description Status Notes
    AC-1 Original A preview never under-reports the apply write-set MET sync --dry-run reports new+modified+local-override. Fixture verify: preview = 18 (17 modified + 1 override), real apply changed 18 files. Equal, non-zero, no mutation.
    AC-2 Original Override classification keyed on real .claude/.local/ twin, not the in-band marker MET templates.ts:231-234 (fileExists(localOverridePath)) unchanged; new templates.test.ts test locks: no twin → modified, twin present → local-override.
    AC-3 Original Header-missing installed vs header-bearing template → Modified in preview MET New templates.test.ts test; live repro shows 17 header-missing SKILL.md → modified (never a false "0").

    Coverage: 3/3 AC items fully met.


    Reproduction Re-Verification (gate)

    Re-ran the fixture (pre-2.6.2 marker, header-stripped SKILL.md) against the real code:

    • update does not diverge — computeTemplateChanges classifies all 17 header-missing files as modified; update --dry-run reports 17 modified, 0 new, never the issue's "0 modified". update.ts:169 derives summary and write-set from one call. The literal update repro is not reproducible — confirmed.
    • sync was the real gap — version-mismatch path runs copyTemplates(force:true) (full-tree rewrite + AGENTS.md) with no preview surface. The fix adds one.

    CI Status

    Check State Impact
    build (22.x) SUCCESS ✅ MET
    typecheck SUCCESS ✅ MET
    validate-plugin SUCCESS ✅ MET
    validate-skills SUCCESS ✅ MET

    CI Summary: 4 passed, 0 pending, 0 failed · mergeStateStatus: CLEAN. (Diff touches .ts — markdown-only relaxation N/A; all gating checks green.)


    Quality Metrics

    Metric Value Status
    Type issues (any) 0 OK
    Deleted tests 0 OK
    Files changed 6 OK
    Lines added +268 -
    Lines deleted -1 -

    Test Coverage Analysis

    Changed File Tier Has Tests? Test File
    src/commands/sync.ts Standard ✅ Yes src/commands/sync.test.ts (4 new dry-run tests)
    bin/cli.ts (flag wiring) Standard ⚠️ Indirect Verified via sync --help; one-line pass-through
    src/lib/templates.test.ts — (tests only) locks AC-2/AC-3 invariants

    Coverage: Core logic fully covered; CLI flag is a trivial pass-through verified by smoke test. Targeted suites: 49 passed; related suites (sync/templates/update-integration/doctor/cli-integration): 102 passed (from exec).


    CLI Registration Verification

    Option files modified: Yes (SyncOptions gained dryRun)

    Interface Field Runtime Usage CLI Registered Status
    dryRun const { dryRun } = options + if (dryRun) (sync.ts) -d, --dry-run in bin/cli.ts ✅ OK

    Verification Status: Passed


    Execution Evidence

    Test Type Command Result
    Flag registered sequant sync --help ✅ -d, --dry-run shown
    Preview = apply fixture harness (real syncCommand) ✅ preview 18 = apply 18
    No mutation dry-run on fixture ✅ file unchanged, version marker not bumped
    Exit code dry-run with pending work ✅ exit 1 (CI-gate signal)
    Not-initialized guard sync --dry-run on bare repo ✅ exits cleanly before preview branch

    Evidence status: Complete


    Code Review

    Strengths:

    • Single source of truth respected — preview reuses computeTemplateChanges, the same diff copyTemplates/update/the pre-flight consult; no duplicated diff logic.
    • Dry-run guard placement is correct: it sits after the matching-version report-only short-circuit (so a no-force matching-version dry-run delegates there and mirrors the real no-op apply) and before copyTemplates (the force-rewrite path). Both branches mutate nothing. Control flow verified for all four (force × version-match) combinations.
    • Honest write-set: counts local-override because sync's force copy overwrites in-place customizations — avoids re-introducing the exact under-reporting update: --dry-run reports "0 modified" but apply rewrites every SKILL.md (dry-run vs apply divergence) #722 describes.
    • Internal caller bin/cli.ts:656 syncCommand({ quiet: true }) is unaffected (no dryRun); exit-code-1 only fires inside the new branch.
    • update, computeTemplateChanges, and the apply write-set untouched (spec non-goals honored).

    Issues: None blocking.

    Suggestions (non-blocking):

    • Minor wording drift between the summary line ("Local overrides (overwritten by sync)") and the list header ("Local overrides (will be overwritten by sync)"). Cosmetic.
    • sync --dry-run exits non-zero on pending work, but update --dry-run exits 0 — an intentional asymmetry (sync is the CI-safe automation surface) but worth aligning eventually.

    Anti-Pattern Detection

    No any, no empty catches, no secrets, no await-in-loop, no resource leaks introduced. N/A — no package.json change.


    Risk Assessment

    • Likely failure mode: computeTemplateChanges maps templates/scripts/* → .claude/scripts/* while copyTemplates symlinks them to scripts/dev/*; in a real install .claude/scripts/ may not exist, so scripts could show as new in the preview. Pre-existing and shared with update --dry-run (identical source of truth) — not introduced here, and consistency with update is the design goal.
    • Not tested: The CLI flag→action wiring has no dedicated automated test (covered by --help smoke + the unit-tested branch). Acceptable for a one-line pass-through.
    • Sibling sites considered: Cross-file — update already has --dry-run and a single source of truth; the checkAndWarnSkillsOutdated pre-flight is already content-aware (fix(sync): areSkillsOutdated/checkAndWarnSkillsOutdated pre-flight is version-only — misses content drift (sibling of #708) #713); init is first-install (no preview needed). sync was the only apply surface lacking a preview — now addressed. No unaddressed cross-file siblings.
    • Sibling-line audit: Within sync.ts there is exactly one apply path (copyTemplates); the dry-run guard precedes it and the matching-version short-circuit is the only other report path (correctly delegated to). No sibling apply sites.

    Adversarial Re-Read

    Findings: Walked the diff adversarially: (1) ran the implementation against the issue's verbatim motivating example — the literal update --dry-run "0 modified" does NOT reproduce (update reports 17 modified), validating that the fix correctly targets sync rather than blind-patching update; (2) audited the evidence claims — the "preview 18 = apply 18" is a genuine post-fix validation (the --dry-run flag is net-new), not a pre-fix bug repro; (3) inspected process state — clean tree, branch 0 behind main, all changes committed; (4) cited sibling sites (above); (5) checked Non-Goals — the apply write-set is unchanged, and sync --dry-run was added only because the repro implicated sync (within the spec's stated condition). One real follow-up surfaced: the new truthful preview reveals that sync (version-mismatch or --force) overwrites in-place customizations including .claude/memory/constitution.md — confirmed in the fixture (real apply changed the constitution), whereas update protects it (#708/#711). This is pre-existing, out of #722's scope (explicit non-goal: no apply-write-set change), and the PR surfaces it correctly. Recommend a follow-up issue to give sync the same in-place-customization protection update has.

    Status: Gaps Found (follow-up recommendation; no missing AC)


    CHANGELOG Verification

    Check Status
    CHANGELOG.md exists ✅
    User-facing change ✅ (fix(#722) commit)
    [Unreleased] entry ✅ Present (### Added, references #722)

    Result: CHANGELOG requirements met.


    Verdict: AC_MET_BUT_NOT_A_PLUS

    All 3 ACs are MET with strong execution evidence (preview write-set proven equal to the real apply write-set), CI is green, build/lint/tests pass, CLI wiring is correct, and the spec non-goals are honored. This is high-quality, well-scoped, well-tested work and is mergeable.

    Not flagged READY_FOR_MERGE only because QA surfaced a meaningful (pre-existing, out-of-scope) behavior worth tracking: sync overwrites in-place customizations (constitution) on the mismatch/force path, which the new dry-run now truthfully reports. Recommend a follow-up issue; it does not block this PR.

    Documentation

    • CHANGELOG [Unreleased] entry added
    • docs/reference/cheat-sheet.md updated with sync --dry-run
    • Optional: run /docs 722 if admin-facing docs are desired

    Next Steps

    1. Merge PR fix(#722): add sync --dry-run so the sync preview can't under-report the apply #723 — all ACs met, CI green.
    2. File follow-up: "sync (mismatch/--force) overwrites in-place customizations (constitution) — give it update's local-override protection" (fix(update/sync): sync reports 'up to date' on content drift; update overwrites in-place customizations (constitution) #708/bug(customization): .claude/.local/skills (and likely hooks) never load — documented override layer is non-functional #711 family).
    3. Optional: align update --dry-run exit-code behavior with sync --dry-run (exit non-zero on pending work) for a consistent CI-gate contract.
  6. added
    needs-improvement
    on Jun 6, 2026
  7. admarble commented on Jun 6, 2026

    @admarble
    ContributorAuthor

    Quality Loop Complete — No Iteration Needed

    Issue: #722 · Iterations: 0/3 · Final Status: READY (mergeable; no AC gaps)

    The loop parsed the QA verdict (AC_MET_BUT_NOT_A_PLUS) and found no actionable AC gaps:

    • AC-1, AC-2, AC-3 → all MET (0 NOT_MET, 0 PARTIALLY_MET)
    • CI green · mergeStateStatus: CLEAN · HEAD f8cd04e unchanged

    The single QA finding is a prose recommendation, not an unmet AC: the new truthful sync --dry-run preview surfaces a pre-existing behavior where sync (version-mismatch / --force) overwrites in-place customizations (constitution), unlike update. Fixing that would change the apply write-set — the explicit non-goal of #722's spec — so it belongs in a separate follow-up issue, not this loop.

    No code changes made (iterating would either no-op against the No-Diff Guard or introduce out-of-scope creep).

    Recommended next steps

    1. Merge PR fix(#722): add sync --dry-run so the sync preview can't under-report the apply #723 — all ACs met, CI green.
    2. File follow-up (separate issue): give sync the same local-override protection update has (fix(update/sync): sync reports 'up to date' on content drift; update overwrites in-place customizations (constitution) #708/bug(customization): .claude/.local/skills (and likely hooks) never load — documented override layer is non-functional #711 family).
  8. admarble commented on Jun 7, 2026

    @admarble
    ContributorAuthor

    QA Re-Review (fresh session) for Issue #722 — PR #723

    Independent second-look at commit f8cd04e (a full QA already exists at this SHA; this is a fresh-session re-verification, not a re-post). I concur with the prior verdict.

    What I re-verified independently

    Check Result
    npm run build (tsc) ✅ passes
    Targeted tests (sync + templates) ✅ 49 passed
    sequant sync --help ✅ -d, --dry-run registered and wired to syncCommand
    CI (PR #723) ✅ 4/4 SUCCESS (build 22.x, typecheck, validate-plugin, validate-skills), mergeStateStatus: CLEAN

    AC Coverage (independently confirmed)

    AC Status Evidence
    AC-1 Preview never under-reports apply write-set MET sync --dry-run reports new + modified + local-override (sync.ts:323–390), reuses the same computeTemplateChanges() the apply consults; tests assert no copyTemplates/writeFile and exitCode === 1 on pending work.
    AC-2 Override classification via real .claude/.local/ twin (not in-band marker) MET templates.ts:231-234 unchanged (fileExists(localOverridePath)); new test proves no-twin → modified, twin → local-override (also proves SKILL.md isn't blanket-isCustomizableFile).
    AC-3 Header-missing installed vs header-bearing template → Modified MET New templates.test.ts regression; the literal update --dry-run "0 modified" repro is structurally impossible (one computeTemplateChanges call drives both summary & write-set; header-missing classifies modified).

    Scope-pivot judgment

    The issue names update --dry-run; the PR fixes sync --dry-run instead. This is not scope creep — the approved /spec was explicitly reproduction-gated and pre-authorized exactly this pivot ("add sync --dry-run only if repro confirms sync is the diverging path"). The update non-reproduction is test-backed (AC-3 passes), and spec non-goals (no change to update/computeTemplateChanges/apply write-set) are honored.

    Adversarial re-read

    Verdict: AC_MET_BUT_NOT_A_PLUS

    All 3 ACs MET, CI green, build/tests pass, CLI wiring correct, scope pivot legitimate and spec-sanctioned. Mergeable. Not READY_FOR_MERGE only because of the (pre-existing, out-of-scope) sync-overwrites-customizations behavior worth tracking as a follow-up.

    Next steps

    1. Merge PR fix(#722): add sync --dry-run so the sync preview can't under-report the apply #723.
    2. File follow-up: "sync (force/version-mismatch) overwrites in-place customizations (constitution) — give it update's local-override protection" (fix(update/sync): sync reports 'up to date' on content drift; update overwrites in-place customizations (constitution) #708/bug(customization): .claude/.local/skills (and likely hooks) never load — documented override layer is non-functional #711 family).
  9. admarble commented on Jun 7, 2026

    @admarble
    ContributorAuthor

    /fullsolve QA — #722 (verdict: READY_FOR_MERGE)

    Existing PR #723 already resolves this. I re-verified the implementation against the issue's three suggested-fix directions, with emphasis on adversarially checking the PR's central reframing.

    Key finding: the PR's reframing is correct

    The issue hypothesizes update --dry-run is broken. It is not. Verified in source:

    • update derives both its summary counts and its apply write-set from a single computeTemplateChanges() call (src/commands/update.ts:169,172-186) — they cannot diverge.
    • The classifier keys an override on a real .claude/.local/ twin (hasLocalOverride) — not the in-band <!-- sequant:local-override --> marker (src/lib/templates.ts:231-242). A header-missing SKILL.md with no .local/ twin → status: "modified".
    • update returns at the empty-applySet short-circuit before any write (update.ts:188-199), so "Everything is up to date" + 22 writes is impossible in one invocation on current code — confirming the reporter saw npx version skew (dry-run ran pre-bug(customization): .claude/.local/skills (and likely hooks) never load — documented override layer is non-functional #711 templates, apply ran 2.6.2 templates), not an update bug.

    The real remaining gap was that sync had no preview and silently copyTemplates(force:true) rewrote the whole tree. The PR closes that.

    AC coverage (from issue's "Suggested fix direction")

    Verification

    • Targeted suite: 49/49 pass (templates.test.ts + sync.test.ts), real filesystem (not mocked classifier).
    • CLI wiring confirmed e2e: -d, --dry-run registered, Commander → dryRun matches SyncOptions.
    • CI: build/typecheck/validate-skills/validate-plugin all green; PR MERGEABLE.
    • Docs: docs/reference/cheat-sheet.md updated.

    Risk assessment

    • Likely failure mode: none material. The matching-version + non-force --dry-run falls through the report-only short-circuit (prints "version current but N differ" rather than the full per-file preview) — functionally correct (never mutates, exits 1 on drift), minor UX asymmetry only.
    • Minor wording nuance (non-blocking): CHANGELOG says dry-run reports "the exact set the apply would write"; copyTemplates(force) technically also rewrites unchanged files with byte-identical content. The reported set (new+modified+local-override) is the correct observable change-set — reporting identical-byte rewrites would be noise.

    Recommendation: merge #723. Left for human merge gate (no auto-merge).

  10. admarble commented on Jun 8, 2026

    @admarble
    ContributorAuthor

    Follow-up filed: #724 — update --dry-run exit-code parity with sync --dry-run (set exit 1 on pending changes). Split out from this fix because it changes update --dry-run's exit code (always-0 → 1-on-pending), which is a potential breaking change for scripts and warrants its own release note. PR #723 remains ready to merge as-is.

  11. added 2 commits that reference this issue on Jun 9, 2026
  12. added a commit that references this issue on Jul 26, 2026
  13. added a commit that references this issue on Sep 9, 2026
  14. added a commit that references this issue on Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds-improvementplanned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions