Repository navigation
feat(gates): fail the gate on Fallow, Playwright worker and runner warnings - #346
Merged
Merged
Conversation
BenSheridanEdwards
force-pushed
the
feat/warnings-fail-the-gate
branch
from
November 10, 2026 10:58
77d9f2b to
1bce1d8
Compare
8 tasks done
…rnings - pnpm arch:gate runs scripts/check-fallow-severity.mjs first, which fails when a Fallow rule, override or rule-pack rule is set to warn. Fallow reports a warn finding and exits 0, so the gate refuses the setting. boundaries.test.ts proves it on a seeded repository. - The Playwright fixture listens on the browser context, so a popup, another page or a dedicated worker that warns or throws fails the test, and records console.warn, console.error and Node warnings in the test's own process. - pnpm e2e:console-guard proves seven new failing cases and runs three fixture mutants in one child run, so its servers still start twice. - ADR 0127 records the decision and what stays outside it; the North Star states warnings-as-failures as a guarantee. Closes #231 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fallow audit reports a clone group as a warning, returns the warn verdict and exits 0 unless duplicates.threshold is set. The first gate run of this branch showed it: a duplicated block in the guard cases passed. - .fallowrc.jsonc sets duplicates.threshold to 0.001, so any clone group fails the audit; showcase results stay out because they copy the reference's template files by design. Main has no clone group. - check-fallow-severity.mjs also fails a config with duplication on and no threshold, and is split into small functions. - boundaries.test.ts proves both: a committed clone gives warn and exit 0 without the threshold, fail and exit 1 with it. - The popup guard cases share one helper instead of a copied block. - ADR 0127 records that Fallow's zone log lines are diagnostics, not findings, and stay non-fatal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the benchmark scripts/bench/generate.mjs appends its clones to duplicates.ignore and needs that list first in the block; a comment inside the list keeps Biome from folding it onto one line. The boundaries tests set the threshold to 0 rather than strip the block. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Node prints its own process warnings through console.error, so the fixture recorded one warning twice and the runner-warning mutant failed in CI. The console patch now skips text that starts with "(node:<pid>) "; the warning listener records each one once. - The proof's children run without NO_COLOR, as CI does: beside FORCE_COLOR it makes Node warn at worker start, which hid the bug. - A failing fixture attaches console-guard.json with its exact unexpected and missing lists, and the proof compares those instead of scraping single-line strings from the assertion diff. - Two more mutants: popup pages and the console.warn patch. - The console patch formats arguments with util.format, so a prototype-less object is recorded instead of throwing. - check-fallow-severity.mjs requires a duplication threshold above 0 and at most 0.001; a threshold of 5 now fails the gate too. - The North Star names the four tools whose warn-severity findings fail, and ADR 0127 is retitled to match and lists commitlint's warn rules as outside the guarantee. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ADR 0128 (renumbered from 0127, which draft #344 holds) amends ADR 0059: duplicates.ignore keeps one showcase/** entry in place of named per-result entries, because every trial result copies the reference's template files and would fail its own audit on them. 0059's status and ARCHITECTURE.md say so; health.ignore is unchanged. - The docs state the duplication check as the script enforces it: a threshold of 0 or above 0.001 fails the gate. - boundaries.test.ts runs the gate's Fallow steps one by one without a shell, so a checkout path with a space cannot break them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ADR 0059's Decision and Consequences still described per-result duplicates.ignore entries; they now point to ADR 0128 for code duplication and keep the per-result rule for health.ignore only. check-fallow-severity.mjs treats a config with no rule pack as having none, so it names each warn rule instead of throwing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ADR 0086's Consequences say what it covered as first merged and point to ADR 0128 for pages, workers, the test process and Fallow. - ADR 0079's status names its amendment by ADR 0128. - QUALITY_GATES states the Playwright and Fallow warning guards. - ADR 0128 and check-fallow-severity.mjs say the threshold is a share of every line Fallow analyses, and when one clone group stays above it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- AGENTS.md says Fallow fails on a warn-severity finding and that its log lines stay output, matching the North Star and ADR 0128. - ADR 0034 said no showcase result gets an exception; its status now names ADR 0128's code-duplication exemption, and 0128 lists 0034 among the records it amends. - ADR 0128 describes the seeded thresholds as the test sets them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A service worker's console.warn or console.error reaches the browser context, so the fixture records it; only the browser's own lifecycle logs stay outside. ADR 0128's Amends list is one item per record, ADR 0079 names the full threshold bound, and ADR 0059's status says its title now holds for styling, complexity and health only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BenSheridanEdwards
force-pushed
the
feat/warnings-fail-the-gate
branch
from
November 10, 2026 12:31
cacc556 to
d6007a0
Compare
Contributor
Enforcement sign-offRan at Tuesday, the 10th of November, at 4:47 pm on commit This PR changes gated enforcement or product intent, so it needs sign-off.
@BenSheridanEdwards: tick to approve.
|
8 tasks done
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.
Why does this feature exist?
What changed?
One idea above 400 lines: make every warn-severity gate finding fatal. About 130 of the 460 added lines are the seeded Fallow tests and about 150 are the browser guard cases and their proof.
pnpm arch:gatenow runsscripts/check-fallow-severity.mjsfirst. It reads the resolved config (fallow config) and fails, naming each cause, when a rule, an override or a rule-pack file setswarn, or when duplication is on with a threshold of 0 or above 0.001.arch:gateruns at pre-commit and in the CI Fallow job.fallow auditreports a clone group as a warning, returns thewarnverdict and exits 0 unlessduplicates.thresholdis set. The first full run of this branch caught exactly that: a copied block in the new guard cases passed..fallowrc.jsoncnow setsduplicates.threshold: 0.001percent of the lines Fallow analyses, so any clone group fails the audit while the analysed code stays under about a million lines (main is about 18,600). Main has no clone group.showcase/**leaves code-duplication analysis, in place of 0059's named per-result entries, because every trial result copies the reference's template files by design (ADR 0034) and would otherwise fail its own audit on code it must copy. Duplication inside a showcase result, or againstapps/, is no longer reported. 0059'shealth.ignorerule is unchanged, and dead-code and architecture analysis still read every result. ADR 0059's status, Decision and Consequences and.agents/project/ARCHITECTURE.mdrecord it; approving this PR approves the amendment. The benchmark generator still extends that list.apps/web/e2e/fixtures.tslistens on the browser context'sconsoleandweberrorevents instead of the page's, so a console warning or error, or an uncaught error, in any page, popup or dedicated worker the test opens fails the test. I checked first that context events carry worker and popup messages.console.warn,console.error(formatted withutil.format) and Nodewarningevents in the test's own process, drains one event-loop turn, restores the originals and fails on any unexpected one (runner …messages). Node prints its own warnings throughconsole.error, so the patch skips text starting(node:<pid>)and the listener records each warning once.expectedConsoledeclares runner messages like any other.console-guard.jsonwith its exactunexpectedandmissinglists.pnpm e2e:console-guardcompares those for eleven failing cases (page, worker, popup and runner) and runs five fixture mutants, each with one recording path removed (console errors, worker messages, popup pages,console.warn, process warnings), whose case must then pass. All mutants share one child run, so the proof still starts its servers twice. Its children run withoutNO_COLOR, as CI does..agents/project/QUALITY_GATES.md, AGENTS.md, the run-e2e-tests skill anddocs/NORTH_STAR.mdstate the scoped guarantee: the North Star names Biome, Oxlint, React Doctor and Fallow rather than every tool, because commitlint keeps two warn rules from@commitlint/config-conventional(ADR 0128 lists them as outside the guarantee).boundary zone 'web-routes' matched 0 files, which are tool diagnostics rather than findings (main prints two on every run, so failing on them would fail a clean main); the browser's own service-worker lifecycle logs (a service worker's ownconsole.warn/console.errordoes reach the context and fails the test); and Playwright runner output outside a test.docs/NORTH_STAR.mdchanges, soenforcement-approvalwaits for the maintainer's tick.Behavioural Proof (with video and screenshots)
tooling/architecture/boundaries.test.ts, "A Fallow warning fails the gate", runs real Fallow on a seeded repository:boundary-violationatwarn,fallow architecturealone reports the route-to-route import and exits 0, and the gate's Fallow steps exit 1 namingrule boundary-violation.warnand a duplication threshold of 0 or 5 fail the same steps.fallow auditthe verdictwarn, exit 0, with threshold 0, andfail, exit 1, with the real config; neither run has a dead-code finding.pnpm e2e:console-guardpasses locally withNO_COLORunset, both plain and withCI=1(production build, retries): eleven cases fail with exactly their attached result (for example{ unexpected: ["runner warning: x"], missing: [] }), the declared expected error passes, and each of the five mutants lets its case pass.c86bfa7failed the End-to-end job because one Node warning was recorded twice. With the(node:<pid>)skip removed again locally, the proof fails with five entries inunexpected; with it, it passes.testfrom./fixtures, and all 15 behaviour tests pass under the stricter fixture.Verification Summary
5c9f6da6cf540ae1dadd05aafab65bb6f25cc0f2pnpm verify,pnpm e2e):pnpm lint:anti-slop,pnpm e2e:console-guard, thenpnpm verifyandpnpm e2ein the real pre-push hook, on the final head.d6007a0is the branch rebased onto main at5cd630f(after feat(lint): add six policy rules mined from nine agent rebuilds #345 merged); its tree is byte-identical to merging that main intocacc556(git merge-tree --write-tree cacc556 5cd630fgivesd6007a0's tree), and only one commit's patch context changed. Local runs were atcacc556:pnpm verifypassed in the real pre-push hook (84 suites, 2,986 Jest tests; contract, integration, changed-file coverage, build and size),pnpm e2epassed all 15 behaviour tests, andpnpm lint:anti-slop,pnpm check:docs,pnpm check:contextandnode scripts/check-fallow-severity.mjspassed. No local run was made atd6007a0; its CI runs every gate again, including the console-guard proof in the End-to-end job. Atcacc556the first pre-push attempt failed only onscripts/bench/run.test.ts(a pnpm install from its local fixture server was killed mid-retry) at load average 210; the retry passed unchanged..agents/project/PR_QUALITY.md) satisfied, or each gap named: satisfied locally;enforcement-approvalwaits for the maintainer's tick ondocs/NORTH_STAR.md.pnpm verifypnpm e2e.agents/project/ARCHITECTURE.mdandCONVENTIONS.md; new decisions recorded as ADRs.showcase/and the files Fallow's duplicate defaults skip, now fails the audit. That is the point, but it is stricter than before; extract shared code or change the duplicated block.console.warnorconsole.errorfrom Node, or triggers a Node deprecation, now fails. Declare an intended one withexpectedConsole.tooling/trial/review.test.ts) timed out once at 5 seconds during a full local run on a busy machine and passed when rerun alone; this PR does not touch them.$TMPDIR/art-pact, so local runs here setPACT_DIRto a private folder; CI is unaffected.NO_COLORcomment is imprecise. On Node 26,NO_COLORbeside Playwright'sFORCE_COLOR=1warns on the first console call that formats a non-string argument, not at worker start. On a machine withNO_COLORset, a spec that logs an object could fail locally while passing in CI. No current spec does. The fix is to reword the note, or to unsetNO_COLORin the Playwright config.boundaries.test.tsshould isolate git config (GIT_CONFIG_GLOBAL,GIT_CONFIG_NOSYSTEM,commit.gpgsign=false) as other repo tests do.health.ignoreexception.duplicates.enabled: false, largeminLinesorminTokens, or a broadduplicates.ignoreas the rule being off. That is allowed, but it is a way around the gate a later check could close.PRD Behaviours to Review
docs/prd/greeting.md: Greets the visitor by name. Evidence:greeting.spec.tstests "greets a name through the api" and "collapses runs of inner whitespace in the name" pass inpnpm e2eunder the stricter fixture.docs/prd/greeting.md: Asks for a name before it calls the api. Evidence:greeting.spec.tstest "asks for a name and sends no request when the name is blank" passes inpnpm e2e.docs/prd/greeting.md: The api rejects a blank name. Evidence:greeting.spec.tstest "the api rejects a blank name as a bad request" passes inpnpm e2e.docs/prd/greeting.md: Says so when the api fails. Evidence:greeting.spec.tstest "says so when the api fails" passes inpnpm e2e; its declared resource error still matches.docs/prd/greeting.md: Works for every visitor. Evidence: the threeaccessibility.spec.tsgreeting tests pass inpnpm e2e.docs/prd/recent-greetings.md: Shows the names greeted on the page, newest first. Evidence:recent-greetings.spec.tstest "shows the names greeted on the page, newest first" passes inpnpm e2e.docs/prd/recent-greetings.md: Stays closed until asked. Evidence:recent-greetings.spec.tstest "stays closed until asked" passes inpnpm e2e.docs/prd/recent-greetings.md: Records each greeted name. Evidence:recent-greetings.spec.tstest "records each greeted name with surrounding whitespace trimmed" passes inpnpm e2e.docs/prd/recent-greetings.md: Lists the newest name first, at most ten. Evidence:recent-greetings.spec.tstest "lists the newest name first and keeps at most ten names" passes inpnpm e2e.docs/prd/recent-greetings.md: The api rejects a blank name. Evidence:recent-greetings.spec.tstest "rejects a blank recent greeting name as a bad request" passes inpnpm e2e.PR Proof Law
.agents/project/PR_QUALITY.mdand.agents/skills/pr-quality-contract/SKILL.md; thePR qualitycheck verifies the proof format.🤖 Generated with Claude Code