# `orchestrator.planner.v1`
<!-- generated by `orchestrator understand`; the PKG is source of truth, edits here are advisory -->

[← Episteme](../README.md) · [Architecture](../architecture.md)

**Source:** [`src/orchestrator/planner/v1.py`](../../src/orchestrator/planner/v1.py)

5 types · 8 functions · python

## Changing this safely

**No test module imports this.**

**Most depended-upon here** — a change to these reaches the most code (call graph, ≤4 hops):

- [`_build_manager_ir`](../../src/orchestrator/planner/v1.py#L577) — reaches **2** symbols · **no test path visible**
- [`_build_sequential_ir`](../../src/orchestrator/planner/v1.py#L634) — reaches **2** symbols · **no test path visible**
- [`_build_single_agent_ir`](../../src/orchestrator/planner/v1.py#L545) — reaches **2** symbols · **no test path visible**
- [`_render_calibration`](../../src/orchestrator/planner/v1.py#L476) — reaches **2** symbols · **no test path visible**
- [`_render_org_glossary`](../../src/orchestrator/planner/v1.py#L509) — reaches **2** symbols · **no test path visible**
- [`_resolve`](../../src/orchestrator/planner/v1.py#L469) — reaches **2** symbols · **no test path visible**
- [`_glossary_terms_to_plain`](../../src/orchestrator/planner/v1.py#L491) — reaches **1** symbol · **no test path visible**
- [`_merge_glossaries`](../../src/orchestrator/planner/v1.py#L518) — reaches **1** symbol · **no test path visible**

_8 of the symbols other code depends on here have no test path the graph can see — worth a second look before changing them. Absence of a path is not proof of absence of a test: calls through an attribute chain (`obj.method()`) are skipped rather than guessed at, so indirect coverage is invisible._

## Types

### `PlannerV1`

[`src/orchestrator/planner/v1.py:72`](../../src/orchestrator/planner/v1.py#L72)

- **Fields**: `_default_model`, `_llm`
- **Documented in**: `SETUP.md#10-project-layout`

### `_InferredGlossaryEntry`

[`src/orchestrator/planner/v1.py:53`](../../src/orchestrator/planner/v1.py#L53)

- **Extends** (1): `pydantic.BaseModel`
- **Fields**: `reason`, `value`

### `_ManagerSpecialistChoice`

[`src/orchestrator/planner/v1.py:47`](../../src/orchestrator/planner/v1.py#L47)

- **Extends** (1): `pydantic.BaseModel`
- **Fields**: `node_id`, `template_id`, `template_version`

### `_Plan`

[`src/orchestrator/planner/v1.py:60`](../../src/orchestrator/planner/v1.py#L60)

- **Extends** (1): `pydantic.BaseModel`
- **Fields**: `inferred_glossary`, `justification`, `manager`, `parallelism_max`, `pattern`, `specialists`, `steps`, `template_id`, `template_version`

### `_StepChoice`

[`src/orchestrator/planner/v1.py:40`](../../src/orchestrator/planner/v1.py#L40)

- **Extends** (1): `pydantic.BaseModel`
- **Fields**: `inputs_from`, `node_id`, `template_id`, `template_version`

## Functions

### `_build_manager_ir`

[`src/orchestrator/planner/v1.py:577`](../../src/orchestrator/planner/v1.py#L577)

- **Called by** (2): [`plan`](../../src/orchestrator/planner/v1.py#L77), [`replan`](../../src/orchestrator/planner/v1.py#L183)
- **Calls** (6): [`Budget`](../../src/orchestrator/ir/graph.py#L104), [`GraphIR`](../../src/orchestrator/ir/graph.py#L153), [`GraphSpec`](../../src/orchestrator/ir/graph.py#L113), [`Metadata`](../../src/orchestrator/registry/_common.py#L30), [`Node`](../../src/orchestrator/ir/graph.py#L50), [`_coerce_glossary_term`](../../src/orchestrator/planner/v0.py#L162)

### `_build_sequential_ir`

[`src/orchestrator/planner/v1.py:634`](../../src/orchestrator/planner/v1.py#L634)

- **Called by** (2): [`plan`](../../src/orchestrator/planner/v1.py#L77), [`replan`](../../src/orchestrator/planner/v1.py#L183)
- **Calls** (7): [`Budget`](../../src/orchestrator/ir/graph.py#L104), [`Edge`](../../src/orchestrator/ir/graph.py#L60), [`GraphIR`](../../src/orchestrator/ir/graph.py#L153), [`GraphSpec`](../../src/orchestrator/ir/graph.py#L113), [`Metadata`](../../src/orchestrator/registry/_common.py#L30), [`Node`](../../src/orchestrator/ir/graph.py#L50), [`_coerce_glossary_term`](../../src/orchestrator/planner/v0.py#L162)

### `_build_single_agent_ir`

[`src/orchestrator/planner/v1.py:545`](../../src/orchestrator/planner/v1.py#L545)

- **Called by** (2): [`plan`](../../src/orchestrator/planner/v1.py#L77), [`replan`](../../src/orchestrator/planner/v1.py#L183)
- **Calls** (6): [`Budget`](../../src/orchestrator/ir/graph.py#L104), [`GraphIR`](../../src/orchestrator/ir/graph.py#L153), [`GraphSpec`](../../src/orchestrator/ir/graph.py#L113), [`Metadata`](../../src/orchestrator/registry/_common.py#L30), [`Node`](../../src/orchestrator/ir/graph.py#L50), [`_coerce_glossary_term`](../../src/orchestrator/planner/v0.py#L162)

### `_glossary_terms_to_plain`

[`src/orchestrator/planner/v1.py:491`](../../src/orchestrator/planner/v1.py#L491)

- **Called by** (1): [`replan`](../../src/orchestrator/planner/v1.py#L183)

### `_merge_glossaries`

[`src/orchestrator/planner/v1.py:518`](../../src/orchestrator/planner/v1.py#L518)

- **Called by** (1): [`plan`](../../src/orchestrator/planner/v1.py#L77)

### `_render_calibration`

[`src/orchestrator/planner/v1.py:476`](../../src/orchestrator/planner/v1.py#L476)

- **Called by** (1): [`_select_with_llm`](../../src/orchestrator/planner/v1.py#L372)

### `_render_org_glossary`

[`src/orchestrator/planner/v1.py:509`](../../src/orchestrator/planner/v1.py#L509)

- **Called by** (1): [`_select_with_llm`](../../src/orchestrator/planner/v1.py#L372)

### `_resolve`

[`src/orchestrator/planner/v1.py:469`](../../src/orchestrator/planner/v1.py#L469)

- **Called by** (2): [`plan`](../../src/orchestrator/planner/v1.py#L77), [`replan`](../../src/orchestrator/planner/v1.py#L183)

## Imports

`__future__.annotations`, `json`, [`orchestrator.core.llm`](../../src/orchestrator/core/llm/__init__.py#L1), [`orchestrator.ir.graph`](../../src/orchestrator/ir/graph.py#L1), [`orchestrator.planner.v0`](../../src/orchestrator/planner/v0.py#L1), [`orchestrator.registry._common`](../../src/orchestrator/registry/_common.py#L1), [`orchestrator.registry.calibration`](../../src/orchestrator/registry/calibration.py#L1), [`orchestrator.registry.db.models`](../../src/orchestrator/registry/db/models.py#L1), `pydantic.BaseModel`, `pydantic.Field`, `sqlalchemy.ext.asyncio.AsyncSession`, `sqlalchemy.select`, `typing.Any`

## Imported by

[`orchestrator.planner`](../../src/orchestrator/planner/__init__.py#L1)
