Skip to content

fix(sync/init/update): one ownership rule for project files — the clobbering class fixed file-by-file in #708/#814/#990/#1042/#1071/#1078 #1090

Closed

Description

@admarble

Problem

Six issues in nine months are the same defect: a sequant command writes a template over a file the project owns or has customized, silently. Each fix protected one file with its own mechanism; none established a rule, so the next template or the next command path reopens the class.

Issue Command File clobbered Fix shape
#708 update in-place customizations diff/write variable sets unified
#814 sync .claude/memory/constitution.md CUSTOMIZABLE_FILES + isCustomizableFile()
#990 sync user-owned AGENTS.md; machine-specific scripts/dev symlink <!-- sequant:agents-md v= h= --> marker + body hash
#1030 → #1042 sync/update .claude/opencode/** planted unrendered templates/opencode excluded from the generic engine
#1053 (open) sync copy mode foreign scripts/dev symlinks left in place —
#1071 (open) init --agent .sequant/settings.json reset to defaults —
#1078 (closed 09-18) sync .claude/settings.json hook matcher groups deleted —

#1071 already says it: "this class has been fixed three times, never as a rule." It is now six.

Why it keeps recurring

computeTemplateChanges walks the whole templates tree and every destination defaults to overwrite. Ownership exceptions live in four unrelated places (CUSTOMIZABLE_FILES, the AGENTS.md marker, the opencode skip, init's unconditional createDefaultSettings). A new template, or a new writer such as init --agent, inherits the overwrite default and nobody is asked to declare otherwise.

Proposal

One declared ownership policy per destination, consulted by every writer (init, sync, update):

  • sequant-owned — overwrite freely (skills, hooks, scripts).
  • user-owned — never touched after creation unless --force; report preserved: (constitution, AGENTS.md when the marker is absent, .sequant/settings.json).
  • merge — structural merge with sequant's entries ensured and everything else kept (.claude/settings.json hook arrays, .mcp.json, .opencode MCP config).

Every template destination must map to exactly one policy, and every dry-run must show the decision before the write (the #1030 I-2 invariant).

Owner decisions (2026-09-19, applied from the spec pass)

Acceptance Criteria

  • AC-1: a single ownershipPolicy(destinationPath) function in src/lib/templates.ts returns sequant-owned | user-owned | merge and is the only source init, sync and update consult — Evidence: grep -rn "CUSTOMIZABLE_FILES\|isCustomizableFile" src --include='*.ts' | grep -v "\.test\.ts:" | grep -vc "^src/lib/templates.ts:" prints 0 (today 9: eight call sites in sync.ts plus the prose comment at agents-md.ts:36, which gets reworded)
  • AC-2: gate test, two-sided — (a) every file under templates/** on disk resolves to a declared route and policy, and (b) an explicit NON_TEMPLATE_DESTINATIONS list covering .sequant/settings.json, AGENTS.md, .mcp.json, .opencode/**, .codex/config.toml is asserted exhaustive against the writeFile( targets in init.ts, sync.ts, update.ts; an undeclared destination on either side fails the test naming the path — Evidence: npx vitest run src/lib/templates.test.ts -t "ownership policy covers" 2>&1 | grep -E "Tests +[2-9][0-9]* passed" prints a passed line (two cases, one per side)
  • AC-3: .sequant/settings.json is declared user-owned in the ownership table, and createDefaultSettings's preserve-vs-overwrite decision reads ownershipPolicy(...) rather than a check local to settings.ts; the bug(init): init --agent <name> on an initialized repo overwrites .sequant/settings.json with defaults #1071 behaviour is unchanged — Evidence: grep -c "ownershipPolicy" src/lib/settings.ts prints 1 or more, and npx vitest run src/commands/init.test.ts -t "1071" 2>&1 | grep -E "Tests +([5-9]|[1-9][0-9]+) passed" prints a passed line
  • AC-4: .claude/settings.json is declared sequant-owned with a code comment naming .claude/settings.local.json as the extension point, and sync --dry-run prints overwrite for it — Evidence: grep -n "settings.local.json" src/lib/templates.ts | wc -l | tr -d " " prints 1 or more, and the AC-5 parity case covers the path
  • AC-5: sync --dry-run prints the policy decision per file (overwrite / preserved / merged) and sync applies exactly that list — the applied set equals the printed overwrite + merged set — Evidence: npx vitest run src/commands -t "1090" 2>&1 | grep -E "Tests +[1-9][0-9]* passed" prints a passed line (the parity case is named with 1090; a repo with a modified constitution and a modified skill is the fixture)
  • AC-6: ownershipPolicy normalizes \ to /, and the gate asserts a backslash destination resolves identically to its forward-slash form — Evidence: covered by the AC-2 command, as an assertion inside side (a)
  • AC-7: update --force reports the same protected set before and after the refactor — Evidence: npx vitest run src/commands/update.test.ts src/commands/update.integration.test.ts -t "1090" 2>&1 | grep -E "Tests +[1-9][0-9]* passed" prints a passed line (a characterization case named with 1090)
  • AC-8: npm run build && npm test green — Evidence: the PR body's test-plan table shows both, full suite run once in the foreground

AC-2 is a gate test: mutation-verify both sides (add a stray file under templates/ with no route → side (a) fails naming it; remove one entry from NON_TEMPLATE_DESTINATIONS → side (b) fails) and record both markers in the Mutation-verified: AC-2 — <mutation>; <file> > <test> failed; restored. form, failedTest starting with the test file path.

Out of Scope

Release-graph plan — pre-2.16.0 follow-ups (2026-09-19)

Graph: pre-2.16.0 follow-ups Tier: judgment Wave: 3
May touch: src/lib/templates.ts, src/lib/templates.test.ts, src/commands/sync.ts, src/commands/sync.test.ts, src/commands/init.ts, src/lib/settings.ts (guard only), src/lib/agents-md.ts (comment), src/commands/update.test.ts, src/commands/update.integration.test.ts, CHANGELOG.md

Activity

  1. added
    enhancement
    on Sep 19, 2026
  2. admarble commented on Sep 19, 2026

    @admarble
    ContributorAuthor

    Complexity: Standard (6 ACs, 3 directories)

    AC Quality Check

    lintAcceptanceCriteria returns 0 issues on all 6 ACs. Three format findings the linter does not cover:

    1. All 6 ACs resolve to verificationMethod: "manual". They use — Verify: <cmd> prose; resolveVerificationMethod only reads a declared Evidence: clause. AC-2 is explicitly a gate test and AC-4/AC-5 need real suites, so manual is wrong for at least four of them. Downstream testgen auto-detection and /qa §6i both key off Evidence:. Rewrite Verify: → Evidence:.

    2. AC-1's verify command is stricter than its stated intent. Literal baseline on main today is 25 hits, not "hits in sync.ts only":

      File Hits
      src/commands/sync.ts 8
      src/lib/templates.test.ts 11
      src/commands/sync.test.ts 5
      src/lib/agents-md.ts:36 (prose comment) 1

      grep -v templates.ts does not filter templates.test.ts — the regex templates.ts needs templates + any char + ts, and templates.test.ts gives templates + . + te. Reaching 0 therefore also requires deleting the legacy names from both test suites and rewording a doc comment. Either accept that (it is a clean rename) or tighten to grep -rn "isCustomizableFile(" src --include='*.ts' | grep -v '^src/lib/templates.ts'.

    3. ## Not in scope is not a heading parseNonGoals recognises (it accepts Non-Goals, Out of Scope, Scope Boundaries). The scope verdict below is degraded by this. Rename to ## Out of Scope.


    Scope Assessment

    Non-Goals: ⚠️ Section present as ## Not in scope but not machine-detected — see AC Quality Check item 3.

    Metric Value Status
    Feature count 2 ⚠️
    AC items 6 ⚠️
    Directory spread 3 (src/lib, src/commands, tests) ⚠️

    Verdict: ⚠️ SCOPE_WARNING — "Multiple features detected (2): config; title contains multiple action verbs: fix, update; high AC count (6); Non-Goals section missing."

    Quality loop auto-enables. The warning is not a split recommendation: AC-1/AC-2/AC-5 are one coherent change (the policy table plus its gate plus its reporting). The split pressure is entirely from AC-3 and AC-4, both addressed under Open Questions.


    Acceptance Criteria

    AC-1: single ownershipPolicy(destinationPath) in src/lib/templates.ts, sole source for init/sync/update

    Verification: Unit Test (plus the grep as a lint assertion)
    Scenario: Given src/commands/sync.ts imports only ownershipPolicy → When grep -rn "CUSTOMIZABLE_FILES\|isCustomizableFile" src runs → Then hits appear only in src/lib/templates.ts
    Assumptions: The three legacy sites in sync.ts:399/401/514 map cleanly onto policy === "user-owned"; the agents-md.ts:36 reference is comment-only and needs a reword, not a code change.

    AC-2: gate test — every file under templates/ resolves to a declared policy

    Verification: Unit Test (gate test → mutation-verify + record the marker per CLAUDE.md §Testing)
    Scenario: Given a new file added under templates/ with no route entry → When npx vitest run src/lib/templates.test.ts -t "ownership policy covers every template" runs → Then the test fails naming the undeclared path
    Assumptions: The gate walks templates/ on disk (63 files today), not a hardcoded list — a hardcoded list cannot fail on a new template, which is the whole point.
    ⚠️ Coverage gap: see Open Question 5 — 4 of the 6 issues in the problem table are about destinations not under templates/.

    AC-3: init on an initialized repo preserves .sequant/settings.json

    Verification: Unit Test
    ⚠️ Already green on main. 52cd790e (PR #1092, #1071) landed createDefaultSettings → preserveExistingSettings, which returns preserved/updated/created and merges only flag-set keys onto the raw parsed object. As literally written, AC-3 passes today with zero new code. See Open Question 2 for the restatement that makes it do work.

    AC-4: sync merges .claude/settings.json hook arrays by command path

    Verification: Integration Test
    🚫 BLOCKED — contradicts the resolution of #1078. See Open Question 1. Do not implement until the owner rules.

    AC-5: sync --dry-run prints the policy decision per file; sync applies exactly that list

    Verification: Integration Test
    Scenario: Given a repo with a modified constitution and a modified skill → When sync --dry-run then sync run → Then dry-run prints overwrite:/preserved:/merged: per path and the applied set is byte-identical to the printed overwrite+merged set
    Assumptions: Extends the #722/#814 parity contract (sync.ts:387-401 vs sync.ts:499-543) rather than replacing it. merged: is unreachable until a merge-policy destination exists — if AC-4 is dropped, the first real merge destination is .mcp.json/.opencode MCP config.

    AC-6: npm run build && npm test green

    Verification: Integration Test


    Implementation Plan

    Root cause (the sibling-site finding)

    templateDestination() (src/lib/templates.ts:326) is the diff-path router. copyTemplates() (src/lib/templates.ts:783-830) is the write-path router, and it is six hardcoded copyDir() calls plus one inline settings.json write — all seven defaulting to overwrite, none consulting templateDestination. They agree today only because #708 and #1030 were each fixes for them disagreeing. A policy hung off one of the two routers inherits that drift. Unifying them is the actual fix; the policy is an attribute of the unified table.

    Phase 1: One routing table with a declared policy (AC-1, AC-2)

    1. In src/lib/templates.ts, add type OwnershipPolicy = "sequant-owned" | "user-owned" | "merge" and a TEMPLATE_ROUTES table mapping each templates/ prefix → { destination: string | null; policy: OwnershipPolicy }. Seed it from the seven existing write-path calls and the five null rules already documented at templates.ts:308-324.
    2. Rewrite templateDestination() as a thin read of the table — pure refactor, existing computeTemplateChanges tests must pass unchanged.
    3. Export ownershipPolicy(destinationPath). Keep isCustomizableFile as a module-private alias for exactly one release or delete it outright and update both test suites — AC-1's grep forces the latter.
    4. Add the coverage gate test. Mutation-verify: add a stray file under templates/ with no route → the named test must fail → remove → record Mutation-verified: AC-2 — ... in the PR body.

    Phase 2: Route the writers through it (AC-1, AC-3)

    1. copyTemplates(): replace the six copyDir calls + inline settings.json write with a single walk over TEMPLATE_ROUTES. The per-file guard at templates.ts:751-766 becomes policy === "user-owned" && !options.force → push to preservedCustomizable.
    2. sync.ts:399/401/514: swap isCustomizableFile(c.path) → ownershipPolicy(c.path) === "user-owned". Behaviour-identical while CUSTOMIZABLE_FILES holds one entry — this is the seam, not a behaviour change.
    3. Declare the non-template destinations in the same table: .sequant/settings.json → user-owned, AGENTS.md → user-owned (marker-gated, agents-md.ts:39), .mcp.json → merge, .opencode/ + .codex/ → sequant-owned via their own renderers. Make createDefaultSettings's guard (settings.ts:1285) read the declaration instead of its inline settingsExist() check — that is what turns AC-3 from already-green into real work.

    Phase 3: Dry-run/apply parity (AC-5)

    1. Extend the dry-run summary (sync.ts:434-484) to print overwrite: / preserved: / merged: per path, sourced from ownershipPolicy.
    2. Extend the apply path (sync.ts:532-543) to emit the same three verbs, and add the parity test asserting the applied set equals the printed overwrite+merged set.

    Phase 4: AC-4 — hold

    1. Do not start. Gated on Open Question 1.

    Phase 5: AC-6

    1. npm run build && npm test. Full suite before push (worktree runs exceed 2 min — budget for it).

    Design Review

    1. Where does this logic belong? src/lib/templates.ts — it already owns both routers and CUSTOMIZABLE_FILES. A new module would add a fifth ownership location before removing the four.
    2. What's the simplest correct approach? A static table plus one lookup function, with templateDestination and copyTemplates both reading it. Rejected: a per-template front-matter/sidecar declaration (63 new files to touch, no gate until every one is edited); rejected: a policy interface with pluggable resolvers (no second consumer).
    3. What existing pattern does this follow? The "single source of truth shared by write and diff paths" pattern buildTemplateVariables established for template variables in fix(update/sync): sync reports 'up to date' on content drift; update overwrites in-place customizations (constitution) #708 — templates.ts:254 says so in its own doc comment. This applies it to destinations and policy, which is the half fix(update/sync): sync reports 'up to date' on content drift; update overwrites in-place customizations (constitution) #708 left undone and fix(sync): dry-run lists files apply never writes — the template walk maps templates/opencode/** to .claude/opencode/** (phantom drift nag in serve; update plants unrendered {{PHASE}} files) #1030 then hit.
    4. What would a senior reviewer challenge? "Why is this not just CUSTOMIZABLE_FILES with more entries?" — because the class is not "which files are protected", it is "no writer is ever asked to declare"; without the gate in AC-2 a new template still defaults to overwrite silently. Second: "you renamed things and shipped one real behaviour change (AC-3's guard)" — true, and that is deliberate: the value is the gate, and the gate only has teeth if the table is the sole router.

    Feature Quality Planning

    • Windows path separators. isCustomizableFile normalizes \ → / (templates.ts:246, fix(update/sync): sync reports 'up to date' on content drift; update overwrites in-place customizations (constitution) #708). ownershipPolicy must do the same on destinationPath, and the gate test must cover a backslash input — the existing templates.test.ts:199 case is the model.
    • --force semantics must stay single-override. sync --force, update --force and createDefaultSettings(force) currently mean three slightly different things. The policy makes user-owned + --force = overwrite; verify update --force's existing local-override path (update.ts:210,262) still reports the same set.
    • Non-templates/ writers are the majority of the reported class — see Open Question 5.

    Derived ACs

    Source Derived AC Priority
    Robustness AC-7: ownershipPolicy normalizes \ → /; gate test asserts a backslash destination resolves identically Medium
    Parity AC-8: update --force reports the same protected set before and after the refactor (characterization test) Medium

    Open Questions

    1. AC-4 contradicts the maintainer's own closure of sync overwrites .claude/settings.json wholesale, deleting project-owned hook matcher groups #1078 — blocking. sync overwrites .claude/settings.json wholesale, deleting project-owned hook matcher groups #1078 was closed COMPLETED on 2026-09-17 with: "filed on a wrong premise, and docs/guides/customization.md:167 already answers it… .claude/settings.local.json is the supported, update-safe mechanism… the overwrite at src/lib/templates.ts:828 was doing exactly what it is designed to do." There is also no "sync overwrites .claude/settings.json wholesale, deleting project-owned hook matcher groups #1078 repro fixture" to take — the issue was closed without a fix, so AC-4's cited artifact does not exist. — Recommendation: drop the merge behaviour; classify .claude/settings.json as sequant-owned in the table with a comment naming settings.local.json as the extension point, and let AC-5 print overwrite for it. merge stays a real policy value, earned by .mcp.json / .opencode MCP config instead. Impact if wrong: if the owner does want the merge, AC-4 stands — but then docs/guides/customization.md:167 and src/commands/local-hooks-not-autodiscovered.test.ts must change in the same PR, or the docs and the code will disagree. Per feedback_owner_decision_must_edit_ac_text, a decision comment is not enough — edit the AC-4 line in the issue body either way.
    2. AC-3 is already satisfied by 52cd790e. — Recommendation: restate AC-3 as ".sequant/settings.json is declared user-owned in the ownership table, and createDefaultSettings's guard reads that declaration rather than its own settingsExist() check". Impact if wrong: left as-is, QA marks AC-3 met against code that predates this issue, and .sequant/settings.json stays the fifth undeclared ownership location — the exact thing the issue exists to end.
    3. chore(init): finish #1071 — keep JSONC comments on the run.agent update, test the blank-file branch, drop two non-discriminating assertions #1100 overlaps src/lib/settings.ts. chore(init): finish #1071 — keep JSONC comments on the run.agent update, test the blank-file branch, drop two non-discriminating assertions #1100 is open, has a live worktree, and rewrites preserveExistingSettings — the function AC-3 touches. chore(init): finish #1071 — keep JSONC comments on the run.agent update, test the blank-file branch, drop two non-discriminating assertions #1100's own "Out of scope" defers the ownership rule to fix(sync/init/update): one ownership rule for project files — the clobbering class fixed file-by-file in #708/#814/#990/#1042/#1071/#1078 #1090, but not the file. — Recommendation: land chore(init): finish #1071 — keep JSONC comments on the run.agent update, test the blank-file branch, drop two non-discriminating assertions #1100 first (mechanical, ~1 function), then rebase fix(sync/init/update): one ownership rule for project files — the clobbering class fixed file-by-file in #708/#814/#990/#1042/#1071/#1078 #1090. If fix(sync/init/update): one ownership rule for project files — the clobbering class fixed file-by-file in #708/#814/#990/#1042/#1071/#1078 #1090 starts first, confine it to createDefaultSettings's guard and leave preserveExistingSettings's body alone. Impact if wrong: a conflict in a 40-line function both PRs rewrite.
    4. AC-1's grep is stricter than its intent — 25 literal hits today including test files the filter does not exclude. — Recommendation: tighten the command (see AC Quality Check item 2). Impact if wrong: an otherwise-correct implementation fails its own AC on test-file references.
    5. AC-2's gate covers templates/ only — which is not where 4 of the 6 reported defects live. fix(sync): never rewrite a user-owned AGENTS.md or write a machine-specific scripts/dev symlink (absorbs #991) #990 (AGENTS.md), fix(sync): dry-run lists files apply never writes — the template walk maps templates/opencode/** to .claude/opencode/** (phantom drift nag in serve; update plants unrendered {{PHASE}} files) #1030/fix(sync): exclude templates/opencode from the generic diff/copy engine (#1030) #1042 (.opencode/**), bug(init): init --agent <name> on an initialized repo overwrites .sequant/settings.json with defaults #1071 (.sequant/settings.json) and fix(sync): copy-mode sync leaves existing machine-specific scripts/dev symlinks in place, and doctor's hint loops back to sync #1053 (scripts/dev symlinks) all concern destinations outside the templates/ → .claude/ mapping. A gate that only walks templates/ would have caught fix(sync): plain sync overwrites CUSTOMIZABLE_FILES (constitution) — copyDir ignores force and never consults isCustomizableFile #814 and sync overwrites .claude/settings.json wholesale, deleting project-owned hook matcher groups #1078 and missed the rest. — Recommendation: make the gate two-sided — (a) every templates/** file resolves to a route+policy, and (b) an explicit NON_TEMPLATE_DESTINATIONS list covering .sequant/settings.json, AGENTS.md, .mcp.json, .opencode/**, .codex/config.toml, asserted exhaustive against a grep of writeFile( targets in init.ts/sync.ts/update.ts. Impact if wrong: the issue ships its gate and the class reopens at the next non-template destination — which is where it has reopened 4 times out of 6.
    6. ## Not in scope → ## Out of Scope, and Verify: → Evidence: on all 6 AC lines. Recommendation: apply both; they are free and they unblock scope assessment, testgen detection, and /qa evidence parsing.

    Rule Touchpoints: the behaviour-rule detector short-circuits — no AC description carries ≥2 of default|always|never|rule|behavior|skip (the title does; AC text does not). Section omitted.


    Conflict Risk Analysis

    Worktree Overlap Action
    feature/1100-… (#1100) src/lib/settings.ts — same function Sequence: #1100 then #1090 (Open Question 3)
    feature/1099-… (#1099) none (src/lib/github*) proceed
    feature/1090-… exists, 0 commits ahead of main, clean reuse

    Recommended Workflow

    Phases: exec → qa
    Quality Loop: enabled (SCOPE_WARNING auto-enables)
    Reasoning: No testgen — every AC lands as an edit to an existing suite (src/lib/templates.test.ts, src/commands/sync.test.ts), so generated stubs would be discarded; the parser also resolves all 6 ACs to manual today, so testgen detection does not fire on declared or inferred evidence. Not UI, so no test phase. Not security-sensitive. Quality loop on because the change is a refactor across three commands with a SCOPE_WARNING verdict.

    ⚠️ Do not start exec until Open Questions 1 and 2 are resolved in the issue body. AC-4 asks for work the maintainer already declined, and AC-3 as written is a no-op.


    Label Review

    Current: enhancement
    Recommended: enhancement, refactor, human-required
    Reason: refactor — the change is a consolidation of four existing mechanisms, not a new feature, and it raises the tier to Complex for downstream phases. human-required — Open Question 1 needs an owner ruling before exec can start.
    Quality Loop: auto-enables from SCOPE_WARNING regardless of labels.

    → gh issue edit 1090 --add-label refactor --add-label human-required --add-label planned

  3. added
    planned
    refactor
    human-required
    on Sep 19, 2026
  4. admarble commented on Sep 19, 2026

    @admarble
    ContributorAuthor

    Runner note (2026-09-19) — spec open questions resolved in the AC text

    Applied the spec pass's recommendations as edits to the issue body (not just this comment, per the owner-decision rule):

  5. admarble commented on Sep 19, 2026

    @admarble
    ContributorAuthor

    Runner context (2026-09-19) — exec dispatched

  6. admarble commented on Sep 19, 2026

    @admarble
    ContributorAuthor

    Runner note (2026-09-19) — exec re-dispatched against the QA findings, in this priority

    1. Blocking — the import-time regression (AC-8). settings.ts:18 now imports templates.ts, which imports manifest.ts, whose top level runs JSON.parse(findPackageJson()) — a synchronous fs read at import. Every test that stubs fs and imports settings.js (doctor.test.ts, worktree-isolation.test.ts, token-utils.test.ts, log-rotation.test.ts, …) now throws at import; CI build (22.x) is red. Preferred fix, root cause not symptom: make the version read lazy in manifest.ts — let cached: string | undefined; export function getPackageVersion() { return (cached ??= JSON.parse(findPackageJson()).version as string); } — and replace the two internal PACKAGE_VERSION uses (:68, :86-87) with getPackageVersion(). That removes a module-level side effect that has bitten ESM import order before (#734). Fallback only if that breaks a manifest mock: const { ownershipPolicy } = await import("./templates.js") inside createDefaultSettings. Do not move ownershipPolicy out of templates.ts; AC-1 names the module.

    2. Shipped docs name a deleted symbol. templates/memory/constitution.md:131 (ships to every project), its twin memory/constitution.md:131, and README.md:225 all say CUSTOMIZABLE_FILES. Reword to the policy (user-owned). Keep the two constitution copies identical.

    3. Apply-path cost. sync.ts:592 now runs a full computeTemplateChanges pass on every non-quiet apply; before it ran only under force && !quiet. Reuse the result already computed for the decision block instead of computing twice, so the common path does no extra render-and-read.

    4. Duplicate output. A preserved file prints twice (preserved: <path> in the decisions block, then preserved: <path> — run \sync --force`…` after the copy). Print once.

    5. .opencode/opencode.json merge rule. Either protect the exact rule in gate side (b) (map the write site to the exact path, not the .opencode/ prefix) or drop the rule if no writer reads it at runtime. A declared policy nothing enforces is the class this issue exists to end.

    Deferred, not for this PR: side-(b) granularity (per-write-site destinations rather than per-enclosing-function; non-awaited writeFile(; arrow-const writers) — the runner will file it as a follow-up. merged: .mcp.json printing after syncSequantMcpPin already wrote is acceptable on the apply path; note it in the PR body.

    Same constraints as before: 30-minute wall, commit early, no full npm test (runner runs it), touched files + AC evidence commands only, failedTest starts with the test file path (the two AC-2 markers already do — keep them), stop at PR.

  7. added 5 commits that reference this issue on Sep 19, 2026
  8. admarble commented on Sep 19, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

    AC coverage: 0/1 met

    Gaps:

    • A templates/** destination declared would be reported as and clobbered while the two-sided gate stays green — a latent reopening of the clobbering class this issue closes (unreachable today: 0 of 63 templates resolve to merge).
    • On a version-current repo returns at the report-only fast path and prints no per-file policy decision, so AC-5's user-facing promise is not kept on the most common invocation path (parity still holds because that path never writes).
    • On the apply path the decision for .mcp.json is printed after the write it describes, partially breaking the fix(sync): dry-run lists files apply never writes — the template walk maps templates/opencode/** to .claude/opencode/** (phantom drift nag in serve; update plants unrendered {{PHASE}} files) #1030 I-2 decision-before-write invariant for the one merge destination sync touches.
    • The side (b) gate would silently attribute a future arrow-const or non-awaited writeFile writer to the preceding registered function instead of failing, making the gate narrower than AC-2's wording.
    • AC-7's characterization test pins update's reporting of a supplied classification rather than the classification itself; the protected-set-unchanged claim was confirmed only by independent enumeration during QA (exactly one user-owned template destination, identical to main's CUSTOMIZABLE_FILES).

    Suggestions:

    • Add a side-(a) assertion that no templates/** destination resolves to merge (see finding 1).
    • Print the decision block on the version-current report-only fast path too (see finding 2) — changes is already computed there at sync.ts:419.
  9. added a commit that references this issue on Sep 20, 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

    enhancementhuman-requiredplannedrefactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions