Expand description
A workflow is a typed, parameterised function over bags of units: a graph of nodes, each applying one of five primitives or another workflow, joined by edges that decide where a unit goes next.
This module reads a document, refuses everything it cannot apply exactly,
and computes the worst case a graph can cost. Nothing here runs a node or
touches the store: a document is read long before anything is dispatched,
and the bound is what pma workflow activate weighs against the budget.
The document is JSON for the reason route.rs gives: this crate parses
JSON already. Design: docs/dev/workflows.md.
Structs§
- Call
Node - Caps
- Document
- Edge
- Edit
Node - Effects
- Emit
Node - Estimate
- Field
- Guard
- MapNode
- Node
- Node
Bound - What one node can cost at worst.
- Param
- Reduce
Node - Retry
- Type
- Workflow
Enums§
- Action
- Cmp
- Count
- A count a document states: a constant, or a parameter that declares its own maximum. The worst case is computed at the maximum, so a bound never depends on the arguments an invocation happened to pass.
- Field
Type - From
- Key
- What a guard reads: a declared field of the units on the edge, or a system
field or verdict, written with a leading
@. - Op
- Out
- What a
mapmay do to the size of its input. - Param
Type - Sink
- Test
- To
- Via
- Who decides: a model, which costs money and is untrusted, or a rule, which is free and replays exactly.
Constants§
- BUILTIN_
TYPES - Types
pmawrites itself, from data it already holds. A document may not declare one of these names, nor add fields to them; a workflow that needs its own fields projects with theas:rule. - CHECK_
RULES - Rules a
checknode, or aneditnode’scheck, may name. Each writes a verdict under its own name:verifywrites@verify. - SYSTEM_
FIELDS - Fields on every unit, whatever its type. Reserved, so a declaration may
not shadow one, and addressed in a guard or a prompt with a leading
@.
Functions§
- builtin_
type - A built-in type’s fields. They are all read as text: nothing declares them, so nothing checks them beyond their names being addressable.
- holds
- Whether a guard admits a unit.
datais the unit’s declared fields;systemholds its@fields and the verdicts written against it, which the caller assembles because a guard reads what is recorded rather than recomputing it. - topological
- Node names in dependency order, ignoring lap edges and self-edges. The graph is a DAG without them, which validation already established.