pub fn validate_workflow(
script: &str,
) -> Result<WorkflowValidation, ScriptError>Expand description
Deep validation of a workflow script without executing main().
Performs three layers of checks:
- Syntax —
Lua::load+execthe top level (safe: onlymetaassignment and function definitions run). SDK functions are stubbed so stray top-level calls don’t crash validation. - Structure — verifies
metatable exists withreasoningandphases, and thatmain()is defined. - Heuristic — checks for
report(call andphase_begin/phase_endpairing.
Returns a WorkflowValidation regardless of semantic errors (only syntax
errors or internal failures produce Err).