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

# Validation Report

**Session ID**: `phase19-session04-campaign-workbench` **Package**: cross-cutting (`apps/server`, `apps/web`) **Validated**: 2026-06-26 **Result**: PASS

## Validation Summary

| Check                     | Status | Notes                                                                                                            |
| ------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------- |
| Code Review               | PASS   | `code-review.md` exists, scope is all uncommitted changes, and `Result: RESOLVED`                                |
| Tasks Complete            | PASS   | 20/20 tasks complete                                                                                             |
| Files Exist               | PASS   | 20/20 spec deliverables exist and are non-empty                                                                  |
| ASCII Encoding            | PASS   | 27 changed files checked; all ASCII/LF                                                                           |
| Tests Passing             | PASS   | Focused tests 42/42 passed; full suite 2721/2722 passed with 1 skipped                                           |
| Database/Schema Alignment | N/A    | N/A - no DB-layer, migration, schema, SQL, or dependency changes                                                 |
| Quality Gates             | PASS   | Server/web typechecks, workspace typecheck, lint, format check, whitespace, focused tests, and full tests passed |
| Conventions               | PASS   | Spot-check matched npm workspace, protocol-first, local-first, compact-error, redaction, and UI conventions      |
| Security & GDPR           | PASS   | Security PASS; GDPR N/A because no personal-data handling was introduced                                         |
| Behavioral Quality        | PASS   | Top-risk source files spot-checked; no high-severity violations                                                  |
| UI Product Surface        | PASS   | Campaign and queue workbench surfaces and component tests show no debug/scaffolding diagnostics                  |

**Overall**: PASS

## Evidence Ledger

