> 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/.spec_system/archive/phases/phase_05/war_room_requirement_routing_matrix.md).

# War Room Requirement Routing Matrix

**Phase**: 05 - War Room Worker Integration **Session**: 01 - War Room Requirements and Trust Baseline **Status**: Owner-session routing baseline **Last Updated**: 2026-05-29

***

## Routing Rules

* Assign each requirement to the smallest later session that can implement and validate it coherently.
* Protocol-owned contracts come before Worker or web consumers.
* Worker federation is optional external transfer and must stay redacted, bounded, and local-first.
* The local Express server remains a compatibility/status stub for `/warroom`.
* Later-phase deferrals must not appear as shipped Phase 05 behavior.

## Phase 05 Session Ownership

| Session    | Ownership                                                                                                                                                                              |
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Session 02 | Worker API hardening, shared client contract, schemas, deterministic errors, participant authority, rate-limit surface tests, and Worker-focused tests.                                |
| Session 03 | Web room lifecycle state store, Worker URL hints, create/join/connect/disconnect controls, local-only fallback, unavailable states, and web client contract consumption.               |
| Session 04 | Leader approval UX, pending and rejected participant states, member/observer display, presence, reconnect, catch-up, leave behavior, duplicate-action guards, and accessibility tests. |
| Session 05 | Redacted federation event allowlist, sender-excluded cockpit updates, ghost participant overlays, catch-up event filtering, replay/export/log adjacency, and payload tests.            |
| Session 06 | Deployment configuration, environment variables, Worker URL diagnostics, health checks, rate-limit/WAF posture, runbooks, and operational docs.                                        |
| Session 07 | End-to-end validation, security/privacy review, stable documentation closeout, evidence retention, and Phase 06 handoff.                                                               |

## Requirement Matrix

| ID     | Requirement                                                                | Current evidence                                                                          | Owner           | Required output                                                                                   |
| ------ | -------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | --------------- | ------------------------------------------------------------------------------------------------- |
| WR-001 | Keep War Room as optional Cloudflare Worker relay, not local server relay. | ADR 0002, local `/warroom` stub, unsupported route classification.                        | Session 02      | Worker/client contract confirms Worker-only room relay.                                           |
| WR-002 | Harden `POST /rooms` create contract.                                      | Worker source and tests create room with 6-character code and leader.                     | Session 02      | Shared request/response schemas, leader authority material, deterministic errors, tests.          |
| WR-003 | Harden `GET /rooms/:code` room snapshot contract.                          | Worker source returns code, createdAt, participants, leaderId.                            | Session 02      | Shared snapshot type, not-found/error envelope, bounded participant shape, tests.                 |
| WR-004 | Harden `POST /rooms/:code/join`.                                           | Worker source creates pending participant and returns duplicate existing participant.     | Session 02      | Validated join request, participant id/name bounds, room-full conflict, stale duplicate behavior. |
| WR-005 | Harden leader approval.                                                    | Worker source checks approver id and pending participant.                                 | Session 02      | Authority proof, stale approval conflict, deterministic non-leader and missing-pending errors.    |
| WR-006 | Add or define rejection contract.                                          | Protocol has `join_reject`; Worker lacks explicit reject route.                           | Sessions 02, 04 | Reject API/event contract in Session 02; accessible UX in Session 04.                             |
| WR-007 | Define leave semantics.                                                    | Current socket close marks offline; no explicit leave route.                              | Sessions 02, 04 | Leave contract or documented disconnect-only behavior; web leave UX.                              |
| WR-008 | Validate Worker WebSocket handshake.                                       | Worker requires Upgrade, participant id, known participant, non-pending role.             | Session 02      | Shared socket URL builder, expected errors, participant revalidation tests.                       |
| WR-009 | Replace schema-loose socket event acceptance.                              | Current Worker stores unknown `event` payloads in recentEvents.                           | Sessions 02, 05 | Shared event allowlist, runtime validation, rejection/drop tests.                                 |
| WR-010 | Preserve sender-excluded broadcast.                                        | Worker code and tests fan out to peers except sender.                                     | Session 05      | Browser store updates and Worker tests prove no local echo loop.                                  |
| WR-011 | Bound reconnect catch-up.                                                  | Worker keeps last 100 events and sends `warroom_pending_catchup`.                         | Sessions 04, 05 | UX catch-up state plus allowlisted redacted catch-up frames.                                      |
| WR-012 | Keep room size bounded.                                                    | Worker cap is 16 participants.                                                            | Sessions 02, 04 | Shared constant, full-room copy, tests for Worker and UI.                                         |
| WR-013 | Preserve CORS behavior for browser Worker access.                          | Worker source and tests allow GET/POST/OPTIONS and `X-FactionOS-Identity`.                | Sessions 02, 06 | Documented CORS contract and diagnostics for browser failures.                                    |
| WR-014 | Preserve app-level Worker rate limit.                                      | Worker defaults to 240 requests per 60 seconds.                                           | Sessions 02, 06 | Typed 429 envelope, retry-after handling, diagnostics docs.                                       |
| WR-015 | Store bounded participant metadata only.                                   | Worker persists participant rows and recent events.                                       | Sessions 02, 05 | Storage docs and payload tests block sensitive local fields.                                      |
| WR-016 | Keep web panel honest until wired.                                         | `WarRoomPanel.tsx` and cockpit shell mark the surface as deferred.                        | Session 03      | Real controls only when lifecycle store and Worker contract exist.                                |
| WR-017 | Add local-only web fallback.                                               | PRD and docs require core local workflows without Cloudflare.                             | Session 03      | No-Worker URL state, Worker-down state, local-only copy, tests.                                   |
| WR-018 | Add room create/join controls.                                             | Web panel is disabled today.                                                              | Session 03      | Controls consume shared client contract and guard duplicate submissions.                          |
| WR-019 | Add connect/disconnect/reconnect state store.                              | Web has no Worker client state today.                                                     | Sessions 03, 04 | Zustand store, socket lifecycle, cleanup, retry policy, stale state reset.                        |
| WR-020 | Add leader pending approval surface.                                       | Worker emits pending event; web lacks UX.                                                 | Session 04      | Accessible approval UI with in-flight guards and stale-state feedback.                            |
| WR-021 | Add rejected participant UX.                                               | Protocol event exists; Worker/web behavior incomplete.                                    | Sessions 02, 04 | Deterministic rejection event/API plus visible rejected state.                                    |
| WR-022 | Add participant presence display.                                          | Worker participants include `online`.                                                     | Session 04      | Presence list/overlay with accessible labels and stale state handling.                            |
| WR-023 | Add observer semantics or defer them explicitly.                           | Protocol role exists; route behavior undefined.                                           | Session 04      | Member/observer policy and UI, or documented Phase 06 deferral.                                   |
| WR-024 | Redact federated cockpit events.                                           | Current server/web redaction exists for local surfaces; Worker payloads are not hardened. | Session 05      | Allowlisted event schema and tests for blocked categories.                                        |
| WR-025 | Prevent replay/export leakage through War Room.                            | Replay/export are local redacted surfaces today.                                          | Session 05      | Worker events must not include replay buffers, exports, or share fragments.                       |
| WR-026 | Prevent media and draft leakage through War Room.                          | Phase 04 media gate keeps drafts non-runtime.                                             | Session 05      | Federation tests block media drafts, generated prompts, and unapproved media records.             |
| WR-027 | Add Worker URL environment configuration.                                  | Deployment docs list deployed URLs; web has no runtime config flow.                       | Session 06      | Env vars, settings hints, diagnostics, and local fallback docs.                                   |
| WR-028 | Document health and deployment checks.                                     | Deployment docs list health endpoints and deploy workflow.                                | Session 06      | Runbook and CLI/docs diagnostics for health, domain, and rate limits.                             |
| WR-029 | Retain optional Cloudflare posture.                                        | Hosted-services docs say Cloudflare Worker is optional.                                   | Sessions 06, 07 | Docs state core local flows do not require Cloudflare credentials.                                |
| WR-030 | Validate end-to-end Worker/web behavior.                                   | Current tests are Worker-focused and web stub-focused.                                    | Session 07      | Focused Worker, web, browser, docs, security, and privacy evidence.                               |
| WR-031 | Update stable docs after behavior ships.                                   | Stable docs currently distinguish shipped Worker and web stub.                            | Session 07      | Architecture, API, privacy, deployment, README, PRD closeout sync.                                |

