degenbot.diagnostics¶
Runtime diagnostics (GIL-probe stuck-watchdog) — stable ADR-013 home.
The settlement-arbitrage bot installs a GIL-acquire-latency probe + main-loop stuck-watchdog
(start_gil_probe / mark_progress). These pyfunctions are dynamically
created in degenbot._ffi.diagnostics by the PyO3 wrapper; this __init__.py
is the stable degenbot.<domain> home leaf modules must import from (ADR-013:
the Pydantic barrier — the _ffi seam is private to __init__.py files).
Package Contents¶
- class degenbot.diagnostics.FailureAction¶
Bases:
enum.StrEnumThe closed per-bucket failure-reaction vocabulary (ADR-040).
The Rust
failure_policymatrix is the single source of truth; itsfailure_actionpyfunction answers one of these spellings. This enum is the ONE wire-string → member conversion — consumers compare members, never raw strings.- OBSERVE = 'observe'¶
- EVENT = 'event'¶
- QUARANTINE = 'quarantine'¶
- EXIT = 'exit'¶
- degenbot.diagnostics.failure_action(kind: str, reason: str | None = None) FailureAction¶
Consult the Rust failure-policy matrix for one bucket’s action.
- Parameters:
kind – The failure bucket (e.g.
"sim_failure").reason – The optional reason sub-split.
- Returns:
The bucket’s action as a
FailureActionmember.- Raises:
DegenbotValueError – On a wire string outside the FailureAction vocabulary — Rust/Python matrix drift, loud.
- degenbot.diagnostics.mark_progress¶
- degenbot.diagnostics.start_gil_probe¶