Repository navigation
Description
Blocked by: #1093 Tier: mechanical Doc: guard plan 2026-09-18 (16-bug classification; research: Amazon one-box stage, Kayenta canary)
Why
Five of the sixteen recent bugs were found only by field use, days to weeks after release: the 12-repo sync found #1053, a downstream project hit #1078 twice and #1084 once, the Codex gate found #1076 and #1079. CI has nothing that resembles a downstream project, so every one of these was invisible until a human ran a real install. Amazon's one-box stage and Netflix's canary exist for this class. The cheap version for a CLI is a fixture downstream project in CI and a soak on the next tag before latest.
Change
__tests__/canary/downstream.integration.test.ts, run as its own CI job on every PR:- creates a temp project, installs the previous minor release of sequant from npm, runs
init - customizes it the way real projects do: edits
.claude/memory/constitution.md, adds the project's ownPreToolUsematcher group to.claude/settings.local.json(the extension point per 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 D-1;.claude/settings.jsonis sequant-owned and is expected to be overwritten, with the dry-run saying so), hand-writesAGENTS.md, tunes.sequant/settings.json, adds a stale"sequant": "^1.20.0"devDependency - builds the PR's tree and runs from it:
sync --dry-run,sync,init --agent codex --yes,update - asserts: the listed dry-run decisions equal the files that changed; every customization survives; no
{{PLACEHOLDER}}lands under.claude/;doctorexits 0 afterwards - starts the MCP server the way the plugin does (from that project's cwd with the stale local
node_modules/sequantpresent) and asserts theinitializereply reports the PR's version, not 1.20.x — the regression test for fix(mcp): plugin MCP server dies with CONNECTION_CLOSED when the open project has an older sequant in node_modules — npx ignores the pin and runs the local copy #1084, which merged as PR fix(#1084): plugin MCP server no longer lets a local sequant shadow the pin #1085
- creates a temp project, installs the previous minor release of sequant from npm, runs
- Release skill: publish to the
nextdist-tag first; promote tolatestonly after the canary job has passed against the published tarball and a manual soak on the maintainer's own projects (npx sequant@next sync --dry-runacross the local repo set) shows only expected decisions. The skill prints the soak checklist and refuseslatestwithout a--soakedflag.
Release-graph plan — guard-2026-09 (2026-09-20)
Graph: guard-2026-09 Tier: mechanical Wave: 3
May touch: .github/workflows/ci.yml (new canary job only), __tests__/canary/downstream.integration.test.ts, __tests__/canary/fixture/, release SKILL.md ×3 (next publish + --soaked), src/lib/__tests__/release-skill-soak.test.ts, CHANGELOG.md
The npm run build && npm test AC is verified by the runner from a clean shell after the PR opens (PLAN I-1); the agent runs only the test files its ACs name. Mutation markers use failedTest starting with the test file path (I-4). Fixture first: the downstream fixture project and its customizations land before the assertions. Real npm install of the previous minor and a real MCP initialize over stdio, no mocks (I-6). Phase 0 measured the full local suite at 433 s; the 6-minute AC-6 budget is for the canary job alone (OQ-2). Skill edits: I-3 applies.
Acceptance criteria
- AC-1: a job named
canaryexists in.github/workflows/ci.yml, runs on every PR, and passes on this PR — Verify:gh run list --branch <pr-branch> --json jobs(orgh pr checks) showscanarygreen. Requiring it in the ruleset is gate(owner): require the canary check, soaknextacross the local repo set, promote tolatest#1110's AC-1 (owner action). - AC-2: gate test — every customization survives
syncandinit --agent codex --yes— Verify:npx vitest run __tests__/canary/downstream.integration.test.ts -t "customizations survive"→ green. Mutation-verified per CLAUDE.md §Testing: point the fixture'sinitatcreateDefaultSettingsunconditionally (the bug(init): init --agent <name> on an initialized repo overwrites .sequant/settings.json with defaults #1071 behavior) → the test fails; restore. - AC-3: dry-run decisions equal applied changes, file for file — Verify:
-t "dry-run equals apply"→ green. - AC-4: the MCP
initializereply from the fixture project's cwd, with a stale localnode_modules/sequantpresent, reports the PR's version (regression test for fix(mcp): plugin MCP server dies with CONNECTION_CLOSED when the open project has an older sequant in node_modules — npx ignores the pin and runs the local copy #1084) — Verify:-t "mcp handshake"→ green. Mutation-verified per CLAUDE.md §Testing: point the launcher at the localnode_modules/sequantbin (the pre-fix(#1084): plugin MCP server no longer lets a local sequant shadow the pin #1085 resolution) → the test fails; restore. - AC-5: the release skill publishes to
nextfirst and refuseslatestwithout--soaked, in all three skill copies — Verify:npx vitest run src/lib/__tests__/release-skill-soak.test.ts→ green. - AC-6: the canary job finishes under 6 minutes on the ubuntu runner — Verify:
gh run view <id> --json jobs --jq '.jobs[] | select(.name=="canary") | .conclusion, .completed_at, .started_at'. - AC-7:
npm run build && npm testgreen.
Not in scope
Running the canary on macOS and Windows runners (follow-up once the ubuntu job is stable). Requiring the canary check and the next soak decision are #1110's.
Activity
admarble commentedon Sep 20, 2026
Runner context — guard-2026-09 wave 3 launch, 2026-09-20. Base:
origin/mainat138d12ac(waves 1 and 2 merged: #1093 settle-against-base script + red-main rule + CI jobtest, #1069 merge-not-rebase, #1087, #1097, plus all of wave 1). These rules override the exec AND qa skills' defaults for this run:npm testin the worktree — this applies to the qa phase too. Under concurrent phase agents that one call exceeds the 30-minute no-progress wall and the phase is killed (three wave-1 phases died this way). Verify each AC by its own command; run only the test files the ACs name. The runner runs the full suite once per PR from a clean shell and records it on the PR.<!-- SEQUANT_MUTATION: {"ac":"AC-N","mutation":"<what you deleted>","failedTest":"<test file path> > <describe> > <case>"} -->in the PR body.failedTestMUST start with the test file path. RunparseMutationMarkerson your body before opening the PR. Commit before mutating.timeout.git commit -m "...", noCo-Authored-By. Push the branch and open the PR yourself (one wave-1 exec forgot). Never rebase or force-push after pushing. One AC per line in the PR body, idsAC-Nonly.Issue-specific: Only the new
canaryjob in.github/workflows/ci.yml— do not touch thetestjob (its id and matrix-less shape are load-bearing for themainruleset, see the comment above it). The fixture installs the real previous minor ([email protected], realnpm install) and sends a real MCPinitialize; no mocks (I-6). AC-1 needs thecanaryjob green on your own PR: push, then readgh pr checksand put the run URL and the AC-6 timing in the PR body. Only this issue edits the releaseSKILL.mdmirrors this wave (the red-main pre-flight from #1093 is already there; add thenextpublish +--soakedgate without touching it);npm run lint:skill-sync0 diverged, no SKILL.md contains the word relay.admarble commentedon Sep 20, 2026
Complexity: Standard (7 ACs, 6 directories)
AC Quality Check
Warning-only (
lintAcceptanceCriteria):Verify:, not a trailingEvidence:clause, soextractAcceptanceCriteriainfers the method (AC-3, AC-4, AC-5, AC-6 all resolve tomanual; only AC-2 resolves tointegration_test). The commands are unambiguous, so I'm treating theVerify:command as authoritative below. Optional cleanup: re-label asEvidence:so/testgenand/qaread them as declared.Scope Assessment
Non-Goals: present ("Not in scope": macOS/Windows runners; requiring the check and the
nextsoak decision are #1110's).next/--soaked).github/workflows,__tests__/canary, 3 skill dirs,src/lib/__tests__, root config)Verdict: ✅ SCOPE_OK (spread is mostly the three mirrored skill copies)
Acceptance Criteria
AC-1:
canaryjob exists inci.yml, runs on every PR, green on this PRVerification: Manual Test (CI observation)
Scenario: Given the PR is pushed → When CI runs → Then
gh pr checksshowscanarypassAssumptions: New job only;
testjob id and matrix-less shape untouched (ruleset-load-bearing, see comment above it inci.yml).AC-2: gate — every customization survives
syncandinit --agent codex --yesVerification: Integration Test (
-t "customizations survive"), mutation-verifiedScenario: Given fixture project on previous-minor install with customized constitution,
settings.local.jsonmatcher group, hand-writtenAGENTS.md, tuned.sequant/settings.json, stale^1.20.0devDependency → When PR build runssynctheninit --agent codex --yes→ Then every customization is byte-preservedAssumptions:
.claude/settings.jsonis sequant-owned (#1090 D-1) and is expected to be overwritten; the assertion targetssettings.local.json, not it.Mutation: make fixture
initcallcreateDefaultSettingsunconditionally (#1071 behavior,src/commands/init.ts:949) → test fails → restore.AC-3: dry-run decisions equal applied changes, file for file
Verification: Integration Test (
-t "dry-run equals apply")Scenario: Given the fixture → When
sync --dry-run(exits non-zero when work is pending — the test must tolerate that) thensync→ Then the file set printed by the dry-run's ownership decisions equals the set whose bytes changed (snapshot before/after)Assumptions: Dry-run output format (
printOwnershipDecisions,src/commands/sync.ts) is parseable; if not, expose it through a small stable parser rather than scraping ad hoc.AC-4: MCP
initializefrom fixture cwd with stale localnode_modules/sequantreports the PR's versionVerification: Integration Test (
-t "mcp handshake"), mutation-verifiedScenario: Given the fixture with a stale local
node_modules/sequant→ When the plugin launcher (scripts/mcp-launch.mjs, spawned with cwd = fixture) starts the server and a JSON-RPCinitializeis sent over stdio → ThenserverInfo.versionequals the PR'spackage.jsonversion, not 1.20.xAssumptions: The shipped
.mcp.jsonpinssequant@<released version>, which is unpublished for a PR. Pass the launcher a spec that is anpm packtarball path of the PR tree (isSafeSpecallows[A-Za-z0-9@._/-], so a path without spaces passes). Realnpx, no mocks (I-6).Mutation: point the launcher/command at the local
node_modules/sequantbin (pre-#1085) → reports 1.20.x → fails → restore.AC-5: release skill publishes to
nextfirst, refuseslatestwithout--soaked, in all 3 copiesVerification: Unit Test (
src/lib/__tests__/release-skill-soak.test.ts), scoped to the delimited regionScenario: Given the three
release/SKILL.mdcopies → When the test extracts the Step 9 publish region → Then each copy hasnpm publish --tag nextbefore anylatestpromotion (npm dist-tag add … latest), prints the soak checklist, and gateslateston--soakedAssumptions: Edits go beside, not inside, the #1093 red-main pre-flight. Per CLAUDE.md, scope assertions to the region and mutation-verify (delete the
--soakedgate in one copy → that copy's case fails). Plain gate-test discipline;lint:skill-syncstays 0 diverged, no SKILL.md contains "relay" (I-3).AC-6: canary job < 6 min on ubuntu
Verification: Manual Test —
gh run view <id> --json jobs --jq '…'Scenario: Given the green PR run → Then
completed_at − started_at< 360 s; recorded in PR body (closes OQ-2)AC-7:
npm run build && npm testgreenVerification: Manual Test — run by the runner from a clean shell after the PR opens (PLAN I-1); the agent runs only the named test files.
Implementation Plan
Phase 1: Fixture first (no assertions yet)
__tests__/canary/fixture/— a builder (createDownstreamFixture()), not a checked-in tree: temp dir;npm install sequant@<previous minor>(computed frompackage.json: 2.16.0 → highest2.15.xvianpm view [email protected] version, not hardcoded); run itsinit; apply the five customizations; add stale localnode_modules/sequant(the real installed one, or a stale stub for the MCP case).npm packof the PR tree once per test file (beforeAll), reused forsync/init/update/MCP.Phase 2: Assertions (
downstream.integration.test.ts)customizations survive(AC-2),dry-run equals apply(AC-3), plus the unlisted-but-in-the-issue asserts: no{{PLACEHOLDER}}under.claude/,doctor --skip-issue-checkexits 0 afterwards (skip the closed-issue check — needsgh/network).mcp handshake(AC-4): spawn the launcher, writeinitializeto stdin, read one JSON-RPC line with a hard timeout, kill the process group (detached:true+ group kill).Phase 3: CI + release skill
ci.yml: newcanaryjob (same pinned action SHAs as siblings;npm ci→npm run build→ the canary command). Do not touchtest.templates/skills/release,skills/release,.claude/skills/release): Step 9 →npm publish --tag next; new "Promote" step + soak checklist (npx sequant@next sync --dry-runacross the local repo set);--soakedflag in Usage. Keep the EOTP handoff and Post-Release Verification (dist-tags) consistent.release-skill-soak.test.ts+ CHANGELOG.Dependencies: #1093 is closed/merged. Phases 1→2 sequential; Phase 3 items 5 and 6 are independent of each other.
Design Review
__tests__/canary/(a black-box test of the built CLI, notsrc/); the release gate in the release skill (prose with no runtime twin), pinned by a skill-text test likerelease-checkout-lock-skill.test.ts.npm install+npm pack+ real stdio, per I-6. Rejected: mocking npm / an offline previous-minor tarball checked into the repo (that is exactly the "fixture mocks npm" failure mode the plan names).*.integration.test.tsin the serializedintegrationvitest project, spawning the built CLI (sync-source-invocation.integration.test.ts,mcp-launch.integration.test.ts); skill-text gate tests as inrelease-checkout-lock-skill.test.ts.testjob now depend on the npm registry?" — see OQ-1. (b) "AC-3 scrapes CLI output" — pin the format with the test itself. (c) "Version derivation" — hardcoding2.15.1rots at the next minor; derive it.Feature Quality Planning
All standard checks pass except:
integrationproject by glob, so plainnpm test(thetestjob, which themainruleset requires) would also run it and go red on an npm outage. See OQ-1.testTimeoutis too short fornpm install+npx; needs a per-file/beforeAlltimeout (e.g. 180 s).finally), or the vitest worker hangs.git config user.*before committing (CI identity vs macOS GECOS lesson); env must scrubSEQUANT_*(bug(test): suite isn't hermetic against the SEQUANT_* env phases inject — exec sees red tests it didn't cause and opens no PR #1086).SEQUANT_MUTATIONmarkers whosefailedTeststarts with the test file path (I-4); commit before mutating.Derived ACs
{{PLACEHOLDER}}under.claude/anddoctor --skip-issue-checkexits 0 afterupdate— currently in the issue body but not in any numbered ACpackage.json, not hardcoded(Both are folded into the Phase 2 plan; not proposed as blocking.)
Open Questions
testjob? — Recommendation: add acanaryvitest project (include__tests__/canary/**, long timeouts), exclude it fromunit/integration, change"test"tovitest run --project unit --project integrationand add"test:canary": "vitest run --project canary". AC-2/3/4npx vitest run <file> -t …still resolve (no--projectfilter). This touchesvitest.config.tsandpackage.json, which are not in the issue's "May touch" list — needs owner OK. Impact if wrong: either the requiredtestcheck depends on the registry, or a bare-path verify command finds no files.<major>.<minor-1>.x" vianpm view; fall back to failing loudly if none. Impact: wrong pin tests a non-representative upgrade path..claude/settings.jsonoverwrite need an explicit assertion? — Recommendation: yes, assert it is overwritten and listed in the dry-run (per the issue's Change §1 parenthetical), so the expected loss is pinned rather than implied.Recommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: Skipping
testgendeliberately despite integration-test ACs: the deliverable is the test file, so stubs would duplicate it (fixture-first ordering in the runner context already covers the intent). No UI, no security-sensitive surface. Quality loop off; AC-1/AC-6 need real CI runs, which the exec agent gets by pushing and readinggh pr checks. Runner-context rules apply: no fullnpm testin the worktree (run only the named files), no merge.Label Review
Current: enhancement, cli
Recommended: enhancement, cli (add
planned)Reason: No complexity labels apply; 7 ACs = Standard.
Quality Loop: Won't auto-enable (SCOPE_OK).
fix(#1098): canary doctor check ignores ambient-tooling failures on a…
admarble commentedon Sep 20, 2026
QA Verdict: AC_MET_BUT_NOT_A_PLUS
AC coverage: 0/2 met
Gaps:
latestpath survives in the same file (all 3 copies).release/SKILL.md:728, under "### After npm publish":Suggestions:
timeout-minutes: 6to thecanaryjob so AC-6 stays a gate rather than a one-sample reading.dry-run equals applymust run before anything has synced") is currently held only by vitest's in-file declaration order. I confirmed each AC's-tcommand works standalone, so this is not a live defect — but adescribe.sequentialor an explicit guard would make it structural rather than incidental.BOOKKEEPINGis subtracted fromchangedbut not frompredicted; it passes today because the dry-run doesn't list those paths, which is a property of sync's output rather than of this test.test(#1098): soak gate enumerates the release skill copies through co…
ci(#1098): downstream canary job on every PR and a next-tag soak gate…
fix(#1123): --yes init no longer replaces an unparseable .mcp.json (#…