Repository navigation
Web: replay an agent session and watch Sthira catch the drift - #35
Merged
Merged
Conversation
The server-side demo drop only works in desktop demo mode, so the hosted site had no live "an agent drifts and Sthira catches it" moment. Add GET /api/demo-session (the demo Claude Code session, parsed) and a "Watch an agent drift" section that types the session out and runs each agent message through /api/check, interrupting inline with the OVERRULED confrontation card, honest fallback labels, a busy-model note and a final score. Adds a tour step pointing at it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ Shipwright · ApproveRecommendation: approve PR #35 · Tier
WalkthroughThe PR adds a /api/demo-session endpoint that returns a parsed Claude Code session, and a browser replay UI that types the session out and runs each agent message through /api/check, showing Sthira's verdict inline.
Estimated review effort: 3 (Moderate) · ~20 minutes Review✅ Full review input coverage: 10/10 changed files · 4 review shard(s) · 638 changed lines. Open the Shipwright check for full evidence and the audit bundle. Use |
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.
Stacked on #34.
Why
The live "an agent drifts and Sthira catches it" moment (
POST /api/demo/drop) only works in desktop demo mode (STHIRA_DEMO_DROPplus the background watcher). On the hosted site there was no way to see it happen. This adds an in-browser replay that works on any host, next to the existing feed. The demo-drop button is unchanged and still shows only in demo mode.What
GET /api/demo-session(web/app.py): returns{title, messages: [{role, text}]}, parsed fromdemo/claude_code/session.jsonlwithsthira.ingest.claude_code.parse. Returns emptymessagesif the file is missing. Documented indocs/CONTRACTS.md.web/static/index.html, right after "While you were away"), built in the page's own design system:you/agentlabels, a caret while typing) types the session out.POST /api/check. It shows "Sthira is checking…", then interrupts inline:keyword match · not a model verdicttag plus a note, orrecorded run.textContent. Typing is time-boxed per message (about 12 s for the whole session with checks) and skipped underprefers-reduced-motion. Progress is announced through an sr-only live region, so screen readers don't hear every character.web/tests/test_demo_session.pychecks the endpoint's shape and content, and that both agent messages are caught by the labelled keyword fallback when the model is unreachable.Test plan
PYTHONPATH=. python -m pytest -q: 59 passedOLLAMA_HOST=http://127.0.0.1:9). At 1280px, the replay finished in about 12 s: both agent messages were caught by the labelled keyword fallback (MongoDB, email+password), and it showed "2 of 2 drifts caught"scrollWidth375), and the stamp doesn't overlap the fallback tag/api/checkto fail with a 502: each message shows the busy-model note, and the score reads "0 of 2 drifts caught · 2 not checked (model busy)"prefers-reduced-motion: not emulated in the browser. The code path sets text instantly and skips the pauses🤖 Generated with Claude Code
Summary by ShipWright
Change: Feature · Merge risk: 🟢 Low · updated on each push