Skip to main content

Module ir

Module ir 

Source
Expand description

Typed view of the Warble IR (warble_ir_version: 0.9) that this back-end consumes.

Mirrors ir-schema.md field-for-field. The IR JSON is the language-neutral seam between the front-end compiler and any back-end: this module depends on the schema doc, not on the front-end’s Rust types. Enum arms cover every schema-valid value; arms this target does not yet realize are rejected at emit time (a “wall-hit”), not at deserialization.

Structs§

ComponentCall
ComponentNode
ContextBinding
Effect
EvalSpec
An authored evaluation spec: which eval template to run and which metrics it scores.
Guardrail
IrConfig
The IR’s profile-level config block. Empty since IR 0.6 removed tier_policy (an inert field no back-end read); kept as a struct so future profile-level config is an additive change.
LlmCall
Outcome
Param
A component parameter, either bound at dispatch time (bind, with an optional default) or sourced from context (source). Exactly one of bind/source is expected to be present per the schema, but both are optional here since this is a Deserialize-only view.
Precondition
A context precondition a component requires to hold before it runs (e.g. has_metric).
PreconditionCheck
One evaluated context_precondition and its outcome (pass in emitted IR — a failing predicate loud-fails the compile before any IR is emitted).
PreconditionResult
RenderBlock
A typed render block: a block type plus its field-name → field-type schema. The field-type strings are echoed into the agent’s render contract verbatim; the back-end never interprets them. BTreeMap keeps field order stable (deterministic output).
SlotDecl
A named position in prompt text, with the alternative wordings that may fill it (IR 0.7).
Trigger
WarbleIr
WhenGuard
A closed-vocabulary guard on a conditional llm_call: guard is one of on_failure / on_flag / on_missing, target is the guard-specific argument. See ir-schema.md.

Enums§

ComponentType
OutcomeKind
RealizationKind
A step’s tier is an open string, not a fixed enum. Warble ships a standard core vocabulary (strong, cheap) that keeps components portable, but a component may name a custom tier; the dispatch-time model config (see ModelConfig) maps each tier name to a concrete model, and a tier with no mapping is a loud-fail. Kept as String so the seam never constrains the vocabulary.
TriggerKind

Constants§

SUPPORTED_IR_VERSION
IR version this back-end understands. Copied (not shared via a core dependency — dispatchers never depend on warble) from the same source of truth as docs/spec/ir-schema.md’s title and the TS back-end’s SUPPORTED_IR_VERSIONS in dispatcher/claude-agent-sdk/src/ir.ts. The sole cross-target lockstep owner is core/tests/ir_version_lockstep_tests.rs; this target’s ir_version_tests.rs covers only its own rejection behavior. An unrecognized warble_ir_version is a loud-fail — see validate_ir_version — never a silent best-effort read.

Functions§

reject_unsupported_component_composition
Reject the composition facets before any executable artifact is emitted. This target parses the complete IR 0.9 shape but does not yet own a trusted component invocation runtime.
validate_ir_version
The one version gate every IR-consuming entry point in this crate (and the cli binary, at IR parse time) must call before doing anything else with ir: emit_claude_code_with_realization calls this as its first statement, and cli::load_ir calls it right after deserializing, so every subcommand that reads an ir.json — dispatch and manifest alike — is covered by the same check instead of each reimplementing (and potentially forgetting) it.