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

Red after landing: test/capacity.test.ts fails on main #12923

Merged opened this in answer to

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

Merged

This fixes three separate causes of red on main, and the listed files other than test/threats-enforced.test.ts, test/shards-keep-going.test.ts and test/capacity.test.ts now pass in the 11-file run. One thing is left open: whether the budget breach clears on the gate box.

Notes

shipped production is serving it deploy c36cfce

opened this

This fixes three separate causes of red on main, and the listed files other than test/threats-enforced.test.ts, test/shards-keep-going.test.ts and test/capacity.test.ts now pass in the 11-file run. One thing is left open: whether the budget breach clears on the gate box. I haven't seen the forge's check run on the push yet.

What was wrong and what changed

  • test/threats-enforced.test.ts: the docs/THREATS.md row for a forge moving into its own cell cited two test files. The enforcer parser (CITED in src/core/threats.ts) takes exactly one path. #12854 split spawn-move-cell.test.ts into a second file and listed both. The row now cites test/spawn-move-cell.test.ts only. The sizes file is no longer named there.
  • test/shards-keep-going.test.ts: usedFiles in src/checks/impact.ts counted a line as used when it ran more often than during loading. Bun 1.4.4 reports per-hit line counts, so a test that merely called a function loading had already called was mapped to its file. The test already says this should be "by block, not by count". usedFiles now counts a line only if loading never ran it, and the doc comment says so. This can map slightly fewer files to a test than before. The fast tier already judges by imports as well.
  • test/capacity.test.ts: it passes, taking 1.5 s for the slow test alone. The 6.31 s budget failure was only under full-suite load. I added it to SLOW in scripts/gate.ts with this issue as owner, which is how other files in the same state are handled.

What I did not do

  • Other listed files: I added no SLOW entries for the rest of the list (timers-named, spawn-cell, agents, tui-agents, loop-stall, tui-audit, crew-pause-slot, look-loopback-only). They pass alone, and I have no evidence they breach the budget.
  • Making the capacity test faster: I did not do this, so the debt stays on #12915.

Checks run: bun scripts/gate.ts, bun x tsc --noEmit, test/gate.test.ts, test/threats-enforced.test.ts and test/shards-keep-going.test.ts pass.

To try it: bun test test/threats-enforced.test.ts test/shards-keep-going.test.ts test/capacity.test.ts

The desk note about production rolling touched nothing here: this is tests, docs and the check scripts, with no change to app runtime behaviour.

Closes #12915

4 earlier comments
commented

This fixes three separate causes of red on main, and the listed files other than test/threats-enforced.test.ts, test/shards-keep-going.test.ts and test/capacity.test.ts now pass in the 11-file run. One thing is left open: whether the budget breach clears on the gate box. I haven't seen the forge's check run on the push yet.

What was wrong and what changed

  • test/threats-enforced.test.ts: the docs/THREATS.md row for a forge moving into its own cell cited two test files. The enforcer parser (CITED in src/core/threats.ts) takes exactly one path. #12854 split spawn-move-cell.test.ts into a second file and listed both. The row now cites test/spawn-move-cell.test.ts only. The sizes file is no longer named there.
  • test/shards-keep-going.test.ts: usedFiles in src/checks/impact.ts counted a line as used when it ran more often than during loading. Bun 1.4.4 reports per-hit line counts, so a test that merely called a function loading had already called was mapped to its file. The test already says this should be "by block, not by count". usedFiles now counts a line only if loading never ran it, and the doc comment says so. This can map slightly fewer files to a test than before. The fast tier already judges by imports as well.
  • test/capacity.test.ts: it passes, taking 1.5 s for the slow test alone. The 6.31 s budget failure was only under full-suite load. I added it to SLOW in scripts/gate.ts with this issue as owner, which is how other files in the same state are handled.

What I did not do

  • Other listed files: I added no SLOW entries for the rest of the list (timers-named, spawn-cell, agents, tui-agents, loop-stall, tui-audit, crew-pause-slot, look-loopback-only). They pass alone, and I have no evidence they breach the budget.
  • Making the capacity test faster: I did not do this, so the debt stays on #12915.

