Repository navigation
ci(#1093): required checks on main, red-main revert rule, and mechanical proof for "pre-existing failure" claims - #1126
Merged
admarble merged 4 commits intoSep 20, 2026
Conversation
…t job context Entire-Checkpoint: b2c158192276
…set docs Entire-Checkpoint: 3741d2d86349
Entire-Checkpoint: 0c9baa362eee
… red; gate test asserts the enforcement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes the merge gate on
mainmechanical, and makes any "pre-existing failure" claim provable.scripts/ruleset-main.sh --printemits the corrected ruleset payload forCC(12393605).--printis its only mode — it makes no network call, so no agent can apply it. The owner applies it in gate(owner): apply themainruleset — target~DEFAULT_BRANCH, require thetestcheck, strict up-to-date #1109.scripts/settle-against-base.sh <test-file> [-t <name>]runs a named test at HEAD and again at the base commit, in the same worktree, with everySEQUANT_*var unset, and prints both results as a### Settled against baseblock for the PR body. It commits nothing and restores the branch and any uncommitted work on every exit path./execcalls it for every red test outside the diff;/qa§2a setssettle_evidence_statusand §7 step 4 floors an unbacked claim atAC_MET_BUT_NOT_A_PLUS.CLAUDE.mdgains a## Red mainrule, repeated in the release skill's pre-flight checks.Decision taken on the spec's blocking finding B1
/specflagged that AC-1 names a required check context (test) that did not exist:npm testran inside a job calledbuildcarrying a single-entry matrix, so its real context wasbuild (22.x). Applying a ruleset requiringtestwould have blocked every merge tomainpermanently. No owner decision was posted, so this PR resolves it by making the context real rather than by rewriting AC-1:.github/workflows/ci.yml'sbuildjob is renamedtestand loses its single-entry matrix, so the context it reports is the plain, stable stringtest. This satisfies AC-1 verbatim and removes the matrix footgun in spec option A (anode-versionbump silently stops matching a required context).ci.ymlwas not in the issue's May touch list; options B and C both required it, and option A is the only one that avoids it — at the cost of contradicting AC-1's literal text.Side effect, called out rather than left silent:
settings.markdownOnlySafeCiPatternsdefaults to["build (*)", "Plugin Structure Validation"], so sequant's own markdown-only PRs no longer get thetestcheck relaxed while pending. The default is deliberately left unchanged — it is a consumer-facing default wherebuild (*)still matches, and relaxing a check the ruleset requires understrict_required_status_checks_policywould be exactly the "field for excusing a failure" this issue removes.Acceptance criteria
scripts/ruleset-main.sh --print | jq -e '...'exits 0;[.rules[].type]is["deletion","non_fast_forward","required_status_checks"],includeis["~DEFAULT_BRANCH"], strict policy true, contexttest. Applying it stays gate(owner): apply themainruleset — target~DEFAULT_BRANCH, require thetestcheck, strict up-to-date #1109's AC.npx vitest run scripts/settle-against-base.test.ts→ 7 passed. Real temp git repo per case (init, bareorigin, commits, branches); red-at-base/green-at-head and the reverse both assert the block carries both runner outputs."preserves uncommitted changes": the tracked edit and an untracked file are byte-identical afterwards,HEADis back on the original branch, and no stash entry survives.npx vitest run scripts/preexisting-claim-gate.test.ts→ 4 passed, across all three skill copies. Mutation-verified..github/PULL_REQUEST_TEMPLATE.mddoes not exist; passes by absence, and none was created.npm testfrom a clean shell after the PR opens).npm run build,npm run lint,npx tsc --noEmitandnpm run typecheck:scriptsall pass locally; see "Checks run" below.npx vitest run scripts/preexisting-claim-gate.test.ts -t "red-main"→ 2 passed, 2 skipped. Mutation-verified.Mutation verification
Four mutations were run, each from a clean tree (
git status --short | wc -l= 0), each failing exactly the intended test, each restored:templates/skills/exec/SKILL.mdexec skill names the settle script in its red-test section, in all three copies(1 failed, 3 passed)settle_evidence_statusstep-4 branch fromskills/qa/SKILL.mdqa skill rejects an unbacked pre-existing claim, in all three copies(1 failed, 3 passed)## Red mainsection fromCLAUDE.mdred-main rule is stated in CLAUDE.md(1 failed, 1 passed, 2 skipped)skills/release/SKILL.mdred-main rule is stated in CLAUDE.md+red-main rule is repeated by the release skill in all three copies(2 failed)Design notes
Build & Red-Test Verificationand now triggers on a pre-existing test claim as well as a failing build. It declaressettle_evidence_status(Backed/Unbacked/N/A) with a real §7 gate — a step-2 token attributed to Section 2a and a step-4 branch on it. Prose alone would have failednpm run lint:skill-gatesinvariant I1 (the §2h and §6f defects it was written for).npm run lint:skill-gates: no violations.ABSENT AT BASEis not support for a pre-existing claim. A brand-new test file errors at base, and reporting the runner's "no test files found" as a base failure would fake the exact claim this script exists to make unfakeable. The script distinguishes the two and the qa section says so; covered by the casedistinguishes a test file absent at base from a failure at base.SEQUANT_*var unset (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). A base-vs-head comparison under two different environments proves nothing.apply+drops it rather than using positionalpop. AnEXIT/INT/TERMtrap does the restore; a failed restore exits 4 and names the tag rather than exiting quietly.git init, a bareorigin, real commits and checkouts).SETTLE_TEST_CMDsubstitutes a trivial runner so the file does not nest a realvitestper case — the behaviour under test is the checkout/stash/restore dance, not vitest.vitest.config.tsgainsscripts/settle-against-base.test.tsin theintegrationproject (andunit's exclude list), mirroringscripts/qa/tautology-detector-cli.test.ts. It cannot finish insideunit's 5s default.scripts/generate-constitution-dod.tsgains a label for the new gate, and bothconstitution.mdcopies are regenerated — the new §7 branch otherwise failsnpm run lint:constitution-dod.Checks run
npm run buildnpm run lintnpx tsc --noEmitnpm run typecheck:scriptsnpm run lint:skill-syncnpm run lint:skill-gatesnpm run lint:skill-callsnpm run lint:constitution-dod--base origin/main)bash -non both new scriptsshellchecknot installed locally)npx vitest run scripts/settle-against-base.test.tsnpx vitest run scripts/preexisting-claim-gate.test.tsNo red tests were seen in this worktree, so no
### Settled against baseblock is attached. Per the wave-2 launch rules the fullnpm testis the runner's, from a clean shell — it was deliberately not run here (the 30-minute no-progress wall).Test coverage
scripts/settle-against-base.shscripts/settle-against-base.test.ts(7 cases)scripts/ruleset-main.sh.claude/skills/**×3,CLAUDE.mdscripts/preexisting-claim-gate.test.ts(4 cases, mutation-verified)scripts/generate-constitution-dod.tsscripts/check-constitution-dod.test.ts+ the CI gate.github/workflows/ci.yml,vitest.config.tsKnown gap:
scripts/ruleset-main.shhas no test file. AC-1's verification is thejq -ecommand in the AC itself, which is run above and is the whole of the script's contract (it prints one fixed document). A test would restate the samejqassertion against the same literal. Flagging it rather than adding a restatement; say the word and I will add one.Closes #1093
🤖 Generated with Claude Code
Runner verification (guard-2026-09 wave 2, 2026-09-20)
6a11d760. The first round found the release skill's new red-main pre-flight read whichever push run was newest (Scorecard, not CI) and never stopped; runner fix:--workflow ci.ymlandexit 1on non-success in all three mirrors, gated by the AC-7 test (mutation: dropping--workflowfrom one mirror fails exactly that case; restored).ruleset-main.sh --print:~DEFAULT_BRANCH, deletion + non_fast_forward + required_status_checks, contexttest, strict), AC-2/3 (settle test, 7 passed), AC-4/7 gate (4 passed), AC-5 (no PR template); markers classifier-valid;lint:skill-sync44/44; no SKILL.md mentions relay.build→testand drops its single-entry matrix so the required context is exactlytest(AC-1). gate(owner): apply themainruleset — target~DEFAULT_BRANCH, require thetestcheck, strict up-to-date #1109 applies the ruleset by hand after merge.npm testfrom a clean shell on6a11d760: 331 files, 6626 passed, 3 expected fail, 3 skipped, 352 s. CI green (context nowtest).