Repository navigation
Description
Blocked by: #1104 Tier: judgment Doc: guard plan 2026-09-18 (16-bug classification; research: Uber SubmitQueue, Shopify merge queue, Google TAP)
Why
The main ruleset today enforces only deletion and non_fast_forward. There are no required status checks and no up-to-date requirement, so a PR can merge with stale or red CI. In practice that is what happened on 2026-09-10/11: PRs #1036, #1042 and #1048 each shipped with "3 pre-existing failures, unrelated to this diff" in the body. The failures were #1086 and stopped a gate run a week later. The structural fix used by every always-green-main team is the same: the gate tests the merge state, a red main is a revert, and there is no field for excusing a failure.
The mechanical half: an agent's "pre-existing" claim is unverifiable unless it attaches the same test's result at the base commit in the same worktree. The exec and qa skills now say so in prose; this makes it a script the skills call and qa checks.
Change
- Ruleset payload:
scripts/ruleset-main.sh --printemits the JSON for rulesetCC(id 12393605) withconditions.ref_name.include: ["~DEFAULT_BRANCH"](Phase 0 found it[], targeting no ref), the existingdeletionandnon_fast_forwardrules, and arequired_status_checksrule naming thetestjob withstrict_required_status_checks_policy: true;docs/internal/graph-2026-09-guard/ruleset.mdexplains each field. The owner applies it in gate(owner): apply themainruleset — target~DEFAULT_BRANCH, require thetestcheck, strict up-to-date #1109 (G-1). An agent never callsgh api -X PUTon the ruleset. - Red-main rule in
CLAUDE.md's hooks/commit section and the release skill: a failingpushrun onmainis reverted first and debugged second; the revert PR references the run. scripts/settle-against-base.sh <test-file> [-t name]: commits nothing, checks outorigin/maindetached in the current worktree, runs the named test, restores HEAD, prints both results as a fenced block for the PR body. The exec skill's pre-PR gate calls it for every red test outside the diff; the qa skill rejects a "pre-existing" claim whose PR body has no such block.- PR template: no "known failures" field.
Release-graph plan — guard-2026-09 (2026-09-20)
Graph: guard-2026-09 Tier: judgment Wave: 2
May touch: scripts/settle-against-base.sh, scripts/settle-against-base.test.ts, scripts/ruleset-main.sh, scripts/preexisting-claim-gate.test.ts, docs/internal/graph-2026-09-guard/ruleset.md, CLAUDE.md, exec SKILL.md ×3, qa SKILL.md ×3, release SKILL.md ×3 (the red-main line only), 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). Skill edits: mirrors byte-identical (npm run lint:skill-sync 44/44) and no SKILL.md may contain the word relay (I-3). AC-2/AC-3 run the script against a real temp git repo, no mocked git (I-6). .github/PULL_REQUEST_TEMPLATE.md does not exist on main, so AC-5 passes by absence; do not create one.
Acceptance criteria
- AC-1:
scripts/ruleset-main.sh --printexits 0 and prints JSON whose.conditions.ref_name.includeis["~DEFAULT_BRANCH"], whose[.rules[].type]containsdeletion,non_fast_forwardandrequired_status_checks, and whose required-check rule namestestwithstrict_required_status_checks_policy: true— Verify:scripts/ruleset-main.sh --print | jq -e '.conditions.ref_name.include == ["~DEFAULT_BRANCH"] and ([.rules[].type] | index("required_status_checks")) and (.rules[] | select(.type=="required_status_checks") | .parameters.strict_required_status_checks_policy == true and (.parameters.required_status_checks | map(.context) | index("test")))'→ exit 0. Applying it is gate(owner): apply themainruleset — target~DEFAULT_BRANCH, require thetestcheck, strict up-to-date #1109's AC. - AC-2:
scripts/settle-against-base.shexits 0 and prints a### Settled against baseblock containing both the base and head results for the named test — Verify:npx vitest run scripts/settle-against-base.test.ts(temp repo where the test fails at base and passes at head, and the reverse) → green. - AC-3: the script never loses work: run it with an uncommitted edit present and the edit survives — Verify: same test file, case "preserves uncommitted changes".
- AC-4: gate test — the exec skill's pre-PR section names the script and the qa skill's verdict section rejects an unbacked "pre-existing" claim, in all three skill copies — Verify:
npx vitest run scripts/preexisting-claim-gate.test.ts→ green. Mutation-verified per CLAUDE.md §Testing: remove the script reference from one copy → the test fails; restore. - AC-5:
.github/PULL_REQUEST_TEMPLATE.md(if present) has no known-failures or pre-existing-failures section — Verify:grep -ci "known failures\|pre-existing" .github/PULL_REQUEST_TEMPLATE.md→ 0, or the file does not exist. - AC-6:
npm run build && npm testgreen. - AC-7: gate test —
CLAUDE.mdstates the red-main rule (a failingpushrun onmainis reverted first, debugged second, the revert PR references the run) and the release skill repeats it in all three copies — Verify:npx vitest run scripts/preexisting-claim-gate.test.ts -t "red-main"→ green, scoped to the section between the rule's heading and the next##. Mutation-verified per CLAUDE.md §Testing: delete the rule fromCLAUDE.md→ the test fails; restore.
Not in scope
Auto-revert automation. A human reverts; the rule just says which order.
Activity
admarble commentedon Sep 20, 2026
Runner context — guard-2026-09 wave 2 launch, 2026-09-20. Base:
origin/mainatbef0ac98(all seven wave-1 PRs merged: #1086 scrub, #1104 marker docs, #1053, #1106 ownership gate, #1095 parsers, #1096 conformance suite, #1070 failing verdicts post). 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: Judgment tier. You are the only node editing skills this wave: after editing,
npm run lint:skill-syncmust report 0 diverged (the count is 44 or 45 files — check the number, not the prose), and no SKILL.md may contain the word relay. Gate tests inscripts/must import and call a production function (the tautology detector fails the full suite otherwise; a brace-bearing regex literal insideit()also trips it — use line matching). AC-1 only prints the ruleset payload; the owner applies it in #1109. Thesettle-against-base.shtest runs against a real temp git repo (I-6).admarble commentedon Sep 20, 2026
Plan — #1093 (merge gate + mechanical "pre-existing" proof)
Complexity: Standard (7 ACs, 4 directories) · Blocker #1104 is CLOSED — unblocked. Worktree
feature/1093-ci-gate-...exists atbef0ac98, no commits yet.AC Quality Check
lintAcceptanceCriteria→ ✅ all 7 clear and testable; all 7 parse on a single line. One format note: the ACs useVerify:rather than the houseEvidence:clause, soextractAcceptanceCriteriasetsverificationMethod: "manual"on all seven andAC.evidenceis empty on all seven. Consequence:/qa§6h (declared_evidence_status) will readN/Aand the testgen auto-detector sees zero declared evidence. Not worth an edit now — flagged so the QA verdict isn't read as a coverage signal.detectBehaviorRule→ no AC triggers (0/7), so no Rule Touchpoints table. That is a false negative: AC-4 and AC-7 are textbook multi-touchpoint rules (3 skill copies each, plusCLAUDE.md). The issue enumerates the touchpoints itself, so nothing is lost here — the touchpoints are in the plan below. Worth a follow-up on the detector's keyword set.Scope Assessment
Non-Goals: present as
## Not in scope("auto-revert automation") — the parser looks forNon-Goalsand reports it missing. Cosmetic.Verdict: ❌ SCOPE_SPLIT_RECOMMENDED — do not split. The three "features" are keyword clusters the detector invented (
uifrom AC-1+AC-6,apifrom AC-4/5/7); there is one coherent change: make the gate mechanical. Splitting would break a fixed wave-2 graph contract. Recording the verdict honestly and overriding it.Blocking findings — resolve before
/execB1 — AC-1 names a status check that does not exist (would hard-block
main)ci.ymlhas no job namedtest. Real contexts on PR #1118:npm testruns inside thebuildjob (ci.yml:10-37: lint → build → test → CLI smoke), whose check-run context isbuild (22.x)because of its single-entry matrix (node-version: [22.x]). A ruleset requiring the contexttestwithstrict_required_status_checks_policy: truewould require a check that never reports — every PR tomainblocks permanently, and #1109 (G-1) is the owner applying it by hand.Confirmed current state of ruleset
CC(12393605):conditions.ref_name.include: [], rulesdeletion+non_fast_forward,bypass_actors: [],current_user_can_bypass: "never". The payload must preserveenforcement: "active"and the emptybypass_actors.Three ways out — owner picks, and must rewrite the AC-1 line in the issue body (a decision comment does not re-open exec):
build (22.x); AC-1'sjqassertsindex("build (22.x)")node-versionsilently stops matching and blocksmainbuildso the context is plainbuild; requirebuildci.yml(not in May touch)test:job toci.yml; keep AC-1 verbatimci.yml, duplicated install/buildRecommendation: B. It keeps the required context stable against matrix edits, which is the failure mode A carries forever, and it costs three deleted lines. Either way
tautology-advisorymust stay optional — it isif: github.event_name == 'pull_request'and never runs on push.B2 — AC-2/AC-3's test file lands in the 5 s unit project
vitest.config.tsputs every**/*.test.tswithout.integration.in theunitproject at vitest's default 5 stestTimeout.scripts/settle-against-base.test.tsbuilds a real temp git repo and runs a test at base and at head — it will not finish in 5 s. Exact precedent in the same config:scripts/qa/tautology-detector-cli.test.tsis excluded fromunitand listed inintegrationfor this reason.Recommendation: keep the AC's filename and
Verify:command byte-identical; addscripts/settle-against-base.test.tsto theintegrationproject'sincludeand tounit's exclude list, mirroring the tautology entry.vitest.config.tsmust be added to May touch. (Renaming the file to.integration.test.tswould instead force an AC-2/AC-3 text edit — strictly more expensive.)B3 — AC-4's qa edit must wire a §7 gate, or
lint:skill-gatesfails CInpm run lint:skill-gatesruns in thevalidate-skillsjob and enforces invariant I1: a/qasection declaring a verdict floor needs a status token in §7 step 2 and a branch on it in step 4. The two shipped defects it was written for (§2h, §6f) were exactly prose-only floors. So "the qa skill rejects an unbacked pre-existing claim" cannot be prose.Recommendation: add
settle_evidence_status(Backed/Unbacked/N/A) to §7 step 2 (skills/qa/SKILL.md:2621-2630) and anELSE IF settle_evidence_status == "Unbacked"floor in step 4 (~:2655-2661), alongside the existingtrust_boundary_status/cli_registration_statusbranches. Natural home for the section itself: §2a Build Verification's "Pre-existing failure" row (:1349), which today says only "document it with a linked issue".Acceptance Criteria
AC-1: ruleset payload prints with
~DEFAULT_BRANCH+ requiredtest, strictVerification: Integration Test —⚠️ blocked by B1 — the required context is not
scripts/ruleset-main.sh --print | jq -e '...'→ exit 0Scenario: Given no
ghnetwork call → When--printruns → Then stdout is a valid ruleset PUT body withinclude: ["~DEFAULT_BRANCH"], the three rule types,strict_required_status_checks_policy: trueAssumptions:
test. Also: the script must never callgh api -X PUT;--printis its only mode.AC-2:
settle-against-base.shprints base and head resultsVerification: Integration Test —⚠️ blocked by B2. I-6 keeps git real; the test runner is substituted via an env override (below) — that substitution is a design decision, called out so QA does not read it as a mocked seam.
npx vitest run scripts/settle-against-base.test.tsScenario: Given a temp git repo where a named test is red at base and green at head (and the reverse) → When the script runs → Then stdout carries a
### Settled against basefenced block with both results and exit 0Assumptions:
AC-3: never loses work
Verification: Integration Test — same file, case
"preserves uncommitted changes"Scenario: Given an uncommitted edit (and an untracked file) → When the script runs → Then the edit is byte-identical afterwards,
HEADpoints at the original branch, and no stash entry is left behindAC-4: gate test — exec names the script, qa rejects an unbacked claim, ×3 copies
Verification: Integration Test —⚠️ blocked by B3
npx vitest run scripts/preexisting-claim-gate.test.ts; mutation-verifiedScenario: Given all three
SKILL.mdcopies → When the gate test reads each pre-PR / verdict section → Then both assertions hold in all threeAssumptions:
AC-5: PR template has no known-failures field
Verification: Manual — file absent on
mainScenario:
.github/PULL_REQUEST_TEMPLATE.mddoes not exist → AC passes by absence; do not create oneAssumptions: Note
grep -ci <pat> <missing-file>prints nothing and exits 2, not0— the AC's own "or the file does not exist" clause is what carries it. This AC is non-gating: nothing stops a future template from adding the field. Accepted as-is; not worth a test that asserts the absence of an absent file.AC-6:
npm run build && npm testgreenVerification: Integration Test — runner-owned, from a clean shell after the PR opens (I-1). The agent runs only the test files its own ACs name.
AC-7: gate test — red-main rule in
CLAUDE.md+ release skill ×3Verification: Integration Test —⚠️ ambiguity — Change §2 says "
npx vitest run scripts/preexisting-claim-gate.test.ts -t "red-main"; mutation-verifiedScenario: Given
CLAUDE.md→ When the test reads the region between the rule's heading and the next##→ Then it states revert-first/debug-second and that the revert PR references the run; and all threerelease/SKILL.mdcopies repeat itAssumptions:
CLAUDE.md's hooks/commit section", but AC-7 scopes to "the rule's heading → next##".CLAUDE.mdtoday has exactly four##sections (Commit Rules,Hooks,Skills,Testing). Recommendation: give the rule its own## Red mainsection so the scoping is unambiguous and deleting the rule fails exactly this test. Reading it as "inside## Hooks" would make the mutation also delete unrelated hook prose.Implementation Plan
Phase 1 — the script and its test (AC-2, AC-3)
scripts/settle-against-base.sh <test-file> [-t name]. Preflight: refuse ifHEADis already detached or a rebase/merge is in progress.git stash push --include-untracked→git checkout --detach origin/main→ run the test → restore →git stash pop, all guarded by atrap ... EXIT INT TERMthat restoresHEADand pops before exiting. Read base viaorigin/main, never the main checkout (I-7).SEQUANT_*var for both runs — the suite is not hermetic against the orchestrator's env (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), and a base/head comparison under different envs proves nothing. The exec skill already documents theenv $(printenv | grep -o '^SEQUANT_[A-Z_]*' | sed 's/^/-u /')form atskills/exec/SKILL.md:1226; reuse it verbatim.SETTLE_TEST_CMDenv override (defaultnpx vitest run) so the temp-repo test can substitute a trivial runner. Git stays real (I-6); a nested real vitest per case would push the file toward the 30-min wall.scripts/settle-against-base.test.ts— realgit inittemp repo, four cases: red-at-base/green-at-head, the reverse,"preserves uncommitted changes", and test-file-absent-at-base. Add tointegrationper B2.Phase 2 — skill and doc edits (AC-4, AC-7)
.claude/skills/first (canonical perscripts/check-skill-sync.ts:8), thennpm run sync:skills; verifynpm run lint:skill-syncreports 0 diverged — read the file count (44 or 45), not the prose (I-3). Confirm noSKILL.mdgained the word relay.exec/SKILL.md~:1219-1229 — namescripts/settle-against-base.shin the pre-PR gate, called for every red test outside the diff.qa/SKILL.md§2a ~:1349 + §7 steps 2/4 — thesettle_evidence_statuswiring from B3.release/SKILL.md— the red-main line only.CLAUDE.md: new## Red mainsection (per AC-7's scoping note).scripts/preexisting-claim-gate.test.ts, modelled onscripts/exec-skill-marker.test.ts(docs(exec/qa): the SEQUANT_MUTATION failedTest contract (<test file> > <name>) is enforced by the classifier but never told to authors — tripped 2 of 4 gate PRs #1104): section-scopedmarkerSection-style reader, line matching not brace-bearing regex literals, and a real production import —collectFilesfromscripts/check-skill-sync.tsto enumerate the three dirs structurally rather than hardcoding them. Both satisfies the tautology detector and makes "all three copies" survive a fourth mirror.Phase 3 — payload and docs (AC-1)
scripts/ruleset-main.sh --print—--printonly, nogh api -X PUT, preservingenforcement: "active"andbypass_actors: []. Gated on B1's resolution.docs/internal/graph-2026-09-guard/ruleset.md— field-by-field, including why the required context is spelled the way B1 settles on.CHANGELOG.mdlast, in one commit.CHANGELOG.md, and thedocs-2.16worktree is also editing it — expect a merge round at PR time.Mutation records (AC-4, AC-7)
Commit first (
git status --short | wc -l= 0), then per CLAUDE.md §Testing.failedTestmust start with the test file path (I-4) — runparseMutationMarkerson the PR body before opening:Design Review
scripts/, not TypeScript: it manipulates the worktree the test runner runs in, so it must survive the runner's own process. The skills only name it; the enforcement floor lives in/qa§7, which is the only place a verdict can actually be blocked.git worktree add --detachatorigin/main, which is structurally incapable of losing work — but a fresh worktree has nonode_modulesand triggersvitest.global-setup.ts's full build, which is how phases hit the 30-min wall. The trap is the cheaper guarantee, and AC-3 tests it.scripts/exec-skill-marker.test.tsfor the gate tests;scripts/qa/tautology-detector-cli.test.tsfor the integration-project registration; §7'strust_boundary_statusfor the verdict floor. All three are in-repo and current.Feature Quality Planning
npm testin the worktree exceeds the 30-min no-progress wall; three wave-1 phases died that way.npm run lint:skill-gates,lint:skill-sync,lint:skill-callsand the tautology detector all gate this diff invalidate-skills— run them before the PR, they are seconds each.Derived ACs
SEQUANT_*var unset (#1086)SIGTERMmid-run leavesHEADon the original branch, the edit intact, no stash leftscripts/settle-against-base.test.tsis registered in theintegrationprojectOpen Questions
build's single-entry matrix, requirebuild). Impact if wrong: applying the payload in gate(owner): apply themainruleset — target~DEFAULT_BRANCH, require thetestcheck, strict up-to-date #1109 blocks every merge tomainuntil the ruleset is hand-edited back. Needs an edit to the AC-1 line in the issue body, by the owner — a decision comment alone will not re-open exec.## Red mainsection vs inside## Hooks. Recommendation: own section. Impact if wrong: the mutation deletes unrelated prose and the gate proves less than it claims.vitest.config.tsjoin May touch? Recommendation: yes (B2). Impact if wrong: AC-2/AC-3 are red at 5 s regardless of whether the script is correct.Recommended Workflow
Phases: exec → qa
Quality Loop: enabled
Reasoning: testgen skipped deliberately, against the decision table's "Integration Test ACs → recommend testgen": here the test files are the deliverable (AC-2/3/4/7 are gate tests), and
/testgencharacteristically leavestodostubs — a stub is the failure mode these ACs exist to prevent. Quality loop on: seven ACs across three mirrored skill copies plus a §7 verdict-gate wiring, where a single unsynced mirror fails CI.verifyis not an orchestrated phase —/qa§11script_verification_statusalready fires becausescripts/is modified, so script execution evidence is required in the QA pass.Label Review
Current:
enhancement,github_actionsRecommended: add
plannedReason: no
.tsx/.jsxanywhere, so nouilabel and no browser test. Nocomplexlabel — 7 ACs sit in the Standard band.Quality Loop: enabled above by explicit reasoning, not by the scope heuristic (whose SPLIT verdict is overridden).
Conflict Risk
Four wave-2 worktrees are checked out at
bef0ac98with zero commits — no overlap yet.docs-2.16hasCHANGELOG.md+src/lib/settings.tsin flight; onlyCHANGELOG.mdoverlaps. Keep the CHANGELOG edit in its own final commit.Do not merge. Stop at the PR.
fix(#1093): release pre-flight reads the CI workflow run and stops on…
admarble commentedon Sep 20, 2026
QA Verdict: AC_MET_BUT_NOT_A_PLUS
ci(#1093): required checks on main, red-main revert rule, settle-agai…