API Reference StatifierBlocks v#0.36.0

Copy Markdown View Source

Modules

Resolves the line-number citations this repository's documents make into the decision records, and reports the ones that no longer point at the text they were written against.

Block document model, one-way SCXML compiler, and LiveView editor components for composing Statifier statecharts from typed blocks.

May this block land in this slot? Answered by two independent gates - structural admission by kind tag (ADR-0003 decision 3, untouched), and data flow by the environment at the position, checked with the datamodel document's own read check plus the palette's host relation last (ADR-0011).

A host's widening relation. Consulted only after identity has failed, so an implementation can only widen, never narrow (ADR-0003 decision 6).

One node of a block document (ADR-0001).

The authoring-time extension seam. A host implements this behaviour once per palette entry; the core.* structural vocabulary this package will ship itself lands in a later record (ADR-0002 decision 10) and is not present yet.

The join between a block document and the chart it compiled to (ADR-0004 decision 7).

What one successful compile produced (ADR-0004 decision 1).

The one-way compile: a block document plus a palette in, one artifact out (ADR-0004 decisions 1-4, 6-7).

Resolves each element of one block's emission to the block an author would recognise (ADR-0004 decision 5).

The scope-shaped cancel: a delayed send armed by a child block is cancelled in the <onexit> of the state that armed it (ADR-0004's 2026-08-29 amendment, "a delayed send's cancel, emitted in the arming state's <onexit>").

The Chart stage: run the generated SCXML through statifier's own pipeline and route every finding back to a block (ADR-0004 decisions 9 and 10).

What a block type is entitled to know while emitting, and nothing more (ADR-0004 decision 4).

How a block type contributes a compiler-declared <data> root to the chart's one top-level <datamodel> (ADR-0004's 2026-08-29 foreach amendment, F2 and F3), and the collision refusal F6 records.

One thing the compiler has to say about one block (ADR-0004 decision 10).

The group-scoped interrupt pair: a <raise> of the interrupt protocol emitted inside a group's rail is rewritten to that group's own salted event name (ADR-0010 decision 8).

The two-registry gap, surfaced as data and linted only on request (ADR-0004 decision 8).

The direct self-reference refusal: a document may not run itself (ADR-0004's 2026-08-29 amendment on what core.subchart's src resolves against).

The secrets rule, checked against a document: a declared-sensitive datamodel path may not be read into a trace-visible position (ADR-0002, the accepted 2026-08-29 amendment "decision 7, an optional sensitive? key, and the secrets rule behind it").

Turns an StatifierBlocks.Emission tree into SCXML bytes, and records where every one of them came from (ADR-0004 decisions 5 and 6).

State ids derived from block ids by a pure function (ADR-0004 decision 3).

