The Beta-Bernoulli model

Each (phaseType, agentId) pair maintains two counters: α (successes) and β (failures). These parameterize a Beta distribution.

haikuθ=0.84α=7 β=1sonnetθ=0.71α=5 β=2opusθ=0.91α=9 β=0selected

θ ~ Beta(α + 1, β + 1) — agent with highest sampled θ is selected

function selectAgent(phaseType, candidates) {
  const samples = candidates.map(agent => {
    const { alpha, beta } = getDistribution(phaseType, agent.id)
    const theta = sampleBeta(alpha + 1, beta + 1)
    return { agent, theta }
  })
  return samples.sort((a, b) => b.theta - a.theta)[0].agent
}

function updateDistribution(phaseType, agentId, success) {
  const dist = getDistribution(phaseType, agentId)
  if (success) dist.alpha++
  else dist.beta++
  saveDistribution(phaseType, agentId, dist)
}
Convergence

After ~20 runs on a task type, distributions converge and quality gains plateau. Projects with repetitive tasks (CRUD features, migrations, specs) converge fastest.