Adds the event log pane for the inspector - #29
Merged
Conversation
StatifierUI.EventLog.build/1 groups a session's trace messages into macrosteps and rounds keyed by their own (macrostep, round) stamps, never arrival order. Rounds bucket by round then order internally by (microstep, seq); exit and entry sequences keep the engine's own emission order per ADR-0011. effect.budget_exhausted attaches to its round since it is the one core effect that carries one; every other effect.* attaches to its macrostep. A mixed-session list is refused rather than merged onto one timeline. Adds StatifierUI.EventLog.Round and StatifierUI.EventLog.Macrostep as the structs the fold produces. No Kino reference and no rendering yet; labels and Markdown output land in later phases of this bead. Refs: sui-t36.5
StatifierUI.EventLog.Labels turns the wire format's state, transition, content, and data indexes into human strings, reading only the tables session.start already carries. origin/2 and owner/2 dispatch on the "kind" key over the eight origin shapes and five owner shapes, delegating to the four index resolvers; an unrecognized kind renders its own name rather than raising, matching the format's additive-field rule. from_log/1 finds the first session.start on a log and builds from its manifest; with none, empty/0 renders every index as a bare "#n" for the late-attach case. No Kino reference. Refs: sui-t36.5
StatifierUI.EventLog.Markdown.render/2 turns the log model into a string a host hands to Kino.Markdown.new/1: one collapsible block per macrostep (summary, round count, quiescence state), one table row per round (event, selected transitions, exit/entry sets in the engine's own order per ADR-0011), a raised-cause note where the dequeue's event was raised by the platform, a budget note where a round blew ADR-0019's round budget, and the macrostep's round-less effects listed last under their own heading. collapsible: false swaps <details> blocks for plain headings; :open controls which macrosteps start expanded. No manifest degrades every index to a bare "#n" instead of crashing. Adds the changelog fragment for the whole bead. No Kino reference in code, only in moduledoc prose. Refs: sui-t36.5
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 epic (sui-t36) needs a timeline view: the normalized
trace stream rendered as a readable log keyed by (macrostep, round), one row
per dequeued event with its selected transitions, exit/entry sets, and
raised-cause metadata, collapsible per macrostep. Ordering comes entirely
from the stamps, never arrival order - this is the UI the counters were
designed for (statifier ADR-0020).
What
Three pure modules, no Kino reference (the sui-t36.8 assembly bead owns the
widget wrapper, matching how StatifierUI.Diagram satisfies ADR-0004):
StatifierUI.EventLog- a fold from[%Trace.Message{}]intomacrostep -> round buckets (
Macrostep/Roundstructs). Buckets order by(macrostep, round); messages inside a bucket by {microstep, seq}. Routing
is by round-presence rather than type prefix, so
effect.budget_exhausted(which carries a round) lands in its round while the other
effect.*types sit at macrostep level.
build/1refuses mixed-session input with{:error, {:mixed_sessions, ids}}rather than merging timelines.StatifierUI.EventLog.Labels- resolves state/t_index/c_index/d_indexreferences through the
session.startmanifest already on the stream.StatifierUI.EventLog.Markdown- collapsible per-macrostep Markdownrendering, with a
collapsible: falsefallback in case<details>doesnot collapse inside a rendered Markdown cell.
Exit/entry sequences are never re-sorted (ADR-0011).
Notes
trace.*messages, which already carry
roundon main;effect.datamodel_change(Serializes datamodel_change as a wire type #27) feeds the datamodel explorer (sui-t36.7), not this pane. Not stacked.
effect.*types stays out of scope:docs/wire-format.md (lines 63 and 856) currently names sui-t36.5 as its
owner, but that is a wire-format extension beyond this bead's spec and
needs its own bead; the round-presence routing here makes it a zero-code
change for this pane when it lands.
mix qualityandmix gate.verifygreen after every phase andafter rebase - 307/307 tests, 93.7% coverage; Gettext/Sobelow are the two
permanent not-applicable skips. The known sui-hmm flake did not fire.
docs/plans/260822-sui-t36.5-event-log-pane.md, chiefly whether
<details>collapses inside a rendered Markdown cell.
Closes sui-t36.5