> For the complete documentation index, see [llms.txt](https://faction-os.gitbook.io/faction-os-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://faction-os.gitbook.io/faction-os-docs/docs/game-design/13-implementation-phase-outline.md).

# Implementation Phase Outline — The War Effort

**Project:** FactionOS — The War Effort **Document role:** High-level implementation phasing plan **Sizing unit:** one phase ≈ one \~800k-token agentic context window of work (design reading + code + tests + doc updates inside a single session), so each phase is deliberately one coherent vertical slice with a small, stable file surface — not a grab bag.

This document sequences the *entire* design package (docs 01–12) into buildable phases. It refines the fun-ordered build order in `08-production-roadmap-and-phase-a-spec.md` (Phases A–F) into session-sized units. Section references (§) use the package-wide numbering.

## Grounding notes (second pass — code-verified 2026-07-03)

Facts checked directly against the codebase that shape the phasing:

* **All 21 protocol events the design leans on exist** in `packages/protocol/src/events.ts` (774 lines) — verified by grep: `test_failure`, `test_pass`, `build_error`, `build_fix`, `ts_errors`, `lint_error`, `loop_update`, `task_stalled`, `task_near_stall`, `task_verification`, `plan_verification_complete`, `suggestion_update`, `hero_evidence_update`, `file_intent_declare`, `warroom_pending_catchup`, `scroll_collected`, `achievement_unlocked`, `awaiting_input`, `plan_budget_warning`, `plan_budget_exhausted`, `subagent_lineage_update`.
* **`useGameStore.ts` is 3,640 lines.** The projection must be a separate pure module under `apps/web/src/lib/` (the established home of every pure derivation — 60+ modules), folded from the store's event-apply path and read via selectors. Growing the store itself is off the table.
* **The linkage mechanism is real:** `SuggestionAcceptRestResponse` is imported and type-guarded in `apps/web/src/lib/questBoardActions.ts` (§5A verbatim-prompt match confirmed implementable as designed).
* **Replay honesty substrate exists:** `replayingSinceMs` lives in `useGameStore.ts`; `dispatchReplayEntries` in `apps/web/src/lib/replayLink.ts` (536 lines).
* **The battlefield side-module pattern exists:** `apps/web/src/components/battlefield/achievementCelebration.ts` (with `CELEBRATION_MAX_CONCURRENT`) shows how board effects live beside `Battlefield.tsx` (582 lines) instead of inside it. Camp/effects layers mirror this.
* **The mock substrate is `apps/server/src/managers/mockEventGenerator.ts`** plus the `mockEnabled` dev knob in `useSettingsStore.ts` — War Games (Phase 12) is a reframe of a shipped module, not new simulation. Caveat: mock events are indistinguishable on the wire, so the progress-inert guard must key off `mockEnabled` (disable projection persistence), not off event shape.
* **`apps/server/src/lib/names.ts` already generates faction-themed names** — the Named Nemeses table (Phase 8) mirrors an existing pattern rather than inventing one.
* **Heroes record their working directory** (`packages/protocol/src/heroes.ts`) — the multi-front model (Phase 7) has its data already.
* **Scanner stack confirmed:** `codebaseScanOrchestrator.ts`, `codebaseIssueScanners.ts`, `projectScanEngine.ts`, `onDemandAnalysisEngine.ts` in `apps/server/src/lib/` feed `suggestionManager.ts` — camps and Dispatch Scouts sit on live plumbing.
* **`channelCommandManager.ts` exists** in `apps/server/src/managers/` — the Emissary (Phase 4) frames a shipped intake path.
* **SFX manifest shape:** `sfxAssets.ts` keys `SFX_FILES` by `FactionId × BarkKind` with synth fallback via `voiceSynth.ts`. World cues (Phase 3) extend this manifest with a faction-agnostic bucket.
* **Complexity tiers (`quick/routine/heavy/epic`) and specialization confidence (`low/medium/high` + generalist) verified** in `missionComplexity.ts` / `heroSpecialization.ts` — the XP and Class Advantage formulas (Phase 5) compose verified vocabulary.
* **Test convention:** 136 test files in `apps/web/tests/` following a pure-lib test + component test split; every phase adds both kinds.

## Ground rules for every phase

1. **Shippable and fun at the end.** Each phase lands behind nothing — it ships, it demos, and its slice passes its own glance/honesty checks.
2. **The projection is never bypassed.** All game state flows through `gameProjection.ts` (§15/§15A); phases add reducer cases, never new state authorities.
3. **Reduced-motion twins ship with the motion**, never retrofitted (§5B).
4. **Fun Laws audited per phase** — especially Law 1 (no fake fire) and Law 4 (never reward waste); each phase's exit includes a quick §9 pass.
5. **Docs updated in the same window.** The phase's session updates the owning design doc(s) and the §16 change log before it ends.
6. **Check generated assets before making art.** `manifest.md` tracks production-generated assets already present under `assets/generated/game-design/`. Promotion still requires consuming paths, fallbacks, accessibility, cache/mirror behavior, and provenance records in the implementing phase.

## Phase table (dependency order)

| #  | Phase                                   | Design sections                                                   | Depends on |
| -- | --------------------------------------- | ----------------------------------------------------------------- | ---------- |
| 1  | Projection Foundation                   | §15, §15A, §14.6, §14.9                                           | —          |
| 2  | Legion I — Scanner Camps                | §2, §14.3, §14.7, §14.2, §5B                                      | 1          |
| 3  | Legion II — Live Tier & Combat Playback | §3, §5A, §13A, §14.1, §14.4, §14.8                                | 2          |
| 4  | Verbs & Ceremony                        | §3A, §14.5, §11 (Town Crier)                                      | 3          |
| 5  | Banners, XP & Class Advantage           | §6, §6A, §9, Battle Report (§4)                                   | 3          |
| 6  | Stakes & The Return Loop                | §4 (War Tide), §4B, Dawn Report (§4, §16), First Ten Minutes (§4) | 5          |
| 7  | The Living Map                          | §5, §7A, §14.3                                                    | 3          |
| 8  | Loot & Legends                          | §7, §6 (quirks, Hall of Banners), §10 (Nemeses)                   | 5          |
| 9  | Bosses & Dynamic Audio                  | §10, §11                                                          | 7, 8       |
| 10 | The Alliance War                        | §8, §16 (redaction question)                                      | 5          |
| 11 | Seasons & Saga                          | §4 (War Loop), §7A (saga pages)                                   | 7, 8       |
| 12 | War Games, Demo & Hardening             | §5B (synthetic front), §13A criteria re-run, §16 tuning           | all        |

## Generated Asset Handoff

Use `manifest.md` for asset IDs, dimensions, source files, and runtime posture. The paths below are reminders for phase owners so existing assets are not missed:

| Phase                             | Already-present generated assets                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 3 - Live Tier & Combat Playback   | `assets/generated/game-design/phase03/live-enemies/live-enemy-effects-sheet.png`, `assets/generated/game-design/phase03/strike-vocabulary/strike-vocabulary-effects-sheet.png`, `assets/generated/game-design/phase03/reduced-motion/reduced-motion-static-badges-sheet.png`                                                                                                                                                                                                            |
| 4 - Verbs & Ceremony              | `assets/generated/game-design/phase04/town-crier/town-crier-toast-chrome-sheet.png`, `assets/generated/game-design/phase04/command-ceremony/command-ceremony-props-sheet.png`, `assets/generated/game-design/phase05/banners-regalia/banners-regalia-sheet.png`, `assets/generated/game-design/phase05/class-icons/class-icons-and-flares-sheet.png`, `assets/generated/game-design/phase08/loot/loot-roll-visuals-sheet.png`                                                           |
| 5 - Banners, XP & Class Advantage | `assets/generated/game-design/phase05/banners-regalia/banners-regalia-sheet.png`, `assets/generated/game-design/phase05/class-icons/class-icons-and-flares-sheet.png`, `assets/generated/game-design/phase06/battle-report/battle-report-frame.png`                                                                                                                                                                                                                                     |
| 6 - Stakes & The Return Loop      | `assets/generated/game-design/phase06/war-council/war-council-objective-board.png`, `assets/generated/game-design/phase06/war-tide/war-tide-meter-sheet.png`, `assets/generated/game-design/phase06/dawn-report/dawn-report-recap-backdrop.png`, `assets/generated/game-design/phase06/onboarding/first-ten-minutes-onboarding-sheet.png`                                                                                                                                               |
| 7 - The Living Map                | `assets/generated/game-design/phase07/territory-map/territory-map-base.png`, `assets/generated/game-design/phase07/home-sector/home-sector-building-dressings.png`                                                                                                                                                                                                                                                                                                                      |
| 8 - Loot & Legends                | `assets/generated/game-design/phase08/loot/loot-roll-visuals-sheet.png`, `assets/generated/game-design/phase08/tomes/tome-expansion-art-sheet.png`, `assets/generated/game-design/phase08/relics/relic-set-art-sheet.png`, `assets/generated/game-design/phase08/hall-of-banners/hall-of-banners-gallery-backdrop.png`, `assets/generated/game-design/phase08/hero-quirks/hero-quirks-palette-sheet.png`, `assets/generated/game-design/phase08/nemesis/nemesis-presentation-sheet.png` |
| 9 - Bosses & Dynamic Audio        | `assets/generated/game-design/phase09/bosses/blight-titan-standee.png`, `assets/generated/game-design/phase09/bosses/blight-titan-standee-chroma-source.png`, `assets/generated/game-design/phase09/siege/siege-set-piece-static.png`                                                                                                                                                                                                                                                   |
| 10 - The Alliance War             | `assets/generated/game-design/phase10/alliance-war/alliance-war-visuals-sheet.png`, `assets/generated/game-design/phase09/bosses/null-sovereign-world-boss-standee.png`, `assets/generated/game-design/phase09/bosses/null-sovereign-world-boss-standee-chroma-source.png`, `assets/generated/game-design/phase05/banners-regalia/banners-regalia-sheet.png`                                                                                                                            |
| 11 - Seasons & Saga               | `assets/generated/game-design/phase11/seasons-saga/seasons-saga-visuals-sheet.png`, `assets/generated/game-design/phase08/hall-of-banners/hall-of-banners-gallery-backdrop.png`, `assets/generated/game-design/phase08/relics/relic-set-art-sheet.png`, `assets/generated/game-design/phase09/bosses/blight-titan-standee.png`                                                                                                                                                          |
| 12 - War Games, Demo & Hardening  | `assets/generated/game-design/phase12/war-games/war-games-demo-presentation-sheet.png`                                                                                                                                                                                                                                                                                                                                                                                                  |

Phases 4–5 can run in either order after 3; 7, 8, and 10 are parallelizable after their dependencies; 12 is always last.

***

## Phase 1 — Projection Foundation

**Goal:** the single new state module exists, tested, persisted, honest.

* `gameProjection.ts` pure reducer: full §15A shape (fields may start empty), `reduce(state, event, ctx)` signature, `isReplaying` guard (§14.9), snapshot-reconciliation vs accumulation split.
* Single-pulse `alertFocus` authority with the §14.6 priority ladder.
* localStorage persistence with the shipped replay-buffer debounce pattern; hydrate → reconcile → live-fold boot order.
* Test harness mirroring how `factionStandings`/`heroLeaderboard` are tested today; replay-farming exploit test locked in from day one.

**Code anchors.** New: `apps/web/src/lib/gameProjection.ts`, `apps/web/tests/gameProjection.test.ts`. Touched: `useGameStore.ts` — *only* a fold call at the existing event-apply path (where `replayingSinceMs` is already consulted) plus read selectors; the store's 3,640 lines otherwise untouched. Persistence mirrors the replay-persist debounce already tested in `apps/web/tests/replayPersist.test.ts`. Patterns to mirror: `factionStandings.ts` (pure fn over events + roster), its test file for harness shape.

**Exit:** projection folds a live session without rendering anything new; reconnect/replay changes no persisted numbers.

## Phase 2 — Legion I: Scanner Camps

**Goal:** open the cockpit and *see the enemy* — tech debt on the board.

* `suggestion_update` → camp reconciliation: coalescing per sector, HP = Σ severity weights, camp/fort/citadel tiers, entrenchment counters (§14.3, §14.7).
* Camp DOM layer inside `Battlefield.tsx` (§13A layer order): accessible camp buttons → Quest Board filtered to `issueIds`; stable-hash grid placement; static twins.
* **Banish** verb (dry, loot-less dismissal, §14.7) and the **Dispatch Scouts** ceremony on manual scan (§3A).
* **Champion Mode** floor (§14.2): top-K camp rendering scaled to roster size, singular copy. **Legion floor / Golden Age** treatment for clean repos (§5B).

**Code anchors.** New: `apps/web/src/lib/legionCamps.ts` (pure coalescing/tiering over `CodebaseIssue` snapshots from `packages/protocol/src/suggestions.ts`), `apps/web/src/components/battlefield/CampLayer.tsx` — the lib + side-module split mirroring `battlefieldHeroes.ts` + `achievementCelebration.ts`. Touched: `Battlefield.tsx` (582 lines — insert layer, keep thin), `gameProjection.ts` (camp reducer cases). Positioning reuses the clamp helpers in `battlefield2d.ts`. Dismissal rides the existing Quest Board dismiss action in `questBoardActions.ts`; scan ceremony hooks the trigger already surfaced via `scanCodebase.ts` + `useSettingsStore` scan state.

**Exit:** §13A glance test passes with camps only; every camp inspects through to real issues (Fun Law 1 audit).

## Phase 3 — Legion II: Live Tier & Combat Playback

**Goal:** the running mission becomes *watchable* — the fight is the stream.

* Live enemies: skirmishers (`test_failure`/`test_pass`), ram (`build_error/fix`), gremlins (`ts_errors`/`lint_error`), stacked wraiths (§14.8), siege from stall escalations.
* Camp↔mission linkage: `pendingLinks` verbatim-prompt match → `campLinks` (§5A verified mechanism); joint assault rendering for multi-mission links.
* Strike playback on linked camps; combo merging + SFX rate limits + stage props for long sieges (§14.4); scrying posture for silent-active heroes (§14.1).
* Six world SFX cues via the existing synth fallback; bark reuse for hero-actor moments (§13A SFX plan).

**Code anchors.** New: `apps/web/src/components/battlefield/effectsLayer.ts(x)` — concurrency cap + timer cleanup copied from `achievementCelebration.ts` (`CELEBRATION_MAX_CONCURRENT` pattern). Touched: `gameProjection.ts` (skirmisher/ram/gremlin/wraith/siege cases; `pendingLinks` recorded on the `SuggestionAcceptRestResponse` success path in `questBoardActions.ts`, bound on `mission_start` via verbatim `Mission.prompt` match). World cues: add a faction-agnostic bucket to `SFX_FILES` in `sfxAssets.ts`; fallback + rate limiting already live in `voiceSynth.ts` / `audioRuntime.ts`. Scrying posture joins the existing state-badge set in `Battlefield.tsx` (its badge vocabulary is already shipped and tested in `apps/web/tests/Battlefield.test.tsx`).

**Exit:** all eight §13A acceptance criteria pass, including kill-latency (≤5s) and fatigue (45-minute mission, no strobe).

## Phase 4 — Verbs & Ceremony

**Goal:** every one of the \~13 player verbs feels *senior* — thick, chunky, physical (§3A).

* Ceremony pass over the full verb table: summon banner-raise, rally horn, counsel flare-douse, wax-seal plan decisions, portcullis gates, muster flag (with §6A affinity flare hook point), tavern contracts, honorable discharge, Banners Unite, Warchief's decree, **Receive the Emissary** (inbound channel commands), Dispatch Scouts.
* `collect_scroll` polish budget — the one pure-game click gets arcs, rarity beams, shelf-fill (§3A rule 2).
* Flare ceremony budget (§14.5) wired to `flareCeremony` state.
* Toast → **Town Crier** framing; work toasts stay visually senior (§11).

**Code anchors.** No new state — this phase touches the verb surfaces: `PlanWorkpad.tsx`, `PermissionModal.tsx`, `QuestBoard.tsx`, `NoticeBoard.tsx`, `HeroRoster.tsx`, `WarRoomPanel.tsx`, `ScrollShelf.tsx`, `ToastTray` — ceremony hooks only, logic untouched. Emissary reads the shipped channel intake (`apps/server/src/managers/channelCommandManager.ts` surfaces, `channelCommandValidation.ts`) through the existing orchestration store slices. Audio ceremonies route through `useVoiceBarks` / `useFactionVoiceLine` / `audioRuntime.ts`, inheriting opt-in, rate-limit, and fallback posture (§12A).

**Exit:** dogfood self-report — each verb used once feels distinct with eyes closed (audio) and motion off (static twins).

## Phase 5 — Banners, XP & Class Advantage

**Goal:** progression turns on; sessions produce visible growth.

* XP formula (complexity × verification × swift × class-advantage, §6/§6A/§9), levels, titles pipeline via the achievements engine.
* Swift Command timing capture; banner planting on verified completion; banner/trophy regalia (`hero_evidence_update`).
* **Class Advantage** derivation (heroSpecialization × quest tags), affinity flare + XP bonus + class barks; advantage-never-gate guard.
* **Battle Report v1**: SessionRollup reskin — territory delta, banners, MVP, efficiency grade (self-relative, §9).

**Code anchors.** New: `apps/web/src/lib/classAdvantage.ts` (pure fn over `heroSpecialization.ts` roles × `missionTags.ts` tags × quest source — all verified vocabulary). Touched: `gameProjection.ts` (XP/banner/swift cases composing `missionComplexity.ts` tiers and `plan_verification_complete`/`task_verification` events), `SessionRollup.tsx` (reskin; its `sessionStats()` is the stats card), `HeroDetailDrawer.tsx` + `HeroCard.tsx` (level/title display). Titles trigger client-side in the projection but display mirrors the achievements gallery grouping patterns (`AchievementsGallery.tsx` + its two test files).

**Exit:** a normal work session ends with a Battle Report a player wants to screenshot; anti-Goodhart checks (§9.1–9.5) verified by test.

## Phase 6 — Stakes & The Return Loop

**Goal:** sessions get a beginning, middle, and end; absence is narrated.

* **War Council** (§4B): deterministic objective picker, one re-roll, ceremony on completion, declared-vs-achieved ledger opening the Battle Report.
* **War Tide meter** (§4): trailing-window gains/losses, three-state read, signed-chip static twin.
* **Dawn Report** (§4/§16): snapshot-diff composer + recap-event vocabulary, sequenced through `dispatchReplayEntries`; ends focused on the top `alertFocus`.
* **First Ten Minutes** scripted onboarding (§4): oath framing, first banner, the single-camp reveal withhold.

**Code anchors.** New: `apps/web/src/lib/warCouncil.ts` (deterministic picker over projection + Quest Board model), `apps/web/src/lib/dawnReport.ts` (persisted-projection vs fresh-hydration diff → synthetic recap entries). The sequencer is **reused verbatim**: `dispatchReplayEntries` in `replayLink.ts` (536 lines) already does cadence-scaled dispatch with gap capping and the replaying-flag guard (§16, code-verified third pass). Touched: `gameProjection.ts` (`warTide`, `council` fields), `SessionRollup.tsx` (ledger opening), onboarding touches `FactionPicker.tsx` + `App.tsx` first-run path only.

**Exit:** cold-open after 12 hours away → the \~20s recap answers "what happened, are we winning, what needs me" without reading any feed.

## Phase 7 — The Living Map

**Goal:** the board becomes a persistent territory of the actual repo.

* Sector model: directory hashing into the capped grid, small-repo deepening / monorepo Borderlands aggregation (§14.3).
* Fog push on mission touch, slow re-fog, corruption on new findings; frontline-delta framing (§5).
* Building levels from cumulative output; **essence economy** live: income + burst decay, automatic tithe, capped cosmetic treasury (§7A).
* Patrol routes for recurring loops (`loop_update`); multi-front tabs for multi-project play (§5).

**Code anchors.** New: `apps/web/src/lib/territory.ts` (sector hashing + fog math; path aggregation borrows the file-path bucketing already proven in `missionHeatmap.ts`), sector/fog DOM layer beside `CampLayer.tsx`. Touched: `gameProjection.ts` (`sectors`, `essence`, `buildings` cases), `battlefield2d.ts` (grid helpers only if needed — clamp model stays). Multi-front grouping keys off the hero's recorded working directory (`packages/protocol/src/heroes.ts` — verified field). Essence/burst decay composes the `toolUsage.ts` taxonomy (filesystem/shell/search/web/ planning/MCP classes already shipped).

**Exit:** two weeks of normal use produces a map that visibly belongs to *this* repo and *this* player; essence has no dead numbers.

## Phase 8 — Loot & Legends

**Goal:** the collection/retention backbone plus enemy drama.

* Loot rolls on mission complete (celebration choreography, honest odds, §7); tome expansion packs; relics with keep display + cosmetic auras.
* Hero quirks (deterministic from session id) and the **Hall of Banners** enshrinement flow (§6).
* **Named Nemeses** (§10): promotion rules over existing camp-scar / skirmisher / wraith state, deterministic name table, Dawn Report mentions, relic + "Bane of ⟨name⟩" title on verified kill.

**Code anchors.** Tome expansion extends the trigger map in `packages/protocol/src/scrolls.ts` + `apps/server/src/managers/scrolls.ts` (the one phase with protocol-adjacent server work; collection/idempotency flows already tested). New: `apps/web/src/lib/nemesisNames.ts` — a client-side deterministic table mirroring the faction-name pattern that already exists in `apps/server/src/lib/names.ts`. Quirks seed from the hero's `sessionId` (verified stable field). Hall of Banners is a new gallery component following the `AchievementsGallery.tsx` grouping/ collapse conventions. Touched: `gameProjection.ts` (`nemeses`, relic triggers), `HeroDetailDrawer.tsx` (regalia).

**Exit:** a recurring failure gets named within a week of dogfooding, and its kill is the best moment of that week (self-report).

## Phase 9 — Bosses & Dynamic Audio

**Goal:** peak-fun punctuation and a soundtrack that knows the war state.

* **Blight Titan** weekly boss from the entrenched-camp pool; **Siege** set piece from stall escalations (§10).
* Boss standee art through the media pipeline + provenance gates (§11).
* Dynamic music layering: calm/idle mix, percussion per active hero, horns on flares/sieges (§11); world SFX recorded cues replace synth fallbacks as they land.

**Code anchors.** Titan/Siege are projection derivations over fields that already exist by this phase (`entrenchedScans` pool, `siege` level) — new rendering in the effects/camp layers, no new data. Boss art enters via `mediaCatalog.ts` + the provenance gates (the only new-art path the design permits, §5B). Music layering extends `backgroundMusic.ts` / `useBackgroundMusic.ts` (12-track playlist, opt-in/resume posture verified §12A); layer selection reads projection state, not raw events.

**Exit:** boss weeks feel different from normal weeks with the sound off *and* with the screen off.

## Phase 10 — The Alliance War

**Goal:** multiplayer meaning over the shipped War Room.

* Allied standees on the shared front (redacted federation); Banners Unite ceremony (§8).
* **World Boss**: campaign task queue as shared HP bar, loot-for-all on kill (§8).
* Seasonal **faction league** over FactionStandings across rooms; tavern framing for Notice Board contracts (§8).
* Resolve the §16 redaction question: exactly what score/state is shareable.

**Code anchors.** The room/presence/federation stack is fully shipped: `apps/warroom/` worker, `warRoomClient.ts`, `warRoomFederation.ts`, `warRoomPresence.ts`, `useWarRoomStore.ts`, `RemoteParticipantOverlay.tsx` (allied markers already render on the board). World Boss HP reads campaign/queue state from `packages/protocol/src/taskQueue.ts` + `planCampaignManager.ts` surfaces. League aggregates `factionStandings.ts` outputs across the room's safe outbound frames — any new shared fields must pass the same validation posture as existing frames (`packages/protocol/src/warroom.ts`). Redaction answer must respect `sessionPrivacy.ts` / `llmPrivacy.ts` boundaries.

**Exit:** two cockpits in one room both read the same war truthfully, and nothing leaks beyond the existing federation redaction posture.

## Phase 11 — Seasons & Saga

**Goal:** the long game — prestige without loss.

* Season rollover: chronicle entry, veteran retirement to the Hall, re-fog with Legion strength scaled to the current issue census (§4).
* Saga chronicle surface; illuminated saga pages as the treasury's flagship sink (§7A); slain nemeses auto-enter the saga (§16).
* Golden Age celebration state for clean-repo seasons (§5B).

**Code anchors.** Season state is the projection's `season` field plus a rollover reducer case; the chronicle is a new gallery-style component (same conventions as Phase 8's Hall). Cross-device season persistence is the moment to ride `hostedPersistence.ts` (client lib + server lib both exist) beyond localStorage — the §15A posture explicitly deferred this until a phase needed it; this is that phase. Treasury spend actions are client-local cosmetics in the projection (no protocol change).

