🏛 The Monolithic Architecture
As of Phase 2 Complete (Jan 2026), the backend operates on the V5 Monolithic Server model.
1. The Schematic Truth
The Strapi Database is the Single Source of Truth. We have removed the EntityAdapter layer.
EntitySheet: The primary gameplay object. What you see in the DB is what is in the game.
TurnPipeline: A transactional orchestrator. All changes (Move, Attack, Event Log) happen in One Atomic Transaction.
👉 See Schema Architecture Map
2. The Game Loop (“The Sandwich”)
- Intent (GraphQL Mutation): User calls
submitAction.
- Resolution (Pure Logic):
ActionEngine calculates the outcome (e.g., Hit/Miss, Pathfinding).
- Persistence (Transactional): The Database is updated, and Events are logged.
- Narration (Async): The LLM reads the event log and generates a story summary (
Turn.summary).
- Memory (RAG): The summary is auto-embedded into
KnowledgeSnippets.
👉 See Mutation Catalog
3. Reliability & Visibility
- Determinism: World Generation is strictly seeded.
- Fog of War: Server-side
VisibilityService prevents cheating.
- Memory: Automated RAG ingestion via Turn Lifecycles.
🛠 The CLI (Command Line Interface)
The Daicer CLI is a developer’s best friend.
yarn cli <command>
| Command |
Usage |
Description |
explore |
yarn cli explore |
Interactive Browser. View Mobs, Items, and Spells with full JSON inspection. |
knowledge |
yarn cli knowledge -q "Lich" |
Vector Search. Query the RAG database for lore and rules. |
status |
yarn cli status |
Health Check. View active rooms, memory usage, and worker status. |
🗺 Documentation Map
🧪 Developer Cheatsheet
🏃♂️ Running the Server
yarn develop
⚡️ Development / Testing
# Verify Logic Determinism (Zero-DB)
yarn vitest api/game/services/__tests__/logic-determinism.test.ts
# Integration Test (Transaction Verification)
yarn test
🧹 Clean Build
yarn build
评论