> For the complete documentation index, see [llms.txt](https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/.spec_system/archive/sessions/phase25-session03-safe-planning-prompt-authorized-write/tasks.md).

# Task Checklist

**Session ID**: `phase25-session03-safe-planning-prompt-authorized-write` **Total Tasks**: 20 **Estimated Duration**: 3-4 hours **Created**: 2026-06-08

***

## Legend

* `[x]` = Completed
* `[ ]` = Pending
* `[P]` = Parallelizable (can run with other \[P] tasks)
* `[SNNMM]` = Session reference (NN=phase number, MM=session number)
* `TNNN` = Task ID

***

## Progress Summary

| Category       | Total  | Done   | Remaining |
| -------------- | ------ | ------ | --------- |
| Setup          | 3      | 3      | 0         |
| Foundation     | 5      | 5      | 0         |
| Implementation | 8      | 8      | 0         |
| Testing        | 4      | 4      | 0         |
| **Total**      | **20** | **20** | **0**     |

***

## Setup (3 tasks)

Initial configuration and environment preparation.

* [x] T001 \[S2503] Verify Session 01 and Session 02 prerequisite artifacts and PASS validation (`.spec_system/specs/phase25-session02-mission-schema-version-legacy-compatibility/validation.md`)
* [x] T002 \[S2503] \[P] Re-confirm Appendix A planning-prompt anchors and old Step 4 safety replacement before editing (`.spec_system/PRD/phase_25/PRD_phase_25.md`)
* [x] T003 \[S2503] \[P] Create implementation notes and session security review placeholders (`.spec_system/specs/phase25-session03-safe-planning-prompt-authorized-write/implementation-notes.md`)

***

## Foundation (5 tasks)

Core structures and base implementations.

* [x] T004 \[S2503] Create versioned Hermes and Claude Code planning prompt builders with Appendix A discovery, actor, mini-goal, `full_prompt`, `/goal` , and human briefing rules (`src/lib/hermes-mission-planning.ts`)
* [x] T005 \[S2503] Add AI OS-safe Step 4 copy that returns mission JSON for UI import and never instructs tokenless writes (`src/lib/hermes-mission-planning.ts`)
* [x] T006 \[S2503] Define the agent-authored mission import parser with bounded JSON extraction, mission field validation, and explicit error mapping (`src/lib/hermes-mission-planning.ts`)
* [x] T007 \[S2503] \[P] Add prompt utility tests for required sections, agent-specific copy, and absence of tokenless curl/token-shaped instructions (`src/lib/__tests__/hermes-mission-planning.test.ts`)
* [x] T008 \[S2503] \[P] Add mission import parser tests for valid candidates, malformed JSON, unsupported actors/statuses, missing fields, goal limits, and fenced JSON (`src/lib/__tests__/hermes-mission-planning.test.ts`)

***

## Implementation (8 tasks)

Main feature implementation.

* [x] T009 \[S2503] Replace Mission Control starter prompt copy with the long-form prompt builder while preserving clipboard fallback and redacted feedback (`src/components/hermes/hermes-mission-control.tsx`)
* [x] T010 \[S2503] Add an agent mission import dialog or bounded textarea with explicit empty, invalid, disabled, pending, success, and reset-on-close states (`src/components/hermes/hermes-mission-control.tsx`)
* [x] T011 \[S2503] Wire import submit to `admin.missions.commitMission` with authorization enforced through existing `canEdit`, duplicate-trigger prevention while in-flight, and query invalidation on success (`src/components/hermes/hermes-mission-control.tsx`)
* [x] T012 \[S2503] Preserve Hermes and Claude Code presentation parity so the shared prompt/import contract only changes self-address and presentation labels (`src/components/hermes/hermes-mission-control.tsx`)
* [x] T013 \[S2503] Harden import and commit error display for token headers, token-shaped values, local paths, malformed payloads, and bridge details (`src/components/hermes/hermes-mission-control.tsx`)
* [x] T014 \[S2503] Add component coverage for long prompt copy, unsafe-string absence, clipboard fallback, and Hermes/Claude Code presentation parity (`src/components/hermes/__tests__/hermes-mission-control.test.tsx`)
* [x] T015 \[S2503] Add component coverage for import happy path, `commitMission` payload shape, duplicate-submit prevention, success reset, and mission query invalidation (`src/components/hermes/__tests__/hermes-mission-control.test.tsx`)
* [x] T016 \[S2503] Add component coverage for malformed JSON, demo/admin-disabled/token-failure gates, dialog re-entry reset, and redacted error strings (`src/components/hermes/__tests__/hermes-mission-control.test.tsx`)

***

## Testing (4 tasks)

Verification and quality assurance.

* [x] T017 \[S2503] Add or confirm admin bridge regression coverage for unauthorized agent-authored commit rejection and redacted failure output (`scripts/lib/__tests__/hermes-admin-bridge.test.ts`)
* [x] T018 \[S2503] Run focused prompt, Mission Control component, hook, and admin bridge tests and record results (`.spec_system/specs/phase25-session03-safe-planning-prompt-authorized-write/implementation-notes.md`)
* [x] T019 \[S2503] Run `bun run typecheck`, `bun run typecheck:scripts` if bridge code changes, and `bun run lint`, then record results (`.spec_system/specs/phase25-session03-safe-planning-prompt-authorized-write/implementation-notes.md`)
* [x] T020 \[S2503] Validate ASCII/LF output and complete the session security review for copied prompts, import parsing, admin gate preservation, and token redaction (`.spec_system/specs/phase25-session03-safe-planning-prompt-authorized-write/security-compliance.md`)

***

## Completion Checklist

Before marking session complete:

* [x] All tasks marked `[x]`
* [x] All tests passing
* [x] All files ASCII-encoded
* [x] implementation-notes.md updated
* [x] security-compliance.md updated
* [x] Ready for the validate workflow step

***

## Next Steps

Run the validate workflow step to verify session completeness.


---

# 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://ai-os-and-trend-finder.gitbook.io/ai-os-and-trend-finder-docs/.spec_system/archive/sessions/phase25-session03-safe-planning-prompt-authorized-write/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.
