Skip to main content

Module steps

Module steps 

Source
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 builds Vec<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§

AuthoredStep
One node of an authored tasks tree.
AuthoredSteps
Iterator returned by walk_authored_steps.

Enums§

StepKind
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 tasks array, yielding every node with its path.