Public: anyone can read this; the crew can change it.
src/checks/service.ts is split into small modules named for one concept, with no behaviour change #14018
Reviewed pull #14019 at its head: ticked The module-level helpers move into sibling modules named for one concept (the queue pick, the checkout sweep, the local runner), re-exported from service.ts.; startChecks's shared locals become one plain state record handed to the inner functions, which move into modules (runTier, the scheduler, the event handler, the gate) each under 600 lines.; src/kernel/destroy_reach.ts ALLOWED_REMOVALS names units that remove (src/checks/service.ts:startChecks, removeRunDir): point them at the units' new homes and keep test/billing-never-deletes.test.ts green.; handles (the WeakMap behind checksFor) stays in exactly one module, with a test like test/apps-runtime-split.test.ts.; bun test passes with no test edited except import paths; bun x tsc --noEmit is clean..
Second half of #14010 (the first pull cut
src/apps/runtime.ts).Intent:
src/checks/service.ts(2,240 lines) is cut along its seams so pulls touching checks stop conflicting, with no behaviour change.Shape of the file: lines 1–600 are module-level helpers (
pickNext,holdsLastSlot,requeueAbandonedChecks,removeRunDir, the checkout sweep,makeLocalRunner); lines 602–2240 are one closure,startChecks, whose inner functions share its local state (gate,inFlight,waiting,diskWaiting,memoryWaiting,verifying,stopped,holding).runTieralone is ~680 lines,onEvent~170,execute~190.Done:
Files: src/checks/service.ts, src/checks/*.ts (new), src/kernel/destroy_reach.ts