Skip to content

Adds the datamodel explorer pane - #32

Merged
johnnyt merged 4 commits into
mainfrom
sui-t36.7-datamodel-explorer
Aug 22, 2026
Merged

Adds the datamodel explorer pane#32
johnnyt merged 4 commits into
mainfrom
sui-t36.7-datamodel-explorer

Conversation

@johnnyt

@johnnyt johnnyt commented Aug 22, 2026

Copy link
Copy Markdown
Member

Why

The Livebook inspector (sui-t36) needs a pane that answers "what is in the
datamodel, and what just changed" - both while authoring against fixtures
and while observing a live session. Everything it consumes is already on the
wire: session.datamodel arrived with the statifier/predicator 9.0 refresh
(sui-bpb) and effect.datamodel_change serialization landed in sui-h92.

What

One pane, two constructors over a shared entry shape:

  • DatamodelExplorer.Scope builds the mode-independent tiers from a
    compiled Machine: document <data id> declarations, the four spec 5.10.1
    system variables from Statifier.Evaluator.SystemVariables, and the
    provider functions in scope (name/arity), each with an inferred type label.
  • build_authoring/3 merges one fixture scenario onto those tiers.
  • build_live/2 folds a subscribed session's session.datamodel snapshot
    and effect.datamodel_change writes in producer-stamped order, decoding
    wire values at ingestion, and marks entries changed at the latest
    macrostep.
  • DatamodelExplorer.Markdown.render/2 renders the pane as Markdown for
    Kino.Markdown; no Kino call sites in lib/ (sui-t36.8 wraps).

Read-only in this milestone: live datamodel editing waits for a
recordable-channel design, and the send/write correlation question belongs
to sui-t36.8.

Notes

  • Full mix quality green locally: 411/411 tests, 93.2% coverage, Format,
    Compile, Credo, Dialyzer, Doctor, Dependencies all clean (Gettext and
    Sobelow permanently not applicable).
  • Research and plan documents are included under docs/research/ and
    docs/plans/ (260822-sui-t36.7-*).
  • Change marking is macrostep-granular because effect.datamodel_change
    carries no round in its envelope; an absent new_value reads as a write
    to :undefined and counts as a change.
  • A pre-existing timing-sensitive test in trace/subscriber_test.exs
    (untouched here) flaked once under parallel load and passed on rerun.

Closes sui-t36.7

Builds the mode-independent tiers from a compiled Machine: data
declarations, system variables, and provider functions in scope, each
carrying an inferred type label. Read-only, no Kino reference.

Refs: sui-t36.7
Merges a fixture scenario onto Scope's tiers: a scenario value
promotes a matching tier-1 entry, and unmatched keys land as a new
scenario-tier entry. Introduces the pane struct build_authoring/3
constructs, plus entries/1, entries/2, and diagnostics/1.

Refs: sui-t36.7
Folds a subscribed session's session.datamodel snapshot and
effect.datamodel_change writes into the same entry shape as authoring
mode, decoding at ingestion, applying writes in stamped order, and
marking entries changed at the latest macrostep.

Refs: sui-t36.7
Renders a pane's entries as one Markdown table per tier, marking
changed entries and naming the mode, scenario or session. Proves the
live fold against a real session with an assign, and adds the
changelog fragment for the bead.

Refs: sui-t36.7
@johnnyt
johnnyt merged commit c342a62 into main Aug 22, 2026
1 check passed
@johnnyt
johnnyt deleted the sui-t36.7-datamodel-explorer branch August 22, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant