# Central SaaS Phase 5 Review: Runtime Switchover from Mock to Real Central SaaS

**Date:** 2026-05-19
**Status:** COMPLETE
**VPS:** root@187.77.140.128
**Project root:** /opt/devxura

---

## What Was Switched Over

The Devxura runtime was switched from the mock central SaaS dependency to the real Postgres-backed central SaaS at `https://app.aiinvention.tech` (internal Docker network: `http://central-app:4100`).

### Runtime Dependencies
| Before | After |
|--------|-------|
| Mock central (in-memory, fake responses) | Real central SaaS (Postgres, auth, Stripe) |
| mock-central Docker service | central-app Docker service (compose_default network) |
| Hardcoded fake entitlements | DB-backed plan entitlements from plan_entitlements table |

---

## Files Changed

| File | Change |
|------|--------|
| `infra/env/.env.runtime` | Already updated in Phase 1 — DEVXURA_CENTRAL_URL points to central-app:4100 |
| `infra/compose/docker-compose.prod.override.yml` | Already created in Phase 1 — mock-central disabled (profiles: [disabled]) |
| `infra/compose/docker-compose.central.yml` | Created in Phase 4 — standalone central-app deployment |

**No new files changed in Phase 5** — the switchover was already completed in Phases 1-4. Phase 5 verified the integration end-to-end.

---

## Env / Config Changes

No additional changes needed. The runtime already uses:
```
DEVXURA_CENTRAL_URL=http://central-app:4100
```
This resolves within the compose_default Docker network to the real central SaaS container.

---

## Mock Dependency Status

- **Mock container:** Not running (stopped and removed in Phase 1)
- **Mock image:** Still present on disk (devxura/mock-central:0.1.0) but not used
- **Compose entry:** Disabled via profiles: [disabled] in override
- **Code references:** Zero remaining in apps/ or env/
- **Runtime env:** Points to real central SaaS (verified)

---

## What Was Verified Against Real Central SaaS

| Test | Endpoint | Result |
|------|----------|--------|
| Health identity | GET /health | service: central-app, storage: postgres, stripe: true |
| Signup (license creation) | POST /signup | 201 — licenseKey returned |
| Runtime node activation | POST /runtime-nodes/register | 201 — accepted, node created |
| Runtime check-in | POST /runtime-nodes/check-in | 200 — accepted, trialing state |
| Entitlement sync | register response | planId: agency_pro, maxCustomers: 50, maxRuntimeNodes: 3, supportLevel: priority |

All tests executed from within the runtime-api container against `http://central-app:4100` (the real central SaaS).

---

## What Is Still Pending For Phase 6

- Full end-to-end re-validation (complete workflow: signup → trial → Stripe checkout → webhook → license active → runtime writes)
- Production hardening (health checks, resource limits, monitoring)
- Database backup integration
- Remove mock-central Docker image (cleanup)
- Production domain switchover finalization

---

## Blockers Found

**None.** Phase 5 is complete. The runtime is fully switched to the real central SaaS.
