Export & GNN Package
Export stage and GNN package
The export pipeline stage is implemented by run_export (invoked from PipelineRunner and from Session.export_all / CLI translate). It writes flat JSON artifacts under output_dir (program_graph.json, state_space.json, process_model.json, gnn_model.json, etc.).
When all of the following are present on the in-memory bundle—program graph (_program_graph), state-space model (_state_space_model), process model (_process_model)—orchestration also builds a full output_dir/gnn_package/ tree via GNNPackageBuilder. Semantic mappings must be stored as a dict on bundle.artifacts["_semantic_mappings"] (mapping id → SemanticMapping); the builder and markdown formatter expect dict-shaped input, not a bare list of mappings.
On failure, package build is non-fatal: warnings may appear under export-related artifact keys; see GNN export and SPEC § Implementation status.
To validate a package from the CLI or disk layout, use cogant validate. The validate stage in run_validate can run GNNValidator when _gnn_package_dir was set during export.