> 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-session05-attention-and-permissions/tasks.md).

# Task Checklist

**Session ID**: `phase19-session05-attention-and-permissions` **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 \[S1905] Verify Session 05 prerequisites, current command-center behavior, permission hook inputs, and package scripts (`.spec_system/PRD/phase_19/session_05_attention_and_permissions.md`)
* [x] T002 \[S1905] Create the attention workbench component shell and export path with loading, empty, error, and offline states (`apps/web/src/components/orchestration/AttentionWorkbench.tsx`)

***

## Foundation (5 tasks)

* [x] T003 \[S1905] \[P] Extend command-center attention and permission contracts with decision audit/result fields and parser coverage for stale and duplicate metadata with types matching declared contract and exhaustive enum handling (`packages/protocol/src/orchestrationCommandCenter.ts`)
* [x] T004 \[S1905] \[P] Add protocol tests for attention and permission decision audit fields, blocked payload rejection, and malformed state handling (`packages/protocol/tests/orchestrationCommandCenter.test.ts`)
* [x] T005 \[S1905] Implement command-center validation for attention and permission decision request bodies with schema-validated input and explicit error mapping (`apps/server/src/lib/commandCenterValidation.ts`)
* [x] T006 \[S1905] Implement manager-owned attention synthesis and permission/plan approval creation with bounded fields, timeout expiration, redaction, idempotency protection, and transaction-style paired attention/permission changes (`apps/server/src/managers/orchestrationCommandCenter.ts`)
* [x] T007 \[S1905] Add focused manager tests for synthesis, stale decisions, duplicate idempotency, timeout expiration, unsupported provider states, and paired change emission (`apps/server/tests/commandCenterManager.test.ts`)

***

## Implementation (8 tasks)

* [x] T008 \[S1905] Wire command-center attention decision and permission decision routes with authorization inherited from local server middleware, compact conflicts, paired WebSocket emissions, and duplicate-trigger prevention while in-flight (`apps/server/src/routes/commandCenter.ts`)
* [x] T009 \[S1905] Promote hook `permission_request` ingest into command-center permission and attention records with schema-validated input and explicit error mapping (`apps/server/src/routes/event.ts`)
* [x] T010 \[S1905] Route legacy `/permission-response`, `/plan/approve`, and WebSocket approval messages through command-center decision state with duplicate-trigger prevention while in-flight (`apps/server/src/routes/permission.ts`)
* [x] T011 \[S1905] Inject command-center dependencies into server route and WebSocket handler wiring without changing local bind, auth, rate-limit, or no-hosted defaults (`apps/server/src/server.ts`)
* [x] T012 \[S1905] Add web API helpers for attention approve/reject decisions with timeout, stale revision, duplicate, invalid id, refresh, and failure-path handling (`apps/web/src/lib/orchestrationApi.ts`)
* [x] T013 \[S1905] Add attention status, risk, filter, count, reason, and action-availability helpers with blocked payload filtering and product-facing copy only (`apps/web/src/lib/commandCenterUi.ts`)
* [x] T014 \[S1905] Wire AttentionWorkbench into the command-center panes and shell handlers with reason capture, duplicate-trigger prevention while in-flight, refresh on success, cleanup on failure, and platform-appropriate accessibility labels, focus management, and input support (`apps/web/src/components/orchestration/CommandCenterPanes.tsx`)
* [x] T015 \[S1905] Update the game store reducers to normalize attention and permission decision events, clear in-flight mutation keys, and reset stale selection state on re-entry (`apps/web/src/store/useGameStore.ts`)

***

## Testing (4 tasks)

* [x] T016 \[S1905] \[P] Extend server route and legacy permission tests for command-center attention decisions, permission decisions, hook ingest, `/api` aliases, compact errors, event emission, and blocking response round trips (`apps/server/tests/commandCenterRoutes.test.ts`)
* [x] T017 \[S1905] \[P] Extend web API, store, UI helper, and OrchestrationPanel tests for reason capture, filters, approve/reject controls, duplicate guards, stale/offline/timeout states, and product-facing copy (`apps/web/tests/OrchestrationPanel.test.tsx`)
* [x] T018 \[S1905] \[P] Extend hook payload tests to verify permission hook metadata remains bounded and continues to avoid enforcement claims (`apps/hooks/tests/hookPayloads.test.js`)
* [x] T019 \[S1905] Run focused protocol, server, web, and hooks tests plus package typechecks for touched workspaces (`package.json`)

***

## Documentation And Completion (1 task)

* [x] T020 \[S1905] Update API/server/web documentation and run lint, format check, whitespace, ASCII, and LF validation across touched files (`docs/api/README_api.md`)

***

## 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` to continue 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-session05-attention-and-permissions/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.
