ai-code-battle/cmd/acb-api
jedarden f1a0830c51 Add Go API server (cmd/acb-api) with PostgreSQL, Valkey, and Glicko-2
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>
2026-03-26 01:21:48 -04:00
..
config.go Add Go API server (cmd/acb-api) with PostgreSQL, Valkey, and Glicko-2 2026-03-26 01:21:48 -04:00
config_test.go Add Go API server (cmd/acb-api) with PostgreSQL, Valkey, and Glicko-2 2026-03-26 01:21:48 -04:00
crypto.go Add Go API server (cmd/acb-api) with PostgreSQL, Valkey, and Glicko-2 2026-03-26 01:21:48 -04:00
crypto_test.go Add Go API server (cmd/acb-api) with PostgreSQL, Valkey, and Glicko-2 2026-03-26 01:21:48 -04:00
db.go Add Go API server (cmd/acb-api) with PostgreSQL, Valkey, and Glicko-2 2026-03-26 01:21:48 -04:00
Dockerfile Add Go API server (cmd/acb-api) with PostgreSQL, Valkey, and Glicko-2 2026-03-26 01:21:48 -04:00
glicko2.go Add Go API server (cmd/acb-api) with PostgreSQL, Valkey, and Glicko-2 2026-03-26 01:21:48 -04:00
glicko2_test.go Add Go API server (cmd/acb-api) with PostgreSQL, Valkey, and Glicko-2 2026-03-26 01:21:48 -04:00
health.go Add Go API server (cmd/acb-api) with PostgreSQL, Valkey, and Glicko-2 2026-03-26 01:21:48 -04:00
jobs.go Add Go API server (cmd/acb-api) with PostgreSQL, Valkey, and Glicko-2 2026-03-26 01:21:48 -04:00
main.go Add Go API server (cmd/acb-api) with PostgreSQL, Valkey, and Glicko-2 2026-03-26 01:21:48 -04:00
register.go Add Go API server (cmd/acb-api) with PostgreSQL, Valkey, and Glicko-2 2026-03-26 01:21:48 -04:00
server.go Add Go API server (cmd/acb-api) with PostgreSQL, Valkey, and Glicko-2 2026-03-26 01:21:48 -04:00
server_test.go Add Go API server (cmd/acb-api) with PostgreSQL, Valkey, and Glicko-2 2026-03-26 01:21:48 -04:00
tickers.go Add Go API server (cmd/acb-api) with PostgreSQL, Valkey, and Glicko-2 2026-03-26 01:21:48 -04:00