Human-in-the-Loop
Summary
Some inputs are ambiguous and must be resolved by a human before processing can continue. The blueprint models this as a durable pause: an exception is raised, a question is recorded, the job pauses, and later resumes.
The mechanism
- During processing, a stage raises a domain exception carrying the context needed to ask the question:
- The orchestrator catches it, records a question document, and re-raises
so the worker marks the job
paused. - A client lists pending questions and answers one:
- When the last pending question is resolved, the resolve endpoint flips
the parent job back to
pending. - The worker picks it up again, rebuilds a resolution map from previously answered questions, and seeds it into the pipeline so the same decision is not asked twice.
The question document
Resume map
The worker turns answered questions into a lookup keyed by reference, then
injects it into the pipeline so that stage can skip re-raising:
Resolve endpoint
CLI parity
The same flow is available through scripts/CLI: list, get, create,
questions, resolve, retry.