docs(serve): say why turn_in_flight is kept as the bool view; one union spelling

This commit is contained in:
kshitijk4poor
2026-09-19 14:52:39 +05:30
committed by kshitij
parent 03132b18de
commit 8456893ef4
2 changed files with 3 additions and 2 deletions

View File

@@ -137,7 +137,8 @@ def busy_ledger() -> Optional[str]:
def turn_in_flight() -> Optional[bool]:
"""True/False from :func:`busy_ledger`; None when it cannot be read."""
"""Bool view of :func:`busy_ledger`, kept so ``should_exit_idle`` / the idle watchdog and injected
test probes keep their ``Optional[bool]`` contract; None when the ledgers cannot be read."""
ledger = busy_ledger()
return None if ledger is None else bool(ledger)

View File

@@ -36,7 +36,7 @@ def pending_human_input() -> Optional[int]:
return None
def idle_proof(turn_probe: Callable[[], Optional[bool | str]] = busy_ledger,
def idle_proof(turn_probe: Callable[[], bool | str | None] = busy_ledger,
input_probe: Callable[[], Optional[int]] = pending_human_input) -> dict:
"""``{"idle": True | False | None, "reason": str | None}`` plus ``"detail"`` naming the busy ledger.