Add the 'evolve' subcommand that ties together the LLM prompt builder
and ensemble components:
- Load programs from target island
- Select parents via tournament selection
- Analyze optional replay files for strategic context
- Build meta description from current ladder state
- Assemble evolution prompt with all context
- Run LLM ensemble (fast tier + strong tier refinement)
- Output generated bot code
Usage: acb-evolver evolve -island alpha -lang go [-replay file.json] [-out file.go]
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add parent sampling via tournament selection (selector/tournament.go)
- Add replay analyzer to extract key moments, strategies, weaknesses
- Add meta builder for leaderboard summary and dominant strategies
- Add prompt assembler combining parent code + replay + meta context
- Add LLM ensemble with fast tier (GLM-5-Turbo) for bulk generation
and strong tier (GLM-5) for refinement passes
- Add code extraction from LLM responses with language validation
- Add convert utilities for type conversion between packages
- Comprehensive test coverage for all components
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add Delete, List, ListTopByIsland, and GetLineage methods to the programs
Store. These complete the CRUD operations needed for the evolution pipeline:
- Delete: Remove programs by ID
- List: Paginated listing of all programs
- ListTopByIsland: Get top N programs by fitness for a specific island
- GetLineage: Recursively traverse parent chain for lineage tracking
Also adds comprehensive tests for all new operations including lineage
tracking through grandparent-parent-child chains.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add R2 client module (cmd/acb-evolver/internal/live/r2.go) with
S3-compatible uploads to Cloudflare R2
- UploadLiveJSON() uploads evolution state to evolution/live.json
with Cache-Control: max-age=10 for near-real-time updates
- Add -r2 and -r2-only flags to live-export subcommand
- Add tests for R2 config validation and credential handling
- Update frontend to fetch live data from R2 URL instead of Pages
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 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>
- selector: tournament selection for parent sampling from island populations
- prompt: assembles evolution prompts from parent code, replay analysis, and meta description
- llm: OpenAI-compatible client routing to ZAI proxy with fast (GLM-5-Turbo) and strong (GLM-5) tiers, plus code block extraction from model responses
- Tests for prompt assembly, code extraction, and tournament selection
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>