Council Mode and Deliberation
Relevant source files
The following files were used as context for generating this wiki page:
Council Mode is a structured multi-agent deliberation framework within the swarm architecture designed to ensure high-quality decision-making, code review, and architectural alignment. It operates through two primary mechanisms: the Work Complete Council (for phase and project-level quality gates) and the General Council (for advisory deliberation and specification review). These systems utilize peer-review protocols (NSED arXiv:2601.16863) to move beyond simple headcounts toward confidence-weighted consensus and targeted deliberation.
Sources: src/council/general-council-service.ts:10-18, src/agents/council-prompts.ts:4-15, src/council/types.ts:161-167
Architecture and Components
The Council system is divided into two distinct services that share similar synthesis logic but serve different stages of the development lifecycle.
Work Complete Council
The Work Complete Council acts as a mandatory quality gate at the end of a phase or project. It synthesizes verdicts from five specialized agents to determine if work can advance.
- Agents involved: Critic, Reviewer, SME, Test Engineer, and Explorer.
- Verdicts:
APPROVE,CONCERNS, orREJECT. - Veto Priority: By default, any single
REJECTverdict blocks the entire council from approving.
Sources: src/council/council-service.ts:17-48, src/council/types.ts:32-37
General Council
The General Council is an advisory system used for researching complex questions or reviewing specifications. It utilizes a three-agent set:
- Generalist: Reasons from first principles and integrates broad perspectives.
- Skeptic: Stress-tests assumptions and identifies edge cases.
- Domain Expert: Provides deep technical precision and concrete implementation details.
Sources: src/agents/council-prompts.ts:70-128, src/council/general-council-types.ts:10-21
Data Flow for General Council Deliberation
The following diagram illustrates the two-round deliberation protocol used by the General Council.
The Architect gathers research context upfront and provides it to all members. Round 1 involves independent reasoning. If disagreements are detected, Round 2 forces agents to engage with opposing arguments.
Sources: src/agents/council-prompts.ts:17-40, src/council/general-council-service.ts:10-18
Deliberation Protocols
NSED Peer-Review Protocol
The General Council follows the NSED (Nature-Science-Evidence-Design) peer-review protocol. Agents must provide a confidence score (0.0–1.0) and enumerate areas of uncertainty.
Quadratic Voting & Consensus
Consensus is not determined by a simple majority. Instead, the system uses Quadratic Voting where claims are weighted by member confidence. A claim becomes a "consensus point" only if its weighted agreement exceeds a threshold (typically 0.6).
$$WeightedAgreement = \frac{\sum Confidence}{TotalMembers}$$
Sources: src/council/general-council-service.ts:12-16, src/council/general-council-service.ts:63-100
Round 2: Stance Keywords
When a disagreement persists into Round 2, members must use specific keywords to declare their stance:
- MAINTAIN: The original position holds; supported by evidence.
- CONCEDE: The opposing position is correct; specifies what was wrong.
- NUANCE: Both positions are partially right; defines a distinguishing boundary condition.
Sources: src/agents/council-prompts.ts:33-38, src/council/general-council-service.ts:117-133
Technical Implementation
Key Data Structures
CouncilMemberVerdict (Work Complete Council)
| Field | Type | Description |
|---|---|---|
agent | CouncilAgent | One of critic, reviewer, sme, test_engineer, explorer. |
verdict | CouncilVerdict | APPROVE, CONCERNS, or REJECT. |
confidence | number | 0.0 to 1.0 confidence score. |
findings | CouncilFinding[] | Array of specific issues found. |
criteriaUnmet | string[] | IDs of mandatory criteria that failed. |
Sources: src/council/types.ts:39-61
GeneralCouncilResult
| Field | Type | Description |
|---|---|---|
question | string | The original question put to the council. |
consensusPoints | string[] | Claims that cleared the weighted threshold. |
persistingDisagreements | string[] | Topics not resolved by Round 2 concessions. |
synthesis | string | Markdown representation of the council's findings. |
Sources: src/council/general-council-types.ts:63-80
Synthesis Logic
The synthesis process involves clustering similar claims across different agent responses. Similarity is calculated using Jaccard overlap of tokenized text.
function similarity(a: string, b: string): number {
const tokensA = new Set(tokenize(a));
const tokensB = new Set(tokenize(b));
if (tokensA.size === 0 || tokensB.size === 0) return 0;
let intersection = 0;
for (const t of tokensA) if (tokensB.has(t)) intersection++;
const union = tokensA.size + tokensB.size - intersection;
return union === 0 ? 0 : intersection / union;
}
Sources: src/council/general-council-service.ts:32-41
Configuration Options
Council behavior is governed by CouncilConfig (for quality gates) and GeneralCouncilConfig (for advisory modes).
| Option | Type | Default | Description |
|---|---|---|---|
enabled | boolean | false | Master feature flag for council mode. |
maxRounds | number | 3 | Maximum deliberation rounds before escalation. |
vetoPriority | boolean | true | If true, any REJECT verdict blocks approval. |
minimumMembers | number | 3 | Minimum quorum required for a valid synthesis. |
deliberate | boolean | true | Enables Round 2 reconciliation in General Council. |
searchProvider | string | tavily | Provider for architect-led research passes. |
Sources: src/council/types.ts:161-182, src/council/general-council-types.ts:114-135
Sequence of Operations
The following sequence diagram represents a typical Phase-Level Council review.
Summary
Council Mode and Deliberation provide the swarm with a rigorous framework for validating work and exploring technical designs. By utilizing multi-model perspectives and formal deliberation protocols, it reduces the risk of hallucinations and architectural drift. The Work Complete Council enforces high standards for implementation, while the General Council acts as a collaborative research body for the Architect.
Sources: src/council/general-council-service.ts:10-18, src/agents/architect.ts:635-645