Skip to main content

Module compile

Module compile 

Source
Expand description

The plan compiler (spec 002, 3.9).

Phases run in order and stop at the first refusal: (a) parse and bound, (b) structure, (c) resolve operators, calibrations and sources, (d) graph, (e) types, (e2) grades (plan 3 only, spec 032 3.9), (f) bind backends, fallbacks and calibration artifacts, (g) budget, (h) policy, (i) emit. Within a phase, steps are judged in declaration order, then policy items in declaration order.

Structs§

Compiled
A plan with everything evaluation needs.
Refusal
A typed compilation refusal naming its subject and requirement.
Shortfall

Enums§

Category
Refusal categories (spec 002, 3.9.5).
LoadError
Why Compiled::load_checked refused a plan (spec 004, 3.3.2).
ShortfallReason
Why one candidate backend cannot serve a step.

Constants§

COMPILER
The compiler identity recorded in every plan.

Functions§

compile
Compile a definition against supplied backend descriptors and calibration artifacts, with no execution policy (execution: none). Pure: no I/O, no clock.
compile_bytes
Parse a definition document and compile it.
compile_with
Compile with a runtime execution policy (spec 003, 3.2.3). The policy is validated after every step is bound and embedded in the plan, so it is part of the PlanId.
compile_with_extraction_documents
Check extraction with supplied fallback programs and prompt documents. Extraction and acceptance emit plan 3 bindings.
compile_with_sources
Compile with context source descriptors beside backend descriptors and calibrations (spec 032, 3.3.4), and optionally an execution policy. A version 1 definition ignores supplied sources, as an unbound backend descriptor changes nothing.
compile_with_templates
Compile generation with supplied prompt documents, alongside ordinary dependencies.