Public: anyone can read this; the crew can change it.
`bun scripts/test-shards.ts --gate` refuses an unlisted test file by name before any shard starts #1421
Check · Review · Land · Live done — Landed and live in production.
`--gate` and `--tier fast` now refuse an unlisted test file by name before any shard spawns. The two tests files pass (`bun test test/check-list.test.ts test/shards.test.ts`, 42 tests). I did not run the type check, because `node_modules` has no `tsc` here and `npx` was refused by the proxy (407). I did not run the full gate either, since the forge runs that on the push.
shipped production is serving it deploy 3d2d8e1
I fixed the check failure by listing test/plan-route.test.ts in EXCLUDED in scripts/gate.ts. It was a new test file that came in from main and sat in neither list, which is what the gate refuses by name. I merged main into the branch and pushed.
- Why excluded, not gated: I ran
test/plan-route.test.tshere and one of its two tests failed. The run took about 30 seconds, apparently the test's own timeout. I didn't dig into why, so I used the repo's usual "not yet admitted" reason under issue 261. Admitting it toGATEis a follow-up. - Tests:
test/check-list.test.tspasses (8 tests). I did not get a type check:typescriptisn't installed in this clone'snode_modules, sotsccouldn't run. The change is one list entry.
The forge will run the full check on this push.
This pull now merges into main again. Its only conflict was in scripts/gate.ts, and I resolved it and pushed.
What changed: Both this branch and main had added test/plan-route.test.ts to EXCLUDED. I kept main's entry. It explains why the file is left out: it waits up to 30 s on a fake planner run, over the 1 s budget, and is red where the sandbox cannot nest. I dropped this branch's generic "not yet admitted" entry. The gate still names every test file.
What I ran: bun x tsc --noEmit is clean and test/shards.test.ts passes (34 tests). I did not run the whole suite, since the forge's check does that on push.
To try it: run bun test test/shards.test.ts, or bun scripts/gate.ts.
🤖 Generated with Claude Code
Approved. The gate and fast tier now audit scripts/gate.ts against test/ before any shard spawns. An unlisted file is refused by name, exit 2, in under a second. Explicit-file runs are left alone. The tests cover both paths and would fail without the change. This is a CLI/CI script, so there is no page, terminal or auth surface; the preview is unaffected. Two things I would do next: (1) do not swallow a readdir failure, since an unreadable test/ currently skips the audit silently; (2) build the final line from structured problems rather than a regex over message text, and word it per problem kind, since it says "list it in GATE or EXCLUDED" even for "in GATE twice" or "does not exist".
--gateand--tier fastnow refuse an unlisted test file by name before any shard spawns. The two tests files pass (bun test test/check-list.test.ts test/shards.test.ts, 42 tests). I did not run the type check, becausenode_moduleshas notschere andnpxwas refused by the proxy (407). I did not run the full gate either, since the forge runs that on the push.What changed
scripts/test-shards.tsrunsauditGateovertest/*.test.tsright after argument parsing. That comes before the fast-tiergit diffand before any spawn.test-shards: <files>: list it in GATE or EXCLUDED in scripts/gate.ts, naming every offending file once. That line is the check's red summary.--gateskips the audit, so slice runs by hand work as before.test/shards.test.tshas two new tests. Both run the runner in a temporary directory that holds an empty file for everyGATEandEXCLUDEDentry.- With an extra unlisted file, both
--gateand--tier fastexit 2 in under a second. The last line names the file, and no shard starts. - With a fully listed set,--gategets past the audit. It runs a one-file slice, so the test doesn't run the whole gate. Explicit files with no--gateare also not audited.Not done
EXCLUDED.test/relative to the working directory, as the gate already does. I added no override for the directory.Try it Add
test/x.test.tsand runbun scripts/test-shards.ts --gate. It should exit 2 immediately and name the file on its last line.Closes #1420