Expand description
§luft-runtime
Sandboxed Lua orchestration VM.
The runtime executes Luft orchestration scripts in a sandboxed
mlua VM. Scripts call SDK primitives that bridge to the scheduler
— the script is pure orchestration and cannot touch the filesystem, shell,
or network directly.
§SDK Primitives
Lua scripts call these global functions:
| Primitive | Description |
|---|---|
agent(opts) | Run a single agent task; returns AgentResult |
parallel(items, map_fn) | Fan-out: run map_fn(item) for each item concurrently, barrier-sync results |
pipeline(items, stages) | Streaming pipeline: items flow through stages without barrier sync |
workflow(path, args?) | Invoke a nested sub-workflow |
converge(opts) | Multi-round consensus: agents iterate until convergence or round limit |
phase_begin(name) / phase_end(span) | Structural progress spans for observability |
report(value) | Emit the final workflow output (required) |
log(msg, level?) | Structured log event |
budget(time_ms?, rounds?) | Set runtime limits hint |
json.encode(value) / json.decode(str) | JSON helpers (pure Lua, no io) |
§Sandbox Security Model
The following Lua standard libraries are removed from the VM:
io.*— no file I/Oos.*— no process / environment accesspackage.*— no module loadingrequire,dofile,loadfile— no external code execution
Only orchestration primitives and math, string, table, json are available.
This guarantees that scripts — which may be LLM-generated — cannot escape
the orchestration layer.
§Validation
Before execution, scripts are validated via validate (syntax + forbidden
globals) and validate_workflow (structural checks: report() presence,
span pairing, meta consistency).
Structs§
- Converge
Config - Configuration for convergence verification.
- Converge
Result - Result of a converge operation.
- Exec
Limits - Execution limits for a Lua script (instruction count, wall clock, memory).
- Pipeline
Config - Configuration for a pipeline execution.
- Pipeline
Executor - The core pipeline execution engine.
- Pipeline
Item - A single item flowing through the pipeline.
- Pipeline
Item Result - Pipeline
Result - Final result of a pipeline execution.
- Pipeline
Stage - A single pipeline stage with its handler.
- Pipeline
Stats - Round
Stats - Statistics for a single verification round.
- Runtime
- The main runtime structure that executes Lua scripts.
- Stage
Result - Workflow
Meta - Extracted plan metadata from the
metaglobal. - Workflow
Validation - Structured result of deep workflow validation.
Enums§
- Pipeline
Error - Script
Error - Errors that can occur during script execution.
- Stage
Status - Status of an item at a specific stage.
Functions§
- validate
- Validate a script without executing it (syntax + forbidden globals).
- validate_
script - Validates a script (syntax only) without executing it.
- validate_
workflow - Deep validation of a workflow script without executing
main().