① Collection Loop
Scouts harvest session telemetry → aggregate.py computes 22+ metrics →
insights.py scores health (0–100) and annotates mitigation commands →
wid_payload.json written → Dashboard reads it → user (or ronin)
executes a skill → behavior changes → next session measured differently.
Cadence: per session + on-demand refresh
② Ronin Auto Loop
dojo.ts watches DOJO_STATE.json for live_current < live_baseline
on any pillar → AutoRemediationEngine queues that pillar →
spawns bin/ronin <pillar> (shell script) → probes run →
DOJO_STATE updated. Single-concurrency — one pillar at a time, 5-min timeout.
Gap: runs pillar script, not per-metric skill commands → /ronin-remediate skill closes this
③ Reflex Loop
reflexes.py fires when metric value deviates ≥1σ from rolling history (needs ≥4 points)
OR grade falls below threshold → Dashboard shows reflex card with mitigation command →
user clicks ⚡ → WebSocket → spawnExec() → skill streams output →
next payload shows improved metric.
New: /ronin-remediate orchestrates de-dup + priority ordering across simultaneous reflexes
④ Governance Loop
4 verifier modules (root_hygiene, path_authority, archive_boundaries, runtime_contract)
return OK/FAIL/WARN per check → aggregate.py counts FAILs to compute
Governance_Pass_Rate → /verifier-repair maps each failure type to a concrete fix →
verifiers re-run → pass rate rises.
Key gotcha: verifiers use "OK" not "PASS" — fixed in _governance_pass_rate reducer
⑤ Learning Loop
CLAUDE.md principle violations accumulate in the Nudge Catalog → reflexes.py
wraps them as armed alerts via _nudge_command() → user runs /improve-system
or /ce-compound → lessons written to CLAUDE.md and docs/solutions/ →
OS rules improve → future sessions generate fewer violations.
Gap partially closed: _nudge_command() now routes to all 5 new skills
Cross-Loop Shared State
wid_payload.json is the single fan-out point — all loops read from it.
DOJO_STATE.json is the pillar-level truth. METRIC_CONFIG
(insights.py) is the single source of truth for skill→metric mappings.
Loop ①③ share the annotated metric envelope (mitigation_command).
Loop ② reads DOJO_STATE scores, not individual metric commands.