Consensus Protocol
Version: 1.0.0 Type: Conditional Protocol Max Active: 3 protocols (including base)Trigger Conditions
This protocol activates when the task involves:| Trigger | Keywords | Context |
|---|---|---|
| Decision Making | ”vote”, “decide”, “choose”, “select” | Multi-option choice |
| Agreement | ”consensus”, “agree”, “alignment” | Stakeholder coordination |
| Conflict Resolution | ”resolve”, “dispute”, “conflict” | Opposing positions |
| Validation | ”validate claim”, “verify assertion” | Evidence-based judgment |
--protocol consensus flag on task creation.
Requirements (RFC 2119)
MUST
| Requirement | Description |
|---|---|
| CONS-001 | MUST use structured voting format |
| CONS-002 | MUST document rationale for each position |
| CONS-003 | MUST include confidence scores (0.0-1.0) |
| CONS-004 | MUST cite evidence supporting positions |
| CONS-005 | MUST flag conflicts with severity levels |
| CONS-006 | MUST escalate to HITL when threshold not reached |
| CONS-007 | MUST set agent_type: "analysis" in manifest |
SHOULD
| Requirement | Description |
|---|---|
| CONS-010 | SHOULD present multiple perspectives |
| CONS-011 | SHOULD identify hidden assumptions |
| CONS-012 | SHOULD document rejected alternatives |
| CONS-013 | SHOULD include uncertainty notes for low confidence |
MAY
| Requirement | Description |
|---|---|
| CONS-020 | MAY propose compromise positions |
| CONS-021 | MAY defer non-critical decisions |
| CONS-022 | MAY request additional research |
Output Format
Voting Structure
Verdict Thresholds
| Verdict | Threshold | Evidence Requirement |
|---|---|---|
| PROVEN | 3/5 agents OR 50%+ weighted confidence | Reproducible evidence |
| REFUTED | Counter-evidence invalidates | Counter-proof exists |
| CONTESTED | 3/5 split after 2 challenge rounds | Document both sides |
| INSUFFICIENT_EVIDENCE | Cannot reach verdict | Request investigation |
Conflict Structure
File Output
Manifest Entry
Integration Points
Base Protocol
- Inherits task lifecycle (focus, execute, complete)
- Inherits manifest append requirement
- Inherits error handling patterns
Protocol Interactions
| Combined With | Behavior |
|---|---|
| research | Research provides evidence for voting |
| specification | Consensus resolves spec ambiguities |
| contribution | Consensus validates contributions |
HITL Escalation
| Condition | Action |
|---|---|
| Contested verdict (3/5 split) | Present conflict to user |
| Critical severity conflict | Immediate escalation |
| Insufficient evidence | Request user guidance |
| Unanimous suspicious consensus | Verify with user |
Example
Task: Decide on codebase map architecture Manifest Entry:Integration
Implementation Location
Library:lib/contribution-protocol.sh
Primary Function: contribution_compute_consensus(epic_id, [manifest_path])
- Loads complete contributions for epic
- Groups decisions by question ID across contributions
- Runs weighted voting per question
- Classifies: unanimous/majority = resolved, split = unresolved
- Flags unresolved questions for HITL review
contribution_weighted_vote(votes_json)- Calculates weighted consensuscontribution_create_synthesis(consensus_json, epic_id)- Creates Markdown synthesis
CLI Usage
Note: No dedicatedcleo consensus command exists yet. Consensus computation is invoked programmatically through the contribution workflow.
Programmatic Usage:
Orchestrator Integration
Spawn Context: When spawning consensus agents via orchestrator:EXIT_PROTOCOL_CONSENSUS(61) - Consensus protocol violationEXIT_PROTOCOL_GENERIC(67) - Generic protocol error
Validation Hook
Function:validate_consensus_protocol(task_id, manifest_entry, voting_matrix, strict)
Location: lib/protocol-validation.sh
Validates:
- CONS-001: ≥2 options in voting matrix
- CONS-003: Confidence scores 0.0-1.0
- CONS-004: Top confidence ≥50% threshold
- CONS-007: agent_type = “analysis”
Anti-Patterns
| Pattern | Why Avoid |
|---|---|
| Accepting unanimous consensus without scrutiny | May indicate groupthink |
| Skipping evidence citations | Decisions lack foundation |
| Binary voting without confidence | Loses nuance |
| Ignoring minority positions | May miss valid concerns |
| Premature escalation | Wastes human attention |
Protocol Version 1.0.0 - Consensus Protocol