A block type derived from params plus a pure subtree (ADR-0002 decision 5's amendment of 2026-09-07).

The proposer half of Collapse: an arrangement an author built by hand, read back as the StatifierBlocks.Composite.Data declaration that stands for it (ADR-0005 part (iii), amended 2026-09-07, clauses 15E to 20E).

A composite whose declaration arrives as data rather than as a use block (ADR-0002's 2026-09-07 amendment).

Connector geometry: pure functions from measured rectangles to SVG path data (ADR-0005 decision 10, and the 2026-08-29 amendment to decision 7).

One connector: the vocabulary it is drawn in, and its SVG path data.

One measured rectangle, in the stage's untransformed coordinate space.

The core.* structural vocabulary: the block types this package ships itself (ADR-0002 decision 10).

core.assign: a leaf step that writes one literal to one datamodel path.

core.await: an in-flow leaf that holds until a named event arrives, with an optional deadline (ADR-0002 decision 10, the 2026-09-05 amendment).

core.branch: one slot per condition arm, plus otherwise (ADR-0002 decision 10) and undecided (ADR-0012 decision 2).

The core "deadline" recipe: one palette pick puts down the core.send and core.on_event pair that ADR-0010 decision 1 spells (ADR-0005 clause 4C).

core.drafts: the document's shelf, holding fragments an author has built but has not placed (ADR-0002's amendment of 2026-08-31, section G9).

The one duration spelling a :duration field may hold, and the attribute the engine reads.

The SCXML shapes the core.* vocabulary compiles to (ADR-0004 decisions 2-4), and the small builders the core types share.

core.foreach: a container whose body runs once per item of a datamodel list (ADR-0004's 2026-08-29 amendment, F1 through F6).

core.group: a boundary around a run of steps that interrupt rules can fire against.

core.invoke: a step that calls the host and waits for it to answer, with an optional subtree for the failure case (ADR-0002 decision 10, as amended 2026-08-29 section D).

core.map: a step that runs another chart once per item of a datamodel list, all of them at once, and waits for the whole batch (ADR-0009, accepted 2026-09-01).

core.on_event: an interrupt handler, valid inside an interrupts slot and nowhere else (ADR-0002 decision 10).

core.parallel: one slot per lane, with no ordering between the lanes (ADR-0002 decision 10).

core.placeholder: an in-flow leaf marking a gap the author has left on purpose (ADR-0002's amendment of 2026-08-31, section G10).

core.raise: a leaf that raises one event for an enclosing group's interrupt rail (ADR-0002 decision 10's amendment, section D).

core.resumable_group: a group whose config carries a history mode (ADR-0002 decision 10).

core.send: a leaf step that names an event and says when.

core.sequence: an ordered run of steps, and the conventional document root (ADR-0002 decision 10).

core.subchart: a step that runs another chart and waits for it to finish, routing on the outcome that chart finished with (ADR-0004's 2026-08-29 amendment, C1 through C3).

core.wait: a leaf whose whole meaning is its config (ADR-0002 decision 10).

The host's datamodel as the editor consumes it, and the one check it makes against it (ADR-0005 decision 11, amended 2026-08-29 as 11e-11g).

The declarations panel's arithmetic: every author gesture on the document's datamodel key, as a pure list-to-list function (ADR-0005's 2026-09-01 amendment, clauses 2g-2m).

A block document described in words: an outline of its blocks joined by the ways control passes between them, and one line of English per block and per edge (ADR-0016).

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).

One block in a StatifierBlocks.Describe outline (ADR-0016 decision 1).

The seam a host rewords a described document through (ADR-0016 decision 3).

A block document: one tree, one envelope (ADR-0001).

One root the document itself declares (ADR-0001 decision 11).

A host's own whole-document rule (ADR-0005 clauses 11p to 11t).

The :duration control's reading of the text an author typed.

The editor's command algebra. Pure, serializable, invertible - and deliberately free of any UI framework dependency, so it is tested with no editor shell present at all (ADR-0005 decision 1).

Undo and redo over StatifierBlocks.Edit.t() commands (ADR-0005 decision 3), and the one funnel every editor command actually goes through: commit/4 runs Edit.check_config/3 before Edit.apply/2, so "invalid config never reaches the document" is a property of this module, not a rule an editor shell has to remember to enforce itself.

The commit funnel: one place a gesture reaches the document, over StatifierBlocks.Edit.History.commit/4.

Drop-target enumeration (ADR-0005 decision 5): which slots would accept a dragged block, at slot granularity rather than gap granularity.

The block editor: the only stateful module in the package's rendered half (ADR-0005 decisions 6, 8, 9, 13).

One block's chrome, dispatching to its slots (ADR-0005 decisions 10, 11, 12, 13).

The tree's root and the drag hook's element (ADR-0005 decisions 7, 13, 14).

The selected block's config form (ADR-0005 decisions 9 and 13).

The drawn connectors, and the element the measurement hook rides on (ADR-0005 decision 10, and the 2026-08-29 amendment to decision 7).

The declarations panel: the document's own datamodel roots, added, edited and reordered in the drawer (ADR-0005's 2026-09-01 amendment, clauses 2i-2m; the key itself is ADR-0001 decision 11).

The full-width drawer row (ADR-0005, the 2026-08-29 shell amendment, rulings 1A and 2A).

One config field, dispatching on the closed field-type set (ADR-0005 decision 9, ADR-0002 decision 7).

The document-level findings list (ADR-0005 decision 11), rendered as the drawer's Findings tab.

The shipped default icon set, and the seam a host overrides it through (ADR-0005 decision 10's icon key, decision 14's "markup, not styling" line).

The tabbed inspector: Config, Findings, Condition, Fixtures (ADR-0005, the 2026-08-29 shell amendment, ruling 3A, and its 2026-09-05 amendment).

The grouped, searchable, filterable palette (ADR-0005 decisions 8, 10, 13).

The canvas with a run around it: statifier-ui's status and scrubber above it, its event log below, and the document's own blocks where an ops view would draw a diagram.

The marking step of the "Save as a step" gesture (ADR-0005 part (iii), amended 2026-09-07, clause 18E).

One named slot: its header, its children, its gaps, and its "+" buttons (ADR-0005 decisions 5, 6, 8, 11, 13).

The canvas toolbar (ADR-0005, the 2026-08-29 shell amendment, ruling 8A).

One SCXML subtree, structurally (ADR-0004 decision 4).

What is known at a position: a map from datamodel path to type, carried through the document by a pre-order walk (ADR-0011 decision 1).

A finding as the editor renders it: normalized for presentation, and the anchor routes it (ADR-0005 decision 11).

The publish-time check between a parent document and the children it names (ADR-0008's amendment of 2026-09-22).

Mints block and document ids: "blk_" <> uxid and "bdoc_" <> uxid, following the family's identifier convention (st-ADR-0008, as amended to drop the uxid dependency and mint inline - statifier-ex/lib/statifier/machine_state.ex:571-585).

The leaf step that names one host invoke type, as a base a host block type declares itself out of (ADR-0007 decision 2).

The state mapping between two compiled revisions of one document (ADR-0004's amendment of 2026-09-23, clauses M1 to M6).

A palette names the block types a host makes available: a map from a block's type_name to the entry implementing StatifierBlocks.BlockType for it (ADR-0002 decision 2).

Whole-document questions a host asks before it hands a document to the editor.

The evaluation seam: a condition source string plus a binding context in, {:ok, boolean()} | {:error, reason()} out, through predicator.

A table spec plus rows in, a struct with per-cell outcomes, first-match-wins selection and expectation status out.

One row/column intersection: the raw evaluation outcome, whether the column was selected? under first-match-wins, the row's declared expected answer (if any), and the derived status. See StatifierBlocks.Predicates.TruthTable's moduledoc for what each status value means.

One truth-table column: a key, a display label, and a predicator source string, or source: nil for the otherwise column.

One truth-table row: the bindings that build its context, the resulting cells (or a row-level error when the bindings themselves fail), and an optional author-facing note.

Which generated element came from which block (ADR-0004 decision 5).

The findings a host's publish step refuses a document on, from the same functions the editor and the compile run (ADR-0004's Amendment of 2026-09-22, G4).

A palette entry that puts down an arrangement rather than a block (ADR-0005 clauses 1C and 2C).

The durable statifier_blocks:subchart handler (ADR-0008): the child runs as its own persisted statifier_persistence run, and the answer is given at dispatch time rather than from a pure Statifier.Invoke.Handler.start/2.

Turns (document, palette, fixtures) into a list of per-row verdicts, by compiling the document once and driving the compiled chart once per fixture row.

One fixture row driven through the compiled chart, and what happened.

Which block's state handled a macrostep, from a trace read model and a provenance map.

A trace read model and a provenance map become the canvas's run marks.

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

Where a run is being watched from: the scrubber's four moves, and a direct pick of one macrostep.

The canonical statifier_blocks:subchart invoke handler - the runtime half of StatifierBlocks.Core.Subchart's specification.

The half of the statifier_blocks:subchart handler that is pure in both variants: turning the document id on src into a compiled child chart, or into one of the three shared refusal reasons.

The block document's JSON Schema (draft-07), shipped in this package at priv/schemas/block-document.schema.json.

The two placement facts io/1 cannot carry, and the identity every other surface asks about the shelf and the gap marker.

The shell's arrangement, as pure functions (ADR-0005, the 2026-08-29 shell amendment: rulings 1A, 2A, 3A, 7A, 8A).

ADR-0002 decision 6's two properties, checked over a whole document against a palette: declared slots are the complete set a block may carry (:undeclared_slot), and a slot's child count must satisfy the arity its type declares for it (:slot_arity_violated).

The generated SCXML as numbered lines of owned spans, for reading.

One reader's line: the spans it holds, its 1-based number, and the nesting depth it is drawn at.

One run of generated bytes with one owner, as StatifierBlocks.Provenance.owner_at/2 answers for it.

Everything the editor renders, derived from {document, palette, findings} (ADR-0005 decisions 9, 10, 11, 12, 13).

One config field, its schema and its current value (ADR-0005 decision 9).

A resolved node's config form: its fields, plus any :config finding whose key matched no field (ADR-0005 decision 11's fourth routing row).

One block, rendered: its resolved status, its presentation metadata, its slots (recursive), its form, and its own findings.

One palette section: palette entries sharing entry.group, sorted by entry.order then entry.label (ADR-0005 decision 10's grouping rule).

One named slot: declared or raw, with its children and its own findings.

Mix Tasks

Reports citations into docs/adr/ that no longer point at the text they were written against.