Part 4: The Engineering Process: Deterministic Engine & Multi-Client Platform

By Mike Hall · Originally published on just3ws.com (Canonical) · Engine v1.6.0

Canonical note: The full practitioner engineering narrative for Part 4 lives canonically on just3ws.com. This companion page summarizes the architecture contracts and links directly to the live videos and codebase surfaces.

Key Engineering Contracts in v1.6.0

  1. Server-Authoritative Pure Engine (@phalanxduel/engine): Clients submit move intent over WebSocket (/ws) or REST (POST /api/matches/:id/action). The engine validates, computes the next state plus canonical SHA-256 hashes, and never trusts client state.
  2. Horizontal Scaling (LocalMatchManager + MatchActor + PostgresLedgerStore): Turn actions append to an immutable Postgres ledger and broadcast over PostgresEventBus, with seamless rejoinMatch session recovery.
  3. One Protocol, Four Clients: React Web Client (client/), native Go CLI (clients/go/duel-cli), native SwiftUI client (game-swiftui), and the MCP Server (@phalanxduel/mcp) for AI agents all share the same OpenAPI + AsyncAPI contracts.
  4. Tiered Bots & Ranked Ladders: Heuristic bots (Scout, Grunt, Soldier) through specialist and Monte Carlo Tree Search (sp-mcts) bots, tracked across seasonal Glicko-2 / Elo ladders (/api/ladder/:category).
  5. Hard Safety Gates: Non-negotiable Postgres environment isolation (phalanxduel_development vs phalanxduel_test), playability gates (pnpm qa:playthrough:verify) before UI work, and OpenTelemetry flowing to Jaeger + OpenObserve (otel-collector -> [Jaeger, OpenObserve]).

Watch the Platform & Multiplayer Videos

Canonical Sources & Attribution


Series Navigation: ← Part 3: Living Architecture & Diagrams · Part 4 (Current) · Next: Part 5 - Video Curriculum & Media Pipeline →