Public: anyone can read this; the crew can change it.
A pull's test selection says why it chose each test, and a changed doc no longer blinds it to the impact map #14940
Check · Review · Land · Live done — Landed and live in production.
A pull's check log now says why it chose each test. A pull that changes a doc like docs/THREATS.md no longer turns its selection blind. What changed The log says why (src/checks/tiers.ts).
shipped production is serving it deploy 6b7374e
A pull's check log now says why it chose each test. A pull that changes a doc like docs/THREATS.md no longer turns its selection blind.
What changed
- The log says why (
src/checks/tiers.ts). Under the plan line,test-shards.tsandfast.tsprint a count per reason, for exampleby reason: 40 quick, 12 executes, 11 repo-wide rule(reasonLine). When the plan is blind, they also name the files that made it blind and why, for exampleblind (every quick test, guesses for every test) by static/app.js (outside src/ and test/), src/x.ts (no test executes it)(blindLine).FastPlannow carriesblindBy, which holds those files. - Where the width came from. Blind mode adds every test under 1 s, and that rule is what reaches about 2,000 files. The import guess was already limited to the files the map can't see.
- A doc is not blind (
src/checks/scans.ts). The newdocReadersfinds who can read a changed.mdunderdocs/or at the root, the same wayscriptReadersdoes for scripts. That is the tests that name it, directly or through a helper, plus thesrc/files that name it or list its folder (src/view/docs.ts,src/checks/resilience.ts). The impact map then picks the tests that run thosesrc/files, with the reasonreads docs/THREATS.md through src/view/docs.ts. - What still blinds. A doc stays blind only if the suite's preload reads it, or a manifest, chart or the Dockerfile names it. On this tree that is
AGENTS.md(named bytemplates/app-template.json),docs/DESIGN.md(copied by the Dockerfile) andREADME.md. The log names each of them. - Shared code.
scriptReadersanddocReadersnow share one closure (besideReaders). Each round only checks names added since the last round, which took README.md from 25 s to 6 s on the real tree.isDoclives inimpact.tssotiers.tsandscans.tsdon't import each other. - Files the suite's loading runs. They are still guessed by each test's imports, as #12178 requires, but they no longer add every quick test.
What I didn't do
- Step 3 is now #14941. That is the
Bun.Transpiler.scanImportsparser and the loggedbun test --changedcomparison, which needs two weeks of real pulls. #14845 now waits for it. - The 10% target is only shown on a test fixture. The new test in
test/check-tiers.test.tsgives exactly the same selection plus the doc's readers, and no quick tests. I couldn't measure the real pull (onesrc/crew/file plus THREATS.md) because the impact map isn't in the sandbox. - The before/after median count isn't posted. It needs check logs from after this lands. The
by reasonline makes it readable from any log. - Scripts still blind. A changed script whose readers are known still turns the plan blind, and the log now says so. Treating it like a doc is the obvious next step; I left it out of scope.
Tests
- Every existing test passes unchanged, including the #12178 loading test.
- New fixtures in
test/check-script-readers.test.tsandtest/check-tiers.test.ts. A whole-treedocReaderstest took 3 s, over the per-test budget, so I dropped it. bun x tsc --noEmitpasses, andscripts/gate.ts --fixreported its comment rewraps, which are committed.scripts/fast.tsexits 2 for this diff because it touches scripts, so I picked the files myself: 17 files, 293 pass, 0 fail. They are the tier and reader suites, scripts-fast, tree-scans, allow-lists, unused-exports, changed-compare, kept, the shards suites, docs-link and the rule tests.keep_planandestimatewere not available to me, so there is no plan on the issue and no recorded estimate.
To try it: stage any docs/features/*.md change and run bun scripts/fast.ts --why. Stderr ends with the by reason: line, and the reads docs/… reasons appear on stdout.
🤖 Generated with Claude Code
Pipeline tooling only: no page, route, write or terminal surface changed, so the security, both-doors and README items do not apply. The change does what #14845 asked. The log says why each test was chosen (reasonLine, blindLine), and a doc with bounded readers no longer blinds the plan. Each new behaviour has a fixture test, docs/DEVELOP.md carries the how-to, there is no new dependency and I found no dead code. The two things I would do next: (1) treat a changed script whose readers are known like a doc, as the pull says; (2) test that scripts/fast.ts and scripts/test-shards.ts actually print the by-reason and blind lines, since only the tiers functions are covered now.
A pull's check log now says why it chose each test. A pull that changes a doc like
docs/THREATS.mdno longer turns its selection blind.What changed
src/checks/tiers.ts). Under the plan line,test-shards.tsandfast.tsprint a count per reason, for exampleby reason: 40 quick, 12 executes, 11 repo-wide rule(reasonLine). When the plan is blind, they also name the files that made it blind and why, for exampleblind (every quick test, guesses for every test) by static/app.js (outside src/ and test/), src/x.ts (no test executes it)(blindLine).FastPlannow carriesblindBy, which holds those files.src/checks/scans.ts). The newdocReadersfinds who can read a changed.mdunderdocs/or at the root, the same wayscriptReadersdoes for scripts. That is the tests that name it, directly or through a helper, plus thesrc/files that name it or list its folder (src/view/docs.ts,src/checks/resilience.ts). The impact map then picks the tests that run thosesrc/files, with the reasonreads docs/THREATS.md through src/view/docs.ts.AGENTS.md(named bytemplates/app-template.json),docs/DESIGN.md(copied by the Dockerfile) andREADME.md. The log names each of them.scriptReadersanddocReadersnow share one closure (besideReaders). Each round only checks names added since the last round, which took README.md from 25 s to 6 s on the real tree.isDoclives inimpact.tssotiers.tsandscans.tsdon't import each other.What I didn't do
Bun.Transpiler.scanImportsparser and the loggedbun test --changedcomparison, which needs two weeks of real pulls. #14845 now waits for it.test/check-tiers.test.tsgives exactly the same selection plus the doc's readers, and no quick tests. I couldn't measure the real pull (onesrc/crew/file plus THREATS.md) because the impact map isn't in the sandbox.by reasonline makes it readable from any log.Tests
test/check-script-readers.test.tsandtest/check-tiers.test.ts. A whole-treedocReaderstest took 3 s, over the per-test budget, so I dropped it.bun x tsc --noEmitpasses, andscripts/gate.ts --fixreported its comment rewraps, which are committed.scripts/fast.tsexits 2 for this diff because it touches scripts, so I picked the files myself: 17 files, 293 pass, 0 fail. They are the tier and reader suites, scripts-fast, tree-scans, allow-lists, unused-exports, changed-compare, kept, the shards suites, docs-link and the rule tests.keep_planandestimatewere not available to me, so there is no plan on the issue and no recorded estimate.To try it: stage any
docs/features/*.mdchange and runbun scripts/fast.ts --why. Stderr ends with theby reason:line, and thereads docs/…reasons appear on stdout.🤖 Generated with Claude Code
Closes #14845