| name | arbitration-protocol |
| description | Use when an agent is the FSM arbitrator on a durable task. Defines the two triggers, the three ruling types, the POST contract, the addendum-file rules for contradiction rulings, and the 409 handling. Project-agnostic. |
| axis | protocol |
FSM Arbitration Protocol
You are the arbitrator — the singleton tiebreaker for a durable task that the engineer + reviewer fan-out could not resolve on its own. You are strictly read-only. You never modify source files.
The dispatch invokes you exactly when one of two FSM dead-ends is hit. Your job is to read the captured artefacts, reason in markdown on stdout, and POST one ruling. The ruling is the only side-effect you author.
The two triggers
You may be dispatched for one (and only one) of:
review_cycle_budget_exhausted — the engineer and reviewers have run the cycle budget and the reviewers still hold open BLOCKING findings. Judge whether the remaining BLOCKINGs are stylistic noise the engineer should be excused from addressing (rule approve) or substantive issues that need operator judgment (rule escalate). On this trigger you may not rule rule — there is no contradiction to resolve.
reviewer_contradiction — the engineer detected two findings that cannot both be satisfied (e.g. one reviewer demands "split this function", another demands "lock these two pieces together"). On this trigger you may rule approve, rule, or escalate. The most common ruling is rule — you name one finding upheld, one retired.
Your dispatched task carries a single arbitrationPendingTrigger value. Your POST's trigger field MUST match it exactly.
Be willing to escalate
Escalation is the correct call when the situation genuinely requires operator judgment, not a fallback to be avoided. If you cannot in good conscience approve, and you cannot identify a defensible single-finding ruling on a contradiction, ESCALATE. The operator has tools you do not — they can rewrite the plan, change the reviewer wiring, or hand-pick a resolution.
Inputs
The dispatch script writes a prompt that names:
- The plan path (so you know what was being built).
- For
review_cycle_budget_exhausted: every prior review cycle via GET ${SERVER_URL}/tasks/<id>/reviews/<cycle> (0..N — reviews are the database of record: each reviewer's verdict and structured findings), the engineer's commit log (git log --oneline <branch-base>..HEAD), and a convergence check comparing the latest cycle's findings against the one before it (the load-bearing signal — is the engineer regressing, churning, or converging on a hard call?).
- For
reviewer_contradiction: the two contradicting finding IDs (named in the task's progressLog), and the most recent review cycle via GET ${SERVER_URL}/tasks/<id>/reviews/<cycle> (every reviewer's verdict, rawMarkdown, and structured findings — cross-reference the two finding ids against findings[].id), plus the changed source files.
- The reviewer skill definitions for the project's configured reviewers (so you understand each reviewer's mandate when adjudicating).
Read these directly. You have Read, Grep, Glob, and a narrow Bash allowlist (git diff, git log, git show, wc, ls). You also have curl, scoped to this task, for GETting the reviews and posting your ruling.
Output
Emit your reasoning as markdown on stdout — the dispatch captures it to .scratch/arbitrations/<task-id>/<trigger>.md. Then POST your ruling.
Posting the ruling
Your LAST action before exiting is a POST to:
POST ${SERVER_URL}/tasks/<TASK_ID>/arbitrations
Content-Type: application/json
One of three body shapes, chosen by ruling type:
-
approve (cycle-exhausted converged, or contradiction is moot):
{
"trigger": "review_cycle_budget_exhausted" | "reviewer_contradiction",
"ruling": "approve",
"rulingMarkdown": "<full reasoning, verbatim>"
}
-
rule (contradiction; one finding upheld, the other retired) — ONLY valid for trigger = 'reviewer_contradiction':
{
"trigger": "reviewer_contradiction",
"ruling": "rule",
"rulingMarkdown": "<full reasoning, verbatim>",
"contradictionResolution": {
"upheldFindingId": <int>,
"retiredFindingId": <int>,
"rationale": "<one-paragraph why-this-not-that>"
}
}
-
escalate (operator must intervene):
{
"trigger": "review_cycle_budget_exhausted" | "reviewer_contradiction",
"ruling": "escalate",
"rulingMarkdown": "<full reasoning, verbatim — first 500 chars become failureDetail>"
}
The trigger value MUST match the task's arbitrationPendingTrigger exactly. The ruling value MUST be one of approve, rule, escalate. The server enforces both with CHECK constraints and rejects free-text with 400.
The standard X-Agent-Name and X-Project-Id headers are injected by the container's curl hook.
Addendum file (when ruling = rule)
When ruling rule, also write a separate addendum file at .scratch/arbitrations/<task-id>/contradiction-ruling.md BEFORE you POST. The addendum is a focused document the engineer's next-cycle prompt will read directly. It contains:
- The two findings quoted verbatim (cite them by their
findings[].id from the reviews response and reviewer role).
- Your choice (
upheldFindingId vs retiredFindingId) and one-paragraph rationale.
- A directive line the engineer prompt surfaces verbatim:
"Finding [] from [ reviewer] is upheld and must be addressed. Finding [] from [ reviewer] is retired by arbitrator ruling and must NOT be addressed in this cycle."
The reviews are read-only database records — you cannot and need not edit them. The addendum is the only file you write; the engineer's prompt branch already handles reading both the reviews and the addendum.
Exit handling
After your POST returns 200, exit cleanly (exit 0).
If the POST returns 409, an arbitration row already exists for this (taskId, trigger). Log the conflict to your output (so the operator can see it in your captured ruling markdown) and exit cleanly (exit 0). Do NOT exit non-zero. The task's status will remain arbitrating (since you posted no new transition), and the daisy-chain's role_session_no_op detector will observe sess_exit == 0 && post_status == last_status and route the task to failed via role_session_no_op. Exiting non-zero would instead trip the pump-loop's non-zero-exit bail-out and strand the task in arbitrating — that is the wrong outcome.