## Deferred Later-Phase Work

| ID      | Deferred surface                                   | Target phase      | Reason                                                                                                          |
| ------- | -------------------------------------------------- | ----------------- | --------------------------------------------------------------------------------------------------------------- |
| DEF-001 | Hosted accounts or durable collaboration identity. | Phase 06 or 07    | Requires auth, consent, account lifecycle, retention, and erasure design.                                       |
| DEF-002 | Shared hosted queues or remote workers.            | Phase 06 or later | Requires separate queue authority, audit, isolation, and executor model.                                        |
| DEF-003 | Inbound chat or webhook commands.                  | Phase 06 or later | Requires permission, provenance, replay, and abuse controls.                                                    |
| DEF-004 | Docker/container or remote command execution.      | Phase 06 or later | Requires isolation and execution threat model.                                                                  |
| DEF-005 | Hosted analytics dashboards.                       | Phase 07          | Requires explicit analytics consent, scrubbing, and payload tests.                                              |
| DEF-006 | Hosted storage or public replay hosting.           | Phase 07          | Requires storage authorization, privacy, export, and deletion model.                                            |
| DEF-007 | Mobile certification.                              | Phase 06          | Phase 05 web UX must be responsive, but certification is broader scope.                                         |
| DEF-008 | Unified erasure.                                   | Phase 08          | Room data, browser hints, logs, exports, archives, backups, and hosted records need one trusted erasure design. |
| DEF-009 | Release decommission of historical artifacts.      | Phase 08          | Legacy evidence and retained docs need release-hardening review.                                                |
| DEF-010 | Media promotion for War Room UI.                   | Later media scope | Phase 04 keeps non-battlefield media conditional or deferred until promotion gates pass.                        |

## Handoff Criteria

Session 01 is complete when:

* The requirements/trust baseline exists and is linked from stable Phase 05 docs.
* The payload redaction baseline names allowed and blocked Worker transfer categories.
* This routing matrix assigns every known Phase 05 War Room gap to Sessions 02 through 07 or a later-phase deferral.
* Stable docs do not claim that web-to-Worker federation is already shipped.


---

# 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/.spec_system/archive/phases/phase_05/war_room_requirement_routing_matrix.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.
