Skip to main content

Module construction

Module construction 

Source
Expand description

Enumerable workload-construction nodes.

Every node kind of the workload grammar (workload root, phase, op, poll, scenario node, …) implements EnumerableNode: it names itself with a single discriminant, enumerates its valid sub-elements WITH their valid forms, and VALIDATES a runtime AST (partial or complete) directly. Child node kinds are held as DIRECT &'static dyn EnumerableNode references inside Form — no side mapping from names to nodes exists, so a dangling reference is unrepresentable: the reference graph is checked by the compiler, the same single-discriminant discipline the wrapper registry uses at the execution-context layer.

These tables are the single declaration point for each element (name + forms + doc together). The flat name lists in crate::vocab are PROJECTIONS of these tables (the parser consumes those projections for its rejection checks), and the phase table is pinned against the crate::model::WorkloadPhase struct itself by a serde field probe in this module’s tests.

ENFORCEMENT: parse_workload runs validate_workload on every extends-merged document (the construction gate — docs/guide/construction_model.md). COHERENCE AXIOM: a construction that cannot be represented in the synthesizer fuzz is not yet a valid construction; the fuzzer’s deferral list is the debt register against this axiom.

Context sensitivity: EnumerableNode::elements receives the partial AST node (when the caller has one) and may narrow — e.g. a phase carrying poll: pins concurrency to 1, a phase with inline ops: loses the tags: selector (one source of ops, SRD-108 Part A), and an op with abstract: drops the statement payload.

Structs§

AbstractNode
BackoffNode
BindingClassesNode
CheckpointNode
ContinueIfNode
DelayNode
ElementSpec
One valid sub-element of a node: the single declaration point for its name, accepted forms, and documentation.
EvaluationsNode
MemoNode
MetricNode
OpNode
OpPollNode
OptimizeNode
PhaseNode
PollNode
RelevancyNode
ScenarioNode
StopWhenNode
ThrottleNode
TriesNode
Violation
One validation finding, with the AST path it anchors to.
WorkloadNode

Enums§

Form
A valid value form for one element. Nested node kinds are direct references — the grammar graph carries itself.
Mode
Validation strictness: a PARTIAL model skips required-element checks (it is still being authored); a COMPLETE model does not.

Statics§

ABSTRACT
ABSTRACT_ELEMENTS
ALL_NODES
Every registered node kind — an enumeration surface for tooling (describe, docs). Resolution never goes through this list: forms hold their child nodes directly.
BACKOFF
BACKOFF_ELEMENTS
BINDING_CLASSES
BINDING_CLASS_ELEMENTS
GK binding declaration classes usable from workload bindings: blocks (the grammar itself is polydat’s; the bare name := expr derived form has no keyword).
CHECKPOINT
CHECKPOINT_ELEMENTS
CONTINUE_IF
CONTINUE_IF_ELEMENTS
DELAY
DELAY_ELEMENTS
EVALUATIONS
EVALUATIONS_ELEMENTS
MEMO
MEMO_ELEMENTS
METRIC
METRIC_ELEMENTS
OP
OPTIMIZE
OPTIMIZE_ELEMENTS
OP_ACTIVITY_ELEMENTS
Activity-level op keys excised from adapter fields by the model layer (the parser’s excision list is this table’s name projection — single source).
OP_MODEL_ELEMENTS
OP_POLL
OP_POLL_ELEMENTS
OP_STMT_ELEMENTS
PHASE
PHASE_ELEMENTS
POLL
POLL_ELEMENTS
RELEVANCY
RELEVANCY_ELEMENTS
SCENARIO
SCENARIO_NODE_ELEMENTS
STOP_WHEN
STOP_WHEN_ELEMENTS
THROTTLE
THROTTLE_ELEMENTS
TRIES
TRIES_ELEMENTS
WORKLOAD
WORKLOAD_ELEMENTS

Traits§

EnumerableNode
An enumerable node kind of the workload construction grammar.

Functions§

discover_at
Resolve the node kind at path inside partial (a possibly incomplete workload AST) and enumerate its valid sub-elements there. Path segments are the YAML keys / author-chosen names from the root; list indices are decimal. Returns None when the path leaves the modeled grammar (e.g. descends into a declared-open surface).
node_by_kind
Kind lookup over ALL_NODES — a convenience for external tooling only.
root
The workload root node.
validate_workload
Validate an entire (possibly partial) workload AST against the construction grammar.