Skip to main content

Recover from failed CI

When a CI check fails, the orchestrator routes the goal back to REPAIR_REQUIRED or to the role that produced the failure.

Steps

  1. Inspect the CI run: open the PR → "Checks" tab → click the failed check → "View raw logs".
  2. Categorize the failure:
    • Deterministic: a real bug or violation. Fix and push.
    • Flaky: a transient infrastructure issue. Re-run via gh run rerestart <run-id>.
    • Policy violation: a governance rule (e.g., branch protection) is blocking. Open a repair goal.

Deterministic fix

  1. Fix the code in the same branch.
  2. Push; the orchestrator re-dispatches the BUILDER task.
  3. Wait for CI to re-run.

Flaky re-run

  1. gh run rerestart <run-id> — restarts the failed jobs.
  2. Wait for CI to re-run.
  3. If the failure persists, treat as deterministic.

Policy violation

  1. Open a REPAIR_GOAL to fix the violation.
  2. The repair goal itself must be authorized under a separate scope.

What the orchestrator does

The orchestrator records the CI failure as a findings row and routes the goal according to next_action_policy.on_fail. Three consecutive CI failures on the same task transition the goal to REPAIR_REQUIRED.