Skip to main content

extract_structure

Function extract_structure 

Source
pub fn extract_structure(
    package: &Package,
) -> Result<WorkflowGraph, StructureError>
Expand description

Extracts the workflow graph model from a loaded package.

Reads the manifest entry module’s verbatim Gleam source from Package::source, walks it from the entry function over the aion/workflow primitive vocabulary, and builds a control-flow-faithful node/edge graph whose nodes carry the correlation key a consumer overlays a run’s recorded events onto (C21, C22, C23).

§Errors

Returns StructureError::MissingEntrySource when the entry module has no source, StructureError::EntrySourceNotUtf8 when its bytes are not UTF-8, StructureError::NoWorkflowImport when it does not import aion/workflow, StructureError::EntryFunctionNotFound when the manifest entry function is not defined in the source, and StructureError::UnknownActivity when a run node names an activity the manifest does not declare.