ai-code-battle/cmd/acb-evolver/internal/db
jedarden 76e8791e4d Add evaluation arena, promotion gate, and retirement policy (Phase 7)
- arena/arena.go: 10-match mini-tournament running candidate as a local
  subprocess against diverse live opponents sampled across the rating
  distribution; AES-GCM secret decryption for opponent auth
- arena/psro.go: Nash equilibrium computation for the 1×K meta-game;
  FictitiousPlayNash included for future K×K support
- arena/winrate.go: Wilson-score 95% CI for win-rate calculation; draws
  counted as 0.5 wins
- arena/gate.go: two-part promotion gate — Nash value ≥ threshold AND
  MAP-Elites niche fill or improvement; detailed reason strings
- promoter/promoter.go: full promotion pipeline — bot source + Dockerfile
  + K8s Secret/Deployment/Service manifests, docker build, git commit/push
  (ArgoCD sync), kubectl readiness poll, bots-table INSERT, programs-table
  update; RetireBot and EnforcePolicy (rating threshold + population cap 50)
- db/db.go: add bot_name / bot_secret migration columns
- db/programs.go: ListPromoted, SetBotNameAndSecret, UnsetPromoted,
  GetByBotID, PromotedCount helpers for promotion/retirement lifecycle
- main.go: evaluate and retire subcommands wiring arena + gate + promoter;
  remove unused island flag from evaluate
- arena/arena_test.go: 21 unit tests covering Nash, Wilson CI, Gate logic,
  and selectDiverse opponent sampling
- promoter/promoter_test.go: tests for Dockerfiles, bot-ID/secret generation,
  AES-GCM helpers, and K8s manifest templates

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 23:32:37 -04:00
..
seeds Add validation pipeline, sandbox, and evolution DB layer (Phase 7) 2026-03-26 22:45:13 -04:00
db.go Add evaluation arena, promotion gate, and retirement policy (Phase 7) 2026-03-26 23:32:37 -04:00
programs.go Add evaluation arena, promotion gate, and retirement policy (Phase 7) 2026-03-26 23:32:37 -04:00
programs_test.go Add validation pipeline, sandbox, and evolution DB layer (Phase 7) 2026-03-26 22:45:13 -04:00
seed.go Add validation pipeline, sandbox, and evolution DB layer (Phase 7) 2026-03-26 22:45:13 -04:00
validation_log.go Add validation pipeline, sandbox, and evolution DB layer (Phase 7) 2026-03-26 22:45:13 -04:00