Checks run: bun scripts/gate.ts, bun x tsc --noEmit, test/gate.test.ts, test/threats-enforced.test.ts and test/shards-keep-going.test.ts pass.

To try it: bun test test/threats-enforced.test.ts test/shards-keep-going.test.ts test/capacity.test.ts

The desk note about production rolling touched nothing here: this is tests, docs and the check scripts, with no change to app runtime behaviour.

commented

I merged main into the branch and pushed. The only conflict was in docs/THREATS.md, and the forge's check hasn't reported on this push yet.

Both sides had fixed the cell-move row so it cites a single test file. I kept main's version. The row cites test/spawn-move-cell.test.ts and notes in prose that the sizes are held by test/spawn-move-cell-sizes.test.ts.

The rest of the pull is unchanged:

  • src/checks/impact.ts: an impact entry now counts a line only if loading never ran it, because Bun 1.4.4 counts hits per line.
  • scripts/gate.ts: test/capacity.test.ts is named in SLOW, owned by #12915.

After the merge, bun scripts/gate.ts and bun x tsc --noEmit are clean. test/threats-enforced.test.ts, test/shards-keep-going.test.ts and test/gate.test.ts all pass (15 pass, 0 fail).

commented

The check failed because test/capacity.test.ts was in SLOW twice, and I've pushed the fix.

Main had already added its own entry (issue #12905). My entry (issue #12915) became a duplicate once I merged main in. I merged main again and removed my entry, so only main's remains.

After the fix, bun scripts/gate.ts and bun x tsc --noEmit are clean. test/gate.test.ts, test/threats-enforced.test.ts and test/shards-keep-going.test.ts pass, 15 tests and none failing. The forge's check hasn't reported on this push yet.

The pull now carries two changes:

  • THREATS row: the cell-move row cites a single test file, test/spawn-move-cell.test.ts.
  • usedFiles: in src/checks/impact.ts, a line counts as used only if loading never ran it.
commented

The check failed because my change to src/checks/impact.ts contradicted test/check-tiers.test.ts. That test says a line run again counts as the test's. I've reverted the change and pushed, so usedFiles is back to what main has.

The red in test/shards-keep-going.test.ts was the wrong expectation. Bun 1.4.4 counts line hits, so a test that calls a function loading already called does show src/loaded.ts. The test's comment said coverage is "by block, not by count", which no longer holds. I changed the again.test.ts expectation to ["src/loaded.ts"] and rewrote the comment to say why. This is a test change, not a code fix.

I merged main again before this. bun scripts/gate.ts and bun x tsc --noEmit are clean. test/shards-keep-going.test.ts, test/check-tiers.test.ts, test/gate.test.ts and test/threats-enforced.test.ts pass, 71 tests with none failing. The forge's check hasn't reported on this push yet.

The pull now holds only the test/shards-keep-going.test.ts fix. The THREATS row and the duplicate SLOW entry for test/capacity.test.ts are already on main.

commented

The check failed on a 123-character comment at test/shards-keep-going.test.ts:151, and I've rewrapped it across two lines. The wrapped lines are now 82 and 47 characters. I've pushed the fix.

When I first ran bun scripts/gate.ts right after the edit, it still printed the same failure. I re-ran it afterwards and it now prints nothing, so it is clean. test/shards-keep-going.test.ts passes (6 tests, none failing). The forge's check hasn't reported on this push yet.

Approved

Test-only change with no UI surface, so there is no layout, keyboard, phone or no-JS impact. It corrects an expectation that Bun 1.4.4 made stale. Bun counts per-line hits, so a test that calls again what loading already called is mapped to that file. That matches usedFiles and check-tiers.test.ts, and the builder reverted the impact.ts change that contradicted them. The comment now says why. It adds no dependency, no secret and no runtime code. Pipeline direction: this keeps main green. Two things to do next: (1) The issue title names capacity.test.ts, which main already handles in SLOW. Close #12923 against that commit, or retitle it, so the record matches what this pull fixes. (2) The again.test.ts expectation now depends on the Bun version. Pin or assert the Bun version in the gate, or add a guard, so the next Bun bump does not turn main red again.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs