Skip to main content

Module wrapper_resolver

Module wrapper_resolver 

Source
Expand description

SRD-32a — Wrapper composition resolver.

Turns a parsed op template + the wrapper registry + the session-level default order into a concrete WrapperPlan: which wrappers to apply, in what order, with provenance tagging for diagnostics.

Algorithm (4 passes, see SRD-32a §“Algorithm”):

  1. Trigger fan-out — every wrapper whose triggers(template) returns true is added with OwnedField provenance.
  2. Transitive closure — close requires_inner edges, tagging additions with TransitiveFrom.
  3. Constraint validation — mutually_exclusive_with pairs and requires_inner cycles surface as errors.
  4. Topological order — innermost first, with the session-level default order breaking ties; then a forbids_outer post-scan rejects any ordering that placed a forbidden wrapper outside its inner.

Structs§

WrapperPlan
Resolved wrapper composition for one op template.
WrapperResolver
Resolves a WrapperPlan for a parsed op template.

Enums§

ResolveError
Errors the resolver may surface. Each variant carries enough context for the caller to render an actionable diagnostic without re-walking the registry.
WrapperActivation
How a wrapper came to be in a plan — directly triggered by a field, transitively pulled in by another wrapper, or always-on.

Constants§

DEFAULT_ORDER
Default composition order (innermost → outermost). Used by the resolver as a tiebreaker when constraints leave multiple valid orderings.