StatifierBlocks.Runtime.RunValues (StatifierBlocks v0.24.0)

Copy Markdown View Source

What a run is holding at the selected point, as display text keyed by datamodel path.

The editor's Datamodel tab already answers what the document declares at a position - ADR-0011 decision 9's "what is known here", a path and a type. This is the other half of the same row: what a run actually had there when it was at the point the scrubber is on. The two beside each other are what makes a read that should not have been possible visible without a verdict: a path declared one type, holding something else.

Nothing here decides anything. The Datamodel tab is read-only by decision 9 and stays so; this module produces text, and a mismatch is something the reader sees rather than something the package rules on.

The fold is statifier-ui's, the cut is this module's

statifier-ui's StatifierUI.DatamodelExplorer folds the wire format's session.datamodel snapshot and every effect.datamodel_change after it into one set of entries; that fold is the contract and re-implementing it here would be a second answer to a question that already has one. It is reached the way StatifierBlocks.Runtime.Marks reaches the inspector and StatifierBlocks.Editor.Field reaches the expression input - out of application config, checked with function_exported?/3, never named as a call target - because statifier_ui is optional here.

What this module does write is the cut. StatifierUI.Inspector.datamodel/2 takes a selection and folds "the stream as it stood at the end of macrostep n", but the function that shortens the list is private there and what it returns is Markdown rather than entries. So the prefix is taken here, by the rule that read documents: every message the envelope stamps with no macrostep, plus every message stamped at or below the selected one. On :live there is no cut at all.

Tiers 2 and 3 are not the document's datamodel

Only :data and :runtime entries are kept - a <data> element the chart declares, and a location a run wrote that the snapshot did not name. The system variables and the provider functions the explorer also lists are real, and they are not what a block's declared environment is about: a row reading "declared string, held #Function<...>" would be noise beside every path an author actually declared.

Summary

Types

t()

Display text for each datamodel path the run is holding a value at.

Functions

The values state's run holds at its selection, keyed by dotted path.

Types

t()

@type t() :: %{optional(String.t()) => String.t()}

Display text for each datamodel path the run is holding a value at.

Functions

at(state)

@spec at(map()) :: t()

The values state's run holds at its selection, keyed by dotted path.

state is statifier-ui's StatifierUI.Live.State - anything carrying its public messages and selection fields.

%{} rather than an error for every gap: a tree with no resolvable explorer, a stream the fold refuses (more than one session on one timeline), and a run that has written nothing yet all mean the same thing to the caller, which is that there is no held value to draw beside a declared type.