# Runtime Context Preprocessing

Runtime subagent delegation builds a bounded preprocessed context bundle before
rendering spawn prompts. The bundle is embedded in the runtime context manifest
and is the default context a child runtime should use.

## Reduction Contract

Each file record includes:

- `sourcePath`: workspace-relative source path.
- `strategy`: `passthrough`, `schema-extraction`, `section-extraction`,
  `head-tail-truncation`, or `missing`.
- `originalSize`: original line and byte count.
- `finalSize`: reduced line and byte count.
- `omittedContentWarning`: explicit warning when content was reduced or missing.

Delegates may cite full source paths from the bundle, but should avoid loading
raw files unless the reduced context is insufficient for the assigned work.

## Deterministic Strategies

- Small files pass through unchanged.
- TypeScript files prefer exported schema and contract declarations.
- Markdown files prefer relevant sections based on task, role, phase, and
  delegated ownership paths.
- Other large files fall back to annotated head/tail truncation.

## Configuration

Runtime preprocessing defaults are line-based and can be configured with:

- `OPEN_ORCHESTRA_RUNTIME_CONTEXT_MAX_LINES_PER_FILE`
- `OPEN_ORCHESTRA_RUNTIME_CONTEXT_TOTAL_LINE_BUDGET`

The runtime context pack remains available as supplemental search evidence. The
preprocessed bundle is the prompt-local default.
