feat(stella-observatory): Sessions tab — session replay & inspection, prompt diff (#1511), tendencies, self-improvement residue - #1876
Draft
macanderson wants to merge 4 commits into
Draft
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
Reviewer's GuideAdds a new Sessions tab and supporting backend in stella-observatory to list and replay sessions (including tendencies and self-improvement residue), introduces a shared stella-diff crate for unified prompt diffs used by both CLI and observatory, and extends telemetry/tool leaderboards and schema tests to cover the new functionality. Sequence diagram for execution context diff and tendencies in the drawersequenceDiagram
actor User
participant UI as Browser_UI
participant OBS as Observatory_HTTP
participant DB as Observatory_db
participant CTX as context_diff
participant SESS as sessions
participant DIFF as stella_diff
participant STORE as store_db
User->>UI: Open execution drawer
UI->>OBS: GET /api/execution-journal?id
UI->>OBS: GET /api/execution-context?id
UI->>OBS: GET /api/execution-tendencies?id
OBS->>DB: execution_tendencies(id)
DB->>SESS: execution_tendencies(conn, id)
SESS->>STORE: SELECT event_type,payload FROM events
SESS-->>DB: tendencies JSON
DB-->>OBS: tendencies JSON
OBS-->>UI: tendencies JSON
User->>UI: Click "what changed" on a call
UI->>OBS: GET /api/execution-context-diff?id&turn&step&call_seq&base=prev&only=all
OBS->>DB: execution_context_diff(id, turn, step, call_seq, base, only)
DB->>CTX: payload(conn, id, turn, step, call_seq, base, only)
CTX->>STORE: step_receipt / executions / events queries
CTX->>DIFF: unified_diff(old_doc, new_doc, 3)
DIFF-->>CTX: Diff { hunks, added, removed, minimal }
CTX-->>DB: diff payload JSON
DB-->>OBS: diff payload JSON
OBS-->>UI: diff payload JSON
UI-->>User: Render unified diff hunks
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
added 4 commits
August 6, 2026 04:09
macanderson
force-pushed
the
worktree-observatory-sessions-tab
branch
from
August 6, 2026 11:10
9527423 to
8948e13
Compare
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.
What & why
stella observegets a session-first inspection surface: a Sessions tab listing every session of the workspace (the~/.stella/sessions/registry — with the read-time pid-liveness crash downgrade — merged with per-session store rollups), drilling session → turn → step → tool call through the existing execution drawer. On top of it:/api/execution-context-diffisstella inspect --diffin the dashboard — unified hunks in git's exact shape between one call's receipt-reconstructed context and its resolved baseline (prev/first/prompt, same-role, whole-session — the semanticscrates/stella-cli/src/inspect.rsis careful about, including reporting the resolved base and theminimal: falsecoarse flag). The pure differ is extracted fromstella-cli'sinspect::diffinto a new zero-dependency leaf cratestella-diff(thestella-homeprecedent, per stella-observatory: what CHANGED between two model calls — surface stella inspect --diff in the dashboard #1511's triage) rather than becoming a fourth acknowledged copy; the CLI now links it, behavior-preserving (its 10inspect_clitests pass unchanged)./api/execution-tendencies— a sanctioned per-executioneventsfold (retries, loop detections by kind + aborts, budget denials, compactions + tokens reclaimed, policy verdicts, speculation discards, steering, provider fallbacks) rendered as a strip in the drawer.reflectionsjoined throughexecutions.session_id), durable memory writes (recovered from thesave_memorytool-call log), memory citations, skills applied, subagents dispatched, MCP traffic, task board, and PRs.Design constraints honoured: no cross-execution
eventsqueries (the session view fans out one execution at a time through the existing per-execution routes); younger tables (skill_usage,mcp_usage,step_receipt) are folded in separate queries so an older store blanks one column, not the whole view; every route degrades to an empty payload on missing files/tables/columns; every interpolated string in the page goes throughesc().Exemplars followed:
self_driving.rsfor the file-backed module shape,sent_context.rsfor the sibling-module seam,stella-home(#1139) for the leaf-crate extraction.Closes #1511
The witness
main, passes here)tests/schema_conformance.rs::context_diff_names_the_moved_line_and_reports_identity_honestly— two same-role calls whose system prefixes differ by one line across a turn boundary produce exactly one hunk naming that line; a byte-identical pair reportschanged: false;prevon a role's first call resolves topromptand says so. 404s onmain(route absent). The sessions routes are additionally covered byevery_route_survives_the_real_store_schemawith seeded-data pointers (/sessions/0/id,/turns/0/id,/retries), the older-store degradation sweep, andevery_served_route_is_fetched_by_the_embedded_page.The gate
cargo fmt --checkcargo clippy -p stella-diff -p stella-observatory -p stella-cli --all-targets -- -D warnings(workspace clippy/test run in CI)cargo test -p stella-observatory -p stella-diff(87 tests) and-p stella-cli --test inspect_cli(10) green locallystella-diffREADME, AGENTS.md workspace table + crate countsCloses #1511appears both above and as a commit trailerNothing left behind
refs/stella/<session>/turn/<n>), stella-observatory: surface context.db's self-improvement plane — promotion audit trail, episodes, selection health #1871 (context.db promotion audit trail / episodes unread by the observatory), stella-cli: skill_usage is recorded only on the deck path — pipeline and headless runs report zero skill telemetry #1872 (skill_usage recorded only on the deck path)Ground-rule check
stella-core. New deps, both justified in manifests:stella-diff(new zero-dep leaf crate, extraction not addition) andlibcin the observatory (onekill(pid, 0)liveness probe, an acknowledged copy ofstella_store::sessions::pid_alive; opens nothing, writes nothing).Anything reviewers should know?
sessions.rsreads the machine-global registry but filters records to the served workspace (canonicalized path compare, falling back to string compare for deleted workspaces)./api/sessionid is the one client string that meets the filesystem; it is charset-gated (safe_session_id) before any read.Summary by Sourcery
Introduce a workspace-wide Sessions tab with session replay, behavioural tendencies, and self-improvement views, and share a unified prompt-diff implementation between CLI and observatory via a new stella-diff crate.
New Features:
Enhancements:
Documentation:
Tests: