Back to .md Directory

The DMZ: Archive Gate — Project Memory

Tracks project phase, completed milestones, tech decisions, and next deliverables for a game development monorepo.

May 2, 2026
0 downloads
0 views
ai agent eval claude
View source

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

SvelteKitFastifyPostgreSQLDrizzlepnpmTurborepo

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

DecisionChoiceRationaleDate
Frontend frameworkSvelteKit 2.x + Svelte 590% DOM app, compiled reactivity2026-02-05
Backend frameworkFastifyPlugin architecture, JSON Schema2026-02-05
DatabasePostgreSQL + RLSProven, tenant isolation, JSONB2026-02-05
ORMDrizzleTypeScript-native, migration support2026-02-05
State architectureEvent sourcingDeterminism, audit, compliance2026-02-05
Package managerpnpmMonorepo workspaces, disk efficiency2026-02-05
Analytics DBPostgreSQL (defer specialty DB)Start simple, evaluate at M72026-02-05
ArchitectureModular monolithAvoid premature decomposition2026-02-05
Build orchestrationTurborepoTask graph, caching, pnpm workspace integration2026-02-05
Monorepo layoutapps/* + packages/*Apps (deployables) vs packages (libraries) separation2026-02-05
auto-develop finalizationDedicated finalizer agent for commit/push/closeKeeps final git operations in-agent with unbounded retries and validation checks2026-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 dev orchestration script
  • #16 .env.example and 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 pnpm or corepack 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.events table, 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

CommandDescriptionRequirements
pnpm db:migrateRun pending migrationsDocker services running
pnpm db:seedSeed database with base data (M0)-
pnpm db:seed:m1Seed database with M1 foundation dataALLOW_SEEDING=1 env var
pnpm db:seed:testSeed test database-
pnpm db:resetDrop, 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 profiles
  • factories.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:

  1. Runs seedDatabase()
  2. Verifies seeded entities exist in the database
  3. Validates tenant/user/profile relationships

Update Instructions

When updating this file:

  1. Move completed items from "Next Up" to "Completed Work"
  2. Add new decisions to the "Tech Decisions Log" with date
  3. Update "Current State" to reflect the active milestone
  4. Update "Known Blockers" as they are resolved or discovered
  5. 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-dmz with your own repository name
  • Replace issue numbers like #131 with your own issue tracker IDs
  • Replace milestone names like M2, Core Game Loop with your own milestones
  • Replace apps/web, apps/api, packages/shared with 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