Skip to main content

Module queue_contract

Module queue_contract 

Source
Expand description

Queue wait/stream/no-start CLI contract (bd-session-history-remediation-ocv9i.10.2).

When a command hits a busy fleet it may be queued. The cardinal rule of the CLI boundary is that an agent must NEVER be left with “maybe running somewhere” uncertainty: every invocation resolves to a definite StartState — it either started (and we wait/stream), returns a job id in an explicit not-started state (reattachable later), or fails before admission. resolve_queue_contract is the pure decision function that guarantees this, honoring the CLI options (wait, follow/stream, wait timeout, no-start, strict-proof). QueueContractResponse is the JSON/human envelope.

Structs§

QueueContractResponse
The agent-facing response envelope (JSON/human).
QueueOptions
CLI options governing queue behavior.

Enums§

AdmissionState
What admission decided for this command.
QueueContractOutcome
The resolved queue-contract outcome.
StartState
The definite, unambiguous start state of a command. There is deliberately no Unknown — eliminating “maybe running somewhere” is the whole point.
WaitResult
What happened while waiting on a queued job (a runtime input).

Functions§

resolve_queue_contract
Resolve the queue contract — pure and total. Given admission, the CLI options, and (if waited) the wait result, returns exactly one definite outcome. wait is ignored unless the command was queued and waiting.