Modules
UI components for authoring, observing, inspecting, and debugging statifier statecharts.
The datamodel explorer pane (sui-t36.7): one component, two data
sources. Authoring mode (build_authoring/3) merges the mode-
independent tiers StatifierUI.DatamodelExplorer.Scope builds - document
<data id> declarations (tier 1), the SCXML 5.10.1 system variables
(tier 2a), the predicator provider functions in scope (tier 2b) - with
one named fixture scenario (tier 3), the one tier that switches source
between modes (ADR-0003:82-88). Live mode's build_live/2 is
sui-t36.7 Phase 3's addition to this same module.
One node in the datamodel explorer tree (sui-t36.7): a <data>
declaration, a system variable, a provider function, a fixture scenario
value, or a runtime-only location - the ADR-0003 tiers, plus live mode's
:runtime sibling for a location session.datamodel never named.
Renders a StatifierUI.DatamodelExplorer.t() as Markdown a host hands to
Kino.Markdown.new/1, per the sui-t36.7 plan's Phase 4.
The three ADR-0003 tiers that do not switch source between authoring and
live mode: document <data id> declarations (tier 1), the SCXML 5.10.1
system variables (tier 2a), and the predicator provider functions in
scope (tier 2b). All three come from a compiled %Statifier.Machine{}
and two engine constants - no session, no fixtures, no wire messages.
Renders a compiled Statifier.Machine and an active configuration as
Mermaid stateDiagram-v2 source, for display via Kino.Mermaid (or any
other Mermaid consumer - this module is pure and depends on neither Kino
nor LiveView).
The pane model behind the inspector's event-firing form: a palette built
from a fixture bundle's events map (StatifierUI.EventInjection.Palette),
a free_form_only? flag for the degraded mode the bead requires when there
are no fixtures to draw buttons from, and the one send path every submitted
form goes through.
Turns a form's two free-form fields - an event name and a payload text -
into a Statifier.Event.t(), the ordinary recordable input
(Statifier.Event.external/2) rather than a side door.
One fixture event, rendered as a palette button: an event name, its sample payload verbatim, and the ADR-0005 JSON text a form prefills the payload field with.
A fixture bundle's events map (ADR-0003), turned into a sorted list of
StatifierUI.EventInjection.Entry.t() a form can render as buttons.
Folds a [StatifierUI.Trace.Message.t()] (in any order) into a readable
log keyed by (macrostep, round), per the sui-t36.5 plan.
The rendering seam for ADR-0013 correlation: from a macrostep in an
StatifierUI.EventLog.t() to a link into the host's APM backend.
Turns the wire format's integer indexes into strings a human can read,
using only the session.start tables already on the stream
(lib/statifier_ui/trace/manifest.ex:120-211).
One macrostep's worth of an StatifierUI.EventLog.t(): its rounds, its
round-less effect.* messages, and two summaries derived from its rounds
rather than carried on any single message.
Renders a StatifierUI.EventLog.t() as Markdown a host hands to
Kino.Markdown.new/1, per the sui-t36.5 plan's Phase 3.
One (macrostep, round) bucket of an StatifierUI.EventLog.t().
The completion source behind the expression-editing component: predicator's own grammar vocabulary, plus the datamodel paths a host declares.
Example data a host supplies for a chart: named scenario datamodels, example event payloads, and named datasets for evaluating expressions (ADR-0003, ADR-0006).
A fixture bundle that travels with one reusable chart fragment rather than with a whole chart: the ADR-0003/ADR-0006 bundle plus the fragment's name and a record of where it was loaded from.
Renders one StatifierUI.Fixtures.Bundle as the per-fragment "test this
step" panel: what the fragment's expressions evaluate to under each of its
datasets, and whether each expectation it states still holds.
Raised by StatifierUI.Fixtures.Expectations.check!/2 when one or more
stated expect entries did not hold.
Runs every expect entry a fixture bundle states, evaluates it against its
named dataset, and reports whether the stated value held (ADR-0006). This
is the executable side of the fixture contract: StatifierUI.Fixtures.Lint
answers "is this bundle well-formed", this module answers "did every stated
expectation come true".
ADR-0006's two lint findings for a fixture bundle: an expression whose
source text matches no compiled guard, and an expect key naming no
dataset. Both are warnings, never errors - this module has no
{:error, _} return path anywhere in its public API.
Reads a <chart>.fixtures.json sidecar (ADR-0003) and produces the same
StatifierUI.Fixtures struct the behaviour-based delivery path produces.
Behaviour for a host-application module that supplies fixture data.
Pure pane assembly for the Livebook inspector: folds a compiled
Statifier.Machine and a StatifierUI.Trace.Subscriber message list
into the render source each pane displays - Mermaid source for the
configuration diagram, Markdown for the event log and the datamodel
explorer, and a status line from the subscriber's stats/1 snapshot.
The Livebook inspector: inspect/3 composes the four panes -
configuration diagram, datamodel explorer, event injection, event
log - over one shared StatifierUI.Trace.Subscriber, attached with
catch-up (statifier ADR-0049), inside one Kino.Layout.
The inspector's render loop: a GenServer registered as the shared
subscriber's listener, re-rendering every frame from the subscriber's
buffer on a coalesced tick (one render at most every 80 ms, however
fast messages arrive). Started via
Kino.start_child/1 by StatifierUI.Kino.inspect/3, and terminated
with the cell - which is what detaches the inspector.
Read-only LiveView components for a host application's ops views: the
current-state diagram and the run-history event log, side by side over
one trace stream in wire format v1 (docs/wire-format.md), live or
persisted.
An expression field with completion: predicator's grammar and the host's declared datamodel paths, offered at the caret.
The read model a host LiveView keeps in its socket: a compiled
Statifier.Machine, the wire-format v1 messages seen so far, and which
point in the run the panes are showing.
Infers a structured shape from a predicator value, and renders that shape as a display label.
A fixed-capacity, drop-oldest store of %StatifierUI.Trace.Message{}
values - the memory-safety mechanism a chatty session needs so a notebook
does not grow without bound (decision 8 of the plan).
Record a trace off a live Statifier.Session, save it, load it back -
one call each.
Builds a URL into a host's APM backend from the wire format's otel
correlation key (ADR-0013), so a rendered step can be followed to the
trace that covers it.
The wire error object: what docs/wire-format.md documents as an event
object's error key.
The canonical JSON encoder that makes ADR-0005's byte-comparable golden traces real.
Turns a compiled %Statifier.Machine{} plus caller-supplied context into
the session.start definition message (docs/wire-format.md) - the
message that makes every later index (state index, t_index,
c_index, d_index) resolvable to a source location without a compiler
on the reading end.
Pure, no process.
One message of the trace wire format (docs/wire-format.md), held as a
struct in process and rendered to the documented JSON object by to_map/1.
The pure mapping from Statifier.Effect.t() (and the session's own
lifecycle messages) to StatifierUI.Trace.Message.t(), matching
docs/wire-format.md field for field. No process, no session, no
%Statifier.Machine{} - the whole vocabulary is testable from a struct
literal.
The producer half of ADR-0013: stamping a message's otel correlation key
from a resolver the host supplies.
ADR-0012's producer-side projection: the transform that replaces values in
a closed set of value positions with the reserved {"$redacted": true}
sentinel while leaving every identity, counter, ordering, and structural
field untouched.
A named projection profile: the two allowlists plus allow_source.
The offline producer of the v1 trace wire format (ADR-0017): a pure
function that turns a persisted session event log into the same
StatifierUI.Trace.Message stream StatifierUI.Trace.Subscriber
produces from a live session - with no Statifier.Session, no process,
and no clock.
The only GenServer in this bead - it owns attach and detach, seq
stamping, the session.start manifest emission, session-death handling,
and the bounded buffer, and fans every message out to registered
listeners. Everything else under lib/statifier_ui/trace/ is a pure
module; this is the process that wires them to a live
Statifier.Session.
Evaluates a fixture bundle's expressions across its datasets and returns the result matrix ADR-0006 named: "one expression evaluated across all datasets, rendered as a result matrix".
Renders a StatifierUI.TruthTable.t() as Markdown a host hands to
Kino.Markdown.new/1.
Codec for ADR-0005's JSON encoding of the value domain predicator's
Predicator.Types module defines (its value/0 type).