degenbot.runner.diag¶
Incident-diagnostic harnesses for the driver cockpit.
The three operator-runtime probes — the tracemalloc diff thread, the
/proc/self RSS/purge CSV sampler, and the faulthandler repeat dumper —
live here, configured through the typed loader (ArbitrageConfig.diag,
populated by ArbitrageConfig.build()). The cockpit
(start()) arms them at startup;
any entrypoint that runs the cockpit (the settlement-arbitrage example, the
degenbot console) gets the probes uniformly.
Module Contents¶
- class degenbot.runner.diag.DiagConfig¶
The three probe toggles, carried from the declared diagnostics keys.
No field has a default: the core schema declaration owns them (zero is OFF, the production posture), so a second literal here could drift from what an operator set.
- degenbot.runner.diag.arm_diagnostics(cfg: DiagConfig, *, proc_root: pathlib.Path = _DEFAULT_PROC_ROOT) list[str]¶
Arm every configured probe; return the armed probe names (stable order).
Zero-config arms nothing — production default. Called once per session from the cockpit’s
start(); idempotent across runners (threads are daemon and probe-scoped).- Parameters:
cfg – The probe toggles read off the declared diagnostics keys.
proc_root – Where the proc-mem sampler reads
stat/statm/status. The kernel’s live/proc/selfunless a test injects a fixture directory with the same shape.
- Returns:
The armed probe names, in stable arm order.