> 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-session05-campaign-dag-recovery/tasks.md).

# Task Checklist

**Session ID**: `phase20-session05-campaign-dag-recovery` **Total Tasks**: 24 **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 \[S2005] Verify Session 04 validation evidence plus current flat campaign dispatch, retry, route, and graph behavior (`.spec_system/specs/phase20-session04-campaign-executable-dispatch/validation.md`)
* [x] T002 \[S2005] Create dependency-order, blocked-dependent, retry-filtering, and run-history acceptance coverage before implementation (`apps/server/tests/planCampaignDagRecovery.test.ts`)
* [x] T003 \[S2005] Confirm focused Vitest and Playwright command-center targets include the DAG recovery coverage (`playwright.config.ts`)

***

## Foundation (5 tasks)

* [x] T004 \[S2005] Align campaign task and compact event parsing for unavailable readiness and dependency DAG semantics with blocked raw-field rejection (`packages/protocol/src/orchestrationCommandCenter.ts`)
* [x] T005 \[S2005] \[P] Add protocol tests for dependency fields, unavailable readiness, compact campaign task events, and raw execution field rejection (`packages/protocol/tests/orchestrationCommandCenter.test.ts`)
* [x] T006 \[S2005] Add server DAG planning helpers for stable task lookup, topological ready order, unknown dependency detection, and cycle detection (`apps/server/src/managers/planCampaignManager.ts`)
* [x] T007 \[S2005] Add server state derivation helpers for completed, blocked, failed, unavailable-readiness, planning-only, and in-progress campaign outcomes (`apps/server/src/managers/planCampaignManager.ts`)
* [x] T008 \[S2005] Extend web API response guards for DAG recovery task buckets and execution link preservation with schema-validated input and explicit error mapping (`apps/web/src/lib/orchestrationApi.ts`)

***

## Implementation (7 tasks)

* [x] T009 \[S2005] Replace flat campaign task iteration with serial dependency-order dispatch that only runs ready executable tasks after prerequisites complete (`apps/server/src/managers/planCampaignManager.ts`)
* [x] T010 \[S2005] Block or hold dependent tasks when prerequisites fail, are unavailable, are cancelled, are unknown, or remain planning-only where execution is required (`apps/server/src/managers/planCampaignManager.ts`)
* [x] T011 \[S2005] Preserve prior queue and execution-run history while creating new retry execution evidence for failed or unavailable executable tasks (`apps/server/src/managers/planCampaignManager.ts`)
* [x] T012 \[S2005] Update `retryFailed` to reset only failed or unavailable executable tasks with duplicate-trigger prevention while in flight (`apps/server/src/managers/planCampaignManager.ts`)
* [x] T013 \[S2005] Derive campaign state from the full DAG after dispatch or retry so partial failure cannot falsely complete the campaign (`apps/server/src/managers/planCampaignManager.ts`)
* [x] T014 \[S2005] Emit route response changes for campaign, task, queue, and execution updates produced by DAG dispatch and retry (`apps/server/src/routes/commandCenter.ts`)
* [x] T015 \[S2005] Update server route and manager tests for success, dependency order, failed prerequisite, unavailable prerequisite, cycle, unknown dependency, retry filtering, idempotency, and safe events (`apps/server/tests/planCampaignManager.test.ts`, `apps/server/tests/commandCenterRoutes.test.ts`)

***

## Product Surface (4 tasks)

* [x] T016 \[S2005] Sort campaign graph rows by dependency order and label waiting, blocked, retryable, failed, unavailable, and completed tasks (`apps/web/src/lib/commandCenterUi.ts`)
* [x] T017 \[S2005] Render dependency block context, retry controls, queue links, and execution links with product-facing copy only and accessible controls (`apps/web/src/components/orchestration/CampaignWorkbench.tsx`)
* [x] T018 \[S2005] Update campaign dispatch and retry toasts for completed DAGs, blocked dependents, unavailable executors, and retry outcomes (`apps/web/src/components/orchestration/OrchestrationShell.tsx`)
* [x] T019 \[S2005] Add web helper, component, API, and shell tests for DAG graph ordering, retry actions, duplicate prevention, links, and privacy-safe rendering (`apps/web/tests/commandCenterUi.test.ts`, `apps/web/tests/CommandCenterPanes.test.tsx`, `apps/web/tests/orchestrationApi.test.ts`, `apps/web/tests/OrchestrationPanel.test.tsx`)

***

## Testing And Documentation (3 tasks)

* [x] T020 \[S2005] Add browser e2e proof that an operator inspects a blocked dependent task and retries a failed campaign task without raw terminal or Git leakage (`tests/e2e/orchestration-command-center.e2e.ts`)
* [x] T021 \[S2005] Update server, web, and API docs for serial campaign DAG dispatch, retry behavior, unavailable-readiness mapping, and scoped detail boundaries (`apps/server/README_server.md`, `apps/web/README_web.md`, `docs/api/README_api.md`)
* [x] T022 \[S2005] Run focused protocol, server, web, and Playwright command-center checks (`npx vitest run packages/protocol/tests/orchestrationCommandCenter.test.ts apps/server/tests/planCampaignDagRecovery.test.ts apps/server/tests/planCampaignManager.test.ts apps/server/tests/commandCenterRoutes.test.ts apps/web/tests/commandCenterUi.test.ts apps/web/tests/CommandCenterPanes.test.tsx apps/web/tests/orchestrationApi.test.ts apps/web/tests/OrchestrationPanel.test.tsx`; `npx playwright test tests/e2e/orchestration-command-center.e2e.ts --project=app-desktop --project=app-mobile`)

***

## Verification (2 tasks)

* [x] T023 \[S2005] Run workspace quality gates (`npm run format:check`, `npm run lint`, `npm run typecheck --workspaces --if-present`, `npm test`)
* [x] T024 \[S2005] Validate ASCII, LF, and whitespace requirements (`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-session05-campaign-dag-recovery/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.
