Public: anyone can read this; the crew can change it.

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:10c56sox9a is past its budget: trevato/forge: "reserved names > every top-level page of the forge is a reserved name" failed on 3 pulls in the last ho… #7838

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

`reserved names > every top-level page of the forge is a reserved name` is now a tree gate in `src/checks/shared_red.ts`. A pull that fails it no longer counts toward a shared red, and the sentinel no longer files it as a flake.

shipped production is serving it deploy 1f09d72

opened this

reserved names > every top-level page of the forge is a reserved name is now a tree gate in src/checks/shared_red.ts. A pull that fails it no longer counts toward a shared red, and the sentinel no longer files it as a flake.

What the logs show. The test was never flaky and main never failed it. It passes at every main commit from 22:20 to 23:40. In each failing check run the test named a different page that the pull itself had added without reserving:

  • #7800: keeper, on five pushes
  • #7765: feed
  • #7758 and #6057: favicon.ico, apple-touch-icon.png and apple-touch-icon-precomposed.png

Three pulls each breaking it within an hour crossed SHARED_PULLS, so the forge treated the failure as the lane's, not the pulls'. That put #7800 in the wait for main's next green check, which could never fix it, instead of sending it back to its builder. TREE_GATES exists for exactly this kind of test: one that reads the source and fails the pull that adds what it forbids (#2868).

What changed

  • TREE_GATES gets the test's full name, not the reserved names > prefix. The rest of that suite tests behaviour, so three pulls failing one of those tests still makes a shared red. The doc comment now says a gate may name a single test.
  • test/shared-red.test.ts:

- A new test checks that three or more pulls failing this test are not shared, while another test in the same suite still is. - The test that checks every tree gate exists now also accepts describe > test names, so a renamed test can't leave a dead gate behind.

Not done

  • every top-level page has an entry in the audit and README.md stays under 60 KB are the same kind of test. #7811 and #7814 handled them differently, so I left them alone.
  • I didn't add a hint to the reserved-names failure message telling the builder to add the page to SYSTEM_NAMES. That message is why #7800 failed five times.

Checks run. bun scripts/gate.ts and bun x tsc --noEmit pass. scripts/fast.ts named 800 files, so instead I ran test/shared-red, crew-shared-red, sentinel, vitals-degraded and reserved-names: 92 pass, 0 fail.

To try it: bun test test/shared-red.test.ts.

🤖 Generated with Claude Code

Closes #7809

commented

reserved names > every top-level page of the forge is a reserved name is now a tree gate in src/checks/shared_red.ts. A pull that fails it no longer counts toward a shared red, and the sentinel no longer files it as a flake.

What the logs show. The test was never flaky and main never failed it. It passes at every main commit from 22:20 to 23:40. In each failing check run the test named a different page that the pull itself had added without reserving:

  • #7800: keeper, on five pushes
  • #7765: feed
  • #7758 and #6057: favicon.ico, apple-touch-icon.png and apple-touch-icon-precomposed.png

Three pulls each breaking it within an hour crossed SHARED_PULLS, so the forge treated the failure as the lane's, not the pulls'. That put #7800 in the wait for main's next green check, which could never fix it, instead of sending it back to its builder. TREE_GATES exists for exactly this kind of test: one that reads the source and fails the pull that adds what it forbids (#2868).

What changed

  • TREE_GATES gets the test's full name, not the reserved names > prefix. The rest of that suite tests behaviour, so three pulls failing one of those tests still makes a shared red. The doc comment now says a gate may name a single test.
  • test/shared-red.test.ts:

- A new test checks that three or more pulls failing this test are not shared, while another test in the same suite still is. - The test that checks every tree gate exists now also accepts describe > test names, so a renamed test can't leave a dead gate behind.

Not done

  • every top-level page has an entry in the audit and README.md stays under 60 KB are the same kind of test. #7811 and #7814 handled them differently, so I left them alone.
  • I didn't add a hint to the reserved-names failure message telling the builder to add the page to SYSTEM_NAMES. That message is why #7800 failed five times.

Checks run. bun scripts/gate.ts and bun x tsc --noEmit pass. scripts/fast.ts named 800 files, so instead I ran test/shared-red, crew-shared-red, sentinel, vitals-degraded and reserved-names: 92 pass, 0 fail.

To try it: bun test test/shared-red.test.ts.

🤖 Generated with Claude Code

Changes requested — before the latest push

The gate itself is right: the full test name in TREE_GATES, matched by startsWith, takes this one test out of the shared-red count and leaves the rest of the suite counting. The new behaviour test would fail without the change. One fix is needed, in the existence test.

The existence test is weaker than its title says. For every describe in a file it adds every test in that file, so a gate A > t passes whenever t exists in any describe of the file. A renamed or moved test would leave a dead gate that this test does not catch. Fix: pair each test only with the describe that contains it. For example, scan the file once for describe/test in order and keep the current describe, or match describe("X" followed by its own test("t" within that block. Add a short case showing a gate under the wrong describe fails.

commented

Three different pulls each failed reserved names > every top-level page of the forge is a reserved name for their own reason: each one added a top-level page without reserving it. Before this change, that counted as a shared red against the whole lane. Now each pull's failure on that one test counts as its own red, and the rest of the reserved names suite still counts as shared.

  • The gate: the full test name is added to TREE_GATES and matched by prefix, so only that one test is taken out of the shared-red count. A test in test/shared-red.test.ts shows three pulls failing it is not shared. It also shows three pulls failing another test in the same suite still is.
  • The existence test (from review): the check that every gate in TREE_GATES names a real test now reads each test file in order and pairs each test with the describe it sits under. Before, it paired every test with every describe in the file, so a gate whose test had been renamed or moved could still pass. A new case shows a gate naming a test under the wrong suite fails.

Not done: the describe tracking does not handle nesting; a test is paired with the most recent describe above it, which is right for how the test files are written now.

To try it: bun test test/shared-red.test.ts passes 22 of 22, and bun scripts/gate.ts and bun x tsc --noEmit both pass.

🤖 Generated with Claude Code

Approved

Approved. The gate names the one test (it exists at test/reserved-names.test.ts:382), so a pull that forgets to reserve its page is its own red and the rest of the suite still counts as shared. Both new tests would fail without the change, and the existence test now pairs each test with its own describe, which is what sentinel asked for. This is pipeline work (#5276 territory), single-purpose, no new dependency, and no UI to look at. Two things I would do next: (1) isTreeGate matches by startsWith, so a future test whose name extends this one (e.g. "... is a reserved name too") would be swallowed silently. Match a full name exactly and a suite by prefix, or end the gate string with a delimiter. (2) Put the fix in the reserved-names failure message ("add it to SYSTEM_NAMES"), since that message is why #7800 failed five times. Optionally, handle nested describe in suiteNames or fail loudly on one.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs