ADR-003: Agent Orchestration Mapping
Status
Proposed
Context
CODITECT has evolved multiple agent orchestration patterns across 776 agents:
CODITECT Patterns (Implicit):
- MoE (Mixture of Experts): Router selects single best agent from candidate pool
- Independent Parallel: Multiple agents execute different tasks without coordination
- Orchestrator-Delegated: Central coordinator dispatches work to specialized agents
- Peer Review: Multiple agents analyze same input, results compared/voted
- Sequential Pipeline: Output of one agent becomes input to next
Brainqub3 Agent Labs provides 5 explicit architecture types based on arXiv:2512.08296:
Agent Labs Architectures (Explicit):
- SAS (Single-Agent System): One agent handles the entire task
- Independent: Multiple agents work in parallel without communication
- Centralised: Central coordinator delegates to specialized agents
- Decentralised: Peer-to-peer agent communication with consensus
- Hybrid: Combination of centralised coordination + peer communication
To benchmark CODITECT orchestration using Agent Labs, we must define a mapping between these pattern sets. The mapping determines which CODITECT behaviors can be analyzed with which Agent Labs metrics.
Key constraints:
- Not all CODITECT patterns have exact Agent Labs equivalents
- Some CODITECT behaviors span multiple Agent Labs types
- The mapping must preserve semantic intent (e.g., "no coordination" vs "full consensus")
- Agent Labs coordination metrics (overhead, message density, redundancy) depend on architecture type
Decision
Establish the following mapping from CODITECT orchestration patterns to Agent Labs architecture types:
| CODITECT Pattern | Agent Labs Type | Justification |
|---|---|---|
| MoE (single selection) | SAS | Router selects one agent; effectively single-agent from task perspective |
| Independent Parallel | Independent | Direct match: no coordination, parallel execution |
| Orchestrator-Delegated | Centralised or Hybrid | Centralised if no peer communication; Hybrid if agents can exchange info |
| Peer Review | Decentralised | Agents independently analyze, then consensus/voting (peer communication) |
| Sequential Pipeline | Centralised | Orchestrator manages handoffs; agents don't directly communicate |
Adapter Implementation:
Create scripts/scaling-analysis/adapter.py to translate CODITECT agent invocations into Agent Labs experiment configurations. The adapter will:
- Detect orchestration pattern from CODITECT command metadata or invocation structure
- Map to Agent Labs architecture using the table above
- Configure experiment parameters (agent count, communication topology, task distribution)
- Execute Agent Labs run with CODITECT agents as experimental subjects
- Report coordination metrics back to CODITECT for analysis
Ambiguity Resolution:
- Orchestrator-Delegated → Centralised vs Hybrid: Default to Centralised unless CODITECT agents explicitly share state (then Hybrid)
- MoE (multi-selection) → Independent: If MoE invokes multiple agents in parallel with no coordination, map to Independent
- Undefined patterns → Manual classification: Log warning and require explicit
--architectureflag
Alternatives Considered
1. One-to-One Strict Mapping
Pros:
- Simplest implementation
- Clear, unambiguous
Cons:
- CODITECT has more patterns than Agent Labs types (5 CODITECT → 5 Agent Labs forces lossy mapping)
- Ignores nuance (e.g., Orchestrator-Delegated can be Centralised OR Hybrid)
- Fails when new CODITECT patterns emerge
2. Extended Agent Labs Types
Pros:
- Could define CODITECT-specific architecture types (e.g., "MoE-Orchestrated")
- Preserves all nuance
Cons:
- Breaks compatibility with paper-aligned model (arXiv:2512.08296 only defines 5 types)
- Cannot use Agent Labs built-in coordination metrics
- Loses ability to compare CODITECT results with Agent Labs baseline experiments
- High maintenance burden (must extend scaling model math)
3. Multi-Architecture Experiments (Run Same Task with Multiple Mappings)
Pros:
- Explores parameter space fully
- Captures ambiguity in data
Cons:
- Expensive (5x API cost per experiment)
- Adds complexity without clear benefit
- Results difficult to interpret (which architecture is "true"?)
4. No Mapping (Manual Configuration Only)
Pros:
- Maximum flexibility
- User controls everything
Cons:
- High friction for experimentation
- Requires deep understanding of both CODITECT and Agent Labs
- Error-prone (easy to misclassify)
- No automation benefits
Consequences
Positive
- Benchmarking Enabled: CODITECT orchestration patterns can now be quantitatively analyzed
- Coordination Metrics: Access to 5 metrics (overhead, message density, redundancy, efficiency, error amplification)
- Pattern Validation: Can test whether CODITECT patterns match theoretical scaling predictions
- Cost Optimization: Identify which patterns have high coordination overhead for specific task types
- Standardized Vocabulary: Agent Labs types provide common language for discussing orchestration
- Automatic Classification: Adapter reduces manual experiment setup
- Incremental Adoption: Can start with clear mappings (Independent, Centralised), add nuance later
Negative
- Lossy Mapping: Some CODITECT nuance lost in translation (e.g., MoE router intelligence not captured)
- Adapter Complexity: Must maintain mapping logic as CODITECT patterns evolve
- Ambiguity: Orchestrator-Delegated requires runtime detection of peer communication
- False Equivalence Risk: Agent Labs "Centralised" assumes specific coordination topology that might not match CODITECT
- Limited Pattern Coverage: New CODITECT patterns (e.g., Hierarchical Orchestration) have no clear mapping
- Measurement Bias: Coordination metrics designed for Agent Labs types might not fully capture CODITECT behavior
Risks
-
Misclassification: Adapter incorrectly maps CODITECT pattern, leading to invalid metrics
- Mitigation: Log classification decisions; allow manual override with
--architectureflag
- Mitigation: Log classification decisions; allow manual override with
-
Pattern Drift: CODITECT orchestration evolves, mapping becomes stale
- Mitigation: Version adapter alongside CODITECT releases; include pattern detection tests
-
Metric Misinterpretation: Users treat coordination metrics as absolute when they're architecture-specific
- Mitigation: Document metric semantics; include architecture type in all reports
-
Over-Simplification: Mapping forces binary choices (Centralised vs Hybrid) when reality is spectrum
- Mitigation: Support "closest match" heuristic; expose uncertainty in logs
-
Incompleteness: Not all CODITECT use cases fit Agent Labs types
- Mitigation: Identify gaps early; extend mapping incrementally; document known limitations
Implementation Notes
Adapter Module Structure
# scripts/scaling-analysis/adapter.py
from enum import Enum
from typing import Optional
class AgentLabsArchitecture(Enum):
SAS = "sas"
INDEPENDENT = "independent"
CENTRALISED = "centralised"
DECENTRALISED = "decentralised"
HYBRID = "hybrid"
class CODITECTPattern(Enum):
MOE_SINGLE = "moe_single"
INDEPENDENT_PARALLEL = "independent_parallel"
ORCHESTRATOR_DELEGATED = "orchestrator_delegated"
PEER_REVIEW = "peer_review"
SEQUENTIAL_PIPELINE = "sequential_pipeline"
PATTERN_MAPPING = {
CODITECTPattern.MOE_SINGLE: AgentLabsArchitecture.SAS,
CODITECTPattern.INDEPENDENT_PARALLEL: AgentLabsArchitecture.INDEPENDENT,
CODITECTPattern.PEER_REVIEW: AgentLabsArchitecture.DECENTRALISED,
CODITECTPattern.SEQUENTIAL_PIPELINE: AgentLabsArchitecture.CENTRALISED,
# ORCHESTRATOR_DELEGATED handled dynamically
}
def detect_pattern(command_metadata: dict) -> CODITECTPattern:
"""Detect CODITECT orchestration pattern from command/task metadata."""
# Implementation: analyze command structure, agent invocation count, etc.
pass
def map_to_architecture(
pattern: CODITECTPattern,
has_peer_communication: bool = False
) -> AgentLabsArchitecture:
"""Map CODITECT pattern to Agent Labs architecture type."""
if pattern == CODITECTPattern.ORCHESTRATOR_DELEGATED:
return (AgentLabsArchitecture.HYBRID if has_peer_communication
else AgentLabsArchitecture.CENTRALISED)
return PATTERN_MAPPING.get(pattern, AgentLabsArchitecture.SAS)
Example Mapping Flow
# User invokes CODITECT command
/agent-compare frontend-react-expert backend-api-expert security-specialist "analyze auth flow"
# Adapter detects pattern
pattern = detect_pattern({
"agent_count": 3,
"coordination": "orchestrator", # From command metadata
"peer_communication": False
})
# Result: CODITECTPattern.ORCHESTRATOR_DELEGATED
# Map to Agent Labs type
architecture = map_to_architecture(pattern, has_peer_communication=False)
# Result: AgentLabsArchitecture.CENTRALISED
# Configure Agent Labs experiment
agent-labs run \
--scenario coditect_auth_flow_analysis \
--architecture centralised \
--agents 3 \
--coordinator-type orchestrator
Pattern Detection Heuristics
| Indicator | Pattern |
|---|---|
| Single agent invoked | MOE_SINGLE or SAS |
| Multiple agents, no coordination flag | INDEPENDENT_PARALLEL |
| Orchestrator role present | ORCHESTRATOR_DELEGATED |
| "review", "vote", "consensus" in metadata | PEER_REVIEW |
| Agent outputs chained (A→B→C) | SEQUENTIAL_PIPELINE |
Manual Override
# Adapter auto-detects Centralised, but user knows it's Hybrid
/scaling-run coditect_task --architecture hybrid --override-detection
Logging Example
[scaling-adapter] Detected pattern: ORCHESTRATOR_DELEGATED
[scaling-adapter] Peer communication: False
[scaling-adapter] Mapped to Agent Labs architecture: CENTRALISED
[scaling-adapter] Running experiment with 4 agents...
Future Extensions
- Dynamic Topology Detection: Analyze actual message passing at runtime to refine Centralised vs Hybrid classification
- Pattern Taxonomy Expansion: Add new CODITECT patterns as they emerge (e.g., Hierarchical, Streaming)
- Confidence Scores: Report mapping confidence (e.g., "80% Centralised, 20% Hybrid")
- Agent Labs Type Extensions: Propose new architecture types to Agent Labs upstream if CODITECT uncovers novel patterns
References
- Paper: arXiv:2512.08296 - "Scaling Laws for Multi-Agent Systems"
- Agent Labs Architectures: Section 2.2 "Architecture Types"
- CODITECT MoE Patterns:
skills/moe-task-execution/SKILL.md - CODITECT Agent System:
agents/directory (776 agents) - Related ADRs:
- ADR-001: Agent Labs Adoption
- ADR-002: Integration Pattern
- ADR-004: Scaling Model for Agent Selection
Author: Claude (Sonnet 4.5) Date: 2026-02-16 Track: H (Framework) Task ID: H.0