Execution Pipeline
Culsma runs source files through a staged execution pipeline.
ParseCompileValidatePlanRun
Stages
| Stage | Output |
|---|---|
| Parse | AST for the source program. |
| Compile | Canonical IR and compiler analysis. |
| Validate | Semantic diagnostics. |
| Typecheck | Unit and dimension diagnostics. |
| Plan | Executable plan with steps and dependencies. |
| Runtime | Final state, events, diagnostics, and user result. |
| Replay | Reconstructed state from event stream. |
Each stage owns the failures it can decide earliest. For example, unit dimension failures belong before runtime, while insufficient runtime material belongs to material-state execution.
Artifact Flow
A local protocol can be run through all stages with:
bash
python -m culsma run path/to/protocol.culs --artifacts-dir /tmp/culsma-docs-runSuccessful runs report:
| Field | Value |
|---|---|
runtime_ok | true |
failed_steps | 0 |
skipped_steps | 0 |
| semantic/type/plan/runtime diagnostics | 0 |
The run writes:
text
summary.json
ast.json
ir.json
validate.json
typecheck.json
plan.json
run.json
output.json
result.jsonSee Artifacts for details.
