Documentation
¶
Overview ¶
Package scheduler builds and runs the task dependency DAG. It memoizes each (namespace, task, canonical-args) so a node runs at most once per invocation (FR-005), runs dependencies before the body and post-hooks after, detects cycles, and fails fast on the first error. [parallel] dependencies run concurrently (bounded by CPU count) while preserving run-once semantics. Dependency and post-hook targets the Engine reports unavailable (e.g. declared for another OS) are skipped silently — they never execute and leave no memo entry — while the depending task still runs (spec 020).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
func Run(engine Engine, roots []Invocation) error
Run executes the given root invocations in order, sharing one memo table so repeated tasks run once across the whole invocation.
Types ¶
type CycleError ¶
type CycleError struct {
Path []string
}
CycleError reports a dependency cycle with the offending path.
func (*CycleError) Error ¶
func (e *CycleError) Error() string
type Engine ¶
type Engine interface {
// ResolveDep evaluates a dependency/post-hook call in the scope of the
// calling task, returning the target task and its bound parameters.
ResolveDep(curTask *ast.Task, curParams map[string]string, dep *ast.DepCall) (*ast.Task, map[string]string, error)
// Execute runs a single task body with its bound parameters.
Execute(task *ast.Task, params map[string]string) error
// Namespace returns the memoization namespace for a task (mod path, or "").
Namespace(task *ast.Task) string
// Available reports whether a task may run on this host. Unavailable
// dependency/post-hook targets are skipped silently.
Available(task *ast.Task) bool
}
Engine resolves dependencies and executes task bodies. The CLI layer implements it (it owns the evaluator, parameter binding, and executors).