Skip to main content

Module resolver

Module resolver 

Source
Expand description

Pinning resolution pass.

Rewrites a CompositionNode tree so every Stage node’s id field holds a concrete noether_core::stage::StageId (implementation-level hash). After this pass runs, downstream passes — effect inference, --allow-effects enforcement, Ed25519 verification, planner cost/parallel grouping, budget collection, grid-broker splitter — can look up stages via store.get(id) without regard for the original pinning.

§Why a separate pass?

M2 introduced crate::lagrange::Pinning: a Stage node’s id is either a SignatureId (resolve to the current Active impl) or an ImplementationId (bit-exact lookup). Teaching every downstream pass about pinning would have been a dozen file changes, each of them easy to get wrong.

The pass approach is:

  1. Call resolve_pinning(&mut graph, &store) once, after graph construction and after any prefix/name resolution.
  2. Every subsequent pass works on the mutated graph, where id is guaranteed to be an ImplementationId that exists in the store.

This commits to “resolve once per execution”. If the store changes between resolution and execution, the resolved graph keeps referring to the old implementation — a feature, not a bug: we want a single execution to see a consistent snapshot.

§What the pass does NOT do

  • It does not change the pinning field. A node that was declared Pinning::Signature keeps that label even after its id has been rewritten to an implementation hash. Consumers that re-serialise the graph preserve the user’s original intent (the wire format’s pinning: "signature" still means “signature” on a future execution, not “both”).
  • It does not walk RemoteStage — that’s resolved at call-time over HTTP, not via the local store.

Structs§

MultiActiveWarning
Diagnostic raised when a signature-pinned ref matches more than one Active implementation. See ResolutionReport::warnings.
ResolutionReport
Output of a successful resolve_pinning pass.
Rewrite
Record of one rewrite the pass performed. Useful for tracing: noether run --trace-resolution can print the before/after pairs.

Enums§

ResolutionError
Error raised when a Stage node’s reference cannot be resolved against the store.

Functions§

resolve_pinning
Walk a composition tree and rewrite every Stage node’s id field to a concrete, in-store StageId. See the module doc for rationale and invariants.