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.2.0 2026-08-29
The editor ships. Campaign 014 graduated the authoring spike into the
package: StatifierBlocks.Editor renders from assets/ with a documented
--sb-* theming surface, a drag marks the slots that accept a block and can
say why a slot refused, and a host registers its own block types through
Palette.from_modules/2. The core.* vocabulary grows by core.invoke,
core.raise, core.assign and core.send; the compiler now evaluates
predicator conditions, refuses slot-arity and undeclared-slot violations, and
adapts its findings into the shape the editor renders.
Dependency floor: statifier ~> 2.2 (was ~> 2.0); predicator ~> 9.0 is
now a direct dependency.
Added
core.raiseraises an event for an enclosing group's interrupt rules.core.assignwrites a literal to a datamodel path.docs/theming.md: the theming guide - the three tiers of the--sb-*surface, the scheme token, per-block-type accents, and a complete host theme that sets custom properties and nothing else.core.sendsends an event, now or after a delay.- A block type may declare
slot_outcome_keyin its palette entry, naming the config key the blocks in one of its slots carry their outcome under, so a renderer can route an interrupt rule's escape without branching on a type name; the declaration reaches the view model asSlot.outcome_keyand the resolved value asNode.outcome. StatifierBlocks.BlockType.slot_outcome_key/2andStatifierBlocks.BlockType.outcome_name/2read that declaration totally: a malformed declaration or value is refused rather than repaired, and reads as no declared outcome.- A block type may declare
accent_token, the NAME of a--sb-*property, and the editor stamps it on that type's cards and palette rows. Two rules in the stylesheet read it; no rule and no module names a block type (ADR-0005 amendment 14d, consumption side). StatifierBlocks.Finding.severity_class/1, and:infoas a third severity for advisory findings (decision 11, amended 2026-08-29). Nothing emits one yet; only:lintmay.- A form whose config the gate has not accepted names the fields that are outstanding, says why nothing is stored, and offers "Discard edits". A draft was never a command, so it cannot be undone - it can only be thrown away, and that gesture had nowhere to live.
:expressionand:durationcontrols carry a placeholder. A bare:stringstill carries none: there is nothing a type that wide can suggest.- A theme audit test over the stylesheet, failing in both directions: a
var(--sb-*)with no declaration, and a declared token no rule reads (14e). StatifierBlocks.SlotValidation, a palette-aware whole-document check for a block's declared slots (:undeclared_slot) and each declared slot's arity (:slot_arity_violated).StatifierBlocks.Predicatesevaluates a condition expression against a binding context through predicator, returning a boolean or a tagged error.StatifierBlocks.Predicates.TruthTablebuilds a checked truth table over fixture rows, applying first-match-wins arm ordering.StatifierBlocks.Finding.from_compiler/2andfrom_compiler_all/2adapt a compiler finding into the presentation shape the editor renders, so a host can route compile findings throughViewModel.build/3.StatifierBlocks.Assignability.seam_reason/4,finding_reason/2andseam_reasons/3name why a data-flow seam came out the way it did::not_assignableand{:fixable_by, block_id}for a refusal, and:source_untyped/:target_untyped/:both_untypedfor a seam that passed only because a block declared no type.seam_reasons/3is how a host finds the parts of its palette it has not typed yet.StatifierBlocks.Assignability.target_verdicts/4returns every positionvalid_targets/4enumerates with its full verdict, andStatifierBlocks.Edit.Targets.slot_verdicts/3projects those to slots - the accepting ones and the reason each refusing one gives.- The editor stamps a refused slot's reason as
data-drop-reasonbesidedata-drop, so a hover affordance can explain a refusal with no round-trip and no JavaScript. - A
core.invokeblock type: it names an invoke type for the host to run, sends datamodel values along as<param>s, writes the result where itsassign_tonames, and takes an optionalon_errorsubtree entered on a permanent invoke failure. StatifierBlocks.Compiler.Context.outcome_id/2andoutcome_event/2, for a block type with more than one way to finish: one<final>per outcome, and thedone.outcome.<state id>.<outcome>event a parent wires on.StatifierBlocks.Palette.from_modules/2, the registration API a host uses to contribute its own block types: an ordered, explicit list of{type_name, module}registrations, withcore: trueto sit on top of thecore.*vocabulary. Later entries win. It is still a value - no global registry, no application-configuration lookup, and no discovery pass.- A palette entry may declare
badge, a short chip for the card header, andjoin_label, a one-argument function of the block's config phrasing the join marker under a side-by-side arrangement (ADR-0002 amendment B).StatifierBlocks.BlockType.badge/1andjoin_label/2read them. - Both readers are total and refuse rather than repair: a chip that is
blank, carries a newline or tab, or runs past 24 characters is dropped,
not clipped, and a
join_labelthat raises degrades to the editor's own word rather than taking the canvas down. accent_token,badgeandjoin_labelare admitted keys ofStatifierBlocks.BlockType.palette_entry/0.- The README carries a worked host example - a
myapp.risk_holdblock type registered beside the core vocabulary, with a badge and an accent token - and it is executed on every build rather than trusted.
Changed
Compiler.compiler_version/0(and every compilation record'scompiler_version) moves to0.2.0with the package, per ADR-0004 decision 6: a record compiled by 0.1.0 identifies itself as such.--sb-drop-ok-bordermoves from#2f9e5fto#2c945a. The outline that says a slot accepts a drop was 2.93:1 on the sunken surface, under the 3:1 a mark carrying information is held to; the tint follows it.predicatoris now a direct dependency (~> 9.0), becauseStatifierBlocks.Core.DurationcallsPredicator.Duration.parse/1. It already resolved transitively throughstatifier, so the resolved version does not move; naming it records the call.- The editor's stylesheet carries a scoped reset, and every selector in it
matches the container through
:where(.sb-editor)so a component rule always wins (ADR-0005 amendment 14b). --sb-color-schemeis declared and read ascolor-schemeon the editor's own container, so the parts of a control the browser paints - a<select>'s drop-down, the scrollbars, the caret - follow the theme (14a).- The
--sb-*surface gains the space, type and shape scales, a third text step, a strong border, status tints, the drag seam's drag-time height, and the canvas sizing constants that were literals in rules. - A
:secondaryand a:failureslot are both placed as attached rails, and a container declaring either is drawn as a boundary box - the rail partition, not the:secondarypartition (amendments 10c and 10h). --sb-drop-no-opacityis retired. A drag now marks the slots that accept the block and leaves the rest alone rather than dimming them; the disabled-control opacity it doubled as is--sb-disabled-opacity.- The compiler now refuses a document whose slots violate their declared arity or name a slot the block type does not declare, instead of silently dropping those children from the emission.
- Reasons change no verdict:
:unknownstays permissive in both positions,Assignability.validate/3reports exactly the findings it did before, and neither finding tuple gained a field. slot_styleadmits a third value,:failure, for a slot whose children are an in-band continuation taken on a bad outcome;core.invokedeclares it foron_error.- The role namespace beginning
o_is reserved for outcome finals;Context.role_id/2now refuses such a role with a:reserved_rolefinding.
Fixed
- The editor's root rule sets
font-familyrather than thefontshorthand, so--sb-fontreaches the editor.font: <family-list>is not a valid shorthand, so the whole declaration was dropped and the editor's text did not inherit the host page's font as the token promised.
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.