> 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-session04-campaign-workbench/tasks.md).

# Task Checklist

**Session ID**: `phase19-session04-campaign-workbench` **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 (3 tasks)

* [x] T001 \[S1904] Verify completed Phase 19 prerequisites and current campaign/queue artifacts (`.spec_system/specs/phase19-session03-web-shell-and-store/validation.md`)
* [x] T002 \[S1904] Map existing campaign, task, and queue contract gaps before coding (`packages/protocol/src/orchestrationCommandCenter.ts`)
* [x] T003 \[S1904] Inspect current task queue transition behavior for restore, mark-unavailable, and dispatch needs (`apps/server/src/managers/taskQueue.ts`)

***

## Foundation (5 tasks)

* [x] T004 \[S1904] Create campaign manager behavior layer for preview, transition, dispatch, retry, and queue bridging with idempotency protection, transaction boundaries, and compensation on failure (`apps/server/src/managers/planCampaignManager.ts`)
* [x] T005 \[S1904] Add campaign preview, transition, dispatch, and queue-control validators with schema-validated input and explicit error mapping (`apps/server/src/lib/commandCenterValidation.ts`)
* [x] T006 \[S1904] Add focused campaign/task helper methods needed by the workbench manager while preserving bounded output (`apps/server/src/managers/orchestrationCommandCenter.ts`)
* [x] T007 \[S1904] Add explicit queue restore and mark-unavailable transitions with expected-revision and duplicate-trigger protection (`apps/server/src/managers/taskQueue.ts`)
* [x] T008 \[S1904] Wire campaign workbench REST routes and WebSocket emissions with schema-validated input and explicit error mapping (`apps/server/src/routes/commandCenter.ts`)

***

## Implementation (7 tasks)

* [x] T009 \[S1904] Inject campaign workbench dependencies into server route construction (`apps/server/src/server.ts`)
* [x] T010 \[S1904] Add web API helpers for campaign preview, campaign transitions, dispatch, and queue controls with timeout, stale-revision, duplicate-trigger, and refresh handling (`apps/web/src/lib/orchestrationApi.ts`)
* [x] T011 \[S1904] Add campaign graph, task dependency, state label, and action availability helpers with types matching declared contract and exhaustive enum handling (`apps/web/src/lib/commandCenterUi.ts`)
* [x] T012 \[S1904] Create CampaignWorkbench with preview, approval, pause, resume, cancel, refine, retry, dispatch, loading, empty, error, and offline states (`apps/web/src/components/orchestration/CampaignWorkbench.tsx`)
* [x] T013 \[S1904] Create QueueWorkbench with create-from-template, update, reject, restore, mark-unavailable, dispatch controls, and duplicate-trigger prevention while in-flight (`apps/web/src/components/orchestration/QueueWorkbench.tsx`)
* [x] T014 \[S1904] Replace generic campaign pane rendering with workbench composition and accessible interactive controls (`apps/web/src/components/orchestration/CommandCenterPanes.tsx`)
* [x] T015 \[S1904] Add command-center mutation state cleanup for campaign and queue actions with scoped rollback on error (`apps/web/src/store/useGameStore.ts`)

***

## Testing (5 tasks)

* [x] T016 \[S1904] Wire OrchestrationShell action handlers, toasts, refresh paths, and disabled states with cleanup on scope exit for all acquired resources (`apps/web/src/components/orchestration/OrchestrationShell.tsx`)
* [x] T017 \[S1904] \[P] Write server manager tests for preview, transitions, idempotency, stale revisions, dispatch queue bridging, and bounded failures (`apps/server/tests/planCampaignManager.test.ts`)
* [x] T018 \[S1904] \[P] Extend server route tests for campaign routes, WebSocket events, compact errors, and `/api` aliases (`apps/server/tests/commandCenterRoutes.test.ts`)
* [x] T019 \[S1904] \[P] Extend web API, store, UI helper, and component tests for campaign/queue workbench behavior, failure states, accessibility, and product-facing copy (`apps/web/tests/OrchestrationPanel.test.tsx`)
* [x] T020 \[S1904] Run focused server/web typechecks, focused tests, whitespace checks, and ASCII/LF validation (`package.json`)

***

## 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 `implement` 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-session04-campaign-workbench/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.
