plans/2026-07-22-cmem-launch.md
Created 2026-07-22. This is a consolidation plan: it sequences already-validated work (open PRs, the frozen Turbopuffer cutover plan, the audited funnel spec) into phases executable via /do in fresh sessions. Each phase is self-contained. State was verified live on 2026-07-22 (PR states, deploys, DB health, test counts).
/Users/alexnewman/.superset/worktrees/df8069a7-eb08-4626-9d3d-918d1e12eb9f/freckle-nail, branch feat/phase5-two-lane-sync, remote thedotmack/claude-mem. Hub worker in workers/sync-hub/.~/Scripts/claude-mem-pro (currently checked out on codex/turbopuffer-only-launch; main auto-deploys to Vercel prod). Remote thedotmack/claude-mem-pro.PLAN-postgres-to-turbopuffer-cutover.md (in claude-mem-pro worktree .claude/worktrees/tpuf-content-plan, branch docs/tpuf-content-migration-plan).CMEM.ai project ziczmqtpmaxbornfghye) so billing can never pause the control plane again (root cause of the Jul 20–22 outage).npm publish when Phase 2 hands over the built v13.12.0 release (npm publishing is human-only per the version-bump workflow).WOWERPOINT_API_BASE / WOWERPOINT_UPLOAD_TOKEN / WOWERPOINT_VIEWER_BASE if deck share links are wanted.GET /api/pro/sync/verify) — OPEN, green, branch feat/sync-hub-token-verify.AUTH_CACHE KV exists; DISCORD_WEBHOOK_URL secret set; TOKEN_VERIFY_URL NOT yet set → hub fails closed (by design).connect-info gates worker protocol v1 on 13.12.0 + rollout flags).email_waitlist.pro_* content tables still serve ALL reads (dashboard, MCP, timeline, devices, SSE). Turbopuffer v1 is a lossy search mirror only.origin/codex/phase0-sync-verify, origin/codex/phase2-tpuf-product-paths — review for reuse; their last 3 preview deploys FAILED on Vercel (build errors), so treat as WIP input, not truth.Goal: hub live in production, verified end-to-end with real tokens.
Tasks:
main (gh pr merge 51 -R thedotmack/claude-mem-pro). Vercel auto-deploys. Verify GET https://cmem.ai/api/pro/sync/verify responds (401/contract response, not 404) after deploy.gh pr merge 3333 -R thedotmack/claude-mem).workers/sync-hub/): set TOKEN_VERIFY_URL=https://cmem.ai/api/pro/sync/verify (wrangler secret or var per wrangler.jsonc — note the worktree has an uncommitted wrangler.jsonc modification; reconcile it first). Confirm watchdog cron trigger + secrets per workers/sync-hub/DEPLOY.md. Ensure DEV_ALLOW_ANY_TOKEN is empty in prod. Redeploy.workers/sync-hub/canary/) against prod with a real account's setup_token from /api/pro/connect-info.X-Sync-Mode: poll fleet-wide + WS refused with 503 → untrip).Verification checklist:
/api/pro/sync/verify live on cmem.aiAnti-pattern guards: don't set DEV_ALLOW_ANY_TOKEN in prod; don't bypass the fail-closed default by stubbing verify.
Goal: a release whose plugin bundle speaks hub protocol, ready for Alex to npm publish.
Tasks:
main of claude-mem, run the version-bump skill flow to 13.12.0 (manifests: root package.json, plugin/plugin.json, marketplace.json; build via npm run build-and-sync; verify worker starts; tag + GitHub release).plugin/scripts/worker-service.cjs contains the SyncHub client paths (/v1/sync/ops, /v1/sync/changes) and that CLAUDE_MEM_CLOUD_SYNC_HUB_URL defaults empty (sync off unless configured).npm publish. After publish, flip CMEM_WORKER_PROTOCOL_V1_ONBOARDING_ENABLED + canary user IDs on Vercel per the staged-rollout flags in connect-info.Verification checklist:
grep -c "/v1/sync/" plugin/scripts/worker-service.cjs > 0 in the shipped bundlenpm view claude-mem dist-tags shows 13.12.0 after Alex publishesGoal: Turbopuffer v2 is the only content store; Postgres is control plane only. This phase executes the existing frozen plan — read PLAN-postgres-to-turbopuffer-cutover.md in full before starting; its contracts (canonical doc schema, stable ID formula, chronological_key pagination, (epoch, seq) projection checkpoint, entity-rev/tombstone semantics) are binding.
Sub-steps (the plan's own Phases 0–3):
pro_observations / pro_summaries / pro_prompts; classify anything present as disposable dev data and clear deliberately. Add the missing verify:tpuf-content script.cmem-{userId}-v2 namespace, canonical docs, projection endpoint called by the stateless hub worker after pushOps, checkpoint + per-user lease, scheduled repair job. Resolve the compaction watermark gap: the projector must hold the hub compaction watermark (register as a device or add a dedicated projector watermark) so compaction can't outrun it.origin/codex/phase2-tpuf-product-paths for reusable diffs (its Vercel builds failed — fix or rewrite, don't trust blindly).pro_observations, pro_summaries, pro_prompts, pro_sync_state via reviewed migration; remove legacy batch sync routes ONLY after v13.12.0 supersedes v13.11.0 in the wild; strip stale *_migrated columns from pro_users.Verification checklist:
chronological_key, opaque cursor)grep -r "pro_observations\|pro_summaries\|pro_prompts" src/ returns nothing in claude-mem-pro serving codeAnti-pattern guards: do NOT adopt codex/turbopuffer-only-launch wholesale (auth-fused tpuf design is the documented failure mode); never use created_at_epoch as a sync cursor (hub seq only); no outbound I/O from the Durable Object; auth/session/billing code stays untouched (Supabase remains the identity provider).
Goal: the funnel front door to the audited spec. Data source is /api/pro/connect-info (single source of truth for both tokens, MCP URL {base}/api/mcp/mcp, add-command, mcp.json snippet).
Spec (from the Jul 12 product-flow audit):
src/app/api/pro/mcp-activity on main), not self-attestation.Verification checklist:
mcp_token within the 60s cache window; setup_token untouchedGoal: the boring safety rails that make the launch survivable.
Tasks:
copy_from_namespace + backup-age alert.Verification checklist:
connect-info and MCP endpoints regardless of backing store), 5 is last.source intact) are already in email_waitlist for the announce email.