agora.observe.review

Human-in-the-loop review coordinator.

When the orchestrator enters the REVIEW phase, it calls ReviewCoordinator.request_review(). The coordinator:

  1. Posts a review summary to the project room.

  2. Posts an MSC3381 poll with pre-labelled options.

  3. Subscribes (one-shot) to poll responses targeting this poll and to /agora review <answer_id> fallback commands.

  4. Waits up to review_timeout_seconds for a vote.

  5. Builds a ReviewDecision from the answer id + any free-text feedback from replies threaded under the poll message.

  6. On timeout, falls back to the headless auto-review.

The coordinator never blocks the event loop: all waiting happens on asyncio.Event / asyncio.Future, and the timeout is bounded by asyncio.wait_for().

Classes

ReviewCoordinator

Drives the REVIEW-phase poll/approval loop on the Matrix observer side.

class agora.observe.review.ReviewCoordinator[source]

Bases: object

Drives the REVIEW-phase poll/approval loop on the Matrix observer side.

Composed by the orchestrator and called once per project entering REVIEW. The coordinator owns the lifecycle of a single MSC3381 poll event plus its associated /agora review fallback command path, routes both into one asyncio.Future, and resolves to a ReviewDecision.

Free-text feedback in threaded replies under the poll message is captured and surfaced on the decision so the next agent’s prompt can incorporate the human’s reasoning when looping back.

__init__(matrix_client, dispatcher, project_room_id, timeout_seconds=300.0, project_work_dir=None, control=None)[source]
attach()[source]

Register poll and command handlers on the event dispatcher.

Idempotent — calling twice on the same coordinator is a no-op. Normally invoked implicitly by request_review(); expose it directly only if you need handlers wired before the first review poll is posted (e.g. integration tests that pre-feed events).

async request_review(project, results_summary)[source]

Post summary + poll, then await a vote (with timeout).