Skip to main content

CompositionNode

Enum CompositionNode 

Source
pub enum CompositionNode {
    Stage {
        id: StageId,
        pinning: Pinning,
        config: Option<BTreeMap<String, Value>>,
    },
    RemoteStage {
        url: String,
        input: NType,
        output: NType,
    },
    Const {
        value: Value,
    },
    Sequential {
        stages: Vec<CompositionNode>,
    },
    Parallel {
        branches: BTreeMap<String, CompositionNode>,
    },
    Branch {
        predicate: Box<CompositionNode>,
        if_true: Box<CompositionNode>,
        if_false: Box<CompositionNode>,
    },
    Fanout {
        source: Box<CompositionNode>,
        targets: Vec<CompositionNode>,
    },
    Merge {
        sources: Vec<CompositionNode>,
        target: Box<CompositionNode>,
    },
    Retry {
        stage: Box<CompositionNode>,
        max_attempts: u32,
        delay_ms: Option<u64>,
    },
    Let {
        bindings: BTreeMap<String, CompositionNode>,
        body: Box<CompositionNode>,
    },
}
Expand description

A composition graph node. The core AST for Noether’s composition language.

Variants§

§

Stage

Leaf node: reference to a stage in the store.

The id field is interpreted according to pinning:

  • Pinning::Signature (default): id is a signature-level hash (SignatureId) and the resolver returns the currently Active implementation with that signature.
  • Pinning::Both: id is an implementation-inclusive hash (ImplementationId / StageId) and the resolver requires an exact match. No fallback.

The optional config provides static parameter values merged with the pipeline input before the stage executes.

Use CompositionNode::stage to construct a node with default pinning; use the struct literal only when you need a non-default pinning or a config.

§Known gap in M2 (v0.6.0)

resolve_stage_ref is only wired into the type checker and executor runner. Other passes (effect inference, Ed25519 verify, planner cost/parallel grouping, budget, grid-broker splitter) still look up by StageId directly, which means a Pinning::Signature node may type-check but fail at those downstream passes. The resolver-normalisation pass lands as a follow-up: it rewrites graph nodes to implementation IDs before any downstream pass runs, so the rest of the engine keeps operating on concrete implementation hashes.

Fields

§pinning: Pinning
§

RemoteStage

Call a remote Noether API endpoint over HTTP.

The declared input and output types are verified by the type checker at build time — the remote server does not need to be running during noether build. In native builds, execution uses reqwest. In browser builds, the JS runtime makes a fetch() call.

Fields

§url: String

URL of the remote Noether API (e.g. “http://localhost:8080”)

§input: NType

Declared input type — what this node accepts from the pipeline

§output: NType

Declared output type — what this node returns to the pipeline

§

Const

Emits a constant JSON value, ignoring its input entirely. Used to inject literal strings, numbers, or objects into a pipeline.

Fields

§value: Value
§

Sequential

A >> B >> C: output of each stage feeds the next.

Fields

§

Parallel

Execute branches concurrently, merge outputs into a Record keyed by branch name. Each branch receives input[branch_name] if the input is a Record containing that key; otherwise it receives the full input. Const branches ignore their input entirely — use them for literals.

§

Branch

Conditional routing based on a predicate stage.

Fields

§

Fanout

Source output sent to all targets concurrently.

Fields

§

Merge

Multiple sources merge into a single target.

Fields

§

Retry

Retry a stage up to max_attempts times on failure.

Fields

§max_attempts: u32
§delay_ms: Option<u64>
§

Let

Bind named intermediate computations and reference them in body.

Each binding sub-node receives the outer Let input (the same value passed to the Let node). After all bindings have produced a value, the body runs against an augmented input record:

{ ...outer-input fields, <binding-name>: <binding-output>, ... }

Bindings with the same name as an outer-input field shadow it. This makes it possible to carry original-input fields into stages later in a Sequential pipeline — the canonical example is scan → hash → diff, where diff needs state_path from the original input but hash would otherwise erase it.

All bindings are scheduled concurrently — there are no inter-binding references. If you need a binding to depend on another, wrap it in a nested Sequential.

Implementations§

Source§

impl CompositionNode

Source

pub fn stage(id: impl Into<String>) -> Self

Build a Stage node with default pinning (Signature) and no config. Use this in place of the struct literal when you don’t need to set pinning or config explicitly.

Source

pub fn stage_pinned(id: impl Into<String>) -> Self

Build a Stage node with an explicit Both pinning — the resolver will require the exact implementation named by id.

Trait Implementations§

Source§

impl Clone for CompositionNode

Source§

fn clone(&self) -> CompositionNode

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CompositionNode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CompositionNode

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for CompositionNode

Source§

fn eq(&self, other: &CompositionNode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for CompositionNode

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for CompositionNode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,