Developer Guide
API and integration notes for Binary-2048.
Local Endpoints
- App: /
- OpenAPI JSON: /api/openapi
- API Docs UI: /api-docs
Replay Contract
- Replay header is schema-locked (`replayVersion`, `rulesetId`, `engineVersion`, `size`, `seed`, `createdAt`).
- Compatibility checks enforce size/seed alignment with config and initial grid shape.
- Export replay metadata includes normalized step logs (`rngStepStart`, `rngStepEnd`, `scoreDelta`, `scoreTotal`, normalized events).
Common APIs
- Game lifecycle: `/api/games`, `/api/games/:id`, `/api/games/:id/move`, `/api/games/:id/undo`
- Replay: `/api/games/:id/export`, `/api/games/:id/replay`, `/api/replay`, `/api/replay/postmortem`, `/api/replay/code`
- Daily challenge: `/api/challenges/daily`, `/api/challenges/daily/submit`
- Ghost race: `/api/challenges/ghost-race`, `/api/challenges/ghost-race/submit`
- Runs: `/api/runs/:id`, `/api/runs/:id/replay`
- AI: `/api/games/:id/encoded`, `/api/simulate`, `/api/bots/tournament`
- Ranked/security: `/api/leaderboard/submit`, `/api/auth/entitlements/proof`
Testing
- `npm run test:unit`
- `npm run test:all`
- `npm run roadmap:status`
Full markdown copy: docs/developer-guide.md