#[derive(thiserror::Error, Debug, PartialEq, Eq)]
pub enum StructureError {
#[error(
"entry module `{module}` has no Gleam source in the package; structure extraction \
requires the verbatim entry-module source"
)]
MissingEntrySource {
module: String,
},
#[error("entry module `{module}` source is not valid UTF-8")]
EntrySourceNotUtf8 {
module: String,
},
#[error(
"entry module `{module}` does not import `aion/workflow`; the extractor only \
understands workflows that compose the `aion/workflow` primitive vocabulary"
)]
NoWorkflowImport {
module: String,
},
#[error(
"extracted `run` node references activity `{activity}`, which the manifest does not \
declare; the graph would not match the workflow's recorded activities"
)]
UnknownActivity {
activity: String,
},
#[error(
"entry function `{function}` is not defined in entry module `{module}`; the control-flow \
walk requires the entry function's body to start from"
)]
EntryFunctionNotFound {
module: String,
function: String,
},
#[error("structural delta is outside the bounded round-trip vocabulary: {reason}")]
UnboundedDelta {
reason: String,
},
#[error("structural delta targets node {id}, which is not present in the graph")]
DeltaTargetMissing {
id: usize,
},
#[error("cannot regenerate Gleam: name `{name}` is not a valid Gleam identifier: {reason}")]
RegenInvalidName {
name: String,
reason: String,
},
}