| Check              | Command or Inspection                                                                                                                                                                                                                                                         | Result                                                                                                                     | Evidence / Blocker                                                                                                                                                                                                                 |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Project state      | `if [ -d ".spec_system/scripts" ]; then bash .spec_system/scripts/analyze-project.sh --json; else bash /home/aiwithapex/.codex/plugins/cache/apex-spec-system/apex-spec/2.1.3-codex/skills/apex-spec/scripts/analyze-project.sh --json; fi`                                   | PASS                                                                                                                       | Current session is `phase19-session04-campaign-workbench`; monorepo is true; current session directory exists with `spec.md`, `tasks.md`, `implementation-notes.md`, and `code-review.md`.                                         |
| Code review        | \`rg -n '^\\*\Result\\\\*:                                                                                                                                                                                                                                                    | ^\\*\Scope\\\\*:' .spec\_system/specs/phase19-session04-campaign-workbench/code-review\.md\`                               | PASS                                                                                                                                                                                                                               |
| Task completion    | `rg -n '^- \\[[ x]\\] T[0-9]{3}' .spec_system/specs/phase19-session04-campaign-workbench/tasks.md`                                                                                                                                                                            | PASS                                                                                                                       | 20 task rows found and all are `[x]`.                                                                                                                                                                                              |
| Deliverables       | `for f in <spec deliverables>; do if [ -s "$f" ]; then printf 'PASS ...'; else printf 'FAIL ...'; fi; done`                                                                                                                                                                   | PASS                                                                                                                       | 20/20 spec deliverables exist and are non-empty.                                                                                                                                                                                   |
| ASCII/LF           | \`files=$( { git diff --name-only HEAD; git ls-files --others --exclude-standard; }                                                                                                                                                                                           | sort -u ); for f in $files; do file -b "$f"; LC\_ALL=C grep -n '\[^\[:print:]\[:space:]]' "$f"; grep -l $'\r' "$f"; done\` | PASS                                                                                                                                                                                                                               |
| Tests              | `npm test -- apps/server/tests/planCampaignManager.test.ts apps/server/tests/commandCenterRoutes.test.ts apps/web/tests/orchestrationApi.test.ts apps/web/tests/commandCenterUi.test.ts apps/web/tests/commandCenterStore.test.ts apps/web/tests/OrchestrationPanel.test.tsx` | PASS                                                                                                                       | 6 focused test files passed; 42/42 tests passed.                                                                                                                                                                                   |
| Tests              | `npm test`                                                                                                                                                                                                                                                                    | PASS                                                                                                                       | 222 test files passed, 1 skipped; 2721 tests passed, 1 skipped.                                                                                                                                                                    |
| Typecheck          | `npm --workspace apps/server run typecheck`                                                                                                                                                                                                                                   | PASS                                                                                                                       | Server `tsc --noEmit` exited 0.                                                                                                                                                                                                    |
| Typecheck          | `npm --workspace apps/web run typecheck`                                                                                                                                                                                                                                      | PASS                                                                                                                       | Web `tsc -b --noEmit` exited 0.                                                                                                                                                                                                    |
| Typecheck          | `npm run typecheck --workspaces --if-present`                                                                                                                                                                                                                                 | PASS                                                                                                                       | adapters, server, warroom, web, protocol, and public-website typechecks exited 0.                                                                                                                                                  |
| Lint               | `npm run lint`                                                                                                                                                                                                                                                                | PASS                                                                                                                       | Biome checked 668 files; no fixes applied.                                                                                                                                                                                         |
| Format             | `npm run format:check`                                                                                                                                                                                                                                                        | PASS                                                                                                                       | Biome checked 666 files; no fixes applied.                                                                                                                                                                                         |
| Whitespace         | `git diff --check`                                                                                                                                                                                                                                                            | PASS                                                                                                                       | Command exited 0 with no whitespace errors.                                                                                                                                                                                        |
| Database/schema    | \`git diff --name-only HEAD                                                                                                                                                                                                                                                   | rg -n '(migration                                                                                                          | schema                                                                                                                                                                                                                             |
| Dependencies       | \`git diff --name-only HEAD                                                                                                                                                                                                                                                   | rg -n '(^                                                                                                                  | /)package(-lock)?\\.json$                                                                                                                                                                                                          |
| Success criteria   | Inspection of `spec.md`, `tasks.md`, focused tests, and full quality commands                                                                                                                                                                                                 | PASS                                                                                                                       | Functional, testing, non-functional, and quality requirements are covered by completed tasks, implementation notes, tests, typechecks, lint, format, encoding, and security checks.                                                |
| Conventions        | Inspection of `.spec_system/CONVENTIONS.md`, `apps/README_apps.md`, `apps/server/README_server.md`, `apps/web/README_web.md`, `packages/protocol/README_protocol.md`, and touched code                                                                                        | PASS                                                                                                                       | Changes follow npm workspace commands, local-first server/web boundaries, protocol-owned DTO consumption, compact errors, redaction, and focused Vitest coverage.                                                                  |
| Security/GDPR      | `security-compliance.md`; `rg` security scans; static inspection of touched source                                                                                                                                                                                            | PASS                                                                                                                       | No security findings; GDPR N/A; no dependency, SQL, shell, unsafe DOM, debug UI, or hardcoded secret findings.                                                                                                                     |
| Behavioral quality | Inspection of `apps/server/src/managers/planCampaignManager.ts`, `apps/server/src/managers/taskQueue.ts`, `apps/server/src/routes/commandCenter.ts`, `apps/web/src/components/orchestration/OrchestrationShell.tsx`, and `apps/web/src/lib/orchestrationApi.ts`               | PASS                                                                                                                       | Trust boundaries, mutation safety, failure paths, resource cleanup, and contract alignment are covered by validation helpers, expected revisions, idempotency keys, in-flight locks, bounded error mapping, and `finally` cleanup. |
| UI product surface | \`rg -n "(Campaign workbench                                                                                                                                                                                                                                                  | Queue workbench                                                                                                            | Preview                                                                                                                                                                                                                            |

## 1. Code Review Gate

### Status: PASS

**Report**: `code-review.md` **Result**: RESOLVED **Issues**: None. The report lists 0 critical, 2 high, 3 medium, and 1 low review findings, all fixed with regression coverage.

## 2. Task Completion

### Status: PASS

**Tasks**: 20/20 complete **Incomplete tasks**: None

## 3. Deliverables Verification

### Status: PASS

| File                                                           | Found | Status |
| -------------------------------------------------------------- | ----- | ------ |
| `apps/server/src/managers/planCampaignManager.ts`              | Yes   | PASS   |
| `apps/server/tests/planCampaignManager.test.ts`                | Yes   | PASS   |
| `apps/web/src/components/orchestration/CampaignWorkbench.tsx`  | Yes   | PASS   |
| `apps/web/src/components/orchestration/QueueWorkbench.tsx`     | Yes   | PASS   |
| `apps/server/src/lib/commandCenterValidation.ts`               | Yes   | PASS   |
| `apps/server/src/managers/orchestrationCommandCenter.ts`       | Yes   | PASS   |
| `apps/server/src/managers/taskQueue.ts`                        | Yes   | PASS   |
| `apps/server/src/routes/commandCenter.ts`                      | Yes   | PASS   |
| `apps/server/src/server.ts`                                    | Yes   | PASS   |
| `apps/server/tests/commandCenterRoutes.test.ts`                | Yes   | PASS   |
| `apps/web/src/lib/orchestrationApi.ts`                         | Yes   | PASS   |
| `apps/web/src/lib/commandCenterUi.ts`                          | Yes   | PASS   |
| `apps/web/src/store/useGameStore.ts`                           | Yes   | PASS   |
| `apps/web/src/components/orchestration/CommandCenterPanes.tsx` | Yes   | PASS   |
| `apps/web/src/components/orchestration/OrchestrationShell.tsx` | Yes   | PASS   |
| `apps/web/src/components/orchestration/index.ts`               | Yes   | PASS   |
| `apps/web/tests/orchestrationApi.test.ts`                      | Yes   | PASS   |
| `apps/web/tests/commandCenterStore.test.ts`                    | Yes   | PASS   |
| `apps/web/tests/commandCenterUi.test.ts`                       | Yes   | PASS   |
| `apps/web/tests/OrchestrationPanel.test.tsx`                   | Yes   | PASS   |

**Missing deliverables**: None

## 4. ASCII Encoding Check

### Status: PASS

| File                                                                              | Encoding                      | Line Endings | Status |
| --------------------------------------------------------------------------------- | ----------------------------- | ------------ | ------ |
| `.spec_system/specs/phase19-session04-campaign-workbench/code-review.md`          | ASCII text                    | LF           | PASS   |
| `.spec_system/specs/phase19-session04-campaign-workbench/implementation-notes.md` | ASCII text                    | LF           | PASS   |
| `.spec_system/specs/phase19-session04-campaign-workbench/spec.md`                 | ASCII text                    | LF           | PASS   |
| `.spec_system/specs/phase19-session04-campaign-workbench/tasks.md`                | ASCII text                    | LF           | PASS   |
| `.spec_system/state.json`                                                         | JSON text data                | LF           | PASS   |
| `apps/server/src/lib/commandCenterValidation.ts`                                  | JavaScript source, ASCII text | LF           | PASS   |
| `apps/server/src/managers/orchestrationCommandCenter.ts`                          | JavaScript source, ASCII text | LF           | PASS   |
| `apps/server/src/managers/planCampaignManager.ts`                                 | JavaScript source, ASCII text | LF           | PASS   |
| `apps/server/src/managers/taskQueue.ts`                                           | JavaScript source, ASCII text | LF           | PASS   |
| `apps/server/src/routes/commandCenter.ts`                                         | JavaScript source, ASCII text | LF           | PASS   |
| `apps/server/src/routes/orchestration.ts`                                         | JavaScript source, ASCII text | LF           | PASS   |
| `apps/server/src/server.ts`                                                       | JavaScript source, ASCII text | LF           | PASS   |
| `apps/server/tests/commandCenterRoutes.test.ts`                                   | JavaScript source, ASCII text | LF           | PASS   |
| `apps/server/tests/planCampaignManager.test.ts`                                   | JavaScript source, ASCII text | LF           | PASS   |
| `apps/web/src/components/orchestration/CampaignWorkbench.tsx`                     | JavaScript source, ASCII text | LF           | PASS   |
| `apps/web/src/components/orchestration/CommandCenterPanes.tsx`                    | JavaScript source, ASCII text | LF           | PASS   |
| `apps/web/src/components/orchestration/OrchestrationShell.tsx`                    | JavaScript source, ASCII text | LF           | PASS   |
| `apps/web/src/components/orchestration/OrchestrationTabs.tsx`                     | JavaScript source, ASCII text | LF           | PASS   |
| `apps/web/src/components/orchestration/QueueWorkbench.tsx`                        | JavaScript source, ASCII text | LF           | PASS   |
| `apps/web/src/components/orchestration/index.ts`                                  | JavaScript source, ASCII text | LF           | PASS   |
| `apps/web/src/lib/commandCenterUi.ts`                                             | JavaScript source, ASCII text | LF           | PASS   |
| `apps/web/src/lib/orchestrationApi.ts`                                            | JavaScript source, ASCII text | LF           | PASS   |
| `apps/web/src/store/useGameStore.ts`                                              | JavaScript source, ASCII text | LF           | PASS   |
| `apps/web/tests/OrchestrationPanel.test.tsx`                                      | JavaScript source, ASCII text | LF           | PASS   |
| `apps/web/tests/commandCenterStore.test.ts`                                       | JavaScript source, ASCII text | LF           | PASS   |
| `apps/web/tests/commandCenterUi.test.ts`                                          | JavaScript source, ASCII text | LF           | PASS   |
| `apps/web/tests/orchestrationApi.test.ts`                                         | JavaScript source, ASCII text | LF           | PASS   |

**Encoding issues**: None

## 5. Test Results

### Status: PASS

| Metric             | Value                                            |
| ------------------ | ------------------------------------------------ |
| Focused Test Files | 6 passed                                         |
| Focused Tests      | 42 passed                                        |
| Full Test Files    | 222 passed, 1 skipped                            |
| Full Tests         | 2721 passed, 1 skipped                           |
| Failed             | 0                                                |
| Coverage           | Not emitted by the configured `npm test` command |

**Failed tests**: None

Additional passing quality gates:

* `npm --workspace apps/server run typecheck`
* `npm --workspace apps/web run typecheck`
* `npm run typecheck --workspaces --if-present`
* `npm run lint`
* `npm run format:check`
* `git diff --check`

## 6. Database/Schema Alignment

### Status: N/A

**Evidence**: `git diff --name-only HEAD | rg -n '(migration|schema|prisma|sql|db|database)'` returned no matching changed files. The session changed in-memory server managers, REST routes, web UI, API helpers, store state, and tests only.

**Issues found**: None

## 7. Success Criteria

From spec.md:

**Functional requirements**:

* PASS - Campaign preview and creation use bounded manual inputs without raw prompt, command, path, or artifact fields, verified by `planCampaignManager.test.ts`, `commandCenterRoutes.test.ts`, and static inspection.
* PASS - Create, approve, pause, resume, cancel, refine, retry failed, and dispatch transitions enforce idempotency and expected revision checks, verified by manager, route, API, and UI tests.
* PASS - Dispatch creates queue entries with `source: "plan"` and plan references while emitting queue and command-center updates, verified by `planCampaignManager.test.ts` and `commandCenterRoutes.test.ts`.
* PASS - Queue controls support create, update, reject, restore, mark unavailable, and dispatch without duplicate triggers, verified by route/API/store/component tests and static inspection.
* PASS - Web workbench renders graph rows, bounded summaries, expected results, verification state, revisions, transition controls, and scoped detail entry points, verified by `OrchestrationPanel.test.tsx` and `commandCenterUi.test.ts`.
* PASS - Broad rows remain summary-only and product-facing, verified by redaction tests, UI helper tests, and UI product-surface inspection.

**Testing requirements**:

* PASS - Server manager tests cover preview/create idempotency, stale revisions, state transitions, dispatch queue bridging, and repeated dispatch.
* PASS - Server route tests cover compact validation errors, WebSocket emissions, route aliases, stale revision, and queue bridge snapshots.
* PASS - Web API tests cover timeouts, offline failures, stale revision mapping, duplicate trigger prevention, redaction, preview, dispatch, and queue mutations.
* PASS - Store and component tests cover mutation cleanup, graph rows, visible controls, accessibility roles, and product-facing copy.

**Quality gates**:

* PASS - All changed files are ASCII/LF clean.
* PASS - Code follows project conventions by spot-check.
* PASS - Primary user-facing surfaces contain product-facing copy only.
* PASS - `npm --workspace apps/server run typecheck` passed.
* PASS - `npm --workspace apps/web run typecheck` passed.
* PASS - Focused server and web tests passed.

## 8. Conventions Compliance

### Status: PASS

**Categories spot-checked**: naming, file structure, error handling, comments, testing, and database conventions when relevant.

**Convention violations**: None. Evidence:

* `.spec_system/CONVENTIONS.md` identifies npm workspaces, Biome, TypeScript package typechecks, Vitest, and no configured database; validation used those commands.
* `apps/README_apps.md` and `packages/protocol/README_protocol.md` require protocol-first shared contracts; touched code imports command-center and queue DTOs from `@factionos/protocol`.
* `apps/server/README_server.md` emphasizes compact errors, local auth/rate-limit inheritance, and local-first redaction; new routes use validation helpers, compact conflict/error responses, and existing server route wiring.
* `apps/web/README_web.md` requires local-only cockpit states, bounded feedback, duplicate-action guards, and no raw paths/prompts in broad UI; workbench components and helper tests follow that boundary.

## 9. Security & GDPR Compliance

### Status: PASS

**Full report**: See `security-compliance.md` in this session directory.

#### Summary

| Area     | Status | Findings |
| -------- | ------ | -------- |
| Security | PASS   | 0 issues |
| GDPR     | N/A    | 0 issues |

**Critical violations**: None

## 10. Behavioral Quality Spot-Check

### Status: PASS

**Checklist applied**: Yes **Files spot-checked**:

* `apps/server/src/managers/planCampaignManager.ts`
* `apps/server/src/managers/taskQueue.ts`
* `apps/server/src/routes/commandCenter.ts`
* `apps/web/src/components/orchestration/OrchestrationShell.tsx`
* `apps/web/src/lib/orchestrationApi.ts`

**Categories spot-checked**: trust boundaries, resource cleanup, mutation safety, failure paths, and contract alignment.

**Violations found**: None

**Fixes applied during validation**: None

## 11. UI Product-Surface Spot-Check

### Status: PASS

**Surfaces inspected**: Code inspection of `CampaignWorkbench`, `QueueWorkbench`, `CommandCenterPanes`, and `OrchestrationShell`; component coverage in `apps/web/tests/OrchestrationPanel.test.tsx`.

**Diagnostics found in primary UI**: None. `OrchestrationPanel.test.tsx` asserts the rendered workbench does not contain `debug`, `shell ready`, or `data-source`.

**Allowed debug/admin surfaces**: None

**Fixes applied during validation**: None

## Validation Result

### PASS

All required validation gates passed. The active session has resolved code review, complete tasks, present deliverables, clean ASCII/LF encoding, passing focused and full tests, no DB/schema drift, passing workspace quality gates, security PASS, GDPR N/A, behavioral quality PASS, and UI product-surface PASS.

### Unresolved Failures And Blockers

None

## Next Steps

Next command: `updateprd`


---

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