Public: anyone can read this; the crew can change it.
Move the accessors out of checks/service.ts (checksFor, requeueAbandonedChecks) so it leaves the boot's static closure #17254
Merged 29h 3m ago, live in production
src/checks/service.ts is no longer in the static closure of src/main.ts, and test/boot-lazy.test.ts now asserts that. What moved where src/checks/handles.ts is new. It holds the per-forge registry that startChecks fills, plus checksFor and the test-only provideChecksForTest.
-
Reviews
ApprovedApproved. The registry behind checksFor moved to checks/handles.ts, requeueAbandonedChecks is imported from checks/abandoned.ts, and child-apps.ts loads startChecks dynamically. checks/service.ts is now out of the boot's static closure, and boot-lazy asserts it. I ran tsc (clean), boot-lazy and checks-service-split (11 pass). There is no web change, so no page behaviour moves, and the move is internal, so no door is added.
Two things I would do next:
- Do the remaining follow-ups the boot-lazy comment names (#17179, #17181, #17182, #17183) so the 'only' list grows.
- Drop the provideChecksForTest alias in handles.ts and have the tests import keepChecks directly, so there is one name for one thing.
-
Checks
shipped production is serving it deploy 339cc69
-
History
- merge-queue-unapproved test: import the handle registry from checks/handles d921d8b
- Merge main into mason/17180-move-the-accessors-out-of-checks-service 0bca1f2
- Move the accessors out of snapshot/service.ts (snapshotsOf) so it leaves the boot's static closure (#17302) bc00add
- tui-apps: a screen that never comes fails the wait that wanted it, with the screen, before the test's own timeout (#17304) cd00073
- Merge pull request #17279 from sold/agent-json 033ee45
- A check that replaces a waiting one keeps its place in line: main's own check… (#17240) db83789
- EPSS scores on /advisories (#17272) ce4b64f
- keeper-stuck, keeper-rebase-loop and keeper-lull are green on main once the duty roster is built on first ask (#17299) 73af9d7
- The terminal gives up g: read again is R, each screen's own g a letter of its verb (#17200) 31035f1
- fork-follow-history: the history fork does not follow, so only the test's own takes move it (#17288) 72abacc
- The check's tsc gets a 6 GiB heap bound: under 2 GiB its collector never stopped, and tsc was a check's largest CPU cost (#17285) f2c35b2
- fork flows > the MCP tool answers the same data: load /mcp when the file load… (#17269) a58c926
- The merge queue gates an unapproved pull every minute and never lands it (#17286) cfa2451
- Game boxes open 19132/udp for Bedrock players (#17282) a28ad97
- A game box's sync that is not JSON is answered 400 by its route, saying where it broke d16fe55
- The game agent has one compose command: an array every call and the background job share (#17261) c95f990
- Talk workspace W2: live edit loop — Talk's writes and the Code tab edit the working tree (#17177) e0c876b
- Registry: a gallery page with usage (#17192) c82ef2f
- Count the cold home's work instead of timing it, so production's-size budgets are exact on any machine (#17220) 15d3197
- Registry: rebuild the app template on the registry (#17215) 6fa635d
4 earlier comments
src/checks/service.ts is no longer in the static closure of src/main.ts, and test/boot-lazy.test.ts now asserts that.
What moved where
src/checks/handles.tsis new. It holds the per-forge registry thatstartChecksfills, pluschecksForand the test-onlyprovideChecksForTest.service.tscallskeepChecksfrom there instead of owning theWeakMap.- Importers:
src/crew/,src/apps/runtime_events.tsandsrc/checks/now importchecksForfromhandles.ts. src/apps/runtime.tsnow takesrequeueAbandonedChecksfromchecks/abandoned.ts.src/spawn/child-apps.tswas the last static path to the service. It now importsstartChecksdynamically, and only when the parent forge has a checks service. The import comes before the "claimed before the first await" block, so a second request still can't start a child twice.- Tests: about 30 test files import
provideChecksForTestandChecksHandlefrom the new homes.test/checks-service-split.test.tsnow expects the registry inhandles.ts, and the allow-list entry forprovideChecksForTestpoints at it.
Checks run
bun x tsc --noEmitis clean.bun scripts/gate.ts --fixhas been run, and its comment rewrap is in the commit.- Passing: boot-lazy, checks-service-split, spawn-child-runs-apps, stale_reds, merge-queue, ledger, and the unused-exports test.
- Passing in the last run: job-slices, llms-budget and timers-named. The one failure in that batch was the unused-exports test, which the allow-list change fixed.
- The first run of the combined group of six files had one failure and one error. Rerunning the same six files passed with 58 tests and 0 failures. I did not find the cause, so one of them may be flaky.
- I did not run the whole suite, and I did not run
scripts/design-lint.ts(nosrc/web/change).
Not done
checksFor and the handle registry now live in src/checks/handles.ts, outside checks/service.ts, so the boot no longer loads the service module (#17180). The code is unchanged from the earlier push. The check had failed only because no commit message named the issue the new file serves.
I added an empty commit that names #17180 and carries No door: internal module move. A force push is refused here, so I couldn't reword the original commit. bun scripts/gate.ts now passes with no rule failures. Its only output is the existing note about comment lines over 100 columns in seven files. I left those alone, since the nightly rewrap handles them on main. I did not re-run tsc or the tests, because nothing in the code changed.
To try it, check that the app boots and / answers. Behaviour is the same as before.
Nothing in this pull's code caused the three failures, so I changed nothing and pushed nothing. The pull is the commits 2dfbc5fdc and 1c64dc3c2, which only move checksFor and the handle registry out of checks/service.ts.
I ran the three failing tests on this branch and all of them passed:
test/apps-idle.test.tsandtest/strangers.test.tstogether: 27 pass, 0 fail.test/pull-budget.test.ts: 2 pass, 0 fail.
bun x tsc --noEmit is clean, and gate.ts --fix left the working tree unchanged.
The failures look like timing flakes in a heavily loaded sharded run, not behaviour this pull changed:
- Pull page budget: the warm-answer budget test failed at 748 ms.
- Idle-previews test: it failed on a 3.76 s run against a 2 s budget; the test sleeps and deploys, so it is sensitive to machine load.
- Event-streams test: it failed at 21.94 ms in a shard of its own.
- Talk 44 px test: it also appears in the log as
(fail)at 917 ms, but the summary counts only three failures.
Re-running the check on the same commit should clear them. If any of these still fails there, I'll look at it.
Nothing new to push: this branch is already on origin and already passes everything the comment named. The red check it quotes was on pull #17254, not on this one.
What it does: checksFor and the handle registry now live outside src/checks/service.ts. requeueAbandonedChecks was moved earlier in this series. That takes service.ts out of the boot's static closure. Behaviour is unchanged. The remaining changes (37 files) only repoint imports in src/ and the tests.
The check results on this branch:
bun x tsc --noEmitis clean.test/changelog-atom-behind.test.tspasses, 3 of 3 runs.- The dead-code test passes. It prints a note that
useWatchProbeByDefaultanduseReachByDefaultare no longer dead and can be pruned. It does not fail, so I left them. test/llms-budget.test.tsandtest/llms-txt-timing.test.tspass.test/job-slices.test.ts, which holds the job-timing rule (everyduringjob is timed or listed in UNTIMED), passes, as doestest/route-timing-coverage.test.ts.scripts/gate.ts --fixchanged nothing. It reports seven files with comment lines over 100 columns, none of them from this change, and says the nightly rewrap handles them.
What I did not do: I did not touch #17254's failing test, since it is not part of this refactor.
To try it: run bun test test/job-slices.test.ts test/unused-exports.test.ts, then boot the app and request /.
🤖 Generated with Claude Code
I merged main into the branch, resolved the one conflict, and pushed. tsc --noEmit is clean and the tests I ran pass. I did not run the full suite, and I did not run scripts/gate.ts.
- Conflict in
test/boot-lazy.test.ts: the forbidden-imports list now holdschecks/service.ts(this branch's change) andsnapshot/service.ts(frommain), and the comment names #17180 through #17183. - Type error from the merge:
test/merge-queue-unapproved.test.tsis a test that landed onmainand still importedprovideChecksForTestfromchecks/service.ts, where this branch no longer exports it. It now importsprovideChecksForTestfromchecks/handles.tsandChecksHandlefromchecks/lane_state.ts. - Tests run:
test/boot-lazy.test.ts,test/merge-queue-unapproved.test.tsandtest/checks-service-split.test.ts.
src/checks/service.tsis no longer in the static closure ofsrc/main.ts, andtest/boot-lazy.test.tsnow asserts that.What moved where
src/checks/handles.tsis new. It holds the per-forge registry thatstartChecksfills, pluschecksForand the test-onlyprovideChecksForTest.service.tscallskeepChecksfrom there instead of owning theWeakMap.src/crew/,src/apps/runtime_events.tsandsrc/checks/now importchecksForfromhandles.ts.src/apps/runtime.tsnow takesrequeueAbandonedChecksfromchecks/abandoned.ts.src/spawn/child-apps.tswas the last static path to the service. It now importsstartChecksdynamically, and only when the parent forge has a checks service. The import comes before the "claimed before the first await" block, so a second request still can't start a child twice.provideChecksForTestandChecksHandlefrom the new homes.test/checks-service-split.test.tsnow expects the registry inhandles.ts, and the allow-list entry forprovideChecksForTestpoints at it.Checks run
bun x tsc --noEmitis clean.bun scripts/gate.ts --fixhas been run, and its comment rewrap is in the commit.scripts/design-lint.ts(nosrc/web/change).Not done
scripts/similar.ts. I wrote no new logic, only the registry move.Closes #17180