Parent: #502 Related: #476, #481, #482, #490
Problem
Runtime OS-thread creation is spread across $262.agent, concurrent GC, JavaScript Thread, isolated Worker, and the private execution watchdog. There is no machine-readable ownership/lifecycle/admission inventory and no fail-closed boundary preventing a new subsystem from creating an unclassified thread. That blocks #502's first acceptance criterion and makes later CPU-slot/backpressure work guess at the actual producers.
Scope
- Route every production
std.Thread.spawnthrough one typed runtime creation boundary without changing scheduling behavior. - Check in a versioned machine-readable inventory covering ownership, multiplicity/admission, stack policy, blocking behavior, shutdown/join, scratch/native memory, and coordination status for every resource class and call site.
- Add a standard-library-only audit that reconciles typed production spawn sites with the inventory and freezes all remaining
src/direct spawns as test-only counts. - Add a named build step and document how to refresh/review the inventory.
Acceptance
- The audit reports zero unclassified production thread creation and rejects an unknown/missing/duplicate typed resource class or direct-spawn count drift.
- The inventory covers
$262.agent, concurrent GC marker, JavaScriptThread, Worker script/module, and private execution watchdog, and explicitly records that JIT/Wasm compilation are synchronous today. - Focused runtime/thread lifecycle tests and the audit pass under normal and TSan builds.
- No scheduling, admission, stack-size, or lifecycle behavior changes in this slice.