aion_package/structure/mod.rs
1//! Workflow structure projection: a graph model derived from the typed source.
2//!
3//! A workflow is a typed function over a small, known vocabulary
4//! (`run` / `all` / `race` / `map` / `spawn` / `receive` / `sleep` / timers), so
5//! its primitive structure can be projected from the entry-module Gleam source
6//! into an ordered node/edge graph automatically (C21, C23). Each node carries a
7//! [`CorrelationKey`] so a consumer (the dashboard canvas, RM-007) can overlay a
8//! run's recorded events onto the graph (C22). A bounded structural delta
9//! regenerates Gleam that still type-checks (C24).
10//!
11//! The graph model is a projection, never the authoritative artifact: the typed
12//! Gleam module remains the single source of truth (ADR-014, CN6). This module
13//! delivers the data model and the regeneration only — the rendered canvas UI
14//! and the live overlay are deferred to RM-007.
15
16mod arms;
17mod control_flow;
18mod determinism;
19mod error;
20mod extract;
21mod facts;
22mod ident;
23mod model;
24mod reader;
25mod regen;
26mod scan;
27
28#[cfg(test)]
29mod tests;
30
31/// The crate's ONE runtime gate for tests that shell out to the real `gleam`
32/// CLI, shared with the integration tests rather than re-implemented here.
33///
34/// The unit test below is inside `src/`, so it cannot reach a `tests/` module
35/// the ordinary way. Its own gate used `tracing::info!`, which with no
36/// subscriber installed wrote the skip line nowhere at all (#74). Reaching the
37/// shared file by path keeps one definition of "the skip must be visible"
38/// instead of a third copy that looks right in isolation.
39#[cfg(test)]
40#[path = "../../tests/test_support/gleam.rs"]
41mod gleam_test_support;
42
43pub use determinism::{DeterminismError, Violation, ViolationKind, analyze_determinism};
44pub use error::StructureError;
45pub use extract::extract_structure;
46pub use facts::{FactsError, WorkflowFacts, extract_workflow_facts};
47pub use model::{
48 ArmLabel, CorrelationKey, EdgeKind, GraphEdge, GraphNode, NodeId, NodePrimitive, WorkflowGraph,
49};
50pub use regen::{StructuralDelta, regenerate_gleam};