Skip to content
Closed
9,278 changes: 9,278 additions & 0 deletions .egg-state/brc-history/3023-implement-slice-1.json

Large diffs are not rendered by default.

7,823 changes: 7,823 additions & 0 deletions .egg-state/brc-history/3023-implement-slice-1.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/guides/pipeline-health-monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ The orchestrator processes structured progress events with deterministic rules.
| **Infrastructure error** | Agent reports `blocked` state with infrastructure-related blocker (git failures, gateway errors, permission denied) | Critical alert → overseer routes to HITL fast-path (bypasses nudge/redirect ladder) |
| **BRC progress stall** | Fully-ACKed producer hasn't sent `CONSENSUS_CONFIRMED` within timeout | Send direct `OVERSEER_ALERT` to stuck producer instructing it to call `mcp__brc__confirm`; also escalate to overseer/HITL |
| **Branch divergence** | Pipeline branch is >20 commits ahead of base AND ahead-commits contain merged-PR subject signatures (`(#NNNN)`) — the contamination shape from #2222 | Publish `OVERSEER_ALERT` with `anomaly_type: "branch-divergence"` listing offending commits; deduplicates per SHA |
| **Phase-level idle budget** | No agent spawn for an entire phase within the budget window (default 30 min; `DEFAULT_PHASE_IDLE_BUDGET_MIN` in `orchestrator/phase_idle_budget.py`). The orchestrator's per-phase tick calls `PhaseIdleBudgetTimer.check()` once per loop iteration and is the canonical owner of this alert — the per-pod wrapper-side emitter in `consensus_wrapper.py` defers to it when `EGG_PHASE_IDLE_BUDGET_OWNER=orchestrator` to prevent double-paging | Publish `OVERSEER_ALERT` with `anomaly_type: "stuck-phase-transition"` and a `per_role_state` payload describing each role's last spawn action. Priority `medium` at the 1× threshold, `high` at the 2× threshold; **HITL-pending suppression** (AC-R13) downgrades 1× to `low` with `pending_hitl_ids` in `reason` and suppresses the 2× alert entirely. Idempotent per threshold bucket — re-armed by per-phase instance lifetime (`routes/pipelines.py` builds a fresh `PhaseIdleBudgetTimer` inside the per-phase concurrent runner and drops it on return). `PhaseIdleBudgetTimer.reset()` is exposed for tests / cross-phase reuse but is not on the slice-1 production hot path |

### Infrastructure Error Detection

Expand Down
13 changes: 13 additions & 0 deletions orchestrator/concurrent_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,19 @@ def get_agent_env(self, role: AgentRole) -> dict[str, str]:
env = {
"EGG_CONCURRENT_MODE": "true",
"EGG_MESSAGE_POLL_INTERVAL": str(poll_interval),
# Coexistence guard (#3023 slice-1 task-1-3). Tells the in-pod
# wrapper that the orchestrator is now the authoritative emitter
# of the ``stuck-phase-transition`` idle-budget overseer alert
# (see ``orchestrator/phase_idle_budget.py`` and the per-phase
# tick wiring in ``routes/pipelines.py``). The wrapper's own
# ``check_idle_budget`` / ``raise_idle_alert`` arm short-
# circuits when this is set, so the operator does not get
# paged twice (once per role from the wrapper + once per
# phase from the orchestrator). Slice-3 deletes the wrapper-
# side emitter outright; this guard buys clean coexistence
# for slice-2's gradual cutover. Injected unconditionally
# for every role (AC for task-1-3).
"EGG_PHASE_IDLE_BUDGET_OWNER": "orchestrator",
}
# Add review graph info for BRC protocol
graph = self._get_review_graph()
Expand Down
15 changes: 15 additions & 0 deletions orchestrator/consensus_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,21 @@
}}

check_idle_budget() {{
# Coexistence guard (#3023 slice-1 task-1-3). The orchestrator's
# per-phase tick now owns the ``stuck-phase-transition`` overseer
# alert (see ``orchestrator/phase_idle_budget.py`` + the wiring in
# ``routes/pipelines.py``). When ``EGG_PHASE_IDLE_BUDGET_OWNER`` is
# set to ``orchestrator`` (injected unconditionally for every role
# by ``concurrent_executor.get_agent_env``), this wrapper-side
# emitter short-circuits so the operator is not paged twice (once
# per role from the wrapper + once per phase from the orchestrator).
# The local ``LAST_PROGRESS`` / ``ALERTED_AT_*`` bookkeeping is
# left intact: the wrapper still ages the counter for its own
# logging, just without sending the alert. Slice-3 deletes this
# function and the rest of the wrapper-side emitter outright.
if [ "${{EGG_PHASE_IDLE_BUDGET_OWNER:-}}" = "orchestrator" ]; then
return 0
fi
local idle=$(( SECONDS - LAST_PROGRESS ))
local double=$(( 2 * IDLE_BUDGET_SECS ))
if [ "$idle" -ge "$double" ] && [ "$ALERTED_AT_DOUBLE" != "true" ]; then
Expand Down
Loading
Loading