Commit graph

6 commits

Author SHA1 Message Date
jedarden
4b1966a839 Add .gitignore and package-lock.json files
- 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>
2026-03-24 10:30:03 -04:00
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
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
6659027bec Implement match worker container (cmd/acb-worker/)
- 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>
2026-03-24 08:06:15 -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