StatePlane

Context Compiler

The current compiler slice answers a narrow but important question:

Given a set of candidate context items and a token budget, what should actually be sent to the model, and why?

Current Pipeline

  1. Normalization turns known inputs into typed ContextItem objects.
  2. Validation checks ids, provenance, stable hashes, and request budget invariants.
  3. Selection chooses required items first, then optional items by deterministic priority.
  4. Reporting joins the resulting decisions back to source items and produces inspectable receipts.

What Is Deterministic

What Is Required Today

The current selection slice always requires:

If required items are expired or exceed the usable budget, compilation fails with structured issues instead of silently dropping them.

What Is Not Implemented Yet

The current compiler does not yet handle:

Core Entry Points

See Context Items and Receipts for the data model behind those steps.