Skip to main content

Module workflow

Module workflow 

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

CallNode
Caps
Document
Edge
EditNode
Effects
EmitNode
Estimate
Field
Guard
MapNode
Node
NodeBound
What one node can cost at worst.
Param
ReduceNode
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.
FieldType
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 map may do to the size of its input.
ParamType
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 pma writes 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 the as: rule.
CHECK_RULES
Rules a check node, or an edit node’s check, may name. Each writes a verdict under its own name: verify writes @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. data is the unit’s declared fields; system holds 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.