Split the largest modules; move the coordinator's synchronous SQLite off the event loop #12

Closed
opened 2026-10-13 05:50:56 -04:00 by vinny · 0 comments
Owner
  • agents/operational_tools.py (~2,330 lines)
    • A 314-line _schemas literal could move to its own module.
    • Handlers could split by family: search/resolve, hosting, geo, contacts, planning, safety. The picture_tools.py / planning_tools.py delegation already shows the pattern.
  • observation/controller.py (~1,815 lines)
    • The legacy and telemetry collection paths share one 67-method class.
    • _job_step is 231 lines.
  • execution/runtime_verifier.py (1,783 lines)
    • Three parallel method families: extended, catalog, capability.
    • Five copies of the read-back loop (around lines 592, 1022, 1395, 1552, 1667).
  • execution/coordinator.py
    • The composites (_strike_package .. _patrol_setup) could move out.
    • execute is 202 lines and opens SQLite connections synchronously inside the async lock, on the event loop. PR #1 moved the 4x/s scheduler gate and the 2x/s read-back poll to worker threads; execute, _readback and the tactical executor remain.
  • Duplicated helpers
    • 7 canonical-JSON helpers with different flags. Unify them carefully, because digests depend on the bytes.
    • 4 copies of the now() ISO helper.
    • 215 json.loads(row[...]) sites.

The live 500+/500+ run recorded journal delivery p95 1,693 ms from event-loop congestion (docs/verification/stage7/scale-live-2026-10-01.json).

Found in the 2026-10-13 review (PR #1).

- **`agents/operational_tools.py`** (~2,330 lines) - A 314-line `_schemas` literal could move to its own module. - Handlers could split by family: search/resolve, hosting, geo, contacts, planning, safety. The `picture_tools.py` / `planning_tools.py` delegation already shows the pattern. - **`observation/controller.py`** (~1,815 lines) - The legacy and telemetry collection paths share one 67-method class. - `_job_step` is 231 lines. - **`execution/runtime_verifier.py`** (1,783 lines) - Three parallel method families: extended, catalog, capability. - Five copies of the read-back loop (around lines 592, 1022, 1395, 1552, 1667). - **`execution/coordinator.py`** - The composites (`_strike_package` .. `_patrol_setup`) could move out. - `execute` is 202 lines and opens SQLite connections synchronously inside the async lock, on the event loop. PR #1 moved the 4x/s scheduler gate and the 2x/s read-back poll to worker threads; `execute`, `_readback` and the tactical executor remain. - **Duplicated helpers** - 7 canonical-JSON helpers with different flags. Unify them carefully, because digests depend on the bytes. - 4 copies of the `now()` ISO helper. - 215 `json.loads(row[...])` sites. The live 500+/500+ run recorded journal delivery p95 1,693 ms from event-loop congestion (`docs/verification/stage7/scale-live-2026-10-01.json`). Found in the 2026-10-13 review (PR #1).
vinny closed this issue 2026-10-13 22:07:20 -04:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
vinny/CMOnet#12
No description provided.