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

A test that only reads the tree never makes a lane's red: OpenAPI coverage, MCP docs, src imports and the README gates join TREE_GATES #8189

Merged opened this

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

Merged

Eight tests that only read the source tree no longer count as the lane's red. If one fails because a pull added a route without an OpenAPI row, a tool without a docs/MCP.md row, an import into `src/` from outside it, or a README change past its limits, the failure stays that pull's own. Three such pulls no longer add up to a shared test, a degraded cause or a machine-load finding (#8140 was one).

shipped production is serving it deploy 4c3a9d3

opened this

Eight tests that only read the source tree no longer count as the lane's red. If one fails because a pull added a route without an OpenAPI row, a tool without a docs/MCP.md row, an import into src/ from outside it, or a README change past its limits, the failure stays that pull's own. Three such pulls no longer add up to a shared test, a degraded cause or a machine-load finding (#8140 was one).

What changed

  • src/checks/shared_red.ts: TREE_GATES now names, each by its exact full name:

- the three tests in test/openapi-coverage.test.ts - both tests in test/mcp-docs.test.ts - "nothing under src/ imports from outside src/ (scripts/, test/, …)" - both README tests the issue asks for: "README.md stays under 80 KB" and "every docs/ link in README.md resolves"

Each group has a one-line comment saying why it is a tree gate.

  • isTreeGate now matches exactly: an entry is only a prefix when it ends in " > " (a whole suite). Any other entry must equal the failing test's name. Without this, a full-name entry would also hide any longer test name that starts with it, which is the over-broad match the issue warns about. The existing "reserved names > …" entry is a full name, so it now matches exactly too.
  • test/shared-red.test.ts:

- A new test: three pulls failing the OpenAPI-coverage test make no shared test and no shared: degraded cause in vitals. It fails without the new entries. The same test checks that a longer name beginning with that test's name is still treated as shared. - The existence guard's suiteNames now also records top-level tests by their bare name. Renaming any of the new tests therefore fails "every tree gate names a suite, or a test in it, that exists". A small test pins how top-level and nested tests are named.

What to look at: the exact-match rule in isTreeGate, and the indentation-based top-level check in suiteNames. It treats a test( at column 0 as top-level.

Not done: the third README test (every top-level docs/*.md is linked from …) stays out because the issue names only two.

Checks: bun scripts/gate.ts and bun x tsc --noEmit pass. bun test test/shared-red.test.ts test/mcp-size.test.ts passes: 28 tests, 0 failures. No MCP tool changed.

🤖 Generated with Claude Code

Closes #8184

commented

Eight tests that only read the source tree no longer count as the lane's red. If one fails because a pull added a route without an OpenAPI row, a tool without a docs/MCP.md row, an import into src/ from outside it, or a README change past its limits, the failure stays that pull's own. Three such pulls no longer add up to a shared test, a degraded cause or a machine-load finding (#8140 was one).

What changed

  • src/checks/shared_red.ts: TREE_GATES now names, each by its exact full name:

- the three tests in test/openapi-coverage.test.ts - both tests in test/mcp-docs.test.ts - "nothing under src/ imports from outside src/ (scripts/, test/, …)" - both README tests the issue asks for: "README.md stays under 80 KB" and "every docs/ link in README.md resolves"

Each group has a one-line comment saying why it is a tree gate.

  • isTreeGate now matches exactly: an entry is only a prefix when it ends in " > " (a whole suite). Any other entry must equal the failing test's name. Without this, a full-name entry would also hide any longer test name that starts with it, which is the over-broad match the issue warns about. The existing "reserved names > …" entry is a full name, so it now matches exactly too.
  • test/shared-red.test.ts:

- A new test: three pulls failing the OpenAPI-coverage test make no shared test and no shared: degraded cause in vitals. It fails without the new entries. The same test checks that a longer name beginning with that test's name is still treated as shared. - The existence guard's suiteNames now also records top-level tests by their bare name. Renaming any of the new tests therefore fails "every tree gate names a suite, or a test in it, that exists". A small test pins how top-level and nested tests are named.

What to look at: the exact-match rule in isTreeGate, and the indentation-based top-level check in suiteNames. It treats a test( at column 0 as top-level.

Not done: the third README test (every top-level docs/*.md is linked from …) stays out because the issue names only two.

Checks: bun scripts/gate.ts and bun x tsc --noEmit pass. bun test test/shared-red.test.ts test/mcp-size.test.ts passes: 28 tests, 0 failures. No MCP tool changed.

🤖 Generated with Claude Code

commented

Eight tests that only read the source tree no longer count as the lane's red. If one fails because a pull added a route without an OpenAPI row, a tool without a docs/MCP.md row, an import into src/ from outside it, or a README change past its limits, the failure stays that pull's own. Three such pulls no longer add up to a shared test, a degraded cause or a machine-load finding (#8140 was one).

What changed

  • src/checks/shared_red.ts: TREE_GATES now names, each by its exact full name:

- the three tests in test/openapi-coverage.test.ts - both tests in test/mcp-docs.test.ts - "nothing under src/ imports from outside src/ (scripts/, test/, …)" - both README tests the issue asks for: "README.md stays under 80 KB" and "every docs/ link in README.md resolves"

Each group has a one-line comment saying why it is a tree gate.

  • isTreeGate now matches exactly: an entry is only a prefix when it ends in " > " (a whole suite). Any other entry must equal the failing test's name. Without this, a full-name entry would also hide any longer test name that starts with it, which is the over-broad match the issue warns about. The existing "reserved names > …" entry is a full name, so it now matches exactly too.
  • test/shared-red.test.ts:

- A new test: three pulls failing the OpenAPI-coverage test make no shared test and no shared: degraded cause in vitals. It fails without the new entries. The same test checks that a longer name beginning with that test's name is still treated as shared. - The existence guard's suiteNames now records every top-level test (a test( at column 0) by its bare name, wherever it sits in the file. Renaming any of the new tests therefore fails "every tree gate names a suite, or a test in it, that exists". A small test pins how top-level and nested tests are named.

Merge with main: main had separately added the OpenAPI-coverage gate and a "the gathered routes > the index is current" gate (#8140). The merge keeps both. The index gate sits beside the new entries and is covered by main's test, which is folded into the new one. Main's version of suiteNames named top-level tests only when they came before the first describe. I kept the column-0 version above instead, and main's own case for it still passes.

What to look at: the exact-match rule in isTreeGate, and the column-0 top-level check in suiteNames.

Not done: the third README test (every top-level docs/*.md is linked from …) stays out because the issue names only two.

Checks, after the merge: bun scripts/gate.ts and bun x tsc --noEmit pass. bun test test/shared-red.test.ts test/openapi-coverage.test.ts test/mcp-size.test.ts passes: 31 tests, 0 failures. No MCP tool changed.

🤖 Generated with Claude Code

Approved

Approved. All eight new TREE_GATES names match real top-level tests (checked in the tree). The exact-match rule in isTreeGate is right, and the test would fail without the entries. This changes server-side classification only, so there is no UI to review. Next, two things: (1) the third README test (top-level docs/*.md linked) is also a tree-only read, so add it when its issue asks; (2) suiteNames treats column-0 test( as top-level, which is fragile for a nested test written unindented, so consider a comment or a check that the gate names resolve in the real files.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs