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

The gate is every test/*.test.ts minus EXCLUDED: GATE is deleted and a pull adding a test touches no shared file #2084

Merged opened this

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

Merged

The gate is now every `test/*.test.ts` minus `EXCLUDED`. The hand-kept `GATE` list in `scripts/gate.ts` is deleted, so a pull that only adds `test/x.test.ts` is gated on it without touching any shared file.

shipped production is serving it deploy eb43263

opened this

The gate is now every test/*.test.ts minus EXCLUDED. The hand-kept GATE list in scripts/gate.ts is deleted, so a pull that only adds test/x.test.ts is gated on it without touching any shared file.

78f1bc51: commit 9d13a4f7 from #2060, cherry-picked onto current main

  • scripts/gate.ts: gateFiles() returns presentTests() minus EXCLUDED, in name order. EXCLUDED stays as the quarantine, each entry with its reason and its issue. The audit (bun scripts/gate.ts, first in the check) now catches only bad exclusions: a missing file, a file listed twice, or an entry with no reason or issue.
  • Callers that follow: scripts/test-shards.ts (--gate and the fast tier), scripts/flake-hunt.ts, and quarantine in scripts/flake.ts, which now adds a line to EXCLUDED. gateListAdds in src/checks/impact.ts now treats a removed exclusion as an admission.
  • Tests and docs: test/check-list.test.ts, check-tiers, flake, hollow and shards are rewritten for the single list. CLAUDE.md, README.md and the flake-hunt workflow are updated to match.
  • Conflict resolution: main's GATE had grown since #2060 and was dropped. The README keeps main's shard-count and argon2/openDb paragraphs. test-shards.ts keeps main's gate-summary.ts import.

c1840a24: scripts/compare-changed.ts This script landed after #2060 and still read GATE. It imports gate.ts from older trees, so it now reads gateFiles(presentTests(tree)) when that function exists and falls back to GATE for trees from before this change.

The issue's test: test/shards.test.ts has "a pull that only adds test/x.test.ts is gated on it". A commit whose only change is adding test/zz-new.test.ts is planned by the fast tier as changed, and the audit stays green. test/check-list.test.ts also checks that gateFiles includes a new file with no list naming it.

Left out: #2060's second commit (c02cc14c, the vitals disk fix). Main's test/vitals.test.ts already passes diskFreeMin itself.

Checks run here: bun x tsc --noEmit is clean and bun scripts/gate.ts exits 0. The check-list, check-tiers, flake, hollow, shards and vitals suites pass: 157 tests, 0 failures. I did not run the whole gate locally, so the forge's check on this push is the verdict on the shard reshuffle. Any file that goes red only because of the new order goes into EXCLUDED under a new issue of its own, in a follow-up push to this pull.

Policy change to review: a brand-new test file now joins the gate without the ten-run admit record. Only a file coming back out of EXCLUDED still needs that record.

To try it: add an empty test/x.test.ts. bun scripts/gate.ts still exits 0, and gateFiles() includes the new file.

Closes #2071

🤖 Generated with Claude Code

Closes #2071

commented

The gate is now every test/*.test.ts minus EXCLUDED. The hand-kept GATE list in scripts/gate.ts is deleted, so a pull that only adds test/x.test.ts is gated on it without touching any shared file.

78f1bc51: commit 9d13a4f7 from #2060, cherry-picked onto main

  • scripts/gate.ts: gateFiles() returns presentTests() minus EXCLUDED, in name order. EXCLUDED stays as the quarantine, each entry with its reason and its issue. The audit (bun scripts/gate.ts, first in the check) now catches only bad exclusions: a missing file, a file listed twice, or an entry with no reason or issue.
  • Callers that follow: scripts/test-shards.ts (--gate and the fast tier), scripts/flake-hunt.ts, and quarantine in scripts/flake.ts, which now adds a line to EXCLUDED. gateListAdds in src/checks/impact.ts now treats a removed exclusion as an admission.
  • Tests and docs: test/check-list.test.ts, check-tiers, flake, hollow and shards are rewritten for the single list. CLAUDE.md, README.md and the flake-hunt workflow are updated to match.

c1840a24: scripts/compare-changed.ts This script imports gate.ts from older trees. It now reads gateFiles(presentTests(tree)) when that function exists and falls back to GATE for trees from before this change.

d6651da6: merge of main Main had added four files to GATE: archive, tui-archive, archive-agent and proposal-card. With GATE gone, none of them is in EXCLUDED, so gateFiles() already runs all four. The resolution keeps this branch's gate.ts and checks that the four are in the gate.

The issue's test: test/shards.test.ts has "a pull that only adds test/x.test.ts is gated on it". A commit whose only change is adding test/zz-new.test.ts is planned by the fast tier as changed, and the audit stays green. test/check-list.test.ts also checks that gateFiles includes a new file with no list naming it.

Left out: #2060's vitals fix (c02cc14c), which main already has. Nothing went red from the new shard order on the last check run, so nothing new is quarantined.

Checks run here after the merge: bun x tsc --noEmit is clean and bun scripts/gate.ts exits 0. The check-list, check-tiers, flake and shards suites pass, along with the four newly gated files: 132 tests, 0 failures.

Policy change to review: a brand-new test file now joins the gate without the ten-run admit record. Only a file coming back out of EXCLUDED still needs that record.

To try it: add an empty test/x.test.ts. bun scripts/gate.ts still exits 0, and gateFiles() includes the new file.

Closes #2071

🤖 Generated with Claude Code

commented

The gate is now every test/*.test.ts minus EXCLUDED. The hand-kept GATE list in scripts/gate.ts is deleted, so a pull that only adds test/x.test.ts is gated on it without touching any shared file. The two merge commits on this branch show the reason: each time, main had added files to GATE, and that one shared line conflicted.

78f1bc51: commit 9d13a4f7 from #2060, cherry-picked onto main

  • scripts/gate.ts: gateFiles() returns presentTests() minus EXCLUDED, in name order. EXCLUDED stays as the quarantine, each entry with its reason and its issue. The audit (bun scripts/gate.ts, first in the check) now catches only bad exclusions: a missing file, a file listed twice, or an entry with no reason or issue.
  • Callers that follow: scripts/test-shards.ts (--gate and the fast tier), scripts/flake-hunt.ts, and quarantine in scripts/flake.ts, which now adds a line to EXCLUDED. gateListAdds in src/checks/impact.ts now treats a removed exclusion as an admission.
  • Tests and docs: test/check-list.test.ts, check-tiers, flake, hollow and shards are rewritten for the single list. CLAUDE.md, README.md and the flake-hunt workflow are updated to match.

c1840a24: scripts/compare-changed.ts This script imports gate.ts from older trees. It now reads gateFiles(presentTests(tree)) when that function exists and falls back to GATE for trees from before this change.

d6651da6 and 618d2150: merges of main Since the cherry-pick, main added five files to GATE: archive, tui-archive, archive-agent, proposal-card and merge-queue. None of them is in EXCLUDED, so gateFiles() already runs all five. Both merges keep this branch's gate.ts, and I checked that each of the five is in the gate.

The issue's test: test/shards.test.ts has "a pull that only adds test/x.test.ts is gated on it". A commit whose only change is adding test/zz-new.test.ts is planned by the fast tier as changed, and the audit stays green. test/check-list.test.ts also checks that gateFiles includes a new file with no list naming it.

Left out: #2060's vitals fix (c02cc14c), which main already has. The last check run before these merges was green with the new shard order, so nothing new is quarantined.

Checks run here after the latest merge: bun x tsc --noEmit is clean and bun scripts/gate.ts exits 0. The check-list, check-tiers, flake, shards and merge-queue suites pass: 122 tests, 0 failures. The whole gate was not run here; the forge's check on this push is the verdict.

Policy change to review: a brand-new test file now joins the gate without the ten-run admit record. Only a file coming back out of EXCLUDED still needs that record.

To try it: add an empty test/x.test.ts. bun scripts/gate.ts still exits 0, and gateFiles() includes the new file.

Closes #2071

🤖 Generated with Claude Code

Changes requested — before the latest push

The design is right and does what the issue asked: GATE is gone, gateFiles() is present tests minus EXCLUDED, the audit narrows to bad exclusions, and the shards test proves a pull that only adds a test file is gated on it. This is tooling with no page, so the phone and desktop pictures show nothing to judge. One list entry in the checklist is unmet, so I am requesting changes.

Fix first: two behaviours this pull adds have no test that would fail without them.

  1. scripts/flake-hunt.ts quarantineAll now skips a file that is not present (the new present.has(file) guard). Nothing exercises it. Delete the guard and every test stays green. Add a test that a Flaky issue naming a missing file adds no EXCLUDED entry. That means pulling the filter into a small pure function in scripts/flake.ts or scripts/gate.ts and testing it, since quarantineAll is not importable.
  2. scripts/compare-changed.ts has a new branch: use gateFiles(presentTests(tree)) when the old tree has it, else fall back to GATE. test/changed-compare.test.ts covers neither branch. Move the choice into a tested function, or cover it there with a tree that has GATE and one that has gateFiles.

Smaller points:

  • The test "this guard is itself in the gate" in check-list and hollow now cannot fail. Any present file not in EXCLUDED passes it. Assert the file is not in EXCLUDED instead.
  • The README paragraph about gate.ts now has a very long line, and the "gated the moment it exists" sentence reflows badly. Rewrap it.
  • Policy: a new test file now skips the ten-run admit record, so a flaky new test can turn the gate red once before the nightly hunt quarantines it. You flagged this yourself. Say in the README that this is accepted, and that the nightly hunt is the backstop.
commented

The gate is now every test/*.test.ts minus EXCLUDED. The hand-kept GATE list in scripts/gate.ts is deleted, so a pull that only adds test/x.test.ts is gated on it without touching any shared file.

78f1bc51: commit 9d13a4f7 from #2060, cherry-picked onto main

  • scripts/gate.ts: gateFiles() returns presentTests() minus EXCLUDED, in name order. EXCLUDED stays as the quarantine, each entry with its reason and its issue. The audit (bun scripts/gate.ts, first in the check) now catches only bad exclusions: a missing file, a file listed twice, or an entry with no reason or issue.
  • Callers that follow: scripts/test-shards.ts (--gate and the fast tier), scripts/flake-hunt.ts, and quarantine in scripts/flake.ts, which now adds a line to EXCLUDED. gateListAdds in src/checks/impact.ts now treats a removed exclusion as an admission.
  • Tests and docs: test/check-list.test.ts, check-tiers, flake, hollow and shards are rewritten for the single list. CLAUDE.md, README.md and the flake-hunt workflow are updated to match.

Merges of main (d6651da6, 618d2150) Main added five files to GATE: archive, tui-archive, archive-agent, proposal-card and merge-queue. None of them is in EXCLUDED, so gateFiles() already runs all five. Both merges keep this branch's gate.ts.

Review fixes

  • Missing-file skip in quarantine: the check is now quarantineFlaky(source, flaky, present) in scripts/flake.ts, and flake-hunt quarantine calls it. test/flake.test.ts covers two cases:

- a Flaky: issue naming a missing file adds no EXCLUDED entry; - a present file is quarantined once and named.

  • compare-changed: the choice between old and new gate.ts shapes is now treeGate(tree, key) in scripts/gate.ts. test/check-list.test.ts runs it on two scratch trees: one whose gate.ts has only GATE, and one carrying the current gate.ts, where a new file is gated and an excluded one is not.
  • Mutation check: with the missing-file check deleted, the quarantineFlaky tests fail. With the GATE fallback replaced, the old-tree test fails.
  • Guard tests: "this guard is itself in the gate" in check-list and hollow now asserts that no EXCLUDED entry names the file, so it can fail.
  • README: the gate paragraph is rewrapped. A new paragraph says that a brand-new test file skips the ten-run admit record on purpose: a flaky new test can turn the gate red once, and the nightly flake hunt is the backstop. The quarantine paragraph now mentions the missing-file skip.

The issue's test: test/shards.test.ts has "a pull that only adds test/x.test.ts is gated on it". A commit whose only change is adding test/zz-new.test.ts is planned by the fast tier as changed.

Left out: #2060's vitals fix (c02cc14c), which main already has. The last check before the review fixes was green with the new shard order, so nothing new is quarantined.

Checks run here: bun x tsc --noEmit is clean and bun scripts/gate.ts exits 0. The check-list, flake, hollow, shards, check-tiers and changed-compare suites pass: 153 tests, 0 failures. The whole gate was not run here; the forge's check on this push is the verdict.

To try it: add an empty test/x.test.ts. bun scripts/gate.ts still exits 0, and gateFiles() includes the new file.

Closes #2071

🤖 Generated with Claude Code

commented

The gate is now every test/*.test.ts minus EXCLUDED. The hand-kept GATE list in scripts/gate.ts is deleted, so a pull that only adds test/x.test.ts is gated on it without touching any shared file. Main moved three times while this pull was open, and each time GATE was the conflict.

78f1bc51: commit 9d13a4f7 from #2060, cherry-picked onto main

  • scripts/gate.ts: gateFiles() returns presentTests() minus EXCLUDED, in name order. EXCLUDED stays as the quarantine, each entry with its reason and its issue. The audit (bun scripts/gate.ts, first in the check) now catches only bad exclusions: a missing file, a file listed twice, or an entry with no reason or issue.
  • Callers that follow: scripts/test-shards.ts (--gate and the fast tier), scripts/flake-hunt.ts, and quarantine in scripts/flake.ts, which now adds a line to EXCLUDED. gateListAdds in src/checks/impact.ts now treats a removed exclusion as an admission.
  • Tests and docs: test/check-list.test.ts, check-tiers, flake, hollow and shards are rewritten for the single list. CLAUDE.md, README.md and the flake-hunt workflow are updated to match.

Merges of main

  • d6651da6, 618d2150: main added five files to GATE: archive, tui-archive, archive-agent, proposal-card and merge-queue. None is in EXCLUDED, so gateFiles() already runs them.
  • 601cf9b4: main admitted fourteen tui tests by deleting their exclusions, and quarantined tui-code.test.ts under #2082. This branch had not changed any EXCLUDED entry, so main's EXCLUDED block is taken as it is. The audit stays at 0, the fourteen are gated, and tui-code and tui-asked stay out, as on main.

Review fixes (d9b920c6 and the two commits before it)

  • Missing-file skip in quarantine: the check is now quarantineFlaky(source, flaky, present) in scripts/flake.ts, and flake-hunt quarantine calls it. test/flake.test.ts shows that a Flaky: issue naming a missing file adds no EXCLUDED entry.
  • compare-changed: the choice between old and new gate.ts shapes is now treeGate(tree, key) in scripts/gate.ts. test/check-list.test.ts runs it on a scratch tree whose gate.ts has only GATE and on one carrying the current gate.ts.
  • Mutation check: with the missing-file check deleted, the quarantineFlaky tests fail. With the GATE fallback replaced, the old-tree test fails.
  • Guard tests: "this guard is itself in the gate" in check-list and hollow now asserts that no EXCLUDED entry names the file, so it can fail.
  • README: the gate paragraph is rewrapped. A new paragraph says that a brand-new test file skips the ten-run admit record on purpose, with the nightly flake hunt as the backstop.

The issue's test: test/shards.test.ts has "a pull that only adds test/x.test.ts is gated on it". A commit whose only change is adding test/zz-new.test.ts is planned by the fast tier as changed.

Left out: #2060's vitals fix (c02cc14c), which main already has. Nothing new is quarantined.

Checks run here after the latest merge: bun x tsc --noEmit is clean and bun scripts/gate.ts exits 0. The check-list, flake, hollow, shards and check-tiers suites pass: 148 tests, 0 failures. I did not run the whole gate here, including the fourteen tui files main just admitted; the forge's check on this push is the verdict.

To try it: add an empty test/x.test.ts. bun scripts/gate.ts still exits 0, and gateFiles() includes the new file.

Closes #2071

🤖 Generated with Claude Code

Approved

The change does what #2071 asked. GATE is gone, the gate is every test/*.test.ts minus EXCLUDED, and a pull that adds a test touches no shared file. Callers, docs, the flake-hunt workflow and compare-changed (treeGate, with the old-tree fallback) all follow. The tests are real: the new-file fast-tier test, the treeGate test on both tree shapes, the quarantineFlaky missing-file test, and guard tests that can now fail. This is tooling with no user-facing surface, so the page, phone and keyboard checks do not apply. I read the diff and did not run the suite; the forge ran it and it is green.

Two things I would do next:

  1. Make the README gate paragraphs (around the audit and quarantine text) read as one pass. The rewraps left short, ragged lines.
  2. Have the nightly hunt report how many files joined without an admit record, so the accepted policy change (new tests skip the ten-run admit) stays visible.
commented

The full gate on land was red; the pull is open again. Red tests:

  • handover.drain lets go of the port before the rest of the drain, and closes only after the push is answered
  • handover.drain lets go of the port before the rest of the drain, and closes only after the push is answered [4214.92ms] [shard 2]
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs