# Living World Kernel Upgrade - Implementation Index
**Status:** β
TRIAGE COMPLETE - READY FOR IMPLEMENTATION
**Date:** December 6, 2025
**Created By:** Triage Analysis
---
## π DOCUMENT STRUCTURE
### EXECUTIVE DOCUMENTS
**1. TRIAGE_SUMMARY.txt** (START HERE)
- π Quick 2-minute overview
- π Key findings at a glance
- β
Success metrics
- π― Decision checklist
- **Read this first**
**2. TRIAGE_LIVING_WORLD_KERNEL.md** (DETAILED ANALYSIS)
- Part 1: Architectural Analysis (what exists, 70% done)
- Part 2: Integration Analysis (how it fits)
- Part 3: Risk Assessment (what could go wrong)
- Part 4: Required Game Design Decisions (what you need to decide)
- Part 5: Success Criteria (rewritten phases 1-3)
- Part 6: Game Design Decisions (detailed options with recommendations)
- Part 7: Dependency Mapping (what blocks what)
- Part 8: Architecture Compliance (does it follow patterns?)
- Part 9: Known Issues to Fix First (prerequisites)
- Part 10: Recommended Handoff Structure
- **Read this before starting implementation**
### IMPLEMENTATION DOCUMENTS
**3. HANDOFF_LIVING_WORLD_PHASE_1.md** (PHASE 1 SPEC)
- β
Complete implementation spec for Spatial Graph System
- π All 5 deliverables in detail
- π§ͺ 15+ test cases fully written out
- π Database schema with constraints
- π§ MCP tool signatures with examples
- β
Implementation checklist
- π― Success criteria and acceptance tests
- **HAND THIS TO CLAUDE CODE FOR PHASE 1**
**4. HANDOFF_LIVING_WORLD_PHASE_2_OUTLINE.md** (PHASE 2 OUTLINE)
- β³ Forward-looking outline for Phase 2
- β οΈ DO NOT START YET - wait for Phase 1 + fixes
- π Game design decisions needed
- π― Success criteria for Phase 2
- π¦ All deliverables outlined
- β±οΈ Estimated timeline
- **READ BEFORE PHASE 2 - DON'T IMPLEMENT YET**
**5. LIVING_WORLD_IMPLEMENTATION_INDEX.md** (THIS FILE)
- π Quick reference and navigation
- πΊοΈ Document relationships
- βοΈ What to read/do next
- π Cross-references
---
## π― QUICK NAVIGATION BY ROLE
### If You're a MANAGER / DESIGNER
1. Read: `TRIAGE_SUMMARY.txt` (5 min)
2. Ask the team: Game design decisions from Part 6 of `TRIAGE_LIVING_WORLD_KERNEL.md`
3. Approve timeline: Phase 1 (3-4 days), blocking fixes (2 hours), Phase 2 (4-5 days)
### If You're Implementing PHASE 1
1. Read: `TRIAGE_SUMMARY.txt` (understand context)
2. Read: `HANDOFF_LIVING_WORLD_PHASE_1.md` (implementation spec)
3. Follow the checklist - start with schema, then repo, then tools, then tests
4. Use TDD: Write test first, then implementation
5. `npm test -- tests/spatial-graph.test.ts` frequently
### If You're Implementing PHASE 2 (LATER)
1. Wait for Phase 1 to be β
COMPLETE
2. Wait for blocking issues to be β
FIXED (EDGE-001, EDGE-006, stats)
3. Manager/designer must β
APPROVE game design decisions
4. Then: Read `HANDOFF_LIVING_WORLD_PHASE_2_OUTLINE.md`
5. Get full Phase 2 implementation spec (created later)
### If You're Reviewing Code
1. Reference: `TRIAGE_LIVING_WORLD_KERNEL.md` Part 8 (architecture compliance)
2. Check: Are schemas using Zod?
3. Check: Is repository pattern followed?
4. Check: Are tests comprehensive?
5. Check: Does it respect "LLM describes, engine validates" pattern?
### If You're Triaging Bugs Found During Implementation
1. Add findings to `Agents/EMERGENT_DISCOVERY_LOG.md`
2. Reference the original triage: `TRIAGE_LIVING_WORLD_KERNEL.md`
3. If it's a Phase 2 issue, note it for Phase 2 planning
4. If it's architectural, flag for design review
---
## π DOCUMENT RELATIONSHIP MAP
```
DECISION POINT
β
[Manager reads TRIAGE_SUMMARY.txt]
β
[Decide: Phase 1 only, or Phase 1+2?]
ββ Phase 1 only?
β βββ Developer gets HANDOFF_LIVING_WORLD_PHASE_1.md
β Developer implements (3-4 days)
β When done: Phase 2 planning happens later
β
ββ Phase 1+2 planned?
βββ Designer approves game design decisions
β (from TRIAGE_LIVING_WORLD_KERNEL.md Part 6)
β
βββ Developer Phase 1
β Uses: HANDOFF_LIVING_WORLD_PHASE_1.md
β
βββ [Phase 1 complete]
β
βββ Fix blocking issues
β (EDGE-001, EDGE-006, stats from TRIAGE Part 9)
β
βββ Developer Phase 2
β Uses: HANDOFF_LIVING_WORLD_PHASE_2_OUTLINE.md
β Gets: Full Phase 2 spec (created then)
β
βββ [Phase 2 complete]
["Living World" system ready for production]
```
---
## β±οΈ READING ROADMAP
### SHORTEST PATH (5 minutes)
β `TRIAGE_SUMMARY.txt` only
β
Understand what's being done, why, and timeline
### MANAGEMENT PATH (15 minutes)
1. `TRIAGE_SUMMARY.txt` (5 min)
2. `TRIAGE_LIVING_WORLD_KERNEL.md` Part 6 (10 min)
β
Understand decisions needed and timeline
### DEVELOPER - PHASE 1 PATH (30 minutes)
1. `TRIAGE_SUMMARY.txt` (5 min)
2. `HANDOFF_LIVING_WORLD_PHASE_1.md` (25 min)
β
Ready to start implementation
### COMPLETE ANALYSIS PATH (2-3 hours)
1. `TRIAGE_SUMMARY.txt` (5 min)
2. `TRIAGE_LIVING_WORLD_KERNEL.md` - ALL PARTS (60 min)
3. `HANDOFF_LIVING_WORLD_PHASE_1.md` (30 min)
4. `HANDOFF_LIVING_WORLD_PHASE_2_OUTLINE.md` (20 min)
β
Complete understanding of system, phases, and implementation
---
## π FINDING SPECIFIC ANSWERS
### "What exists already?"
β `TRIAGE_LIVING_WORLD_KERNEL.md` Part 1
### "What's the architecture?"
β `TRIAGE_LIVING_WORLD_KERNEL.md` Part 2 + Part 8
### "What could go wrong?"
β `TRIAGE_LIVING_WORLD_KERNEL.md` Part 3
### "What do I need to decide before starting?"
β `TRIAGE_LIVING_WORLD_KERNEL.md` Part 6
### "What's blocking Phase 2?"
β `TRIAGE_LIVING_WORLD_KERNEL.md` Part 9
### "How long will Phase 1 take?"
β `TRIAGE_SUMMARY.txt` Timeline section
### "What tests do I need to write?"
β `HANDOFF_LIVING_WORLD_PHASE_1.md` Section 5
### "What's the database schema?"
β `HANDOFF_LIVING_WORLD_PHASE_1.md` Section 3
### "What MCP tools need to be created?"
β `HANDOFF_LIVING_WORLD_PHASE_1.md` Section 4
### "How do I know when Phase 1 is done?"
β `HANDOFF_LIVING_WORLD_PHASE_1.md` Success Criteria section
### "What about Phase 2?"
β `HANDOFF_LIVING_WORLD_PHASE_2_OUTLINE.md`
### "I found a bug during implementation"
β Reference `Agents/EMERGENT_DISCOVERY_LOG.md` and `TRIAGE_LIVING_WORLD_KERNEL.md` Part 9
---
## β
IMPLEMENTATION CHECKLIST
### BEFORE YOU START
- [ ] Managers: Read `TRIAGE_SUMMARY.txt`
- [ ] Managers: Approve timeline and game design decisions
- [ ] Developers: Read `HANDOFF_LIVING_WORLD_PHASE_1.md`
- [ ] Developers: Understand TDD approach
### PHASE 1 IMPLEMENTATION
- [ ] Create schema (`src/schema/spatial.ts`)
- [ ] Create repository (`src/storage/repos/spatial.repo.ts`)
- [ ] Add database migration (`src/storage/migrations.ts`)
- [ ] Add character.currentRoomId column
- [ ] Write tests first (`tests/spatial-graph.test.ts`)
- [ ] Create tools (`src/server/spatial-tools.ts`)
- [ ] Register tools (`src/server/index.ts`)
- [ ] All tests passing
- [ ] `npm run build` succeeds
- [ ] Commit with message: `feat(spatial): Implement persistent room system`
### BEFORE PHASE 2 STARTS
- [ ] Phase 1 β
complete and merged
- [ ] Fix EDGE-001 (self-theft prevention) β
- [ ] Fix EDGE-006 (victim/fence conflict) β
- [ ] Add perception/stealth to character stats β
- [ ] Manager approves game design decisions β
- [ ] Developers review `HANDOFF_LIVING_WORLD_PHASE_2_OUTLINE.md` β
### PHASE 2 IMPLEMENTATION (LATER)
- [ ] Create hearing engine (`src/engine/social/hearing.ts`)
- [ ] Create stealth/perception engine (`src/engine/social/stealth-perception.ts`)
- [ ] Extend npc-memory-tools with `interact_socially`
- [ ] Write 20+ integration tests
- [ ] All tests passing
- [ ] Commit with message: `feat(social): Implement hearing and eavesdropping mechanics`
---
## π¨ CRITICAL SUCCESS FACTORS
### Phase 1 Must:
1. β
Use Zod validation (don't skip)
2. β
Use repository pattern (don't use raw SQL in tools)
3. β
Write tests first (TDD - RED β GREEN β REFACTOR)
4. β
Respect "LLM describes, engine validates" pattern
5. β
Persist descriptions (can't be retroactively changed)
6. β
Follow existing code patterns (study src/schema/, src/storage/, src/server/)
### Before Phase 2 Must:
1. β
Fix EDGE-001 and EDGE-006
2. β
Add perception/stealth stats
3. β
Finalize game design decisions
4. β
Get management buy-in
### Phase 2 Must:
1. β
All of Phase 1's constraints
2. β
Proper Stealth vs Perception opposed rolls
3. β
Spatial awareness (hearing ranges)
4. β
Environment modifiers (tavern vs forest)
5. β
Memory recording for witnesses only
---
## π LEARNING RESOURCES
### To Understand the Codebase:
1. Read: `Agents/PROJECT_CONTEXT.md` (architecture overview)
2. Study: `src/schema/character.ts` (example Zod schema)
3. Study: `src/storage/repos/character.repo.ts` (example repository)
4. Study: `src/server/combat-tools.ts` (example MCP tools)
5. Study: `tests/server/*.test.ts` (example tests with Vitest)
### To Understand Game Design:
1. Review: D&D 5e rules for Stealth/Perception
2. Review: Combat mechanics in `src/engine/combat/`
3. Review: NPC memory system in `src/server/npc-memory-tools.ts`
4. Review: EMERGENT_DISCOVERY_LOG.md for context on similar systems
### To Understand TDD:
1. Read: `Agents/TDD_FRAMEWORK.md`
2. Review: Example test in `tests/spatial-graph.test.ts` (in Phase 1 spec)
3. Practice: Write test before implementation for every feature
---
## π DECISION POINTS REQUIRING INPUT
**Manager/Designer must decide:**
1. **Phase 1 only or Phase 1+2?**
- Phase 1 only: 3-4 days, ships sooner
- Phase 1+2: 2 weeks, complete system
2. **Hearing Range Formula (for Phase 2)?**
- Option A: Fixed ranges (simple)
- Option B: Perception-based (complex)
- Option C: Environment-aware (immersive) β Recommended
- Option D: Hybrid (most complex)
- See: `TRIAGE_LIVING_WORLD_KERNEL.md` Part 6
3. **Character Description Changes?**
- Should LLM be able to change room descriptions? (Recommendation: No)
4. **Adjacent Room Hearing?**
- Should characters in adjacent rooms hear conversations?
- (Recommendation: Loud shouts yes, whispers no)
---
## π CROSS-REFERENCES
### From EMERGENT_DISCOVERY_LOG.md:
- EDGE-001: Self-theft logic flaw (blocks Phase 2)
- EDGE-006: Victim/fence conflict (blocks Phase 2)
- NEW-MECH-001: No mechanical transfers (affects Phase 1 design)
- MED-007: No actual dialogue system (future enhancement)
### From PROJECT_CONTEXT.md:
- Tech stack and architecture overview
- MCP tool categories and count (122 tools)
- Test coverage (659 tests)
- Repository locations (frontend/backend)
### From PLAYTEST_PHILOSOPHY.md:
- Why we test the way we do
- Player-centric development approach
- Emergent gameplay focus
---
## π¦ DELIVERABLES SUMMARY
| Phase | What | Status | Duration |
|-------|------|--------|----------|
| **1** | Spatial Graph System (rooms, exits, persistence) | π’ SPEC READY | 3-4 days |
| **Fixes** | EDGE-001, EDGE-006, add stats | π‘ OUTLINED | ~2 hours |
| **2** | Social Hearing Mechanics (overhearing, stealth) | π‘ OUTLINE READY | 4-5 days |
| **3** | Auto-Mender Dev Tools | π΄ NOT STARTED | Future |
---
## π― SUCCESS LOOKS LIKE
### Phase 1 Complete:
- β
Rooms persist in database
- β
Room descriptions locked after creation
- β
Rooms link via exits
- β
Perception-based exit filtering works
- β
All 15+ tests pass
- β
Code review approved
### Phase 2 Complete:
- β
Whispers heard only by target + neighbors
- β
Shouts heard across location
- β
Stealth vs Perception rolls working
- β
Eavesdroppers see filtered memory entries
- β
All 20+ tests pass
- β
"Living World" feels alive
---
## π NEXT STEPS
**For Managers:**
1. Read `TRIAGE_SUMMARY.txt` (5 min)
2. Review game design decisions in `TRIAGE_LIVING_WORLD_KERNEL.md` Part 6
3. Decide: Phase 1 only, or Phase 1+2?
4. Approve timeline
**For Developers (Phase 1):**
1. Read `HANDOFF_LIVING_WORLD_PHASE_1.md` (25 min)
2. Set up test database
3. Start with schema (`src/schema/spatial.ts`)
4. Use TDD throughout
5. Reference `src/schema/character.ts` and `src/storage/repos/character.repo.ts` as models
**For Developers (Phase 2):**
1. Wait for Phase 1 β
+ fixes β
+ decisions β
2. Then review `HANDOFF_LIVING_WORLD_PHASE_2_OUTLINE.md`
---
## β QUESTIONS?
- **What's being built?** β `TRIAGE_SUMMARY.txt`
- **Why this way?** β `TRIAGE_LIVING_WORLD_KERNEL.md`
- **How to implement?** β `HANDOFF_LIVING_WORLD_PHASE_1.md`
- **What about Phase 2?** β `HANDOFF_LIVING_WORLD_PHASE_2_OUTLINE.md`
---
**Status:** β
TRIAGE COMPLETE
**Ready for:** Implementation
**Quality:** Production-ready specification
**Confidence:** 95%
Proceed with Phase 1 implementation.