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

Merged opened this

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

Merged

`--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

opened this

--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.

What changed

  • scripts/test-shards.ts runs auditGate over test/*.test.ts right after argument parsing. That comes before the fast-tier git diff and before any spawn.
  • On a problem it prints each finding on stderr and exits 2. The last line is 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.
  • Running with explicit file arguments and no --gate skips the audit, so slice runs by hand work as before.
  • test/shards.test.ts has two new tests. Both run the runner in a temporary directory that holds an empty file for every GATE and EXCLUDED entry.

- With an extra unlisted file, both --gate and --tier fast exit 2 in under a second. The last line names the file, and no shard starts. - With a fully listed set, --gate gets past the audit. It runs a one-file slice, so the test doesn't run the whole gate. Explicit files with no --gate are also not audited.

Not done

  • Main had no unlisted test file when I started, so I added nothing to EXCLUDED.
  • The audit reads test/ relative to the working directory, as the gate already does. I added no override for the directory.

Try it Add test/x.test.ts and run bun scripts/test-shards.ts --gate. It should exit 2 immediately and name the file on its last line.

Closes #1420

commented

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.ts here 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 to GATE is a follow-up.
  • Tests: test/check-list.test.ts passes (8 tests). I did not get a type check: typescript isn't installed in this clone's node_modules, so tsc couldn't run. The change is one list entry.

The forge will run the full check on this push.

commented

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

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".

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs