All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Entries for unreleased work are not written here directly. Each issue drops a
fragment in changelog.d/; the fragments are assembled
into a version section at release. See that README for the format and for when a
change warrants an entry at all.
0.1.0 2026-08-27
First release: the authoring layer above the
statifier statechart engine. A block
document is the source of truth - a tree of typed blocks, each with a declared
shape - and it compiles one way to SCXML plus a provenance map that points a
runtime position back at the block that produced it. Block types are
host-pluggable: a host registers the types its own domain needs, and the
compiler and the editor work off that registry rather than a closed built-in
vocabulary. The core.* structural vocabulary, the compiler, the edit algebra,
and the LiveView editor shell all ship here.
The Changed entries below describe the shape of callbacks and metadata as
they stand at this first release; there is no earlier published version to have
changed from.
Added
StatifierBlocks.Document.validate/1checks a block document's structure: schema version, envelope shape, per-block shape, and document-wide id uniqueness.StatifierBlocks.Document.to_json/1encodes a document to ADR-0001's deterministic canonical JSON: sorted object keys, no insignificant whitespace, emptyslots/config/metadataomitted, no floats.StatifierBlocks.Document.content_hash/1returns a"sha256:" <> hexdocument identity overto_json/1's canonical bytes.StatifierBlocks.Document.from_json/1decodes canonical JSON back into a document, structurally and registry-free: unknown block types decode successfully, and every refusal is one of ADR-0001's typed error arms.StatifierBlocks.BlockTypebehaviour: the nine-callback authoring-time extension seam (ADR-0002), five required (slots/1,config_schema/1,validate_config/1,current_version/0,emit/2) and four optional (io/1,migrate_config/2,fixtures/0,palette_entry/0).StatifierBlocks.Palette: a caller-suppliedtype_name => modulevalue (ADR-0002 decision 2), withnew/1to build one and a totalfetch/2that returns{:ok, module}or{:error, {:unknown_block_type, type_name}}and never raises (ADR-0002 decision 3).StatifierBlocks.Palette.resolve/2: resolves a block through the palette and migrates its config in memory when the storedtype_versionis below the type'scurrent_version/0(ADR-0002 decision 8). Migration is applied to the returned struct only and never written back to a document; a stored version abovecurrent_version/0hard-errors as{:error, {:block_type_too_new, id, version}}rather than reading best-effort, and a failing or missingmigrate_config/2surfaces as{:error, {:migration_failed, id, reason}}.- The
core.*structural block types (ADR-0002 decision 10), oneStatifierBlocks.BlockTypemodule each:StatifierBlocks.Core.Sequence,.Group,.Branch,.Parallel,.Wait,.ResumableGroupand.OnEvent.core.branchderives one slot and one:expressionfield per declared arm,core.parallelone slot per declared lane, and each type is the authority on its own config throughvalidate_config/1. StatifierBlocks.Palette.core/0andStatifierBlocks.Palette.core_types/0: the core vocabulary as a palette, and as the plaintype_name => modulemap a host merges its own entries into.- Structural placement through ADR-0003 decision 3 kind tags:
core.on_eventdeclareskinds: [:interrupt_handler]and the group types accept only that kind in theirinterruptsslot, so an interrupt handler is admitted there and refused everywhere else, and an ordinary step is refused there - in both directions, from the declarations alone, with no special-cased rule. fixtures/0oncore.branch(an arm condition evaluated against two datasets) andcore.on_event(one example event payload). The bundle shape follows an amendment to ADR-0002 decision 9 that is not yet accepted, and is documented as provisional until it is.StatifierBlocks.Assignability: the one decision function for whether a block may land in a slot, checking structural admission by kind tag and data-flow compatibility by type-expression identity plus an optional host-supplied widening relation (ADR-0003).check/5decides a single candidate position;valid_targets/4lists every position a candidate may occupy in a document;validate/3reports every finding already present in a document;inbound_type/4andassignable?/3are the two primitives both are built from.StatifierBlocks.Assignability.Relation: the behaviour a host implements to widen data-flow compatibility beyond exact type-expression identity. A host module can only grow the accepted set, never shrink it.StatifierBlocks.Palettegains anassignabilityfield naming the host'sAssignability.Relationmodule, set viaPalette.new(types, assignability: MyApp.Blocks.Types). Defaults tonil, meaning no widening relation is declared; existing calls toPalette.new/1are unaffected.StatifierBlocks.Compiler: the one-way compile (ADR-0004 decisions 1-4, 6-7).compile/3is a total function of{document, palette}returning{:ok, %StatifierBlocks.Compiled{}}or{:error, [%StatifierBlocks.Compiler.Finding{}]}- no process state, no clock, no IO, and no arm that raises. The pipeline runs Document, Resolve, Config and Emit, stopping at the first stage that produces errors and reporting every error from that stage.StatifierBlocks.Emission: the structural representation of one SCXML subtree a block type returns fromemit/2, withelement/3and thechild_ref/1placeholder the compiler splices its children into.StatifierBlocks.Compiler.Serializer: the deterministic serializer. Attributes sorted, one canonical empty-element form, no incidental whitespace at all. It is identity-bearing code - chart identity hashes source bytes (st-ADR-0052) - andserializer_test.exsnow enforces the whitespace sensitivity ADR-0004 decision 6 named and left unenforced.StatifierBlocks.Compiler.StateId:state_id/1,state_id/2,unstate_id/1anddone_event/1. State ids derive from block ids ("s_" <> block_id,"__" <> rolefor an auxiliary state), so they are unique, invertible and total over generated states.StatifierBlocks.Compiler.Context: what a block type is entitled to know while emitting - its own ids, the document id, its children's summaries (block id, state id, done event) and the role-minting function. No palette, and no child's emitted SCXML.StatifierBlocks.CompiledandStatifierBlocks.CompilationRecord: the artifact, and the join between document identity and chart identity.chart_namecarries the document id andchart_versionstaysnil, so a revision bump or a metadata-only edit still matches the identity a running session holds.StatifierBlocks.Core.Emit: the SCXML shapes thecore.*vocabulary compiles to, and the builders a host block type follows to compose with them.StatifierBlocks.Provenance: the map from generated SCXML back to the blocks that produced it (ADR-0004 decision 5). Keyed by state id for highlighting a running session's configuration, and by byte span for routing findings that carry no element reference.owner_at/2,owner_of_state/2,owners_of_states/2, and canonicalto_json/1/from_json/1so a host can store the map beside the chart.StatifierBlocks.Compilednow carries all five of ADR-0004 decision 1's fields:provenance,invoke_typesandwarningsjoinscxmlandrecord.invoke_typespublishes the sorted set of invoke types the chart emits, unconditionally, so a host can compare it against itsStatifier.Sessionregistration at deploy time (ADR-0004 decision 8).Compiler.compile/3accepts:known_invoke_types, an opt-in lint that warns - never errors - for every emitted invoke type absent from the set the caller believes will be registered.Compiler.compile/3accepts:entry_type, ADR-0003 decision 4's caller-supplied context, which the new Structure stage passes toStatifierBlocks.Assignability.validate/3.- The compiler now runs a Structure stage (assignability) and a Chart stage (statifier's own pipeline over the generated bytes), and maps every upstream finding back to the block that caused it.
StatifierBlocks.Emission.attributed_to/2,from_config/2andattribute_from_config/3: the hints a block type leaves so a finding lands on the block an author would recognise, and on the config field they typed into.StatifierBlocks.Edit: the editor's command algebra - insert, remove, move, and update-config - as a purely structural, invertible rewrite over a document with no palette involved (ADR-0005).apply/2applies one command and returns both the new document and the command that undoes it;check_config/3is the separate config-validity gate one layer up.StatifierBlocks.Edit.History: undo and redo overEditcommands.commit/4is the one funnel a host calls - it runsEdit.check_config/3beforeEdit.apply/2, then pushes the inverse and clears the redo stack, so invalid config never reaches the document on any path, undo and redo included.StatifierBlocks.Edit.Targets:droppable_slots/3anddroppable_slots_for/3, which slots would accept a dragged block, at slot granularity rather than gap granularity, built as a reduction ofStatifierBlocks.Assignability.valid_targets/4.StatifierBlocks.Finding: the presentation finding ADR-0005 specifies, anchored to a block, a slot, or a config field so the editor knows where to render it. Distinct from the existingStatifierBlocks.Compiler.Finding, which serves the compile pipeline.StatifierBlocks.ViewModel: the structure the editor actually renders, derived from a document, a palette, and a list of findings. Resolves and normalizes every block's slots, form fields, and palette presentation metadata, and routes every finding to the position that renders it.StatifierBlocks.Editor: the LiveView editor shell (ADR-0005). ALiveComponenta host embeds over a%Document{}and a%Palette{}; it is the only stateful module in the package's rendered half, and everything it does is translate aphx-event into one ofStatifierBlocks.Edit's four commands. Drag is two round-trips - one atdragstartto enumerate valid slots, one atdrop- with zero per hover, because validity reaches the client asdata-dropmarkup rather than as client-side logic.StatifierBlocks.Editor.Canvas,.BlockNode,.Slot,.ConfigForm,.Field,.PaletteBrowser,.Findings: the function components the shell renders, each independently renderable in a test.BlockNodeandSlotrecurse into each other, and there is no per-block-type component: a block type'slayoutandslot_stylepresentation metadata is the only thing that distinguishes a group from a set of lanes.assets/js/statifier_blocks.js: the package's entire client-side surface, one hook namedStatifierBlocksDrag, shipped as source. A host adds"statifier_blocks": "file:../deps/statifier_blocks"to itsassets/package.jsonand imports the hook inapp.js; this repository bundles nothing and has no Node toolchain.assets/css/statifier_blocks.css: one stylesheet of structural CSS and no visual opinion beyond it. Every class is prefixedsb-, every color, space, radius and drag treatment is a--sb-*custom property with a default, and every top-level component takes aclassattr appended to its own.- A headless CI job that resolves the dependency tree with
phoenix_live_viewabsent, compiles it with warnings as errors, and runs the non-LiveView suite- the acceptance property that makes the optional dependency's guard
trustworthy rather than decorative.
STATIFIER_BLOCKS_HEADLESS=1reproduces it locally without disturbing the ordinary build.
- the acceptance property that makes the optional dependency's guard
trustworthy rather than decorative.
StatifierBlocks.BlockType: a config field declaration may now carry an optionalvalue_path, a list of keys and list indexes from the config root down to the value it edits (ADR-0002 decision 7, amended 2026-08-27). A declaration without one behaves exactly as before - itskeyaddressesconfig[key]. Thekeyremains the field's identity in both cases: the DOM id, the form param name, and what a{:config, block_id, key}finding anchors to.StatifierBlocks.BlockType.value_path/1,fetch_value/2andput_value/3: the reader and writer that resolve a declaration to a path and then read or write through it.value_path/1answers[key]for a declaration that declares none, so a caller never branches on which case it has.fetch_value/2is total and answers:errorfor a path that does not resolve.put_value/3writes the last segment whether or not a value was already there - an arm with no condition yet is exactly the one an author is about to type into - but never invents an intermediate map or list a block type did not write.StatifierBlocks.ViewModel.Fieldcarriesvalue_path, andViewModel.Field.value_path/1reads it with the same[key]default.
Changed
StatifierBlocks.BlockType.io/1's return type isStatifierBlocks.Assignability.io/0instead ofterm(). Every core block type already returns a value of this shape; a custom block type implementingio/1should confirm its return value conforms.- All seven
core.*block types implementemit/2for real; the{:error, {:not_implemented, block_id}}placeholder andStatifierBlocks.Core.Config.emit_deferred/1are gone. StatifierBlocks.BlockType.emit/2is narrowed from(Block.t(), term()) :: {:ok, term()} | {:error, term()}to(Block.t(), StatifierBlocks.Compiler.Context.t()) :: {:ok, StatifierBlocks.Emission.t()} | {:error, StatifierBlocks.BlockType.emit_error()}. A host block type that was returning something else now has a type to conform to.StatifierBlocks.Compiler.Findinggainspath,severity,faultandcode.faultis:authorwhen a document edit fixes the finding and:packagewhen it is a bug in this package or a host's block type - which is what lets an editor say "this cannot be fixed here" rather than blaming the author for a generated state id.- Findings from every stage come back in document order over blocks rather than in the order a stage happened to collect them.
- A bad
:expressionconfig field now surfaces as an:authorfinding naming the arm's config key, rather than as an unrouted upstream error. StatifierBlocks.BlockType.palette_entry/0's return type isStatifierBlocks.BlockType.palette_entry/0instead ofmap(). Every core block type already returns a value of this shape; a custom block type implementingpalette_entry/0should confirm its return value conforms.phoenix_live_viewis a declared optional dependency at~> 1.0, matching statifier_ui's floor. Every module underStatifierBlocks.Editor.*is compiled behindCode.ensure_loaded?(Phoenix.LiveView), and no module outside that namespace references Phoenix - so a host that only compiles documents adds no Phoenix dependency and compiles no editor code.- The hex package's
files:list includesassets. The hook and the stylesheet ship as source, and source that is not in the tarball is not public API. - Every illustrative example in the package - ADR worked examples, doc examples, and the shipped fixture bundles - uses one of the family's two canonical example domains: credit-card authorization and capture, or a signup wizard with A/B testing.
StatifierBlocks.Core.Branch.fixtures/0ships budget-decision datasets ("approved"/"declined") and the expression"budget_remaining > amount". A host rendering the bundle in a palette panel sees those names.- The arm-slot and lane-name validation messages on
core.branchandcore.parallelname"arm_approved"and"capture"as their exemplars.
Fixed
- A
core.brancharm's condition is now readable and editable in the editor.Core.Branch.config_schema/1keys one:expressionfield per arm by the arm's slot name, but the condition is stored atconfig["arms"][i]["cond"]; the form previously read and wrote the slot name as a top-level config key, so every branch condition rendered empty, no edit to one reached the arm, and a junkconfig["arm_approved"]accumulated beside it. Each per-arm field now declaresvalue_path: ["arms", i, "cond"], andStatifierBlocks.ViewModelandStatifierBlocks.Editor.ConfigFormread and write through it.iis the arm's index in the stored list rather than its index among the well-formed ones, so a good arm below a malformed one still addresses its own condition while an author is mid-edit. StatifierBlocks.Editor'sfield-list-addandfield-list-removeevents read and write the rows through the field'svalue_pathas well, rather than through the top-level key. A key naming no field in the selected block's schema now edits nothing, matching the guardConfigForm.decode/3already applied.StatifierBlocks.Assignability.check/5andvalid_targets/4no longer raise aMatchErrorwhen the candidate is the document root.Document.fetch_path/2answers{:ok, []}for the root, and the vacated-seam check now reads that as what it is - the root occupies no slot, so it leaves no seam behind - instead of callingList.last/1on the empty path.StatifierBlocks.Edit.Targets.droppable_slots/3answers[]for the root rather than crashing, so a caller no longer has to guard around it.