Multi-Agent Coordination

Agent registration, task locking, intelligent work distribution, and quality gates

Step 1
Register
Agent declares ID, role, capabilities. Gets tracked.
Step 2
Get Work
getNextTask() scores candidates across 4 dimensions.
Step 3
Lock Task
Exclusive lock. 30-min TTL. One agent per task.
Step 4
Execute
Agent works. BRE validates transitions. Audit trail records.
Step 5
Complete + Handoff
Approve via BRE. Release lock. Find unblocked tasks. Recommend next.
Work Distribution — 4-Dimension Scoring (max 100)
0-40
Cascade Value
How many downstream tasks does completing this unblock? BFS over reverse dependency graph.
0-25
Epic Momentum
Is this epic in progress? Last task in epic gets max score. Finish what's started.
0-20
Capability Match
Does agent's role match the task? Coding+feature, testing+QA. Soft match, no penalties.
0-15
Dependency Freshness
Was a dependency just completed? Pick up momentum while context is fresh.
AgentService
  • Register agent (ID, role, capabilities)
  • Task locking with 30-min TTL
  • Same agent can extend lock
  • Only lock owner can release
  • Heartbeat (stale after 30 min)
  • File persistence for crash recovery
  • Expired locks auto-cleaned
WorkDistributionService
  • getNextTask() — scored recommendation
  • Top pick + 3 alternatives returned
  • Human-readable reasoning per pick
  • Advisory only (agents decide)
  • completeAndHandoff() atomic chain
  • Finds newly unblocked tasks
  • All recommendations are audited
MergeReadinessService
  • 6 checks: workflow, PR reviews, deps, epic integrity, security, compliance
  • Composes existing services
  • Single pass/fail result
  • Override mechanism (audited)
  • Configurable thresholds
  • minReviews=1, minCompliance=70
Advisory, not prescriptive: Work recommendations are scored suggestions. Agents (or humans) decide whether to follow them. Task locks are the only hard constraint: one agent per task at a time.
Every action is audited: Recommendations, handoffs, lock acquisitions, and releases all emit events to the EventBus. Per-agent compliance scoring is possible because the audit trail captures actor identity on every operation.