Coordinator store work off the event loop; the tool catalog in its own module #22
Loading…
Reference in a new issue
No description provided.
Delete branch "vinny/event-loop"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #12, with the scope decided on 2026-10-13: the event loop first, and only the
operational_tools.pyschema split. - Event loop. A write's ledger records, fences, checks, reservations and evidence commit about ten SQLite transactions, and these ran on the controller's event loop.Coordinator._dbnow runs them in a worker thread: each call opens its own connection, and the lock stays with the task. - Three things stay on the loop: the port's guards, the durable submission fence (the gateway calls it synchronously) and the observer callbacks. -tools/perf_coordinator_loop.py, 60 library writes on the synthetic port: the longest stall fell from 275–591 ms to 23–96 ms, and the 95th percentile from 249–437 ms to about 14 ms, at an unchanged 150 ms per write. -tests/stage3/test_coordinator_loop.pyguards it: the loop now gets turns during a write, where it got none before. - Split. The 667-line catalog (closed schemas, purposes, definitions) moved fromagents/operational_tools.pytoagents/operational_catalog.py, and the importers were repointed. - Test stability. The API tests' wait helper allows 20 s instead of 8. Parallel workers on a busy machine once took longer than 8 s to show a collector failure. -docs/stage13/RUNTIME_HARDENING.mdrecords the measurement. 🤖 Generated with Claude Code