Skip to main content

Module model

Module model 

Source
Expand description

Intent value model: origin, builders, accessors, and fail-closed validation.

An Intent is a SIM value: a kind-tagged Expr::Map that also carries an origin (operator plus logical tick) and the fields its kind requires. This module builds and inspects Intents over Expr (no parallel data model), validates them structurally into a IntentError, and resolves the targets an Intent references against a caller-supplied predicate so an Intent naming an unknown target produces a diagnostic rather than a partial mutation.

Structs§

IntentError
A structured Intent validation diagnostic: where the problem is and what it is.
Origin
The origin of an Intent: which operator issued it and at what logical tick.

Enums§

Operator
Who issued an Intent. Recorded on every Intent for audit; both a human (through the browser) and an agent (through the runner) are peers on the bus.

Functions§

field
Read a top-level Intent field by name.
intent
Build an Intent value: a kind-tagged map carrying origin then fields.
intent_kind_of
If expr is a kind-tagged map, return the kind symbol.
origin
Parse the origin of an Intent, if present and well-formed.
referenced_targets
The list of (field-label, target-expr) references an Intent carries, by kind. Port references (from/to) contribute their inner node.
resolve_targets
Resolve every target an Intent references against is_known, returning a diagnostic for the first unknown target. A failed resolution means the editor must not produce an operation: nothing mutates.
validate_intent
Validate that expr is a structurally well-formed Intent, failing closed with an IntentError otherwise.