Corinth's Plight is a persistent cooperative science-fiction wargame built around structured orders, simultaneous round resolution, shared battlefield intentions, and consequences that survive between sessions.
This repository now contains a Cloudflare-native foundation and one executable vertical slice: Planet Corinth / Campaign Outpost K-17. The original Flask/Jinja prototype remains in app/, shipbuilder/, and worldmap/ as migration reference; it is not the production architecture.
The current slice includes:
- React 19 + Vite campaign operations interface
- Canvas hex map with pan, zoom, fog, terrain, stacking, routes, facing, objectives, and allied intentions
- visual Hold / Advance / Rush order composer with scheduling, weapon targeting, drafts, and server validation
- pure seeded TypeScript rules engine with replay-stable movement and simultaneous combat
- campaign-scoped Durable Object state, alarms, accelerated clock presets, and hibernating WebSockets
- versioned D1 schema and idempotent
v5-core-curated@1seed catalogue - viewer-specific battlefield/event projection and local-only demo authentication
- V1 audit, rule conflict catalogue, data model, resolution protocol, and Cloudflare ADRs
The intentionally deferred systems are listed in corinth-foundation.md. Advanced order hooks, the production account flow, D1 persistent-effect finalisation, complete battalion/ship workflows, and strategic-war phases must be implemented as subsequent vertical slices—not simulated in the UI.
Requirements: a current Node.js release and npm.
npm install
npm run db:migrate:local
npm run db:seed:local
npm run devThe development configuration enables the explicit demo-user identity and uses a five-minute round with a thirty-second lock lead. Production configuration disables demo authentication and defaults to a 24-hour round.
npm run seed:check
npm run typecheck
npm run lint
npm test
npm run build
npm run build:productionRemote migration/deployment requires a provisioned Cloudflare D1 database, an authenticated Wrangler session, and replacement of the documented placeholder database ID. After that, run npm run deploy:dry and npm run deploy. The production scripts always select the production Wrangler environment.
src/ React campaign client
worker/ Worker API + Campaign Durable Object
packages/domain/ shared contracts
packages/rules-engine/ deterministic pure game engine + tests
migrations/ versioned D1 schema
seeds/ provenance-bearing rules catalogue
docs/ audit, rules, architecture, data and operations
rules/ supplied rule sources
app/, shipbuilder/, worldmap/ retained V1 prototype
Start with:
docs/GAME_SYSTEMS.md— active rules profile and scopedocs/RULE_CONFLICTS.md— explicit interpretations and unresolved valuesdocs/ARCHITECTURE.md— target boundaries and V1 strangler plandocs/ROUND_RESOLUTION.md— deterministic round and retry protocoldocs/V1_AUDIT.md— evidence-backed legacy assessment