Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sandbox/agent-config/rules/orchestrator.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ BRC consensus + heartbeats:
- `mcp__brc__propose` — Prefer this over `egg-orch consensus propose`. Producer broadcasts a proposal.
- `mcp__brc__ack` — Prefer this over `egg-orch consensus ack`. Reviewer ACKs a proposal.
- `mcp__brc__nack` — Prefer this over `egg-orch consensus nack`. Reviewer NACKs with a blocker reason.
- `mcp__brc__confirm` — Prefer this over `egg-orch consensus confirmed`. Producer confirms after all reviewers ACK.
- `mcp__brc__confirm` — Prefer this over `egg-orch consensus confirmed`. Producer confirms after all reviewers ACK. Returns `ok: True` only when the producer transitioned to CONFIRMED; on `ok: False` (status `pending_acks`) the transition was rejected — read `message` for the reason (e.g. `producer_not_fully_acked`, `global_zero_proposal`, `stale_acks`) and take corrective action before retrying.
- `mcp__brc__wait_for_event` — Prefer this over `egg-orch message wait`. Block on typed BRC messages.
- `mcp__brc__wait_loop` — Prefer this over `egg-orch message wait-loop`. Loop wait_for_event with retry on transient errors.
- `mcp__brc__send_heartbeat` — Prefer this over `egg-orch message heartbeat`. Emit a structured HEARTBEAT to the dedicated `/heartbeat` endpoint.
Expand Down
8 changes: 7 additions & 1 deletion sandbox/egg_agent_tools/handlers/brc.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,12 @@ def brc_confirm(req: dict[str, Any]) -> dict[str, Any]:
pipeline_id, role: overrides.

Response carries:
ok: True only when the producer transitioned to CONFIRMED.
False for "pending_acks" — the orchestrator received the
request but rejected the transition (e.g.
``producer_not_fully_acked``, ``global_zero_proposal``,
``stale_acks``). Inspect ``status`` and ``message`` to pick
corrective action.
status: "confirmed"|"pending_acks"
consensus_reached: bool (only for status=="confirmed")
"""
Expand All @@ -243,7 +249,7 @@ def brc_confirm(req: dict[str, Any]) -> dict[str, Any]:
body = result.get("data", {})
pending = body.get("status") == "pending_acks"
return {
"ok": True,
"ok": not pending,
"role": role,
"status": "pending_acks" if pending else "confirmed",
"consensus_reached": bool(body.get("consensus_reached", False)),
Expand Down
2 changes: 1 addition & 1 deletion tests/sandbox/egg_agent_tools/test_cli_parity.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def test_pending_acks_exits_2(self):
pre-refactor CLI so scripts can distinguish 'waiting' from
'confirmed')."""
fake = {
"ok": True,
"ok": False,
"status": "pending_acks",
"consensus_reached": False,
"role": "coder",
Expand Down
2 changes: 2 additions & 0 deletions tests/sandbox/egg_agent_tools/test_handlers_brc.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ def test_happy_confirmed(self):
},
):
resp = brc.brc_confirm({"pipeline_id": "p", "role": "coder"})
assert resp["ok"] is True
assert resp["status"] == "confirmed"
assert resp["consensus_reached"] is True

Expand All @@ -211,6 +212,7 @@ def test_pending_acks(self):
},
):
resp = brc.brc_confirm({"pipeline_id": "p", "role": "coder"})
assert resp["ok"] is False
assert resp["status"] == "pending_acks"
assert resp["consensus_reached"] is False

Expand Down
Loading