Repository navigation
Description
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; reportpreserved:(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.jsonhook arrays,.mcp.json,.opencodeMCP 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)
- D-1 — AC-4 dropped. sync overwrites .claude/settings.json wholesale, deleting project-owned hook matcher groups #1078 was closed on the ruling that
.claude/settings.local.jsonis the supported update-safe mechanism and the.claude/settings.jsonoverwrite is by design..claude/settings.jsonis therefore declaredsequant-ownedin the table, with a comment namingsettings.local.jsonas the extension point.mergestays a real policy value, earned by.mcp.json/ the.opencodeMCP config. - D-2 — the gate is two-sided. Four of the six defects in the table live outside
templates/(fix(sync): never rewrite a user-owned AGENTS.md or write a machine-specific scripts/dev symlink (absorbs #991) #990, 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, bug(init): init --agent <name> on an initialized repo overwrites .sequant/settings.json with defaults #1071, fix(sync): copy-mode sync leaves existing machine-specific scripts/dev symlinks in place, and doctor's hint loops back to sync #1053), so a gate that walks onlytemplates/reopens the class at the next non-template destination. - D-3 — AC-3 restated. bug(init): init --agent <name> on an initialized repo overwrites .sequant/settings.json with defaults #1071 (
52cd790e) already preserves.sequant/settings.json; what is missing is that the guard reads its own check instead of the declared policy. - D-4 — sequencing. chore(init): finish #1071 — keep JSONC comments on the run.agent update, test the blank-file branch, drop two non-discriminating assertions #1100 rewrites
preserveExistingSettingsinsrc/lib/settings.ts. It lands first; this issue is blocked on it.
Acceptance Criteria
- AC-1: a single
ownershipPolicy(destinationPath)function insrc/lib/templates.tsreturnssequant-owned | user-owned | mergeand is the only sourceinit,syncandupdateconsult — 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 insync.tsplus the prose comment atagents-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 explicitNON_TEMPLATE_DESTINATIONSlist covering.sequant/settings.json,AGENTS.md,.mcp.json,.opencode/**,.codex/config.tomlis asserted exhaustive against thewriteFile(targets ininit.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.jsonis declareduser-ownedin the ownership table, andcreateDefaultSettings's preserve-vs-overwrite decision readsownershipPolicy(...)rather than a check local tosettings.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.tsprints 1 or more, andnpx 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.jsonis declaredsequant-ownedwith a code comment naming.claude/settings.local.jsonas the extension point, andsync --dry-runprintsoverwritefor 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-runprints the policy decision per file (overwrite/preserved/merged) andsyncapplies exactly that list — the applied set equals the printedoverwrite+mergedset — 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 with1090; a repo with a modified constitution and a modified skill is the fixture) - AC-6:
ownershipPolicynormalizes\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 --forcereports 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 with1090) - AC-8:
npm run build && npm testgreen — 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
- The copy-mode symlink replacement in fix(sync): copy-mode sync leaves existing machine-specific scripts/dev symlinks in place, and doctor's hint loops back to sync #1053 stays its own fix; it is a copy-engine bug, not an ownership decision.
- Merging
.claude/settings.jsonhook arrays (the original AC-4) — ruled out by sync overwrites .claude/settings.json wholesale, deleting project-owned hook matcher groups #1078;settings.local.jsonis the mechanism. - Rewriting
preserveExistingSettings's body — that is chore(init): finish #1071 — keep JSONC comments on the run.agent update, test the blank-file branch, drop two non-discriminating assertions #1100; this issue touches only the guard's policy source.
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
admarble commentedon Sep 19, 2026
Complexity: Standard (6 ACs, 3 directories)
AC Quality Check
lintAcceptanceCriteriareturns 0 issues on all 6 ACs. Three format findings the linter does not cover:All 6 ACs resolve to
verificationMethod: "manual". They use— Verify: <cmd>prose;resolveVerificationMethodonly reads a declaredEvidence:clause. AC-2 is explicitly a gate test and AC-4/AC-5 need real suites, somanualis wrong for at least four of them. Downstreamtestgenauto-detection and/qa§6i both key offEvidence:. RewriteVerify:→Evidence:.AC-1's verify command is stricter than its stated intent. Literal baseline on
maintoday is 25 hits, not "hits insync.tsonly":src/commands/sync.tssrc/lib/templates.test.tssrc/commands/sync.test.tssrc/lib/agents-md.ts:36(prose comment)grep -v templates.tsdoes not filtertemplates.test.ts— the regextemplates.tsneedstemplates+ any char +ts, andtemplates.test.tsgivestemplates+.+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 togrep -rn "isCustomizableFile(" src --include='*.ts' | grep -v '^src/lib/templates.ts'.## Not in scopeis not a headingparseNonGoalsrecognises (it acceptsNon-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 scopebut not machine-detected — see AC Quality Check item 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)insrc/lib/templates.ts, sole source forinit/sync/updateVerification: Unit Test (plus the grep as a lint assertion)
Scenario: Given
src/commands/sync.tsimports onlyownershipPolicy→ Whengrep -rn "CUSTOMIZABLE_FILES\|isCustomizableFile" srcruns → Then hits appear only insrc/lib/templates.tsAssumptions: The three legacy sites in
sync.ts:399/401/514map cleanly ontopolicy === "user-owned"; theagents-md.ts:36reference is comment-only and needs a reword, not a code change.AC-2: gate test — every file under
templates/resolves to a declared policyVerification: Unit Test (gate test → mutation-verify + record the marker per CLAUDE.md §Testing)
⚠️ Coverage gap: see Open Question 5 — 4 of the 6 issues in the problem table are about destinations not under
Scenario: Given a new file added under
templates/with no route entry → Whennpx vitest run src/lib/templates.test.ts -t "ownership policy covers every template"runs → Then the test fails naming the undeclared pathAssumptions: 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.templates/.AC-3:
initon an initialized repo preserves.sequant/settings.jsonVerification: Unit Test
⚠️ Already green on
main.52cd790e(PR #1092, #1071) landedcreateDefaultSettings→preserveExistingSettings, which returnspreserved/updated/createdand 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:
syncmerges.claude/settings.jsonhook arrays by command pathVerification: Integration Test
🚫 BLOCKED — contradicts the resolution of #1078. See Open Question 1. Do not implement until the owner rules.
AC-5:
sync --dry-runprints the policy decision per file;syncapplies exactly that listVerification: Integration Test
Scenario: Given a repo with a modified constitution and a modified skill → When
sync --dry-runthensyncrun → Then dry-run printsoverwrite:/preserved:/merged:per path and the applied set is byte-identical to the printedoverwrite+mergedsetAssumptions: Extends the #722/#814 parity contract (
sync.ts:387-401vssync.ts:499-543) rather than replacing it.merged:is unreachable until amerge-policy destination exists — if AC-4 is dropped, the first realmergedestination is.mcp.json/.opencodeMCP config.AC-6:
npm run build && npm testgreenVerification: 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 hardcodedcopyDir()calls plus one inlinesettings.jsonwrite — all seven defaulting to overwrite, none consultingtemplateDestination. 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)
src/lib/templates.ts, addtype OwnershipPolicy = "sequant-owned" | "user-owned" | "merge"and aTEMPLATE_ROUTEStable mapping eachtemplates/prefix →{ destination: string | null; policy: OwnershipPolicy }. Seed it from the seven existing write-path calls and the fivenullrules already documented attemplates.ts:308-324.templateDestination()as a thin read of the table — pure refactor, existingcomputeTemplateChangestests must pass unchanged.ownershipPolicy(destinationPath). KeepisCustomizableFileas a module-private alias for exactly one release or delete it outright and update both test suites — AC-1's grep forces the latter.templates/with no route → the named test must fail → remove → recordMutation-verified: AC-2 — ...in the PR body.Phase 2: Route the writers through it (AC-1, AC-3)
copyTemplates(): replace the sixcopyDircalls + inlinesettings.jsonwrite with a single walk overTEMPLATE_ROUTES. The per-file guard attemplates.ts:751-766becomespolicy === "user-owned" && !options.force→ push topreservedCustomizable.sync.ts:399/401/514: swapisCustomizableFile(c.path)→ownershipPolicy(c.path) === "user-owned". Behaviour-identical whileCUSTOMIZABLE_FILESholds one entry — this is the seam, not a behaviour change..sequant/settings.json→user-owned,AGENTS.md→user-owned(marker-gated,agents-md.ts:39),.mcp.json→merge,.opencode/+.codex/→sequant-ownedvia their own renderers. MakecreateDefaultSettings's guard (settings.ts:1285) read the declaration instead of its inlinesettingsExist()check — that is what turns AC-3 from already-green into real work.Phase 3: Dry-run/apply parity (AC-5)
sync.ts:434-484) to printoverwrite:/preserved:/merged:per path, sourced fromownershipPolicy.sync.ts:532-543) to emit the same three verbs, and add the parity test asserting the applied set equals the printedoverwrite+mergedset.Phase 4: AC-4 — hold
Phase 5: AC-6
npm run build && npm test. Full suite before push (worktree runs exceed 2 min — budget for it).Design Review
src/lib/templates.ts— it already owns both routers andCUSTOMIZABLE_FILES. A new module would add a fifth ownership location before removing the four.templateDestinationandcopyTemplatesboth 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).buildTemplateVariablesestablished for template variables in fix(update/sync): sync reports 'up to date' on content drift; update overwrites in-place customizations (constitution) #708 —templates.ts:254says 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.CUSTOMIZABLE_FILESwith 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
isCustomizableFilenormalizes\→/(templates.ts:246, fix(update/sync): sync reports 'up to date' on content drift; update overwrites in-place customizations (constitution) #708).ownershipPolicymust do the same ondestinationPath, and the gate test must cover a backslash input — the existingtemplates.test.ts:199case is the model.--forcesemantics must stay single-override.sync --force,update --forceandcreateDefaultSettings(force)currently mean three slightly different things. The policy makesuser-owned+--force= overwrite; verifyupdate --force's existing local-override path (update.ts:210,262) still reports the same set.templates/writers are the majority of the reported class — see Open Question 5.Derived ACs
ownershipPolicynormalizes\→/; gate test asserts a backslash destination resolves identicallyupdate --forcereports the same protected set before and after the refactor (characterization test)Open Questions
COMPLETEDon 2026-09-17 with: "filed on a wrong premise, anddocs/guides/customization.md:167already answers it….claude/settings.local.jsonis the supported, update-safe mechanism… the overwrite atsrc/lib/templates.ts:828was 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.jsonassequant-ownedin the table with a comment namingsettings.local.jsonas the extension point, and let AC-5 printoverwritefor it.mergestays a real policy value, earned by.mcp.json/.opencodeMCP config instead. Impact if wrong: if the owner does want the merge, AC-4 stands — but thendocs/guides/customization.md:167andsrc/commands/local-hooks-not-autodiscovered.test.tsmust change in the same PR, or the docs and the code will disagree. Perfeedback_owner_decision_must_edit_ac_text, a decision comment is not enough — edit the AC-4 line in the issue body either way.52cd790e. — Recommendation: restate AC-3 as ".sequant/settings.jsonis declareduser-ownedin the ownership table, andcreateDefaultSettings's guard reads that declaration rather than its ownsettingsExist()check". Impact if wrong: left as-is, QA marks AC-3 met against code that predates this issue, and.sequant/settings.jsonstays the fifth undeclared ownership location — the exact thing the issue exists to end.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 rewritespreserveExistingSettings— 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 tocreateDefaultSettings's guard and leavepreserveExistingSettings's body alone. Impact if wrong: a conflict in a 40-line function both PRs rewrite.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/devsymlinks) all concern destinations outside thetemplates/→.claude/mapping. A gate that only walkstemplates/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) everytemplates/**file resolves to a route+policy, and (b) an explicitNON_TEMPLATE_DESTINATIONSlist covering.sequant/settings.json,AGENTS.md,.mcp.json,.opencode/**,.codex/config.toml, asserted exhaustive against a grep ofwriteFile(targets ininit.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.## Not in scope→## Out of Scope, andVerify:→Evidence:on all 6 AC lines. Recommendation: apply both; they are free and they unblock scope assessment, testgen detection, and/qaevidence 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
feature/1100-…(#1100)src/lib/settings.ts— same functionfeature/1099-…(#1099)src/lib/github*)feature/1090-…main, cleanRecommended 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 tomanualtoday, so testgen detection does not fire on declared or inferred evidence. Not UI, so notestphase. Not security-sensitive. Quality loop on because the change is a refactor across three commands with a SCOPE_WARNING verdict.execuntil 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:
enhancementRecommended:
enhancement,refactor,human-requiredReason:
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 plannedadmarble commentedon Sep 19, 2026
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):
.claude/settings.jsonsequant-ownedand namingsettings.local.jsonas the extension point.templates/**walk plus an exhaustiveNON_TEMPLATE_DESTINATIONSlist.ownershipPolicy(); the bug(init): init --agent <name> on an initialized repo overwrites .sequant/settings.json with defaults #1071 behaviour is already on main.agents-md.tsprose comment gets reworded).Verify:→Evidence:on every line,## Not in scope→## Out of Scope, derived AC-6/AC-7 promoted.src/lib/settings.ts). Exec is dispatched after chore(init): finish #1071 — keep JSONC comments on the run.agent update, test the blank-file branch, drop two non-discriminating assertions #1100 merges, on the strong policy.admarble commentedon Sep 19, 2026
Runner context (2026-09-19) — exec dispatched
mainat006b1414. chore(init): finish #1071 — keep JSONC comments on the run.agent update, test the blank-file branch, drop two non-discriminating assertions #1100 has merged (preserveExistingSettingsnow edits raw JSONC viafindValueStartOfKey/updateAgentInRawContent). Per D-4, leave that function's body alone; AC-3 touches onlycreateDefaultSettings's guard, which should readownershipPolicy(".sequant/settings.json") === "user-owned".doctor.tslocal-shadow check). The plan's line references intemplates.ts/sync.tsmay have shifted by a few lines; re-locate by symbol.npm test— runnpm run build,npm run lint, and the test files this diff touches plus the AC evidence commands. The runner runs the full suite once before merge.failedTestmust start with the test file path (src/lib/templates.test.ts > ... > ...). Mutation-verify both sides of AC-2 from a committed tree.CHANGELOG.mdUnreleased entry; do not reformat neighbours.admarble commentedon Sep 19, 2026
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:18now importstemplates.ts, which importsmanifest.ts, whose top level runsJSON.parse(findPackageJson())— a synchronousfsread at import. Every test that stubsfsand importssettings.js(doctor.test.ts,worktree-isolation.test.ts,token-utils.test.ts,log-rotation.test.ts, …) now throws at import; CIbuild (22.x)is red. Preferred fix, root cause not symptom: make the version read lazy inmanifest.ts—let cached: string | undefined; export function getPackageVersion() { return (cached ??= JSON.parse(findPackageJson()).version as string); }— and replace the two internalPACKAGE_VERSIONuses (:68,:86-87) withgetPackageVersion(). 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")insidecreateDefaultSettings. Do not moveownershipPolicyout oftemplates.ts; AC-1 names the module.2. Shipped docs name a deleted symbol.
templates/memory/constitution.md:131(ships to every project), its twinmemory/constitution.md:131, andREADME.md:225all sayCUSTOMIZABLE_FILES. Reword to the policy (user-owned). Keep the two constitution copies identical.3. Apply-path cost.
sync.ts:592now runs a fullcomputeTemplateChangespass on every non-quiet apply; before it ran only underforce && !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, thenpreserved: <path> — run \sync --force`…` after the copy). Print once.5.
.opencode/opencode.jsonmergerule. 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.jsonprinting aftersyncSequantMcpPinalready 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,failedTeststarts with the test file path (the two AC-2 markers already do — keep them), stop at PR.fix(#1090): read the package version lazily so importing manifest.ts …
docs(#1090): shipped docs name the ownership policy, not the deleted …
fix(#1090): announce a preserved file once, and make the post-copy re…
test(#1090): enforce the .opencode/opencode.json merge rule and every…
docs(#1090): changelog the print-once report, the enforced merge rule…
admarble commentedon Sep 19, 2026
QA Verdict: AC_MET_BUT_NOT_A_PLUS
AC coverage: 0/1 met
Gaps:
Suggestions:
templates/**destination resolves tomerge(see finding 1).changesis already computed there atsync.ts:419.fix(#1090): one ownership rule for project files across init, sync an…