Skip to content

feat(deploy): canonical demo at demo.cacheplane.ai (Phase 2)#306

Merged
blove merged 5 commits into
mainfrom
claude/canonical-demo-deploy-phase-2
May 13, 2026
Merged

feat(deploy): canonical demo at demo.cacheplane.ai (Phase 2)#306
blove merged 5 commits into
mainfrom
claude/canonical-demo-deploy-phase-2

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 13, 2026

Summary

Phase 2 of the canonical-demo deployment plan. Stands up https://demo.cacheplane.ai as an independent Vercel project (cacheplane-demo) serving examples/chat/angular with a /api/* proxy to the shared cockpit-dev LangGraph Cloud assistant (the chat graph from Phase 1).

Architecture

  • Shared proxy module at scripts/langgraph-proxy.tscreateProxyHandler(config) factory. Used by both the existing cockpit-examples deployment (now a thin wrapper preserving its Referer-based fan-out) and the new demo deployment (a 5-line wrapper using defaults).
  • scripts/assemble-demo.ts builds examples-chat-angular in production mode and produces deploy/demo/ with a Vercel Build Output API tree (Node serverless function + route table).
  • examples/chat/angular gets the standard Angular environments/ file-replacement pattern. Production points at /api, dev at http://localhost:2024. Two hardcoded localhost:2024 references removed.
  • CI deploy step gated on changes to the demo's files, parallels the existing examples deploy.

External setup (already done by controller)

  • ✅ Vercel project cacheplane-demo created (prj_i2WgVNmv8N6IMkaUVeLLxJOGyFUW)
  • ✅ Custom domain demo.cacheplane.ai attached + auto-verified via Vercel DNS
  • LANGSMITH_API_KEY + CACHEPLANE_LICENSE_PUBLIC_KEY set on the project
  • VERCEL_DEMO_PROJECT_ID GitHub secret added

Spec & Plan

  • docs/superpowers/specs/2026-05-13-canonical-demo-deploy-design.md
  • docs/superpowers/plans/2026-05-13-canonical-demo-deploy-phase-2.md

Test plan

  • 7 unit tests in scripts/langgraph-proxy.spec.ts (header injection, CORS, path stripping, SSE streaming, error paths, resolveBackend hook)
  • Full chat suite passes (668 tests, no regression)
  • Local: npx tsx scripts/assemble-demo.ts --skip-build produces a valid Build Output API tree
  • Production Angular build replaces localhost:2024 with /api
  • After merge: Deploy → Vercel runs the new demo deploy step → CI green
  • After merge: curl -I https://demo.cacheplane.ai → 200
  • After merge: curl -s https://demo.cacheplane.ai/api/_proxy_debug | jq . shows hasApiKey: true
  • After merge: submitting a message streams a response
  • examples.cacheplane.ai continues to work (refactor only)

🤖 Generated with Claude Code

blove and others added 5 commits May 13, 2026 14:32
6 tasks: extract shared proxy module (+ 7 unit tests), wire Angular
environment files, scripts/assemble-demo.ts + vercel.demo.json, CI
deploy step, external setup checklist, post-merge verification.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The proxy logic was previously inline in scripts/examples-middleware.ts.
Extract a createProxyHandler(config) factory into a new
scripts/langgraph-proxy.ts module so the Phase 2 demo deployment can
import the same handler. examples-middleware.ts becomes a thin
wrapper that supplies the existing examples-specific Referer-based
backend resolver.

Behavior is unchanged for the cockpit-examples deployment. Adds 7
unit tests covering header injection, path stripping, CORS preflight,
SSE streaming, error paths, and the resolveBackend hook.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds the standard Angular environments/ file-replacement pattern
matching every cockpit Angular app. Production uses /api (same-origin,
proxied by the Vercel langgraph-proxy function to the shared
cockpit-dev LangGraph Cloud assistant). Development still uses
http://localhost:2024 for the locally-run langgraph dev server.

Replaces two hardcoded http://localhost:2024 references in
threads.service.ts and demo-shell.component.ts with reads from the
environment module.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Builds the canonical-demo Angular app and assembles it into
deploy/demo/ with a Vercel Build Output API tree containing:
- Static SPA files at deploy/demo/
- Node serverless proxy at .vercel/output/functions/api/[[...path]].func/
- Route table sending /api/* to the proxy, everything else to index.html

The proxy is a 5-line wrapper around scripts/langgraph-proxy.ts
(scripts/demo-middleware.ts) using defaults — single backend, no
Referer-based fan-out.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a deploy step parallel to the existing cockpit-examples deploy.
Gated on changes to examples/chat/{angular,python}/**, the proxy
scripts, vercel.demo.json, or libs/**. Uses the new
VERCEL_DEMO_PROJECT_ID secret and the existing VERCEL_ORG_ID +
VERCEL_TOKEN.

Wires DEMO_URL into the production-smoke env block for future
Playwright assertions against demo.cacheplane.ai.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cacheplane Ready Ready Preview, Comment May 13, 2026 11:35pm

Request Review

@blove blove merged commit 6845262 into main May 13, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant