> 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/session_06_deployment_environment_and_diagnostics.md).

# Session 06: Deployment Environment and Diagnostics

**Session ID**: `phase05-session06-deployment-environment-and-diagnostics` **Packages**: apps/warroom, apps/web **Status**: Not Started **Estimated Tasks**: \~14-20 **Estimated Duration**: 2-4 hours

***

## Objective

Make War Room federation operable by adding Worker URL configuration, environment checks, health diagnostics, deployment guidance, and visible failure paths without making Cloudflare mandatory.

***

## Scope

### In Scope (MVP)

* Add or document web configuration for the default Worker URL, local Wrangler dev URL, custom domain, and disabled or unavailable states.
* Add health checks and diagnostics for Worker reachability, room API availability, socket upgrade support, rate-limit responses, and deployment metadata where practical.
* Preserve the local server `/warroom` compatibility/status stub as separate from the Worker room backend.
* Update deployment, development, API, architecture, privacy, security, release, package README, and runbook docs for Phase 05 behavior.
* Document Cloudflare WAF, rate-limit, custom-domain, Wrangler, and secrets boundaries without exposing account identifiers beyond already approved stable docs.
* Add tests for configuration fallback, health display, unavailable Worker states, and docs-linked operational commands.

### Out of Scope

* Requiring Cloudflare credentials for local core development or tests that can use a mock/local Worker.
* Adding hosted auth, hosted storage, analytics, public replay hosting, inbound commands, real executors, or unified erasure.
* Replacing Cloudflare account WAF rules without explicit approval.

***

## Prerequisites

* [ ] Sessions 03-05 have defined runtime web and Worker behavior.
* [ ] Current deployment docs and Worker README are reviewed.
* [ ] Cloudflare secrets remain outside tracked files and logs.

***

## Deliverables

1. Worker URL and environment configuration guidance.
2. Health and diagnostics surfaces for web and Worker federation.
3. Updated deployment, API, architecture, privacy, security, release, and package README docs.
4. Tests for fallback, unavailable, rate-limited, and misconfigured Worker states.

***

## Success Criteria

* [ ] Users can tell whether War Room federation is disabled, misconfigured, unreachable, rate-limited, or connected.
* [ ] Local FactionOS development still works without Cloudflare credentials.
* [ ] Deployment docs identify the Worker custom domain, local dev path, health checks, secrets, and rollback guidance.


---

# 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/session_06_deployment_environment_and_diagnostics.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.
