Repository navigation
Add a hosted read-only demo - #2
Merged
Merged
Conversation
RootLens can't be deployed as-is: the investigation loop needs a local Ollama model and no free tier hosts one. This records the approach we settled on -- run investigations locally, capture every API response the UI touches, and resolve from those fixtures in the built site. Two findings worth keeping: repointing the API base URL at static files does not work (GETs carry query params, two endpoints are POSTs), and the static export forces a split of the two dynamic routes because a "use client" page cannot export generateStaticParams. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FwJbsXDAjQAERfSQbYkgMc
Seven engineering tasks plus one manual deploy step, sequenced per the spec's build order: resolver -> fetchJson branch -> capture script -> route split -> demo affordances -> e2e -> deploy. Every code block is concrete (real file paths, real component names pulled from the actual source, real Playwright selectors verified against evidence-drawer.tsx) so a fresh executor needs no guesswork. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FwJbsXDAjQAERfSQbYkgMc
…e demo path The demo-mode test asserted only the fixture value, which the mock's fallback branch would also return under the old (pre-demo-mode) fetchJson path. Assert the mock's first call was to /demo/manifest.json so a regression that drops the demo-mode branch fails the test.
Runs the bounded investigation loop against a live local stack (Postgres + qwen3:8b via Ollama) and captures every API response the demo frontend touches: the homepage metrics summary, 3 completed product_revenue investigations with distinct periods/questions, their event streams and evidence, the investigations list, and the (empty) evaluations list. scripts/capture_demo.py's INVESTIGATIONS list uses product_revenue for all 3 entries -- it's the only metric app/analytics/segment_metric.py implements segmentation for today, so it's the only metric that can reach a completed report; "orders" isn't in the metric catalog at all (422 on creation) and "cancellation_rate" creates fine but always dies at the segmentation step.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Runs Playwright against the real npm run build:demo static output (served via serve@latest), exercising the same InvestigationView and EvidenceDrawer components the live app uses: banner text, disabled controls, a completed investigation, and a working evidence citation. The brief's literal `/^E1/` locator was ambiguous against real captured data — the finding's inline citation and the sidebar Evidence Ledger's exhibit entry both render "E1" and call the same openEvidence() handler for the same evidence id. Scoped to .first() (the inline citation, first in DOM order); this doesn't weaken the assertion since both elements open the identical evidence drawer.
Gate the evaluation-case investigation link on demo mode, fold the investigations-list filter and held_out eval-run selection into capture_demo.py, read the API base URL from an env var instead of a hardcoded workaround port, add CI coverage for the static demo build, align page.tsx's demo-flag check with the rest of the codebase, and pin the demo Playwright server's serve version. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
fetchJson/api-client.tsseam; in demo mode it resolves fromapps/web/public/demo/fixtures instead of the network — the demo renders through the exact same components the live app usesscripts/capture_demo.pyagainst a live local stack (Postgres + Ollama), not hand-authored/investigations/[id],/evaluations/[id]) split into a thin server component (forgenerateStaticParams) plus the existing client view, sinceoutput: "export"requires static params that a"use client"page can't exportSee
docs/superpowers/specs/2026-09-11-hosted-demo-design.mdfor the design anddocs/superpowers/plans/2026-09-11-hosted-demo.mdfor the implementation plan.Test plan
npm run test)npm run typecheck)npm run test:e2e)npm run build:demo && npm run test:e2e:demo) — the test that catches demo-vs-real drift, now wired into CIoutput: "export", no demo-mode branch taken when the flag is unsetNot included
Deploying to Vercel and linking the demo from the portfolio site is a manual follow-up (new hosting account, separate repo) — not part of this PR.
🤖 Generated with Claude Code