degenbot.diagnostics ==================== .. py:module:: degenbot.diagnostics .. autoapi-nested-parse:: 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.`` home leaf modules must import from (ADR-013: the Pydantic barrier — the ``_ffi`` seam is private to ``__init__.py`` files). Package Contents ---------------- .. py:class:: FailureAction Bases: :py:obj:`enum.StrEnum` The closed per-bucket failure-reaction vocabulary (ADR-040). The Rust ``failure_policy`` matrix is the single source of truth; its ``failure_action`` pyfunction answers one of these spellings. This enum is the ONE wire-string → member conversion — consumers compare members, never raw strings. .. py:attribute:: OBSERVE :value: 'observe' .. py:attribute:: EVENT :value: 'event' .. py:attribute:: QUARANTINE :value: 'quarantine' .. py:attribute:: EXIT :value: 'exit' .. py:function:: failure_action(kind: str, reason: str | None = None) -> FailureAction Consult the Rust failure-policy matrix for one bucket's action. :param kind: The failure bucket (e.g. ``"sim_failure"``). :param reason: The optional reason sub-split. :returns: The bucket's action as a :class:`FailureAction` member. :raises DegenbotValueError: On a wire string outside the FailureAction vocabulary — Rust/Python matrix drift, loud. .. py:data:: mark_progress .. py:data:: start_gil_probe