Documentation
¶
Overview ¶
Package loader reads workflow YAML files and their referenced compose files/assets into an ir.LoadedDefinition. The I/O front for validation: file reads happen here so validation itself can be pure over an already-loaded snapshot.
Paths declared by containers, imports, and assets go through two independent gates:
- safeRootRelPath rejects absolute paths, paths containing backslashes (manifest paths are slash-separated; silently rewriting them hides authoring mistakes), control characters, and paths that escape the workflow directory after path.Clean.
- os.Root (Go 1.24, rooted at the workflow directory) independently confines all opens to the workflow directory. Root follows inside-root symlinks, so Load explicitly rejects symlink path components before opening files.
Load also normalizes each Container.Compose to its cleaned forward-slash form so the IR field and the ComposeFiles map key agree (this matters for the spec §E compose-fold and for any caller looking up bytes by container).
Index ¶
Constants ¶
const MaxAssetFileBytes int64 = 64 << 20
const MaxAssetFiles = 10000
const MaxAssetTotalBytes int64 = 256 << 20
Variables ¶
This section is empty.
Functions ¶
func Load ¶
func Load(workflowPath string) (*ir.LoadedDefinition, error)
Load reads the root workflow file at workflowPath, parses it into the IR, reads each referenced compose file and asset snapshot, then recursively loads local workflow imports. Root-level Workflow, WorkflowPath, ComposeFiles, and Assets fields remain aliases for the root module.