Commit graph

12 commits

Author SHA1 Message Date
jedarden
257eb32641 Add health monitoring endpoints for Phase 6
- 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>
2026-03-24 10:08:11 -04:00
jedarden
24859669fc Complete D1 database schema and migrations for Phase 6
- Add missing tables: predictions, predictor_stats, map_votes,
  replay_feedback, series, series_games, seasons
- Add evolution fields to bots table (evolved, island, generation,
  parent_ids, description)
- Add additional fields to maps table (player_count, energy_nodes,
  wall_density, status, engagement_score)
- Create migrations/0001_initial.sql for D1 migrations
- Update wrangler.toml with migrations_dir config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 09:52:53 -04:00
jedarden
23186b77e1 Start Phase 6: Add deployment configuration and containers
- 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>
2026-03-24 09:41:14 -04:00
jedarden
d936bc2f62 Complete Phase 5: Add Cloudflare Pages deployment configuration
- 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>
2026-03-24 09:31:35 -04:00
jedarden
6f1cbbcad2 Start Phase 5: Add SPA web platform with routing and pages
- 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>
2026-03-24 09:14:15 -04:00
jedarden
4bbc3f0515 Complete Phase 4: Add index builder container
- 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>
2026-03-24 08:39:47 -04:00
jedarden
4f55d39172 Update PROGRESS.md with match worker completion
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 08:07:40 -04:00
jedarden
9bd4efc935 Start Phase 4: Cloudflare Worker API for match orchestration
- Add worker-api/ with TypeScript + Wrangler setup
- D1 database schema (bots, matches, jobs, rating_history)
- Glicko-2 rating system implementation with unit tests
- Job coordination endpoints (claim, heartbeat, result, fail)
- Bot management endpoints (register, list, update, rotate-key)
- Cron handlers (matchmaker, health checker, stale job reaper)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 07:50:10 -04:00
jedarden
4f77980398 Complete Phase 3: TypeScript Canvas replay viewer
- 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>
2026-03-24 07:30:04 -04:00
jedarden
6f1b50384c Complete Phase 2: HTTP protocol and 6 strategy bots
Phase 2 Implementation:
- HMAC authentication for engine-to-bot communication
  - Request signing with timestamp anti-replay
  - Response signing for integrity verification
- HTTP bot client with timeout and crash detection
  - Per-turn 3s timeout, 10 consecutive failure crash threshold
  - Move validation (position ownership, direction validity)
- Integration tests for HTTP match execution
- 6 strategy bots in 6 languages:
  - RandomBot (Python): Random valid moves - rating floor
  - GathererBot (Go): Energy-focused with combat avoidance
  - RusherBot (Rust): Aggressive core rushing via BFS
  - GuardianBot (PHP): Defensive core protection
  - SwarmBot (TypeScript): Formation-based group combat
  - HunterBot (Java): Target isolation and hunting

All bots include:
- HMAC signature verification
- Dockerfile for containerization
- README documentation

All engine tests passing (32+ tests)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 07:00:38 -04:00
jedarden
890785c5c4 Complete Phase 1: add connectivity validation and determinism tests
- Add connectivity.go: BFS-based map connectivity validation with retry
- Update mapgen to use connectivity checking by default
- Add determinism_test.go: property-based tests for reproducibility
  - Same seed produces identical replays
  - Turn execution is deterministic
  - Grid operations are deterministic
  - Combat resolution is deterministic
  - Full 500-turn match validation
- All 32 tests pass
- Update PROGRESS.md: Phase 1 complete

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 03:44:44 -04:00
jedarden
6d3f3506b3 Implement Phase 1 core engine: grid, combat, fog of war, turn execution
- Add engine package with toroidal grid, game state, turn execution
- Implement focus-fire combat resolution with simultaneous deaths
- Add fog of war visibility filtering for bot state
- Implement energy collection (contested resources denied)
- Add bot spawning at active cores
- Implement win conditions: elimination, draw, dominance, turns
- Add replay JSON writer for match recording
- Add match runner with concurrent bot communication
- Add CLI tools: acb-local (match runner), acb-mapgen (map generator)
- Add comprehensive unit tests (26 tests passing)

Exit criteria met: can run complete 500-turn matches and produce valid replays

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 01:48:27 -04:00