StatifierBlocks.Compiled (StatifierBlocks v0.1.0)

Copy Markdown View Source

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

Nothing in here is written back into the document. ADR-0001 decision 2 forbade storing derived data in the document and named the provenance map specifically. A host stores this artifact beside the document or recomputes it - both are correct, and decision 6's determinism is what makes them equivalent.

Decision 1's five fields, and what each is for:

  • scxml - the generated bytes. Chart identity hashes exactly these (st-ADR-0052), so they are identity-bearing and the serializer that wrote them is identity-bearing code.
  • provenance - StatifierBlocks.Provenance, keyed by state id for runtime highlighting and by byte span for routing findings back to the block that caused them (decision 5).
  • record - StatifierBlocks.CompilationRecord, the join between document identity and chart identity (decision 7). Given a running session, look up by chart_identity and get the document, the revision, and the map.
  • invoke_types - the sorted set of invoke type strings appearing in the generated SCXML (decision 8). Published unconditionally, because it is a fact about the compile and nothing else. The real fix for the two-registry gap is the host comparing this against its st-ADR-0051 registration at deploy time, when it knows both; this field is what makes that a one-liner.
  • warnings - findings that did not fail the compile: upstream's own warnings (st-ADR-0033) mapped through provenance, and decision 8's optional invoke-type lint when the caller asked for it.

Summary

Types

t()

@type t() :: %StatifierBlocks.Compiled{
  invoke_types: [String.t()],
  provenance: StatifierBlocks.Provenance.t(),
  record: StatifierBlocks.CompilationRecord.t(),
  scxml: binary(),
  warnings: [StatifierBlocks.Compiler.Finding.t()]
}