> 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_02_server_backbone.md).

# Session 02: Server Backbone

**Session ID**: `phase19-session02-server-backbone` **Package**: apps/server **Status**: Complete **Completed**: 2026-06-26 **Estimated Tasks**: \~12-25 **Estimated Duration**: 2-4 hours

***

## Objective

Add the server orchestration backbone without implementing every executor family in this session.

***

## Scope

### In Scope (MVP)

* Manager shells and REST route bindings for plan campaigns, attention, executor capabilities, hero lifecycle, permissions, file intents, workpad/evidence, git, terminal, containers, handoffs, diagnostics, channels, and usage metrics
* Shared idempotency, expected revision, timeout, audit, event emission, and bounded payload helpers
* Structured capability errors and repair guidance for unavailable families
* Route tests for validation, stale revisions, duplicate mutation, event emission, and capability-error responses

### Out of Scope

* Full execution behavior for file, git, terminal, containers, remote access, or channels
* Web component restructuring

***

## Prerequisites

* [x] Session 01 protocol contracts merged
* [x] Existing server manager, route, rate-limit, and WebSocket patterns inspected

***

## Deliverables

1. Server manager scaffolds following current server conventions
2. Route bindings for snapshots and placeholder or ready mutations
3. Shared orchestration mutation and broadcast utilities
4. Server route tests for accepted and rejected inputs

***

## Source Coverage And Evidence

Source coverage:

* Session Split Plan Session 02: Server Backbone
* Balls-To-The-Wall Track B: Server Managers And Routes
* Implementation targets covering campaigns, attention, executors, heroes, permissions, file intents, workpad/evidence, Git, terminal, containers, handoff, diagnostics, channels, and usage routes

Key EXAMPLES links:

* [Historical REST inventory](https://github.com/AI-with-Apex-VIP/factionos/tree/main/.spec_system/EXAMPLES/findings/api-routes.txt#L1-L210)
* [Plan campaign routes and decomposer](https://github.com/AI-with-Apex-VIP/factionos/tree/main/.spec_system/EXAMPLES/findings/api-routes.txt#L159-L189)
* [Permission routes](https://github.com/AI-with-Apex-VIP/factionos/tree/main/.spec_system/EXAMPLES/findings/api-routes.txt#L118-L122)
* [Guarded route inventory](https://github.com/AI-with-Apex-VIP/factionos/tree/main/.spec_system/EXAMPLES/findings/api-routes.txt#L42-L115)
* [Architecture manager/executor notes](https://github.com/AI-with-Apex-VIP/factionos/tree/main/.spec_system/EXAMPLES/findings/architecture.md#L90-L203)

***

## Success Criteria

* [x] Every scaffolded route validates input and emits expected events when accepted
* [x] Current Orchestration panel snapshot APIs continue to work
* [x] Non-ready capabilities return structured errors with repair guidance
* [x] Server docs distinguish scaffolded capability from implemented execution


---

# 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_02_server_backbone.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.
