Phase 3 W4: applied-demo runner (cloudflare/dmv)#33
Merged
Conversation
W4 of the web demo. Add /api/demos and /api/run-demo/:name, which run the real demo-agent loop over a real scenario and the genuine fail-closed tools (Cloudflare migration, CA DMV registration), returning the tool-call trace and the authoritative tool decisions. The model is a deterministic mock by default — offline, no key, safe for a public site; a live model stays a local opt-in, and the eval suites cover the misbehaving-model cases. The client gains an Applied demos tab showing the ordered tool calls next to the tool decisions, making the security property visible: the model orchestrates, but the tools decide — the verdict is never the model's prose. Co-Authored-By: Claude Opus 4.8 <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.
Stacks on #32 (W3). Base is
phase-3-w3-sd-ui; merge #32 first.What (W4 of the web-demo plan)
Run the applied demos in the browser.
Server (2 new endpoints):
GET /api/demos— list the applied demos (cloudflare,dmv).POST /api/run-demo/:name— run the genuinerunAgentloop over a real scenario and the fail-closed tools, returning the tool-call trace, the authoritative tool decisions (captured server-side viaonToolResult), and the agent's final text.The model is a deterministic mock that issues the demo's tool sequence — offline, no key, safe for a public site. A live model stays a local opt-in (mock-only public, per the plan); the eval suites already cover misbehaving-model cases.
Client: an Applied demos tab showing the ordered tool calls beside the tool decisions, making the core property visible — the model orchestrates, the tools decide; the verdict is never the model's prose.
Tests
demoRunner.test.js— 5 integration cases viaapp.inject: lists demos, runs DMV (granted viaregister_vehicle, real confirmation number), runs Cloudflare (verify → stage → approve → cutover authorized), 404 for unknown demo, and a key-material canary over the whole trace.npm run typecheck+npm run lintclean; web suite 28 passing; client builds clean. Live-smoke-tested: DMV runs, granted, no key leak.W5 (polish + deploy doc + README "Try it") is the last slice.
🤖 Generated with Claude Code