**Exit:** a season ends and the player keeps everything that mattered, loses nothing real, and wants to see the next map.

## Phase 12 — War Games, Demo & Hardening

**Goal:** the game is visible pre-install, and the whole package holds up.

* **War Games** synthetic front for the public demo (mock-generator substrate, §5B) — clearly bannered, progress-inert (mirrors §14.9).
* Full §13A acceptance re-run across all shipped phases; perf/fatigue tuning sweep of every rate limiter and cap.
* Burn down the §16 tuning questions that required playtest data: essence rates, affinity bonus size, council heuristics, tide window, nemesis name table.

**Code anchors.** The engine is `apps/server/src/managers/mockEventGenerator.ts` (shipped) driven by the `mockEnabled` knob in `useSettingsStore.ts`. Grounding caveat (verified): mock events are **indistinguishable on the wire**, so the progress-inert guard keys off the client's `mockEnabled` setting — when set, the projection folds for spectacle but persistence is disabled (same shape as the `isReplaying` no-accumulate guard). Demo parity follows the existing static-demo pattern the docs cite (§5B). The tuning sweep touches only constants in `gameProjection.ts` / `legionCamps.ts` / `warCouncil.ts` — by design, every tunable landed in pure modules with focused tests.

**Exit:** a stranger opening the public demo understands the fantasy in 60 seconds; a two-hour real session produces zero mute-the-tab impulses.

***

*Update log:*

* 2026-07-03 — Initial phase outline: 12 session-sized phases covering the full design package, refining doc 08's fun-ordered Phases A–F into \~800k-token implementation windows with dependencies and exit criteria.
* 2026-07-03 (second pass, code-grounded) — Verified the plan against the codebase: all 20 design-cited events confirmed in `events.ts`; added the Grounding Notes index (module sizes, verified symbols, test conventions) and per-phase **Code anchors** blocks naming new modules, touched files, and shipped patterns to mirror. Material findings folded in: projection must live in `apps/web/src/lib/` (store is 3,640 lines); `achievementCelebration.ts` is the board-effects pattern; the mock substrate is `mockEventGenerator.ts` + `mockEnabled` and the War Games progress-inert guard must key off the setting (mock events are wire-indistinguishable); `names.ts` grounds the nemesis name table; heroes' recorded working directory grounds multi-front; Phase 11 is where `hostedPersistence.ts` graduates the projection beyond localStorage.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://faction-os.gitbook.io/faction-os-docs/docs/game-design/13-implementation-phase-outline.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
