StatifierBlocks.Describe.Edge (StatifierBlocks v0.40.0)

Copy Markdown View Source

One way control passes between blocks in a StatifierBlocks.Describe outline, in the vocabulary of the package's note on the block-level flow graph, docs/block-level-flow-graph.md (ADR-0016 decision 1).

container is the block whose structure produced the edge. An endpoint names a block and which part of it the edge touches: {:block, id} the block itself, {:entry, id} and {:exit, id} a container's entry and exit, and {:body, id} a group's body.

kindFromToCarries
:entry{:entry, container}the first child, or {:exit, container} for an empty bodynothing
:sequencea childthe next child in the same slotoutcomes
:exitthe last child of a slot{:exit, container}outcomes
:branch{:entry, branch}an arm's first child, or {:exit, branch} for an empty armcondition
:interrupta handler{:exit, group} to abandon, {:body, group} to resumeevent, history
:timera delayed core.send{:block, id}, a core.on_event or core.await naming the sent eventevent, delay

outcomes is every outcome name the source block's type declares, on the one edge. condition is the arm's condition as its config holds it (nil when none is written), :otherwise, or :undecided. history is :shallow or :deep for a resume into a core.resumable_group, and nil otherwise: a resume into a core.group restarts its body from the first step.

A :timer edge is the one edge that joins two blocks by an event name (ADR-0016's amendment of 2026-09-27, ADR-0017 decision 3): it is not a transition, it says that the send arms an event the other block waits for. Its container is the send's parent, event is the sent event, and delay is the send's delay as its config holds it, the edge's label. delay is nil on every other kind of edge.

Summary

Types

condition()

@type condition() :: String.t() | :otherwise | :undecided | nil

endpoint()

@type endpoint() ::
  {:block, StatifierBlocks.Block.id()}
  | {:entry, StatifierBlocks.Block.id()}
  | {:exit, StatifierBlocks.Block.id()}
  | {:body, StatifierBlocks.Block.id()}

kind()

@type kind() :: :entry | :sequence | :exit | :branch | :interrupt | :timer

t()

@type t() :: %StatifierBlocks.Describe.Edge{
  condition: condition(),
  container: StatifierBlocks.Block.id(),
  delay: String.t() | nil,
  event: String.t() | nil,
  from: endpoint(),
  history: :shallow | :deep | nil,
  kind: kind(),
  outcomes: [String.t()],
  to: endpoint()
}