Skip to main content
This is the actual move order for taking Lucia from localhost into a private hosted staging environment without creating fake progress or an avoidable mess.

Purpose

Use this page as the working runbook for:
  • exact transition order
  • environment cutover notes
  • credentials and secret references
  • validation status
  • rollback notes
  • live issues / fixes discovered during staging

Current phase tracker

Use this block first. If the folder ever feels confusing, come back here and mark exactly where the transition stands.
  • Current phase:
  • Current owner / driver:
  • Started on:
  • Last updated on:
  • Blocking issue:
  • Next concrete move:

Quick phase checklist

  • Phase 0 — Preflight
  • Phase 1 — Service accounts and access
  • Phase 2 — Cloudflare private staging front door
  • Phase 3 — Render: host Lucia Engine first
  • Phase 4 — Render: host Lucia Admin/UI second
  • Phase 5 — Supabase and Clerk staging alignment
  • Phase 6 — Add Redis-backed continuity
  • Phase 7 — Observability
  • Phase 8 — Validation against hosted staging
  • Phase 9 — Rollback and recovery

Phase guide at a glance

PhaseGoalPrimary page(s)
0lock repo/domain/env truth00 - START HERE ~ Ultimate Goal, 08 - Live Transition Runbook
1organize service access and secrets00 - START HERE ~ Ultimate Goal, 01 - Cloudflare, 02 - Render, 03 - Supabase, 04 - Clerk, 05 - Upstash Redis, 06 - Sentry
2protect staging with Cloudflare01 - Cloudflare
3host Lucia Engine02 - Render
4host Lucia Admin/UI02 - Render
5align Supabase + Clerk for staging03 - Supabase, 04 - Clerk
6move continuity to Redis05 - Upstash Redis
7add Sentry and visibility06 - Sentry
8validate hosted staging07 - Final Goal
9keep rollback clean07 - Final Goal, 08 - Live Transition Runbook

Runbook rules

  1. Do not move everything at once.
  2. Engine first, then Admin.
  3. Keep private staging protected before broad access.
  4. Do not claim Lucia is “production-ready” because it has a URL.
  5. Validate runtime behavior after every meaningful move.

Phase 0 — Preflight

Goal: make sure we are not walking into staging with sloppy config or repo confusion.

Repo ownership

LayerRepoNotes
Lucia Enginemain backend/runtime behavior owner
Lucia Admin/UIoperator-facing shell

Preflight checklist

  • confirm Engine repo path
  • confirm Admin repo path
  • confirm primary branches
  • confirm who owns each service account
  • confirm Lucia domain/subdomain plan
  • confirm current localhost assumptions still present
  • confirm which secrets already exist vs need creation

Known runtime items to fix during staging move

  • Admin API base URL must become environment-driven
  • hosted callback/origin URLs must be added where needed
  • in-memory continuity assumptions must be documented before Redis migration
  • validation battery must be ready to run against hosted staging

Phase 1 — Service accounts and access

Goal: get the house keys organized before touching deployment.

Service access tracker

ServiceAccount EmailDashboard URLOwnerMFA Confirmed1Password ItemStatus
Cloudflare[ ]
Render[ ]
Supabase[ ]
Clerk[ ]
Upstash Redis[ ]
Sentry[ ]

Secrets posture

  • decide: raw secrets here vs 1Password references only
  • confirm private Obsidian vault only
  • confirm no published sync/share path includes this folder

Phase 2 — Cloudflare private staging front door

Goal: create a private, access-protected staging perimeter before Lucia is broadly reachable.

Tasks

  • create / confirm staging subdomains
  • point DNS to hosted services when available
  • enable SSL/TLS
  • enable Cloudflare Access for staging
  • restrict staging to approved identities only
  • verify protected login flow

Staging hostnames

UseHostnameLive YetNotes
Lucia Admin staging[ ]
Lucia Engine/API staging[ ]
Optional status / health[ ]

Cloudflare credential references

ItemValue
Account email
Account ID
Zone ID
Dashboard URL
Access app name
Allowed user emails
API token reference

Phase 3 — Render: host Lucia Engine first

Engine first. Always. Admin without a stable engine behind it is just a shiny shell with nowhere to go.

Engine deploy checklist

  • create Lucia Engine service in Render
  • attach correct repo/branch
  • set region
  • set start command
  • add environment variables
  • verify health check path
  • deploy
  • confirm service is reachable internally / through protected path

Engine service record

ItemValue
Render service name
Repo
Branch
Region
Runtime
Start command
Health check path
Render URL
Custom domain

Engine env vars

