# `CommBus.Context`
[🔗](https://github.com/fosferon/comm_bus/blob/v0.1.0/{path}#L{line})

High-level planning utilities for CommBus assemblies.

Produces diffable plans with budget allocations, diagnostics, and exclusion reasons,
and emits telemetry events for observability.

# `plan`
[🔗](https://github.com/fosferon/comm_bus/blob/v0.1.0/{path}#L{line})

```elixir
@spec plan(CommBus.Conversation.t(), [CommBus.Entry.t()], keyword()) ::
  CommBus.Context.Plan.t()
```

Produces a comprehensive assembly plan from a conversation and entries,
including budget allocations, match diagnostics, and exclusion reasons.

Orchestrates the full assembly pipeline: methodology resolution, entry
partitioning, keyword matching, deduplication, token annotation, budget
fitting, and section positioning. Emits telemetry events for observability.

## Parameters

  - `conversation` — A `%CommBus.Conversation{}` with message history.
  - `entries` — List of `%CommBus.Entry{}` structs to consider.
  - `opts` — Keyword options:
    - `:budget` — Budget configuration map (see `CommBus.Budget.Planner`).
    - `:methodologies` — List of methodology refs to include.
    - `:scan_depth`, `:recency_decay` — Matching options.

## Returns

A `%CommBus.Context.Plan{}` struct with sections, included/excluded entries,
token usage, match diagnostics, and exclusion reasons.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
