The DMZ: Archive Gate — Project Memory
Tracks project phase, completed milestones, tech decisions, and next deliverables for a game development monorepo.
What this file does
Tracks project phase, completed milestones, tech decisions, and next deliverables for a game development monorepo.
When to use it
- Starting a new game project and need a living project memory template
- Managing a multi-milestone monorepo with many issues and agents
- Keeping a decision log alongside a roadmap and blocker list
- Coordinating between AI agents that need a single source of truth
Assumes this stack
The DMZ: Archive Gate — Project Memory
Living document. Update when milestones complete, decisions are made, or blockers change.
Current State
- Phase: Pre-implementation (documentation complete, issues created)
- Active milestone: M2 — Core Game Loop (issue #131 created, more to follow)
- Blocker: Monorepo needs bootstrapping (M0)
Completed Work
- Game premise and story (
docs/story.md) - Business Requirements Document (
docs/BRD.md, 1,363 lines) - 14 BRD research files (
docs/BRD/, ~22,200 lines) - 14 Design Documents (
docs/DD/, ~24,500 lines) - Development roadmap (
docs/MILESTONES.md, M0–M16) - Multi-agent development loop (
auto-develop.sh) - AI instruction files (SOUL.md, AGENTS.md, CLAUDE.md, MEMORY.md)
- Sub-agent definitions (
.claude/agents/: frontend, backend, database, testing, devops, reviewer) - M0 GitHub issues created (#1–#33, 33 issues covering full bootstrap scope)
Tech Decisions Log
| Decision | Choice | Rationale | Date |
|---|---|---|---|
| Frontend framework | SvelteKit 2.x + Svelte 5 | 90% DOM app, compiled reactivity | 2026-02-05 |
| Backend framework | Fastify | Plugin architecture, JSON Schema | 2026-02-05 |
| Database | PostgreSQL + RLS | Proven, tenant isolation, JSONB | 2026-02-05 |
| ORM | Drizzle | TypeScript-native, migration support | 2026-02-05 |
| State architecture | Event sourcing | Determinism, audit, compliance | 2026-02-05 |
| Package manager | pnpm | Monorepo workspaces, disk efficiency | 2026-02-05 |
| Analytics DB | PostgreSQL (defer specialty DB) | Start simple, evaluate at M7 | 2026-02-05 |
| Architecture | Modular monolith | Avoid premature decomposition | 2026-02-05 |
| Build orchestration | Turborepo | Task graph, caching, pnpm workspace integration | 2026-02-05 |
| Monorepo layout | apps/* + packages/* | Apps (deployables) vs packages (libraries) separation | 2026-02-05 |
| auto-develop finalization | Dedicated finalizer agent for commit/push/close | Keeps final git operations in-agent with unbounded retries and validation checks | 2026-02-06 |
Completed Work (M0, M1)
- M0: Project Bootstrap (33 issues completed #1–#33)
- M1: Foundation (issues #34–#130 completed)
Next Up: M2 — Core Game Loop
Backend - Game Engine (#131–#136)
- #131 M2-01: Game engine module with session lifecycle and day cycle state machine
- M2-02: Event sourcing system (immutable game.events table, snapshots)
- M2-03: Deterministic RNG for email selection and attack outcomes
- M2-04: Email & decision system (instances, indicators, decisions)
- M2-05: Verification packet system
- #136 M2-06: Facility module (4 resource systems)
Backend - Game Systems (#137–#142)
- M2-07: Threat engine v1 (attack generation, threat tiers)
- M2-08: Consequence engine (trust score, funds, faction relations)
- M2-09: Upgrade system (security tools, facility upgrades)
- M2-10: Economy domain v1 (credits, trust score, intel fragments)
- M2-11: Incident response system
- M2-12: Breach & recovery (ransom mechanic, game over)
Frontend - Game Screens (#143–#155)
- M2-13: Main terminal layout (3-panel CSS Grid)
- M2-14: InboxList component with urgency indicators
- M2-15: EmailViewer with header inspection
- M2-16: ActionStamp (Approve/Deny/Flag/Verify)
- M2-17: Phishing Analysis Worksheet
- M2-18: Verification Packet viewer
- M2-19: Facility dashboard
- M2-20: Day summary panel
- M2-21: State management (3-layer architecture)
- M2-22: Phase-driven rendering
- M2-23: Keyboard shortcuts (core: A/D/F/V)
- M2-24: ResourceMeter components
- M2-25: ThreatIndicator display
Core Scaffolding (#1–#5)
- #1 Initialize pnpm monorepo with Turborepo (
apps/web,apps/api,packages/shared) - #2 Scaffold SvelteKit frontend in
apps/web - #3 Scaffold Fastify backend in
apps/api - #4 Create shared TypeScript package (
packages/shared) - #5 Set up Zod shared validation schemas
Infrastructure & Database (#6–#7, #17–#18, #20, #32)
- #6 Docker Compose dev environment (PostgreSQL, Redis)
- #7 Drizzle ORM + migration framework
- #18 Initial database schema migration (
0001_initial_schema) - #17 Test database seeding infrastructure
- #20 Docker Compose health checks and service readiness
- #32 Application Dockerfiles for API and Web
Tooling & DX (#9–#16, #19, #25–#26)
- #9 TypeScript strict mode configuration
- #10 ESLint with flat config
- #11 Prettier for code formatting
- #12 Husky git hooks with lint-staged
- #15 Unified
pnpm devorchestration script - #16
.env.exampleand environment variable validation - #19 Repository configuration (.gitignore, .gitattributes, LICENSE)
- #25 VS Code workspace settings and debug configuration
- #26 Automated dependency updates (Renovate)
Testing (#13–#14, #24)
- #13 Vitest unit testing infrastructure
- #14 Playwright E2E testing infrastructure
- #24 Accessibility testing foundation (axe-core in CI)
CI/CD & Security (#8, #23, #29–#30, #33)
- #8 GitHub Actions CI/CD pipeline
- #23 Dependency scanning and security baseline in CI
- #29 Security headers middleware (Helmet, CSP, HSTS)
- #30 Request input sanitization middleware
- #33 Rate limiting middleware (@fastify/rate-limit)
Backend Architecture (#27–#28, #31)
- #27 OpenAPI/Swagger documentation endpoint
- #28 In-process event bus with DomainEvent interface
- #31 Auth RBAC and session schema migration
Documentation (#21–#22)
- #21 Developer documentation (README.md + CONTRIBUTING.md)
- #22 Architecture Decision Records (ADR template + initial ADRs)
Exit criteria: pnpm dev starts both frontend and backend. CI passes. First migration runs.
Known Blockers
- pnpm not yet installed globally (
npm i -g pnpmorcorepack enable)
Architecture Notes
- Monorepo:
apps/web(SvelteKit),apps/api(Fastify),packages/shared(types, schemas, constants) - Workspaces:
apps/*+packages/*(pnpm-workspace.yaml) - Build orchestration: Turborepo (
turbo.json) - 4 route groups:
/(game),/(admin),/(auth),/(public) - Event sourcing: immutable
game.eventstable, snapshots every 50 events - In-process event bus (EventEmitter-based) from M0, upgrades to BullMQ in M1+
- State layers: ephemeral UI / synced game state / event sourcing
- 11-phase day cycle state machine (see DD-01)
- 13 in-game document types (see DD-02, DD-07)
Database Seeding
Seed Commands
| Command | Description | Requirements |
|---|---|---|
pnpm db:migrate | Run pending migrations | Docker services running |
pnpm db:seed | Seed database with base data (M0) | - |
pnpm db:seed:m1 | Seed database with M1 foundation data | ALLOW_SEEDING=1 env var |
pnpm db:seed:test | Seed test database | - |
pnpm db:reset | Drop, migrate, and re-seed (dev only) | Docker services running |
Seed Data Fixtures
The project uses deterministic seed fixtures in packages/shared/src/testing/:
seed-ids.ts— Stable UUIDs for tenants, users, and profilesfactories.ts— Test data factories (createTestProfile, etc.)
These fixtures are used by:
- Database seed scripts (
apps/api/src/shared/database/seed.ts) - Integration tests requiring authenticated users
- E2E tests with stable identities
Seed Verification
Automated seed verification is done via apps/api/src/shared/database/__tests__/seed.test.ts which:
- Runs
seedDatabase() - Verifies seeded entities exist in the database
- Validates tenant/user/profile relationships
Update Instructions
When updating this file:
- Move completed items from "Next Up" to "Completed Work"
- Add new decisions to the "Tech Decisions Log" with date
- Update "Current State" to reflect the active milestone
- Update "Known Blockers" as they are resolved or discovered
- Replace "Next Up" contents with the next milestone's deliverables from
docs/MILESTONES.md
What's inside
7 sections: current state, completed work, tech decisions log, next up, blockers, architecture notes, database seeding
Change this for your project
- Replace
TheMorpheus407/the-dmzwith your own repository name - Replace issue numbers like
#131with your own issue tracker IDs - Replace milestone names like
M2, Core Game Loopwith your own milestones - Replace
apps/web,apps/api,packages/sharedwith your own monorepo layout
Where it goes
Keep it in your repository where the agent or team that needs it will read it.
Worth borrowing
- Separating completed work into a log and next up into a detailed checklist per milestone
- Using a tech decisions log with date and rationale to avoid revisiting settled choices
- Including seed data fixtures with stable UUIDs for deterministic testing
Related Documents
Zig 0.16.0 Context Document for LLMs
Documents breaking changes from Zig 0.13/0.14 to 0.16.0, covering syntax, I/O, build system, and standard library updates.
Beads Workflow Context
Guides when to use bd graph-based issue tracker versus TodoWrite for session vs multi-session work, with commands and workflows.
TreeDex — Comprehensive Documentation
Documents the architecture, API, and internals of a tree-based, vectorless RAG framework available in Python and Node.js.
每日安全资讯(2023-08-05)
Aggregates daily security news from multiple RSS feeds into a single Markdown page for quick scanning.