# Session Handoff: Production Deploy Complete + Platform State Map

Date: 2026-04-06
Session scope: Production deployment, platform mapping, gap analysis

## Milestone: Production Deploy COMPLETE

Both CMS surfaces are now live in production behind Caddy reverse proxy with PM2 process management:

- cms.chem.dev → Next.js 15 on port 3500 (PM2: cms-web) — HTTP 200
- cms-content.chem.dev → Astro 6 + EmDash on port 3501 (PM2: cms-content) — HTTP 302 (EmDash setup pending)
- cms.chem.dev/ref/ → Caddy file_server with browse for static reference content (tokens, handoffs, design briefs, docs)
- SSL: auto-provisioned by Caddy (Let's Encrypt)
- DNS: Cloudflare A records for cms and cms-content subdomains
- No regression on existing services (penpot.chem.dev, flowise, etc.)

## Production Infrastructure

- PM2 ecosystem config: ecosystem.config.cjs (Astro uses fnm Node 22 interpreter path)
- Caddy site blocks: ops/caddy-cms-blocks.txt (appended to /etc/caddy/Caddyfile)
- Static content sync: ops/sync-static.sh (tokens, briefs, handoffs, docs → static-site/)
- Log files: /var/log/caddy/cms-web.log, /var/log/caddy/cms-content.log

## Issues Resolved During Deploy

1. Port 3030 conflict with Flowise → moved to 3500/3501
2. PM2 node_modules/.bin/next is shell script → use node_modules/next/dist/bin/next
3. better-sqlite3 missing at runtime → add as direct pnpm dependency
4. Zod .meta() tree-shaken by Vite in production → externalize from SSR bundle + add zod as direct dep
5. Caddy log permission denied → touch + chown as caddy user
6. Caddy stuck in reload state → full restart required

## Platform Entry Points (All Verified Live)

| URL | Status | Surface |
|-----|--------|--------|
| cms.chem.dev/ | 200 | Next.js landing page |
| cms.chem.dev/dashboard | 200 | Interactive dashboard |
| cms.chem.dev/design-system | 200 | Design system catalog |
| cms.chem.dev/kaleido-life | 200 | KL showcase |
| cms.chem.dev/pricing | 200 | Pricing page |
| cms-content.chem.dev/ | 302 | EmDash setup redirect |
| cms.chem.dev/ref/tokens/ | 200 | Token reference |

## Delivered vs Spec — What Exists

- Repo structure: matches spec layout (apps/, packages/, design/, docs/, ops/)
- CLAUDE.md: full session protocol with brain integration
- GitHub: issue templates (bug/feature/task), PR template, label taxonomy
- Token pipeline: 121 DTCG tokens, Penpot→JSON→CSS pipeline
- Shared UI: 5 components (Button, Card, Tabs, Alert, PricingTable)
- Brain integration: pull/push/query/status scripts (ops/brain/)
- ADW: issue intake → agent dispatch (running)
- CSA: briefing + input form → FTP deploy (running)
- EmDash: seed schema, SQLite adapter, blog pages
- Stitch: MCP server + promotion rules
- Penpot: MCP server + KL cross-project population
- Production: PM2 + Caddy + DNS + SSL (just completed)

## Gaps (Prioritized)

1. **CI/CD** — No GitHub Actions workflows
2. **Design drift monitoring** — No implementation vs Penpot comparison
3. **Storybook/interactive component catalog** — route exists but no Storybook
4. **EmDash first-run setup** — cms-content returns 302
5. **Branch protection** — Not enforced on GitHub
6. **Supervisor/LangGraph** — Brain + skills serve informally; no formal orchestrator
7. **GitReport automation hooks**
8. **CSA source bundle schema formalization**
9. **FTP deploy** blocked on ftp.chem.dev DNS
10. **Component metadata** (spec requires 16 fields per component)
11. **Architecture docs and decision records** (placeholder READMEs only)
12. **packages/schemas** (placeholder only)
13. **Dead CTAs** on landing page

## Next Session Priorities

1. Complete EmDash first-run setup (make cms-content.chem.dev functional)
2. GitHub Actions CI/CD (build + lint + test on PR)
3. Branch protection on master
4. Commit production deploy files
5. FTP DNS + static mirror deploy
