docs(serve): say why turn_in_flight is kept as the bool view; one union spelling
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user