Adds the datamodel explorer pane - #32
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.datamodelarrived with the statifier/predicator 9.0 refresh(sui-bpb) and
effect.datamodel_changeserialization landed in sui-h92.What
One pane, two constructors over a shared entry shape:
DatamodelExplorer.Scopebuilds the mode-independent tiers from acompiled Machine: document
<data id>declarations, the four spec 5.10.1system variables from
Statifier.Evaluator.SystemVariables, and theprovider functions in scope (name/arity), each with an inferred type label.
build_authoring/3merges one fixture scenario onto those tiers.build_live/2folds a subscribed session'ssession.datamodelsnapshotand
effect.datamodel_changewrites in producer-stamped order, decodingwire values at ingestion, and marks entries changed at the latest
macrostep.
DatamodelExplorer.Markdown.render/2renders the pane as Markdown forKino.Markdown; noKinocall sites inlib/(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
mix qualitygreen locally: 411/411 tests, 93.2% coverage, Format,Compile, Credo, Dialyzer, Doctor, Dependencies all clean (Gettext and
Sobelow permanently not applicable).
docs/research/anddocs/plans/(260822-sui-t36.7-*).effect.datamodel_changecarries no round in its envelope; an absent
new_valuereads as a writeto
:undefinedand counts as a change.trace/subscriber_test.exs(untouched here) flaked once under parallel load and passed on rerun.
Closes sui-t36.7