Repository navigation
trace: #traces notebook surface — Obj::Traces, tr[i], #trace/#lin/#project (#63) - #72
Merged
Merged
Conversation
Phase 6 — the user-facing trace toolkit.
- `#traces <p> [bound=N] -> tr` enumerates the trace-set, renders the indexed
list, and binds `Obj::Traces { traces, truncated }`.
- `tr[i]` addressing via `parse_index`/`resolve_trace`.
- Single-trace verbs on a handle:
- `#trace tr[i]` — the trace's partial order (dir_trace now branches an
LTS-sample vs a trace handle); `#lin tr[i]` — its linearizations;
`#project tr[i] <a,b>` — one agent's view (via the new Trace::project).
- Obj::Traces arms added to the Rune bridge (script.rs) and inspector
(service.rs); `#help` updated.
Adds `Trace::project` in stratum-lts (keep events on given channels, induced
causal order) with a unit test.
Tests: `#traces` binds + lists; `tr[0]` selects and renders (∥ for the
diamond); `#lin` counts linearizations; `#project a` restricts to one event;
out-of-range / unknown-handle errors are clean.
Refs #63
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Address review items: - #project with no channels now errors with a usage message instead of silently yielding an empty trace. - Add examples/traces.ipynb — a short worked notebook (diamond → one trace, #trace / #lin / #project, then a race → two traces), satisfying the #63 acceptance criterion without touching the unrelated WIP example notebooks. Refs #63 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Phase 6 — the user-facing surface for the trace toolkit. Builds on #59–#62.
What
crates/stratum-notebook/src/{eval,lib,script,service}.rs:#traces <p> [bound=N] -> tr— enumerates the trace-set (stratum::lts::traces), renders the indexed list (render_traces), binds a newObj::Traces { traces, truncated }.tr[i]addressing —parse_index+resolve_traceresolve aname[i]handle against a#tracesbinding, with clean out-of-range / wrong-kind / unknown-name errors.#trace tr[i]— the trace's partial order viarender_trace(dir_tracenow branches: an LTS name → sample run as before; aname[i]handle → trace detail).#lin tr[i]— its linearizations, as label words.#project tr[i] <a,b>— one agent's view (the events on those channels, induced order).Obj::Tracesarms added to the Rune bridge (script.rs→ its size) and the inspector (service.rs);#helpgains the four lines.Supporting change in
stratum-ltsTrace::project(keep)— keep the events satisfyingkeepunder the induced causal order (a ≤ bin the projection iffa ≤ bin the original). Unit-tested.Tests (acceptance)
Directive-level integration tests:
#tracesbinds + lists (Obj::Traces);tr[0]selects and renders (diamond shows∥);#linreports 2 linearizations;#project arestricts to one event; out-of-range index and unknown handle both error cleanly (the eval never-panic contract).fmt / clippy
-D warnings/cargo test --workspacegreen locally.Closes #63