- Web build: passing (273ms, 5 chunks)
- Worker-api tests: 17/17 passing
- Git status: clean, up to date with origin/master
- All phases 1-10 complete - project finished
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Web build passing (272ms)
- Worker-api tests: 17/17
- Architecture conformance verified
- No remaining implementation work
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- All 10 phases implemented and verified
- Worker-api tests: 17/17 passing
- Web build: successful (268ms)
- Architecture conformance: K8s manifests in correct location
- No TODO/FIXME/HACK markers in Go codebase
- Git clean, up to date with origin
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Verified:
- Web build: passing (dist/ generated successfully)
- TypeScript: no compilation errors
- Worker-api tests: 17/17 passing
- All phases marked complete per plan
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
All Phase 10 deliverables implemented:
- Weekly meta reports with LLM-enhanced narratives
- Public match data documentation at /docs/api
- Accessibility suite (color-blind palette, shapes, keyboard shortcuts)
- Live evolution observatory with R2 streaming
Phase 10 exit criteria verified:
✅ Weekly editorial content as blog posts
✅ All match data as documented static JSON
✅ WCAG accessibility standards met
✅ Live evolution observatory streaming
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add :focus-visible styles for all interactive elements (buttons, links, inputs)
- Add skip link for screen reader navigation ("Skip to main content")
- Add high contrast focus enhancement for prefers-contrast: more
- Update PROGRESS.md with keyboard shortcuts and focus indicator details
Phase 10 accessibility suite now complete with WCAG 2.1 focus-visible compliance.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add LLMBaseURL and LLMAPIKey config options for narrative generation
- Wire up LLM client to generateBlog() when LLM is configured
- Fix ParticipantData type usage in test files
- Simplify rivalry arc detection (remove alternation check)
- Fix type conversion in upset detection gap calculation
- Mark narrative engine as complete in PROGRESS.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Created narrative.go with story arc detection per plan §15.5
- Arc types: Rise, Fall, Rivalry, upset, evolution, comeback
- LLMClient for OpenAI-compatible API narrative generation
- generateLLMChronicles() using narrative engine
- Updated blog.go with LLM integration
- Template-based fallback when LLM unavailable
- Added tests in narrative_test.go
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- New /docs/api route with OpenAPI-style endpoint documentation
- Documents all Pages endpoints (leaderboard, bots, matches, playlists, blog)
- Documents R2 endpoints (live evolution, replays, thumbnails, cards)
- Documents B2 endpoints (cold archive for all data)
- Includes JSON Schema for replay format
- Recommended fetching pattern with R2-then-B2 fallback
- Cache behavior documentation for each endpoint type
- Added link from Getting Started page to API Reference
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>
- Add blog generation to Go index builder (cmd/acb-index-builder/blog.go):
- Weekly meta report generation with competitive analysis
- Story arc chronicles: rise stories, upsets, rivalries
- Blog index and individual post JSON generation
- Add blog page to web SPA (web/src/pages/blog.ts):
- Blog listing with type filters (all/meta-report/chronicle)
- Individual post view with markdown rendering
- Tag cloud and post metadata display
- Added /blog and /blog/:slug routes
- Add Blog link to navigation menu
- Add placeholder blog data files for initial content
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Mark Phase 9 as complete
- Add Phase 10 in progress section
- Document accessibility suite deliverables
- Record recent changes for Phase 10 work
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add Canvas-rendered PNG card generation in cmd/acb-index-builder/cards.go
- 1200x630 images for social sharing (OG/Twitter)
- Rating tiers with color coding (gold/silver/bronze/green/gray)
- Win rate color coding (green/blue/yellow/red)
- Rank badges for top 100 bots
- Evolved bot badges with island indicator
- Add card upload to R2 warm cache and B2 cold archive
- Add Open Graph meta tags in web/app.html
- Add dynamic OG tag management in web/src/og-tags.ts
- Update bot profile page to set OG tags on load
- Add BuildTimeout config field (fixes test failures)
- Add comprehensive tests for card generation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Per plan §11.1, the index builder reads PostgreSQL and generates all JSON
index files for Cloudflare Pages deployment:
- main.go: Build cycle orchestration with configurable timeout, self-restart
- config.go: Environment-based configuration with sensible defaults
- db.go: PostgreSQL data fetching for bots, matches, series, seasons, predictions
- generator.go: JSON index generation (leaderboard, bots, matches, playlists)
- deploy.go: Cloudflare Pages deployment via wrangler, R2 warm cache pruning
- Dockerfile: Multi-stage build with Go + Node.js + wrangler CLI
- main_test.go: Tests for config, index generation, playlists
Index builder runs on 15-minute cycles, deploys to Pages every ~90 minutes,
and prunes R2 warm cache weekly to stay within 10GB free tier.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Embeddable Replay Widget:
- web/embed.html: Minimal standalone HTML with Open Graph and Twitter Card tags
- web/src/embed.ts: TypeScript embed viewer with auto-play, progress bar, keyboard controls
- R2 warm cache + B2 cold archive fallback for replay loading
- ~7KB gzipped (well under 50KB target)
Replay Playlists:
- cmd/acb-indexer/src/playlists.ts: Auto-curated playlist generator
- Featured, upsets, comebacks, domination, close games, long games, weekly categories
- Uses match data to detect notable games
- web/src/pages/playlists.ts: SPA page for browsing playlists
- web/src/api-types.ts: Added playlist types and fetch functions
Other changes:
- web/src/replay-viewer.ts: Added getIsPlaying() method for embed viewer
- web/vite.config.ts: Added embed.html as build entry point
- web/app.html: Added Playlists nav link
- web/public/img/embed-placeholder.svg: OG image placeholder
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update current phase to Phase 9 (Platform Depth)
- Add Phase 7 (Evolution) completion section
- Add Phase 8 (Enhanced Features) completion section
- Add Phase 9 (Platform Depth) in-progress section
- Update file structure to include new modules:
- cmd/acb-evolver/ for evolution pipeline
- cmd/acb-wasm/ for WASM game engine
- cmd/acb-matchmaker/ for internal matchmaker
- New web pages: sandbox, evolution, clip-maker, etc.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Architecture conformance fix per plan §12 Phase 4:
- Plan specifies Matchmaker Deployment as internal service with no external exposure
- Extracted tickers.go from acb-api to new cmd/acb-matchmaker/
- Tickers: bot pairing (1 min), health checking (15 min), stale job reaping (5 min)
- Alerting webhooks moved from acb-api to acb-matchmaker
- Created Dockerfile for acb-matchmaker container
- Created K8s deployment manifest (no service needed - internal only)
- Fixed syntax error in cmd/acb-api/db.go (prematurely closed schemaSQL string)
This separates concerns per the plan:
- acb-api: HTTP endpoints for bot registration, job coordination, bot status
- acb-matchmaker: Internal tickers for matchmaking, health checks, reaping
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Architecture conformance fix per plan §9.3, §9.7, §12 Phase 6:
- K8s manifests must be in cluster-configuration/apexalgo-iad/ai-code-battle/
for ArgoCD Application to sync from the correct path
- Flat directory structure (no subdirectories) per cluster norms
- Naming convention: {name}-{kind}.yml
Changes:
- Moved all manifests from deploy/k8s/ to cluster-configuration/apexalgo-iad/ai-code-battle/
- Updated ArgoCD Application to point to new path with recurse: false
- Renamed files to follow flat naming convention:
- deployments/acb-api.yaml -> acb-api-deployment.yml
- services/acb-api.yaml -> acb-api-service.yml
- sealed-secrets/api-key.yaml -> acb-api-key-sealedsecret.yml
- etc.
- Removed deploy/k8s/ directory
- Updated PROGRESS.md with migration details
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>
Update r2_data URL from data.aicodebattle.com to r2.aicodebattle.com
to match the planned R2 bucket custom domain in the project plan.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements the monitoring alerting deliverable from Phase 6. The Alerter
module sends color-coded notifications to Discord and/or Slack webhooks
for operational events: bot health transitions, stale job re-enqueues,
and match errors. Includes per-key rate limiting to prevent alert storms.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implements the K8s-native Go API service per the plan architecture:
- HTTP server with graceful shutdown and env-var configuration
- PostgreSQL schema (bots, matches, match_participants, jobs, rating_history)
- Health/ready endpoints checking PostgreSQL and Valkey connectivity
- Bot registration with health check, HMAC secret gen, AES-256-GCM encryption
- Key rotation and bot status endpoints
- Job claim via Valkey BRPOP, result submission with Glicko-2 rating update
- Glicko-2 rating system: multi-player pairwise, Illinois volatility algorithm
- Background tickers: matchmaker (1m), health checker (15m), stale job reaper (5m)
- Worker API key authentication (Bearer/X-API-Key)
- Dockerfile, K8s Deployment (2 replicas), ClusterIP Service
- 30 unit tests covering Glicko-2, crypto, config, and handlers
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace broken Taylor series sin/cos approximations with math.Sin/math.Cos
in both engine/match.go and cmd/acb-mapgen. The Taylor series produced
incorrect results for angles > π, causing wrong positions in 3+ player maps.
Upgrade map generator wall placement from random scatter to cellular
automata (B5/S4 rule, 4 iterations) with rotational symmetry enforcement
and connectivity validation. Add comprehensive mapgen tests and dominance
win condition tests.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Create deploy/k8s/ directory with complete K8s manifests for the
ai-code-battle namespace on apexalgo-iad cluster:
- Namespace and ArgoCD Application (auto-sync, prune, self-heal)
- Match worker Deployment (2 replicas, metrics on :9090)
- Index builder Deployment (Recreate strategy)
- 6 strategy bot Deployments (random, gatherer, rusher, guardian, swarm, hunter)
- ClusterIP Services for all bots (cluster DNS resolution)
- SealedSecret templates (API key, R2 creds, bot secrets, Cloudflare token)
- All containers from forgejo.ardenone.com/ai-code-battle/ registry
- Health/readiness probes and resource limits on all deployments
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a metrics HTTP server to acb-worker exposing Prometheus text format
at /metrics, plus /health and /ready K8s probe endpoints. Tracks counters
(matches, errors, jobs, replays, polls, heartbeats) and histograms
(match duration, replay upload duration, replay size). Instruments the
full worker execution flow. Fixes .gitignore binary patterns to use
root-anchored paths so cmd/ subdirectories aren't incorrectly excluded.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Corrected the full-K8s migration — the static site belongs on Cloudflare
Pages, not Nginx in K8s. The architecture is now:
- Cloudflare Pages: SPA + pre-computed JSON indexes (deployed by K8s
index builder via wrangler every ~90 min)
- Cloudflare R2: replays, per-match metadata, evolution live.json,
thumbnails, bot cards (uploaded by K8s workers via S3 API)
- apexalgo-iad K8s: Go API (Traefik ingress), PostgreSQL (CNPG),
Valkey (job queue), match workers, strategy bots, evolver,
index builder
Browser loads SPA from Pages, replays from R2, calls Go API on K8s.
No Nginx pod, no PersistentVolume for web data. R2 is the data bus
between K8s agents and the Cloudflare-served website.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All periodic workloads now run as Deployments with internal sleep loops
that exit after a configurable lifetime (default 4h) for K8s to restart.
No CronJobs or Jobs used.
- Index builder: 15-min sleep loop, writes JSON to PV, exits after 4h
- Replay pruning: folded into index builder (weekly cycle check),
acb-replay-pruner container removed
- Evolver: already used this pattern (4h exit)
- Match workers: standard long-running Deployment (no periodic exit needed)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Major architecture change: everything now deploys to the apexalgo-iad
Kubernetes cluster via ArgoCD GitOps.
Replaced:
- Cloudflare Pages → Nginx container in Web Pod
- Cloudflare Workers → Go API container in Web Pod (same pod, shared PVC)
- Cloudflare D1 → CNPG PostgreSQL (cnpg-apexalgo cluster)
- Cloudflare R2 → SATA (Cinder CSI) PersistentVolume
- Rackspace Spot → K8s Deployments in ai-code-battle namespace
New infrastructure:
- Web Pod: 2-container pod (Nginx + Go API) sharing an RWO SATA PVC
- Match workers: K8s Deployment with configurable replicas
- Strategy bots: individual Deployments + Services
- Job queue: Valkey (Redis-compatible, existing cluster resource)
- Cron jobs: K8s CronJobs for index building, replay pruning, health checks
- CI/CD: Argo Workflows + Events (GitHub webhook triggers)
- Secrets: SealedSecrets encrypted in git
- TLS: Traefik IngressRoutes + cert-manager
- CDN: Cloudflare free plan as reverse proxy only (no CF services)
- D1 SQLite schema → PostgreSQL (proper types, FKs, indexes, JSONB)
Storage: SATA Cinder CSI (RWO). Web Pod and Index Builder CronJob
share the PVC via node affinity (both scheduled to same node).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Runs Go engine tests with race detector on every push/PR
- Runs TypeScript tests for worker-api and indexer
- Builds web app and uploads artifacts
- Builds all Go CLI tools (acb-local, acb-mapgen, acb-worker)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add comprehensive README with project structure, quick start, and deployment info
- Document all 6 strategy bots with their languages and strategies
- Include testing and architecture overview
- Update PROGRESS.md to reflect this change
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add comprehensive .gitignore for binaries, node_modules, and build outputs
- Add package-lock.json for cmd/acb-indexer and worker-api
- Ensures reproducible builds with exact dependency versions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add /health (liveness) and /ready (readiness) endpoints to worker-api
- /ready checks database connectivity and returns 503 if unavailable
- Update DEPLOYMENT.md with health endpoint documentation
- Update PROGRESS.md to reflect monitoring setup complete
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add Dockerfile for acb-worker match execution container
- Add docker-compose.bots.yml for orchestrating all 6 strategy bots
- Add docker-compose.workers.yml for worker and indexer deployment
- Add .env.example documenting all required environment variables
- Add DEPLOYMENT.md with deployment guide and troubleshooting
- Update PROGRESS.md with Phase 6 progress
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add web/pages.json documenting Pages project settings and data paths
- Add web/public/_headers for cache control on static assets
- Add web/public/robots.txt for SEO
- Add web/public/data/ placeholder structure for index files
- leaderboard.json
- bots/index.json
- matches/index.json
- Update PROGRESS.md marking Phase 5 complete
Phase 5 is now complete. Ready for Phase 6 (Deployment & Production).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Create app.html as SPA shell with navigation header and dark theme
- Add hash-based router (router.ts) for client-side navigation
- Implement page components:
- Home page with hero section and feature overview
- Leaderboard with ranking table and status indicators
- Match history with match cards and participant info
- Bot directory with bot cards sorted by rating
- Bot profile with stats, rating sparkline chart, and recent matches
- Registration form with API key display
- Replay viewer (integrated from Phase 3)
- Docs/Getting Started page with protocol overview
- Add API client (api-types.ts) for fetching data from Worker API
- Update vite.config.ts for multi-page build (index.html + app.html)
- Update PROGRESS.md with Phase 5 status and exit criteria
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add /api/data/export endpoint to worker-api for data export
- Create cmd/acb-indexer/ TypeScript container:
- API client for fetching data from Worker API
- Index generator for leaderboard, bot profiles, match index
- File writer for outputting JSON files
- Optional Cloudflare Pages deploy support
- Unit tests (6 tests)
- Update PROGRESS.md to mark Phase 4 complete
Phase 4 is now complete. All exit criteria met:
- Matchmaker cron creates jobs in D1
- Workers claim and execute matches
- Replays land in R2
- Results flow into D1
- Ratings update via Glicko-2
- Leaderboard.json rebuilds automatically
- Stale job reaper recovers from worker disappearance
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Worker polls Cloudflare Worker API for pending match jobs
- Claims jobs and executes matches using the game engine
- Uploads replays to R2 via S3-compatible API
- Sends heartbeats during match execution
- Submits results back to Worker API
- Includes retry logic with exponential backoff
- API client tests for job coordination endpoints
Also fixes glicko2.ts: export g() and E() functions for testing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add web/ directory with TypeScript + Vite build tooling
- Implement ReplayViewer class with Canvas-based grid rendering
- Add play/pause, scrub, and speed controls with keyboard shortcuts
- Implement fog of war perspective toggle per player
- Add score overlay with player names, scores, and energy
- Support loading replays from local file or URL
- Add match info panel and event log display
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>