Part 3: Living Architecture: Diagrams, C4 & Freshness Gates
By Mike Hall · Canonical edition on phalanxduel.com · Companion Panoramic View essay on just3ws.com · Engine v1.6.0
Architecture diagrams usually rot the week after they are drawn. A diagram that claims a retired vendor is still in production - or still labels routes v1.0 when the server is on v1.6.0 - is worse than no diagram at all because it misleads the next engineer with confidence.
Phalanx Duel solves diagram drift with a two-tier architecture surface:
- Auto-generated live views built directly from repository code and synced to
phalanxduel.com:- Interactive Groma C4 Architecture Map - Drill-down C4 explorer across system context, containers, and components.
- Interactive Documentation & Visual Library - Live SPA covering the Database ERD, System Topology, Package DAG, Fastify API Directory, and audience overviews.
- 12 curated GitHub Wiki diagrams mapped in a Meta-Diagram on
Diagram-Index, each pinned to an exact release version and a 90-day reconfirmation date.
The Meta-Diagram (Map of Diagrams)
flowchart TB
Index["Diagram-Index (Wiki Hub)"]
C4["Groma C4 Explorer - /library/architecture/"]
Lib["Interactive Docs Library - /library/"]
Ctx["System-Context-Diagram"] --> Cont["Container-Architecture-Diagram"]
Cont --> API["API-Surface-Diagram"]
Cont --> OTel["Telemetry-Pipeline-Diagram"]
Cont --> ERD["Database-ERD"]
API --> Boot["Match-Bootstrap-Sequence-Diagram"]
API --> Run["Runtime-Sequence-Diagram"]
Boot --> Life["Match-Lifecycle-Diagram"]
Run --> FSM["State-Machine-Diagram"]
Run --> Life
Life --> ERD
Run --> OTel
Intake["Intake-Lifecycle-Diagram"] --> Contrib["Contribution-Workflow-Diagram"]
Index --> C4
Index --> Lib
Index --> Ctx
Index --> Intake
Version Mapping & 90-Day Reconfirmation Enforcement
Every curated wiki diagram carries three machine-parsed header lines:
Applies to version: v1.6.0
Last verified: 2026-11-26
Reconfirm by: 2027-02-24
The zero-dependency checker ./bin/check-diagram-freshness in the wiki repository reads ../game/package.json, compares every diagram’s Applies to version: against the live release, and fails non-zero if any diagram is missing metadata, version-drifted, or past its Reconfirm by: date.
Watch Architecture & Verification in Action
- Reading the HUD, Combat Math Inspector & Narration Settings (Ep. 08) - How engine combat math projects cleanly to the UI.
- Deterministic Replays & Cryptographic Hash-Chain Verification (Ep. 15) - Proving every turn state hash against the append-only ledger.
- Spectator Mode: Watch Links, Delay & Fair-Play Redaction (Ep. 16) - Server-side viewer projection enforcing Fog of War.
Canonical Sources & Attribution
- Live Architecture: Visual Library · Groma C4 Map · Technical Details
- Wiki Diagrams: Diagram Index · API Surface · Database ERD · Telemetry Pipeline
Series Navigation: ← Part 2: Rules & Combat Cascade · Part 3 (Current) · Next: Part 4 - The Engineering Process →