> 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/sessions/phase19-session03-web-shell-and-store/tasks.md).

# Task Checklist

**Session ID**: `phase19-session03-web-shell-and-store` **Total Tasks**: 20 **Estimated Duration**: 3-4 hours **Created**: 2026-06-26

***

Legend: `[x]` completed; `[ ]` pending; `[P]` parallelizable; `[SNNMM]` session ref; `TNNN` task ID.

***

## Setup (2 tasks)

* [x] T001 \[S1903] Verify Session 01 and Session 02 web-facing contracts, server route names, and existing Orchestration tests before editing (`packages/protocol/src/orchestrationCommandCenter.ts`, `packages/protocol/src/rest.ts`, `apps/server/src/routes/commandCenter.ts`, `apps/web/tests/OrchestrationPanel.test.tsx`)
* [x] T002 \[S1903] Create the orchestration component folder and baseline exports for the shell extraction (`apps/web/src/components/orchestration/`)

***

## Foundation (5 tasks)

* [x] T003 \[S1903] \[P] Extend command-center API types, response validators, snapshot fetchers, capability fetchers, mutation helpers, stale revision mapping, and refresh-on-mutation plumbing with duplicate-trigger prevention while in-flight (`apps/web/src/lib/orchestrationApi.ts`)
* [x] T004 \[S1903] \[P] Create command-center UI normalizers, capability copy, tab count helpers, safe labels, and broad text redaction with schema-shaped input guards and explicit error mapping (`apps/web/src/lib/commandCenterUi.ts`)
* [x] T005 \[S1903] \[P] Add command-center status-copy tests for normalizers, redaction, capability states, tab counts, unknown states, and path/secret-safe labels (`apps/web/tests/commandCenterUi.test.ts`)
* [x] T006 \[S1903] \[P] Add command-center API tests for URLs, validators, stale revision conflicts, redacted errors, timeout/offline mapping, and mutation refresh hooks (`apps/web/tests/orchestrationApi.test.ts`)
* [x] T007 \[S1903] Update legacy orchestration helper exports so existing queue, template, lineage, and guarded-action tests remain source-compatible (`apps/web/src/lib/orchestrationUi.ts`)

***

## Implementation (8 tasks)

* [x] T008 \[S1903] Add command-center Zustand slices, empty-state factories, hydrators, selected tab/drawer state, in-flight mutation keys, and reset behavior with pure normalization before store mutation (`apps/web/src/store/useGameStore.ts`)
* [x] T009 \[S1903] Add reducers for every `command_center_*` WebSocket event family with deterministic sorting, selection cleanup, malformed payload rejection, and scoped rollback on error (`apps/web/src/store/useGameStore.ts`)
* [x] T010 \[S1903] Add WebSocket frame sanitizers for command-center events with schema-validated input, explicit error mapping, and broad sensitive-field redaction (`apps/web/src/store/useWsClient.ts`)
* [x] T011 \[S1903] Create the orchestration shell and header components with explicit loading, empty, error, offline, stale, unavailable, observe-only, proposal-only, and executor-ready states (`apps/web/src/components/orchestration/OrchestrationShell.tsx`, `apps/web/src/components/orchestration/OrchestrationHeader.tsx`)
* [x] T012 \[S1903] Create accessible tabs and command-center overview panes for campaigns, attention, executors, diagnostics, federation posture, and metrics with product-facing copy only and diagnostics confined to capability posture (`apps/web/src/components/orchestration/OrchestrationTabs.tsx`, `apps/web/src/components/orchestration/CommandCenterPanes.tsx`)
* [x] T013 \[S1903] Create the detail drawer with accessible labels, focus management, Escape/backdrop dismissal, state reset on re-entry, and no raw artifact or command display (`apps/web/src/components/orchestration/OrchestrationDrawer.tsx`)
* [x] T014 \[S1903] Extract current queue, templates, lineage, and guarded-action compact sections while preserving reference openers and guarded-action duplicate decision prevention (`apps/web/src/components/orchestration/OrchestrationCurrentState.tsx`)
* [x] T015 \[S1903] Rewire the public Orchestration panel entry point to compose the extracted shell while preserving existing test ids, accessible description, compact rows, detail popup behavior, and mobile scroll region (`apps/web/src/components/OrchestrationPanel.tsx`)

***

## Testing (5 tasks)

* [x] T016 \[S1903] Add command-center store tests for snapshot hydration, event reducers, generatedAt/count handling, selection cleanup, malformed-frame preservation, in-flight mutation keys, and reset behavior (`apps/web/tests/commandCenterStore.test.ts`)
* [x] T017 \[S1903] Update existing orchestration store tests to prove legacy queue, template, graph, and guarded-action reducers still coexist with command-center slices (`apps/web/tests/orchestrationStore.test.ts`)
* [x] T018 \[S1903] Update Orchestration panel component tests for legacy behavior preservation, shell tabs, drawer empty/unavailable states, capability labels, keyboard dismissal, focus behavior, and product-facing copy (`apps/web/tests/OrchestrationPanel.test.tsx`)
* [x] T019 \[S1903] Update WebSocket privacy tests for valid command-center frame sanitization, malformed rejection, sensitive-field redaction, and no state clearing on bad input (`apps/web/tests/wsClientPrivacy.test.ts`)
* [x] T020 \[S1903] Run focused web verification and ASCII/LF/diff checks (`npm --workspace apps/web run typecheck`, `npm test -- apps/web/tests/orchestrationApi.test.ts apps/web/tests/commandCenterUi.test.ts apps/web/tests/commandCenterStore.test.ts apps/web/tests/orchestrationStore.test.ts apps/web/tests/OrchestrationPanel.test.tsx apps/web/tests/wsClientPrivacy.test.ts`, `git diff --check -- apps/web .spec_system/specs/phase19-session03-web-shell-and-store`)

***

## Completion Checklist

* [x] All tasks marked `[x]`
* [x] All tests and checks passing
* [x] All files ASCII-encoded with LF line endings
* [x] implementation-notes.md updated
* [x] Ready for `implement` to start the implement -> creview -> validate sequence

***

## Next Steps

Run the `creview` workflow step.


---

# 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/sessions/phase19-session03-web-shell-and-store/tasks.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.
