CommBus.Context (CommBus v0.1.0)

Copy Markdown View Source

High-level planning utilities for CommBus assemblies.

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

Summary

Functions

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

Functions

plan(conversation, entries, opts \\ [])

@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.