> 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_20/session_09_container_dispatch_decision.md).

# Session 09: Container Dispatch Decision

**Session ID**: `phase20-session09-container-dispatch-decision` **Packages**: `packages/protocol`, `apps/server`, `apps/web` **Status**: Not Started **Estimated Tasks**: \~12-25 **Estimated Duration**: 2-4 hours

***

## Objective

Either prove container dispatch as an executable queue/campaign path or make it explicitly unsupported outside direct runtime controls.

***

## Scope

### In Scope (MVP)

* Decide whether isolated container spawn is an approved executor family for queue and campaign dispatch.
* If approved, add bounded container executable payload support, coordinator dispatch, image/runtime readiness checks, result surfacing, unavailable handling, and tests.
* If not approved for this release, reject container orchestration payloads truthfully and keep direct container runtime controls separate.
* Surface missing runtime, missing image, policy block, timeout, and duplicate dispatch states honestly.

### Out of Scope

* Remote container orchestration or hosted execution.
* Docker isolation claims beyond the proven local runtime and dispatch scope.

***

## Prerequisites

* [ ] Coordinator shape from Sessions 02 through 04 completed and validated.
* [ ] Container support or unsupported-path acceptance test defined before implementation starts.

***

## Deliverables

1. A tested container dispatch slice, or protocol/UI/server behavior that explicitly marks queue/campaign container dispatch unsupported.
2. Documentation or release-note updates that prevent container readiness from being confused with full orchestration support.

***

## Success Criteria

* [ ] If supported, queue or campaign container dispatch runs isolated spawn, creates an execution run, shows output, and handles missing image/runtime recovery.
* [ ] If unsupported, users cannot create or dispatch a container orchestration task that appears executable.
* [ ] Capability labels and release claims distinguish direct container runtime readiness from queue/campaign orchestration readiness.

***

## Folded Source Detail

### User Outcome

Container orchestration is either a proved queue/campaign executor family with visible result and recovery, or it is explicitly unsupported outside direct runtime controls.

### Current Source Reality

* Direct terminal/container routes exist in `apps/server/src/routes/terminalContainers.ts`.
* `apps/server` declares `dockerode`; Docker CLI is available locally.
* The default image `factionos-isolated:latest` was built from `docker/factionos-isolated/Dockerfile`; `npm run isolation:image:build` rebuilds it.
* Live evidence showed `ContainerRuntimeManager.probe()` returning `ready` and `runIsolatedSpawn()` returning `executed`.
* This direct runtime readiness does not automatically prove queue/campaign container orchestration readiness.

### Required Changes

* Decide whether isolated container spawn is an approved executor family for queue and campaign dispatch.
* If approved, add bounded container executable payload support, coordinator dispatch, image/runtime readiness checks, result surfacing, unavailable handling, and tests.
* If not approved for this release, reject container orchestration payloads truthfully and keep direct container runtime controls separate.
* Surface missing runtime, missing image, policy block, timeout, and duplicate dispatch states honestly.
* Documentation or release notes must prevent container readiness from being confused with full orchestration support.

### Acceptance Tests From Findings

* If supported, queue or campaign container dispatch runs isolated spawn, creates an execution run, shows output, and handles missing image/runtime recovery.
* If unsupported, users cannot create or dispatch a container orchestration task that appears executable.
* In both paths, capability labels and release claims distinguish direct container runtime readiness from queue/campaign orchestration readiness.


---

# 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_20/session_09_container_dispatch_decision.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.
