mirror of https://github.com/garrytan/gstack.git
Adds browse/test/fixtures/mock-claude/claude — an executable bun script
that parses the --prompt flag, extracts the session canary via regex,
and emits stream-json NDJSON events that exercise specific sidebar-agent
code paths.
Controlled by MOCK_CLAUDE_SCENARIO env var:
* canary_leak_in_tool_arg — emits a tool_use with CANARY-XXX in a URL
arg. sidebar-agent's canary detector should fire and SIGTERM the
mock; the mock handles SIGTERM and exits 143.
* clean — emits benign tool_use + text response.
Used by security-e2e-fullstack.test.ts. PATH-prepended during the test so
the real sidebar-agent's spawn('claude', ...) picks up the mock without
any source change to sidebar-agent.ts.
Zero LLM cost, fully deterministic, <1s per scenario. Enables gate-tier
full-stack E2E testing of the security pipeline.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| mock-claude | ||
| basic.html | ||
| cursor-interactive.html | ||
| dialog.html | ||
| dropdown.html | ||
| empty.html | ||
| forms.html | ||
| iframe.html | ||
| injection-combined.html | ||
| injection-hidden.html | ||
| injection-social.html | ||
| injection-visible.html | ||
| media-page.html | ||
| network-idle.html | ||
| qa-eval-checkout.html | ||
| qa-eval-spa.html | ||
| qa-eval.html | ||
| responsive.html | ||
| snapshot.html | ||
| spa.html | ||
| states.html | ||
| upload.html | ||