Trace payload for {:trace, %__MODULE__{}} - emitted when a block of
executable content ran (docs/observability.md constraint 2's "content
executed" row). c_indexes are the run content nodes' identities
(constraint 3), in execution order.
owner names which block ran, since a state may write several <onentry>
or <onexit> elements and Statifier.Machine.State.onentry/onexit are
lists of Statifier.Machine.Block.t() with no index of their own - the
ordinal is the block's position in that list. Most of the type lives on
Statifier.Machine.Content.owner/0 (it describes where a content node
lives, so that module is its natural home); this module widens it with one
case of its own rather than redefining the shared part, and
Statifier.Event.Cause.origin/0 embeds Content.owner/0 unwidened for its
:content case (post-review correction):
{:onentry, state_index, ordinal}- an<onentry>block{:onexit, state_index, ordinal}- an<onexit>block{:transition, t_index}- a transition's own executable content{:global_script, index}- a top-level<script>(spec 5.8), run at load time byStatifier.Interpreter.run_global_script/3. This case is added here, not onContent.owner/0itself: a top-level script has noc_indexand belongs to no block at all (Statifier.Machine's "whyglobal_scriptsis different" moduledoc section), so it would be a category error insideContent.owner/0, whose whole point is naming the block a content node lives in.Statifier.Event.Cause.origin/0already drew the same line:{:global_script, index}is that type's own top-level arm, not nested inside its{:content, c_index, owner}case, for the identical reason.indexis the script's position indocument.scripts/machine.global_scripts, the same identityStatifier.Compiler.Expressions.owner_ref/0mints andStatifier.Event.Cause.origin/0's own{:global_script, index}bullet already documents.
Built with new/2, never a struct literal, so macrostep/microstep/
round are always stamped from the Statifier.MachineState at hand.
Summary
Types
Which block of executable content (or, for {:global_script, index}, which
load-time script) produced c_indexes - Statifier.Machine.Content.owner/0
widened with the one case that module cannot carry. See the moduledoc for
why the widening lives here instead of there.
Functions
Stamps macrostep/microstep/round from machine_state and sets
fields (:owner, :c_indexes).
Types
@type owner() :: Statifier.Machine.Content.owner() | {:global_script, non_neg_integer()}
Which block of executable content (or, for {:global_script, index}, which
load-time script) produced c_indexes - Statifier.Machine.Content.owner/0
widened with the one case that module cannot carry. See the moduledoc for
why the widening lives here instead of there.
@type t() :: %Statifier.Effect.Trace.ContentExecuted{ c_indexes: [non_neg_integer()], macrostep: non_neg_integer(), microstep: non_neg_integer(), owner: owner(), round: non_neg_integer() }
Functions
@spec new(machine_state :: Statifier.MachineState.t(), fields :: keyword()) :: t()
Stamps macrostep/microstep/round from machine_state and sets
fields (:owner, :c_indexes).