Replace the flat horizontal playlist row with a curated layout:
- Top 3 featured playlists (Best of Week, Biggest Upsets, Closest Finishes)
displayed as distinct visual sections in a 2:1:1 grid
- "Best of Week" highlighted with a primary accent style
- Remaining playlists shown in a scrollable "More Collections" row
- "Browse all →" header link routes to /watch/playlists
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix nav/home breakpoints from 768px → 639px to match design system
- Add leaderboard mobile card view with tap-to-expand stats and full-stats link
- Add canvas wrapper aspect-ratio:1 on phone (fills full width, square viewport)
- Add commentary text scroll on mobile, win-prob header stacking
- Replay viewer: mobile controls, pinch-to-zoom, tap-to-play, swipe scrub,
floating view-mode toggle, debug telemetry slide-up sheet (already in place)
- Sandbox: desktop-required message with link already implemented
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove duplicate SWR cache (use shared fetchers from api-types.ts)
- Add territory view mode to featured replay embed
- Use demo replay fallback when no live matches available
- Compact layout with tighter spacing for 1080p above-the-fold
- Add missing placeholder data files: evolution/meta.json, seasons/index.json
- Fix unused import in cmd/acb-index-builder/s3_test.go
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add debug telemetry UI to replay viewer with player toggles,
priority-based target markers, and stacked reasoning boxes.
Fix undefined generateTestImage in main_test.go.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Covers buildFirstMatchPerBot, isNewBotDebutFast, buildPairFrequency,
isRivalryMatchFast, and integration test for playlist generation with
the optimized lookups.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Fix deploy.go to query actual table names (series_games not series_matches,
join through series_games for seasons instead of non-existent season_matches)
- Add playlist_matches table to exempt match IDs from R2 pruning
- Pre-build lookup maps for O(1) playlist match filtering instead of O(n²)
- Enhance home page featured replay to prefer AI-enriched matches
- Add enrichment test coverage (shouldEnrich criteria validation)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Verified all §11 deliverables are fully implemented:
series scheduler, seasonal ELO reset, bracket display, season leaderboard.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The series scheduler (series_season.go) and season management were already
fully implemented but not tracked in PROGRESS.md. Updates the file listing
to include series_season.go, series_season_test.go, Dockerfile in the
matchmaker, and series.ts, seasons.ts, season-detail.ts in pages.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Populate web/public/data/playlists/ with all 12 playlist slug JSON files
and update index.json so the frontend fetch calls work during local
development without requiring the index builder to have run.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
PredictionHistoryEntry was imported but never used, and API_BASE was
declared but never read. These caused tsc to fail with TS6196/TS6133.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Implement auto-curated playlists in the index builder: 12 playlist types
(closest finishes, upsets, comebacks, marathons, rivalry classics, etc.)
with weekly highlight curation. Add DB persistence, R2 pruning exemptions,
frontend pages, and AI commentary enrichment pipeline.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The buildSpotlightPrompt function accepted a rivalries parameter but never
used it. This adds top rivalry data to the LLM prompt so the generated
Counter-Strategy Spotlight can reference active rivalries. Test updated to
verify rivalry data appears in prompt output.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The series scheduler was scheduling games and creating series_games rows,
but never updated winner_id or incremented a_wins/b_wins when individual
matches completed. This left series in perpetual "active" state since
finalizeCompletedSeries checks win counts that were never incremented.
Add updateSeriesGameResults step that:
- Finds series_games with completed matches but NULL winner_id
- Updates winner_id from match_participants
- Increments a_wins or b_wins on the series table
Called as step 0 in tickSeriesScheduler, before finalization checks.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Enhance the WASM game sandbox with production-accurate Go engine:
- Add multi-player support (2-4 players) to Go WASM engine via JS callbacks
- New acbEngine.addPlayer/clearPlayers/runMatchMulti API for N-player matches
- Sandbox auto-loads Go WASM engine in background, falls back to TS engine
- Engine selector: Auto (Go WASM → TS fallback), Go WASM only, or TS only
- Engine status indicator shows which engine is active
- Performance panel reports which engine was used
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Worker resolves open predictions after writing match results (resolvePredictions + upsertPredictorStats)
- API endpoints: POST /api/predict, GET /api/predictions/open, GET /api/predictions/history
- Frontend /watch/predictions page with polling, prediction submission, and history display
- predictor_stats table tracks streaks and accuracy per predictor
- Series format selection: fix threshold from >200 to >=200 for bo3 eligibility
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace plain String.equals() with MessageDigest.isEqual() for
constant-time HMAC signature comparison. Switch from manual StringBuilder
JSON to Jackson ObjectMapper. Add typed Java records for game state,
moves, and config.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add forkable starter kit templates for Python, Go, JavaScript, Rust,
Java, and C# — each with HTTP server scaffold, HMAC auth, game types,
random strategy, Dockerfile, and GHCR workflow. Update /compete/docs
page with starter kit links and registration instructions.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Evolution page: live polling (10s), activity feed, candidate tracking,
statistics section, island overview with live.json schema
- Series page: detailed series view with game-by-game results
- Seasons page: season list with status and champion display
- Predictions page: enhanced prediction UI with open matches
- API types: add CycleInfo, Candidate, ActivityEntry, Totals for live.json
- Embed: improved embeddable replay widget
- Mobile CSS: responsive breakpoints and bottom tab bar
- Exporter: enhanced live.json generation with full cycle/candidate data
- Matchmaker: series scheduling support with config
- Worker: additional database queries for series/season data
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Extract all inline page renderers from app.ts into lazy-loaded modules and
remove 500+ lines of duplicated replay viewer code. Every route now uses
dynamic import() so page code loads on-demand.
Changes:
- Remove duplicated replay viewer (renderReplayPage, initReplayViewer) from
app.ts — now uses lazy import from pages/replay.ts
- Extract Watch Hub, Compete Hub, Season Detail, Docs, and 404 pages into
their own modules (pages/watch-hub.ts, compete-hub.ts, season-detail.ts,
docs.ts, not-found.ts)
- app.ts is now a pure routing module (~120 lines) with only lazy loaders
- Update vite.config.ts manualChunks: add replay-page, home, leaderboard
chunks; add node_modules guard to prevent vendor code in page chunks
- All §16.7 budget targets pass: app.js 1.6KB (target 30KB), replay 13KB
(target 80KB), sandbox 8.4KB (target 20KB), agentation separate
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- POST /api/register: bot registration with URL + shared secret validation
- GET /api/job: worker polls for next pending match job (authenticated)
- POST /api/job/:id/result: worker submits match result (winner, replay JSON)
- GET /api/replay/🆔 serve replay JSON from R2 warm cache (falls back to B2)
- GET /api/bot/🆔 bot profile JSON (rating, elo, record, metadata)
- GET /api/bots: leaderboard snapshot with pagination
- POST /api/ui-feedback: accept Agentation UI feedback
Authentication via Bearer token (worker API key). Shared secrets encrypted
with AES-256-GCM using ACB_ENCRYPTION_KEY.
Collect GameState snapshots during match execution (one per turn), then
run 100 random-play rollouts per snapshot post-match to compute per-turn
win probabilities and detect critical moments (|delta| > 0.15). Results
are stored in the replay JSON as win_prob and critical_moments fields.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
GH Actions are not used in this project (all CI/CD runs on Argo Workflows
in iad-ci). The acb-build WorkflowTemplate handles builds; the index-builder
handles Cloudflare Pages deploys internally via wrangler.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Installs Python 3, Node.js/TypeScript for bot validation sandbox.
Base image includes Go; Java/Rust/PHP validation is deferred to follow-up bead.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add §13.2 win probability graph and critical moment navigation to the
replay viewer.
- types.ts: add ReplayCriticalMoment interface; extend Replay with
win_prob ([][]float per turn) and critical_moments fields
- replay-viewer.ts: export CriticalMomentMarker; draw dashed vertical
lines with delta labels for critical moments on the sparkline canvas;
add setCriticalMoments / getCriticalMomentMarkers; update
createWinProbSparkline to accept click-to-scrub callback and replace
existing canvas on reload; refresh sparkline on every render()
- app.ts: add win-probability section below main canvas with prev/next
critical moment buttons, description label, and player legend;
initWinProb converts win_prob array to WinProbPoint[] and wires up
setCriticalMoments; graceful hide when win_prob absent
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Mounts the Agentation React component (v3) as a thin overlay on the vanilla TS
app via a React root shim. The toolbar appears bottom-right and lets users click
any element, annotate it, and generate structured markdown for AI agent feedback.
Submissions are persisted in localStorage and POSTed to /api/ui-feedback when
the API is available.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace os.ReadFile+os.WriteFile with io.Copy so large files (e.g. the 21MB
demo-replay-v2-6p.json) are never fully loaded into RAM during copyWebAssets.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add a web-builder stage to the Dockerfile (Vite/TS build) and copy the
resulting dist/ into the runtime image at /app/web/dist. Call copyWebAssets
each build cycle so HTML/JS/CSS is merged into the output dir before wrangler
deploys — previously only JSON data files were uploaded, causing CF Pages to
serve 404 at the root.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
wrangler creates .wrangler/tmp relative to its working directory.
The container runs as non-root user acb with WORKDIR=/app (root-owned),
so mkdir /app/.wrangler/tmp fails with EACCES. Setting cmd.Dir=/tmp
gives wrangler a writable CWD while keeping the /data output path
(absolute) unchanged.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
matches.winner is an INTEGER (player slot), not a bot_id VARCHAR.
Fix two queries that compared mp.bot_id = m.winner (type mismatch)
to use mp.player_slot = m.winner.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
COALESCE(parent_ids, '[]'::json) fails because the column is JSONB
and PostgreSQL won't coerce json to jsonb. Change to '[]'::jsonb.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove worker-api-tests job (worker-api/ directory was removed)
- Remove indexer-tests job (cmd/acb-indexer/ was removed, replaced by Go acb-index-builder)
- Add cmd tests to go-tests job to run all Go tests
- Add lint and type check steps to web-build job
Add comprehensive deployment instructions for the AI Code Battle SPA.
Includes setup for GitHub Actions, wrangler CLI, and manual deployment
options. The build is working and ready for deployment.
Add wrangler.toml, deployment script, and documentation for deploying
the AI Code Battle SPA to Cloudflare Pages.
- wrangler.toml: Cloudflare Pages project configuration
- scripts/deploy-pages.sh: Manual deployment script using wrangler CLI
- web/CLOUDFLARE_DEPLOYMENT.md: Deployment guide with GitHub Actions setup
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add GitHub Actions workflow for automatic deployment to Cloudflare Pages
- Deploys on push to master/main when web/ directory changes
- Uses cloudflare/pages-action for deployment
- Project name: ai-code-battle
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fixed TestSelectBestCandidate_GoHttpBonus: HTTP bonus (1.5x) on 150-char code
(225 score) doesn't beat 500-char plain text (500 score). Test now expects
the longer code to win.
- Fixed TestScoreCandidate_Bonuses: adjusted minScore expectations to match
actual code lengths with 1.5x bonus applied.
- Fixed TestBehaviorDistance: use epsilon comparison for floating-point
precision instead of exact equality. sqrt(2) ≈ 1.414214 is not exactly
representable in floating-point.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add automated script for creating R2 bucket and configuring custom domain
r2.aicodebattle.com for replay storage.
- Create scripts/setup-r2.sh:
- Creates acb-data R2 bucket if it doesn't exist
- Configures custom domain via Cloudflare API
- Includes verification and usage instructions
- Update DEPLOYMENT.md to reference the new script
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add configure-dns.sh for automated DNS record setup:
- aicodebattle.com CNAME to Pages
- r2.aicodebattle.com CNAME to R2
- api.aicodebattle.com A record to Traefik (optional)
Includes manual dashboard instructions as fallback.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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 helper scripts for Cloudflare Pages and R2 deployment:
- cloudflare-setup.sh: Creates Pages project, deploys dist, creates R2 bucket
- verify-deployment.sh: End-to-end verification of all endpoints
These scripts require wrangler authentication via `wrangler login`.
Note: worker-api deployment removed from scope (legacy code was removed
in commit b06350d).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add Go implementations of 5 strategy bots directly into the engine:
- GathererBot: prioritizes energy collection, avoids combat
- RusherBot: aggressively rushes enemy cores
- GuardianBot: defends cores with cautious expansion
- SwarmBot: formation-based coordinated movement
- HunterBot: targets isolated enemy units
Update acb-local with bot selection flags:
- -bot0/-bot1: select bot strategies
- -list-bots: list available strategies
- Default to gatherer vs rusher for interesting gameplay
Enables demo replays with real strategic behavior without K8s infrastructure.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>