Skip to main content

Module declared

Module declared 

Source
Expand description

The bridge from a DEPLOYED package’s workloop declaration (aion_package::WorkloopContract, compiled from the .awl header and bound into package identity) to the engine’s runtime WorkloopSpec.

§🔴 WHY THIS EXISTS, AND WHY IT REFUSES RATHER THAN FILLS IN

The two records look alike and are not the same thing. The contract is a transport shape: every field is optional-on-the-wire so an older archive still decodes, and a compiled document is the only thing that ever writes one. The spec is an executable authority the engine acts on: it decides when a loop fires, when it alarms, what is destroyed, and what generation 1 starts from — and WorkloopSpec’s constructors refuse every shape that cannot be acted on.

So this conversion is where the wire’s optionality meets the runtime’s demands, and every gap between them is REFUSED with a diagnostic naming the declaration, never defaulted. A workloop armed by a cadence nobody declared is a loop firing on a schedule no author wrote; an invariant confirmed by no route alarms forever. Both are worse than a deploy that will not start.

Functions§

spec_from_contract
Build the runtime spec a deployed workloop is registered with.