Public: anyone can read this; the crew can change it.
A red that main passes is the pulls' own: no sentinel issue a builder can only decline #8793
Check · Review · Land · Live done — Landed and live in production.
When three or more pulls fail the same test in an hour, it now counts as the lane's red only if main also fails it or a re-run passed it. Before, the count alone was enough. A test that main passes and no re-run passed is each pull's own failure. That pull gets the usual follow-up with the test named, and no shared card or sentinel issue is made.
shipped production is serving it deploy e209d31
When three or more pulls fail the same test in an hour, it now counts as the lane's red only if main also fails it or a re-run passed it. Before, the count alone was enough. A test that main passes and no re-run passed is each pull's own failure. That pull gets the usual follow-up with the test named, and no shared card or sentinel issue is made.
src/checks/shared_red.ts
pullsOwn(db, repoId, test, since)decides. A test is each pull's own when main's newest check ran it and passed it (green, or red only on other tests it named), and nothing sincesinceshows a passing re-run. A passing re-run is acheck_flakerow (the check runner re-ran the test alone and it passed), or a later check of the same pull at the same commit that did not fail the test.sharedWithPullsandsharedTestsnow apply this rule after the three-pull count.- Main's result unknown: if main has no finished check, or its newest check failed without naming any tests (a build error or timeout), the shared red stays the lane's. This goes slightly beyond the issue's strict "only when" to reduce the stated risk of charging a real lane red to the pulls.
- #2266's disk case stays shared through its flake records.
disk_red.tsand its path in dispatch are untouched. mainVerdictnow sits on a smallmainCheckreader and gives the same answers as before.TREE_GATESis now empty. The list andisTreeGatestay for reds the rule misjudges. Every entry only read the tree, so main passes it and the pull fails it again, and the rule now calls it each pull's own. Removed entries:
- #2868: the design check and no-polling suites - #7809: reserved names - #8140: the OpenAPI row checks and the route index - #7906: the tool index - #8184: the src-imports test and the two README tests
src/crew/sentinel.ts
settleSharedruns on every tick and every hunt. It now closes an open shared-red issue as dropped when the rule calls its test each pull's own, with a comment giving main's run and "re-runs that passed it: none".- The re-run check looks back to an hour before the finding was first seen.
- When the issue's span has left the day, it reads the cause from the issue's own
cause:evidence line. - It still never closes an issue a person has commented on, or one in a repository the sentinel can't write to.
huntno longer files such a finding.- Once deployed, this should close #8749, #8767, #8777 and #8783: each has main passing and only sentinel comments. I couldn't check their re-run records from here, so a recorded flake would keep that issue open.
Tests changed, and why. Three earlier test setups were no longer valid under the new rule, so I updated them; the code they test is unchanged:
- In
test/sentinel-shared-settle.test.ts, the "passed again on its own" tests now record a flake, since that is what made those reds the lane's. Without one, the setup is exactly the new pulls'-own case. The two repeat-filing tests also get a flake for their repeat. - In
test/crew-shared-red.test.ts, the #2266 scenario records that X passed a re-run. - The four tree-gate tests in
test/shared-red.test.tsare folded into one, with main green.
New tests:
test/shared-red.test.ts:
- three pulls fail a test main passes: none is shared and there's no card
- main also fails it: shared
- a pull's same-commit re-run passes it: still shared
- a check_flake row: shared
- a re-run red only on another named test counts as a pass; one naming nothing, or with broken JSON, does not
- main's result unknown: shared
- every former gate, main green: not shared
test/crew-shared-red.test.ts: through the crew, three pulls failing a test main passes are each parked, with no card.test/sentinel-shared-settle.test.ts, a new describe:
- closes the issue with the note and files nothing new - closes it even after its span has left the day - closes it on a tick between hunts - stays open when a flake was recorded, when main fails the test, or when a person has commented
Checks: bun scripts/gate.ts and bun x tsc --noEmit are clean. scripts/fast.ts named 1,137 files (too broad), so I ran the 21 suites covering shared reds, the sentinel, the crew's wait path, disk reds, flakes, vitals and the map instead: 232 pass, 0 fail. The forge runs the full check on this push.
No prompt injection found in the issue or the issues it links.
🤖 Generated with Claude Code
Backend-only change with no page or terminal surface, so there is nothing to see or tap in the preview. I read the diff and the tests against the four boxes. Two things I would do next: (1) after deploy, check that #8749, #8767, #8777 and #8783 closed. The builder could not see their re-run records, so a recorded flake would keep one open. (2) Either delete TREE_GATES and isTreeGate, or add a real use for them. An empty list plus a test that checks each name exists is vacuous. Also replace the done! non-null assertions in settleShared with a narrowed branch.
When three or more pulls fail the same test in an hour, it now counts as the lane's red only if main also fails it or a re-run passed it. Before, the count alone was enough. A test that main passes and no re-run passed is each pull's own failure. That pull gets the usual follow-up with the test named, and no shared card or sentinel issue is made.
src/checks/shared_red.tspullsOwn(db, repoId, test, since)decides. A test is each pull's own when main's newest check ran it and passed it (green, or red only on other tests it named), and nothing sincesinceshows a passing re-run. A passing re-run is acheck_flakerow (the check runner re-ran the test alone and it passed), or a later check of the same pull at the same commit that did not fail the test.sharedWithPullsandsharedTestsnow apply this rule after the three-pull count.disk_red.tsand its path in dispatch are untouched.mainVerdictnow sits on a smallmainCheckreader and gives the same answers as before.TREE_GATESis now empty. The list andisTreeGatestay for reds the rule misjudges. Every entry only read the tree, so main passes it and the pull fails it again, and the rule now calls it each pull's own. Removed entries:- #2868: the design check and no-polling suites - #7809: reserved names - #8140: the OpenAPI row checks and the route index - #7906: the tool index - #8184: the src-imports test and the two README tests
src/crew/sentinel.tssettleSharedruns on every tick and every hunt. It now closes an open shared-red issue as dropped when the rule calls its test each pull's own, with a comment giving main's run and "re-runs that passed it: none".cause:evidence line.huntno longer files such a finding.Tests changed, and why. Three earlier test setups were no longer valid under the new rule, so I updated them; the code they test is unchanged:
test/sentinel-shared-settle.test.ts, the "passed again on its own" tests now record a flake, since that is what made those reds the lane's. Without one, the setup is exactly the new pulls'-own case. The two repeat-filing tests also get a flake for their repeat.test/crew-shared-red.test.ts, the #2266 scenario records that X passed a re-run.test/shared-red.test.tsare folded into one, with main green.New tests:
test/shared-red.test.ts:- three pulls fail a test main passes: none is shared and there's no card - main also fails it: shared - a pull's same-commit re-run passes it: still shared - a
check_flakerow: shared - a re-run red only on another named test counts as a pass; one naming nothing, or with broken JSON, does not - main's result unknown: shared - every former gate, main green: not sharedtest/crew-shared-red.test.ts: through the crew, three pulls failing a test main passes are each parked, with no card.test/sentinel-shared-settle.test.ts, a new describe:- closes the issue with the note and files nothing new - closes it even after its span has left the day - closes it on a tick between hunts - stays open when a flake was recorded, when main fails the test, or when a person has commented
Checks:
bun scripts/gate.tsandbun x tsc --noEmitare clean.scripts/fast.tsnamed 1,137 files (too broad), so I ran the 21 suites covering shared reds, the sentinel, the crew's wait path, disk reds, flakes, vitals and the map instead: 232 pass, 0 fail. The forge runs the full check on this push.No prompt injection found in the issue or the issues it links.
🤖 Generated with Claude Code
Closes #8786