> 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/phase20-session09-container-dispatch-decision/tasks.md).

# Task Checklist

**Session ID**: `phase20-session09-container-dispatch-decision` **Total Tasks**: 23 **Estimated Duration**: 3.5-4 hours **Created**: 2026-06-28

***

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

***

## Setup (3 tasks)

* [x] T001 \[S2009] Verify current direct container runtime behavior, queue dispatch switch, campaign executable payload storage, and web queue/campaign create paths before implementation (`apps/server/src/managers/containerRuntimeManager.ts`, `apps/server/src/managers/taskExecutionCoordinator.ts`, `apps/server/src/managers/planCampaignManager.ts`, `apps/web/src/components/orchestration/QueueWorkbench.tsx`)
* [x] T002 \[S2009] \[P] Add protocol acceptance coverage for container executable payloads, execution summaries, runtime metadata, cleanup posture, unavailable states, and blocked raw-field rejection (`packages/protocol/tests/orchestrationCommandCenter.test.ts`)
* [x] T003 \[S2009] \[P] Add server acceptance coverage for queue container dispatch success, missing runtime, missing image, timeout/failure, stale revision, duplicate-trigger prevention while in-flight, campaign dispatch integration, and WebSocket event privacy (`apps/server/tests/taskExecutionCoordinator.container.test.ts`, `apps/server/tests/orchestration.test.ts`, `apps/server/tests/containerRuntimeManager.test.ts`)

***

## Foundation (4 tasks)

* [x] T004 \[S2009] Extend task queue protocol with `container` executable payloads, `container_run` execution summaries, safe runtime/image/hero labels, cleanup posture, container run ids, and parser-level blocked raw-field rejection (`packages/protocol/src/taskQueue.ts`)
* [x] T005 \[S2009] Export or reuse command-center container runtime and cleanup parser helpers needed by task queue validation without broadening raw attachment fields (`packages/protocol/src/orchestrationCommandCenter.ts`)
* [x] T006 \[S2009] Add web API container executable builders and response validators with schema-validated input, explicit error mapping, and duplicate in-flight mutation keys (`apps/web/src/lib/orchestrationApi.ts`)
* [x] T007 \[S2009] Thread `ContainerRuntimeManager` into the task execution coordinator construction without changing direct terminal/container routes (`apps/server/src/server.ts`, `apps/server/src/managers/taskExecutionCoordinator.ts`)

***

## Server Implementation (5 tasks)

* [x] T008 \[S2009] Implement `dispatchContainer()` in the coordinator with stale revision checks, queued/executing/completed execution-run transitions, idempotency protection, timeout/failure/unavailable mapping, and compact container attachments (`apps/server/src/managers/taskExecutionCoordinator.ts`)
* [x] T009 \[S2009] Update queue dispatch routing so `executable.kind: "container"` dispatches through the coordinator and emits compact queue plus execution updates without raw Docker output (`apps/server/src/routes/orchestration.ts`)
* [x] T010 \[S2009] Extend campaign executable readiness and dispatch switching for container tasks while preserving dependency order, retry semantics, failed/unavailable buckets, and queue/execution links (`apps/server/src/managers/planCampaignManager.ts`)
* [x] T011 \[S2009] Harden container manager timeout, missing-image, and result-summary behavior needed by queue dispatch with retry/backoff-style recovery guidance and no raw probe output (`apps/server/src/managers/containerRuntimeManager.ts`)
* [x] T012 \[S2009] Update server tests for queue container dispatch, campaign container dispatch, unavailable runtime/image states, timeout/failure states, stale revisions, duplicate idempotency keys, and event privacy (`apps/server/tests/taskExecutionCoordinator.container.test.ts`, `apps/server/tests/orchestration.test.ts`, `apps/server/tests/containerRuntimeManager.test.ts`)

***

## Web Implementation (5 tasks)

* [x] T013 \[S2009] Add container family labels, `Dispatch container` and `Retry container` copy, runtime/cleanup/unavailable summaries, and redacted result labels (`apps/web/src/lib/commandCenterUi.ts`)
* [x] T014 \[S2009] Add a Container queue create mode with safe image/runtime controls, bounded product-facing labels, offline/error states, accessible names, and duplicate-trigger prevention while in-flight (`apps/web/src/components/orchestration/QueueWorkbench.tsx`)
* [x] T015 \[S2009] Add campaign task refinement controls for container executable payloads with product-facing copy only and diagnostics confined to tests or notes (`apps/web/src/components/orchestration/CampaignWorkbench.tsx`)
* [x] T016 \[S2009] Wire container queue creation, campaign refinement, refresh behavior, and mutation keys through the orchestration shell (`apps/web/src/components/orchestration/OrchestrationShell.tsx`)
* [x] T017 \[S2009] Update web tests for container API serialization, queue create controls, campaign refinement, unavailable copy, offline states, in-flight guards, safe metadata, and redaction (`apps/web/tests/orchestrationApi.test.ts`, `apps/web/tests/commandCenterUi.test.ts`, `apps/web/tests/QueueWorkbench.test.tsx`, `apps/web/tests/CampaignWorkbench.test.tsx`)

***

## Documentation And Browser Evidence (3 tasks)

* [x] T018 \[S2009] Add browser e2e proof for create -> dispatch -> observe container queue result or truthful unavailable state without raw Docker output, command body, broad path, token, provider payload, or webhook body leakage (`tests/e2e/orchestration-command-center.e2e.ts`)
* [x] T019 \[S2009] Document queue/campaign container dispatch, direct route distinction, compact result metadata, denied Docker operations, and privacy boundaries (`docs/api/README_api.md`, `docs/isolation-and-sandbox.md`, `docs/ARCHITECTURE.md`)
* [x] T020 \[S2009] Update package docs for server and web container dispatch behavior, unavailable states, UI labels, redaction, and no arbitrary Docker/remote/hosted claim (`apps/server/README_server.md`, `apps/web/README_web.md`)

***

## Verification (3 tasks)

* [x] T021 \[S2009] Run focused protocol, server, and web tests for the container dispatch slice (`npx vitest run packages/protocol/tests/orchestrationCommandCenter.test.ts apps/server/tests/taskExecutionCoordinator.container.test.ts apps/server/tests/orchestration.test.ts apps/server/tests/containerRuntimeManager.test.ts apps/web/tests/orchestrationApi.test.ts apps/web/tests/commandCenterUi.test.ts apps/web/tests/QueueWorkbench.test.tsx apps/web/tests/CampaignWorkbench.test.tsx`)
* [x] T022 \[S2009] Run focused browser evidence for the orchestration command center container flow (`npm run test:e2e -- --project=app-desktop tests/e2e/orchestration-command-center.e2e.ts`)
* [x] T023 \[S2009] Run workspace quality and whitespace gates (`npm --workspace packages/protocol run typecheck`; `npm --workspace apps/server run typecheck`; `npm --workspace apps/web run typecheck`; `npm run format:check`; `npm run lint`; `npm run typecheck --workspaces --if-present`; `npm test`; `git diff --check`)

***

## 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 `creview` in 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/phase20-session09-container-dispatch-decision/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.
