> 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/phases/phase_19/session_01_mission_control_write.md).

# Session 01: Mission Control (Write: Create/Optimize/Tick/Clear)

**Session ID**: `phase19-session01-mission-control-write` **Status**: Not Started **Estimated Tasks**: \~18-24 **Estimated Duration**: 3-4 hours

***

## Objective

Add the Mission Control tab as a full write/orchestration feature: mission view (read) plus create/optimize/tick/clear writes, with the command-exec optimize write getting the strictest spawn treatment. Source-code anchors are `V23/src/components/hermes-mission-control.tsx` and the V23 mission handlers listed below. Per operator direction, Mission Control is full write/orchestration, not read-only telemetry.

***

## Scope

### In Scope (MVP)

* Source: `V23/src/components/hermes-mission-control.tsx` (2,365 lines; writes tick `:611`, clear `:634`). Mission surface, Athena video loop, confetti.
* Target: new `AIOS/src/components/hermes/hermes-mission-control.tsx`, added as a `Mission` tab via `hermes-read-only-page.tsx` (TabsList `:150`, TabsContent `:177-189`).
* **Read:** missions GET (`/__hermes_missions`, V23 `vite.config.ts:780`).
* **Writes (admin-gated, landed in Phase 16 Session 02), Write Inventory #2-5:**
  * \#2 Mission optimize -- V23 `:804` -- **command-exec**: args-array spawn (clone `hermes-admin-bridge.ts:696`), binPath verify, timeout, output cap, redaction `:27`.
  * \#3 Mission create -- V23 `:952` -- FS write, `confinePath` to missions file.
  * \#4 Mission tick -- V23 `:1054` (client `:611`) -- FS write, confined, validate goal id.
  * \#5 Mission clear -- V23 `:1103` (client `:634`) -- FS delete, confirm, confined.
* All mutations through `useHermesAdmin`. Athena video (`claude-art/mission-claude.mp4`, already copied) and confetti (`canvas-confetti` ^1.9.4) are presentational.
* Write affordances disabled with an "admin mode required" hint without the token.

### Out of Scope

* Documents Gallery (Session 02).
* Server endpoint implementation (landed Phase 16 Session 02).

***

## Prerequisites

* [ ] Phase 16 complete: missions GET + create/optimize/tick/clear registered with security tests (including spawn-safety for optimize); hook query/mutations present.
* [ ] Phases 17-18 shell and prior surfaces in place.

***

## Deliverables

1. A modular Mission Control tab rendering the mission view and orchestration controls.
2. Create/optimize/tick/clear wired through `useHermesAdmin`, with confirm on clear and the args-array spawn path for optimize.
3. Mode-matrix coverage and a `hermes-sections.test.tsx` extension.

***

## Success Criteria

* [ ] Mission Control renders the mission view and performs create/optimize/tick/ clear, all admin-gated.
* [ ] Optimize runs via args-array spawn (no shell interpolation), enforces timeout + output cap, and passes spawn security tests.
* [ ] Clear requires confirmation; create/tick are path-confined and validate ids.
* [ ] Mode matrix renders; typecheck, lint, and tests pass.


---

# 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/phases/phase_19/session_01_mission_control_write.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.
