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

# Session 09: Heroes And Lineage

**Session ID**: `phase19-session09-heroes-and-lineage` **Packages**: apps/server, apps/web, apps/hooks **Status**: Not Started **Estimated Tasks**: \~12-25 **Estimated Duration**: 2-4 hours

***

## Objective

Add internal hero lifecycle controls and deepen lineage into an operator roster.

***

## Scope

### In Scope (MVP)

* Spawn, fork, handoff, resume, message, stop, dismiss, model change, permission mode change, and isolation mode lifecycle intents
* Provider, model, permission mode, worktree, process ID, terminal/listener association, lifecycle state, unavailable reason, and event tracking
* Active and completed subagent rows with parent hero, child mission, type, description, state, timing, and degraded reason
* Filters by parent hero, state, and subagent type
* Tests for command validation, state transitions, malformed lineage events, duplicate events, and graph degradation explanations

### Out of Scope

* Raw transcript or prompt rendering
* Container isolated spawn until runtime capability exists

***

## Prerequisites

* [ ] Sessions 01 through 07 complete
* [ ] Current hook/listener and mission lineage implementation inspected

***

## Deliverables

1. Hero lifecycle manager and routes
2. Hero lifecycle panel and lineage operator roster
3. Lifecycle and lineage WebSocket handling
4. Tests for lifecycle, unsupported commands, and lineage degradation

***

## Source Coverage And Evidence

Source coverage:

* Session Split Plan Session 09: Heroes And Lineage
* Implementation Targets 2 and 6 for internal hero lifecycle controls and subagent lineage operator view
* Balls-To-The-Wall Track B `heroLifecycleManager` routes
* Balls-To-The-Wall Track D SessionStart, UserPromptSubmit, Stop, Task/Agent, and SubagentStop hook mappings

Key EXAMPLES links:

* [Hero coordination guide](https://github.com/AI-with-Apex-VIP/factionos/tree/main/.spec_system/EXAMPLES/1st-pass-artifacts/skills/factionos-guide/SKILL.md#L38-L60)
* [Internal hero routes](https://github.com/AI-with-Apex-VIP/factionos/tree/main/.spec_system/EXAMPLES/findings/api-routes.txt#L84-L107)
* [Subagent units guide](https://github.com/AI-with-Apex-VIP/factionos/tree/main/.spec_system/EXAMPLES/1st-pass-artifacts/skills/factionos-guide/SKILL.md#L61-L68)
* [Hook map](https://github.com/AI-with-Apex-VIP/factionos/tree/main/.spec_system/EXAMPLES/1st-pass-artifacts/hooks-config.json#L33-L49)
* [Subagent hook](https://github.com/AI-with-Apex-VIP/factionos/tree/main/.spec_system/EXAMPLES/1st-pass-artifacts/hooks-bundle/factionos-subagent-spawn.sh#L15-L30)
* [Subagent and agent events](https://github.com/AI-with-Apex-VIP/factionos/tree/main/.spec_system/EXAMPLES/findings/websocket-events.txt#L8-L138)

***

## Success Criteria

* [ ] Orchestration can launch or control supported heroes and explain unavailable commands
* [ ] Subagent rows show type, description, parent, state, duration, and result
* [ ] Lineage degradation is visible and test-covered
* [ ] Raw prompts and transcripts stay in dedicated detail surfaces


---

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