VariableValue / ReferenceConfirmed
NODE_ENV[ ]
PORT[ ]
LUCIA_OPENAI_API_KEY[ ]
OPENAI_API_KEY[ ]
LUCIA_INTELLIGENCE_MODEL[ ]
LUCIA_MODEL_FOCUS_OPS_REPLY[ ]
SUPABASE_URL[ ]
SUPABASE_SERVICE_ROLE_KEY[ ]
CLERK_SECRET_KEY[ ]
OPERATOR_TIME_ZONEAmerica/Los_Angeles[ ]

Engine smoke checks

  • service boots without crash
  • root/health endpoint responds
  • /admin/operator-focus accepts non-empty prompt
  • empty prompt still returns prompt_required
  • logs are visible

Phase 4 — Render: host Lucia Admin/UI second

Only do this after the Engine URL is stable enough to target cleanly.

Admin deploy checklist

  • create Lucia Admin service/site in Render
  • attach correct repo/branch
  • set build command
  • set publish/start command
  • replace localhost API target with hosted env value
  • deploy
  • verify login flow
  • verify Admin can reach hosted Engine

Admin service record

ItemValue
Render service/site name
Repo
Branch
Region
Build command
Start / publish command
Render URL
Custom domain
API base URL target

Admin env vars

VariableValue / ReferenceConfirmed
VITE_API_BASE_URL or equivalent[ ]
VITE_CLERK_PUBLISHABLE_KEY[ ]
VITE_CLERK_SIGN_IN_URL[ ]
VITE_CLERK_SIGN_UP_URL[ ]
VITE_CLERK_AFTER_SIGN_IN_URL[ ]
VITE_CLERK_AFTER_SIGN_UP_URL[ ]

Admin smoke checks

  • site loads
  • auth works on staging
  • operator prompt submits successfully
  • response renders correctly
  • no localhost calls remain in network tab

Phase 5 — Supabase and Clerk staging alignment

Supabase

  • confirm staging project or intentional shared project
  • confirm connection strings / secrets
  • confirm backups
  • confirm no client exposure of server-only secrets

Clerk

  • add staging URLs/origins
  • add redirect/callback URLs
  • test sign-in and sign-out on staging
  • confirm protected staging access flow makes sense with Cloudflare Access

Secret references

ServiceSecret / KeyValue / 1Password Reference
Supabaseproject URL
Supabaseanon/public key
Supabaseservice role key
Clerkpublishable key
Clerksecret key
Clerkapp / instance name

Phase 6 — Add Redis-backed continuity

Lucia is not truly staging-hardened if continuity depends only on process memory.

Redis move checklist

  • create Upstash Redis database
  • store endpoint/token secrets
  • define key naming
  • define TTL policy
  • move session/distress continuity to Redis-backed adapter
  • test continuity across restart/redeploy
  • test failure fallback when Redis is unavailable

Redis connection record

ItemValue
Database name
Region
Endpoint
REST URL
Token reference
Key prefixlucia:

Candidate env vars

VariableValue / ReferenceConfirmed
UPSTASH_REDIS_REST_URL[ ]
UPSTASH_REDIS_REST_TOKEN[ ]
LUCIA_SESSION_TTL_SECONDS[ ]

Phase 7 — Observability

Sentry

  • create project
  • add DSN to Engine
  • tag environment and release
  • verify real error ingestion

Better Stack or equivalent

  • add uptime checks
  • add engine health monitor
  • add admin URL monitor
  • add on-call / alert routing if desired

Observability references

ServiceItemValue / Reference
SentryDSN
Sentryproject name
Sentryenvironment names
Better Stackmonitor URLs
Better Stackalert recipients

Phase 8 — Validation against hosted staging

Hosted staging is not “good” because it deployed. It is good when Lucia still behaves like Lucia.

Validation checklist

  • run must-pass validation battery against hosted staging
  • verify payload contract remains stable
  • verify social/human prompts still land softly
  • verify overwhelm containment still works
  • verify off-role boundaries still hold
  • verify no new hosted-environment regressions in tone, routing, or continuity

Must-pass notes

CheckResultNotes
route contract
greeting / human utility
distress continuity
priority triage
payment risk
concierge readiness
maintenance focus
off-topic boundary

Hosted staging test prompts

  • Good morning
  • How are you?
  • I'm overwhelmed
  • What matters most right now?
  • Show payment risks I need to handle now.
  • Show open concierge requests needing confirmation.
  • Any urgent maintenance issues today?

Phase 9 — Rollback and recovery

No migration is serious if rollback is just prayer.

Rollback checklist

  • keep last-known-good branch/commit recorded
  • record previous env vars snapshot
  • record previous DNS targets
  • record service rollback path in Render
  • document Redis disable/fallback plan if needed

Rollback references

ItemValue
Last known good Engine commit
Last known good Admin commit
Previous API base target
Previous DNS target
Rollback owner

Open issues log

DateAreaIssueSeverityOwnerStatusNotes

Change log

DateChangeWhoNotes
Initial runbook createdChatGPTstaging-first migration plan