Expand description
The authored step grammar: how a workflow’s tasks array is read.
An element of tasks is either a Task or a TaskGroup, and the
parser flattens that tree into Workflow::tasks at deserialization time so
the executor keeps walking a flat slice. This module owns both halves of
that grammar:
flatten— the parser, which buildsVec<Task>and fails on the first malformed element.walk_authored_steps— a public walker over the authored JSON, which never fails and yields every node with the coordinate the author typed.
They live together deliberately. The group test and the depth cap are the two facts a downstream host would otherwise have to mirror, and keeping the parser and the walker in one file puts both users of those facts on screen for anyone who changes them.
§Why a host needs the authored shape
By the time a host holds a Workflow, the tree is gone:
tasks is flat and Task::group_starts is not part of the stable API. But
a validation error, a lint finding or a dependency extraction has to point
at tasks[1].tasks[0].id — the coordinate in the document the author
actually wrote. That is what this walker provides.
Structs§
- Authored
Step - One node of an authored
taskstree. - Authored
Steps - Iterator returned by
walk_authored_steps.
Enums§
- Step
Kind - What an authored step element is.
Constants§
- MAX_
GROUP_ DEPTH - Maximum group nesting the parser accepts.
Functions§
- is_
group - Whether this authored step element parses as a task group.
- walk_
authored_ steps - Walk an authored
tasksarray, yielding every node with its path.