Skip to main content

compute_composition_id

Function compute_composition_id 

Source
pub fn compute_composition_id(graph: &CompositionGraph) -> Result<String, Error>
Expand description

Compute a deterministic composition ID.

The hash is taken over the canonical form of the graph’s root node, serialised via JCS (RFC 8785). Metadata fields (description, version) do not contribute to the ID: cosmetic edits should not shift a composition’s identity, and equivalent graphs with different surface syntax (nested Sequentials, permuted Parallel branches, collapsed Retry layers, etc.) must produce identical IDs.

The canonicalisation rules are documented in docs/architecture/semantics.md and implemented in crate::lagrange::canonical.

Compatibility note. This changes composition IDs from the pre-0.5 byte-of-the-whole-graph hash. Migration guidance lives in the 0.5.0 release notes.