clawback report viewer smoke test
Run .skills/report_smoke/scripts/report_smoke.sh from the project root:
.skills/report_smoke/scripts/report_smoke.sh
Environment variables (optional):
CLAWBACK_REPORT_DIR— runs directory to serve (default./runs)
It needs at least one completed run on disk (a subdir with a parseable
summary.json). The repo ships runs/smoke and runs/L0-tier1; the L0-tier1
run also contains the sensitive proxy.*.log + turns.*.ndjson siblings, which
is exactly what the non-exposure assertions check against.
No upstream and no API key are required — report routes never proxy to Anthropic. The proxy boots over plain HTTP on a free high port and is torn down on exit. Exit code is the number of failed assertions (0 = all green).
What the script verifies:
- Static + base injection —
/_proxy/report/serves index.html with__BASE__replaced by the real/_proxy/report/base href (no literal__BASE__leaks);report.js/report.cssserve with correct MIME types. - Dynamic routes against real analyzer output —
/runslists the on-disk runs newest-first;/data?run=L0-tier1returns summary (carrying thetokensreclaim block) + charts + csvBytes;/chart/<id>/tokens_saved.svgserves that SVG by name (the same route also serves the baretokens_saved.bg.svgshare-card background);/csv/<id>serves a CSV download. - Security (allowlist is the control; traversal guards are depth) — the
proxy.*.log/turns.*.ndjsonsiblings are unreachable, the data payload does not leak their bytes, and?run=../ encoded traversal are rejected 400. - Publicly readable — a GET with a bogus
Host421s on a guarded endpoint (/_proxy/metrics) but the report viewer is exempt and still returns 200. - Dashboard cross-link —
/_proxy/ui/exposes thereportLink. - Prefix mutability — a re-boot with
--admin-path ctrlserves/ctrl/report/...(base href injected as/ctrl/report/) while the old/_proxy/report/path 404s, proving the admin prefix is not hardcoded.
Complements test/report.test.js (unit-level, synthetic run dirs): this
exercises the shipped bin/clawback.js boot path against real runs.