Skip to main content

Bilko Prod Topology — app.bilko.cloud Cutover (reuse-demo-as-prod)

Bilko Prod Topology — app.bilko.cloud Cutover (reuse-demo-as-prod)

MC: #103300  |  Completed: 2026-06-10  |  Proveo verdict: CUTOVER PASS  |  Evidence root: /tmp/evidence-103300/

CRITICAL REFERENCE — do not make assumptions about which DB is prod or what data is on it. Read this page first.


1. Topology Overview

CEO decision 2026-06-09: reuse the existing "demo" Cloud Run services and Cloud SQL instance as production. No new infrastructure was provisioned. The prior bilko-demo-* services are now the live prod environment.

DomainCloud Run ServiceStatusNotes
app.bilko.cloudbilko-web-demoReady/True, cert Ready/TruePrimary prod frontend
app-api.bilko.cloudbilko-api-demoReady/True, cert Ready/TruePrimary prod API
api.bilko.cloudHTTP 000 (CF Worker SNI issue)Pre-existing issue, separate follow-up
  • GCP Project: tribal-sign-487920-k0
  • Region: europe-north1
  • Prod DB: Cloud SQL instance bilko-demo-db (PostgreSQL 16, RUNNABLE) — this is the REUSED demo instance, now serving production
  • Live health probes (C1 evidence): https://app.bilko.cloud/ → HTTP 200 | https://app-api.bilko.cloud/api/v1/health → HTTP 200 {"status":"ok"}

2. Hostname Recognition — Dual-Mode (C2, PR #334)

Three files on main now recognize BOTH app.bilko.cloud (prod) AND bilko-demo.alai.no (demo/legacy) simultaneously.

FileProd hostnameDemo hostnameVerification
apps/web/lib/api-base.tsapp.bilko.cloudhttps://app-api.bilko.cloud/api/v1bilko-demo.alai.no preserved (dual-mode)Vitest 4/4 PASS
apps/web/middleware.tsapp.bilko.cloud + .bilko.cloudbilko-demo.alai.no preservedMachine-verified on main
apps/web/i18n/request.tsapp.bilko.cloud + .bilko.cloudbilko-demo.alai.no preservedMachine-verified on main

PR #334 (feat/prod-hostname-c2-103300, HEAD c70dab73) adds the test file apps/web/test/api-base-hostname-103300.test.ts. The source changes to the three files above were already on main from prior commits. Proveo confirmed no merge conflict; safe to merge.

Landing CTAs: landing-hr CTAs already point to app.bilko.cloud. landing-io and landing-ba use #demo-form/mailto: anchors — no repoint required.


3. Backend Features Live on Prod (MC #103323)

Deployed to bilko-api-demo (now prod):

  • Sentry error tracking — wired to prod service
  • Flyway V72audit_log.request_id column (renamed from V71 to avoid collision with V71__seed_e2e_test_user)
  • Flyway V73support_tickets table (renamed from V72 for same reason)
  • SupportTicketRoutes live:
    • POST /api/v1/support/tickets — auth-gated (returns 401 if no token)
    • GET /api/v1/admin/support/tickets — auth-gated (returns 401 if no token)
    • PATCH /api/v1/admin/support/tickets/{id} — auth-gated (returns 401 if no token)

Route verification (Proveo C6-lite): Both POST /api/v1/support/tickets and GET /api/v1/admin/support/tickets return 401 (not 404) — routes are live and correctly auth-gated.


4. Prod DB State After Cleanup (C3)

Instance: bilko-demo-db (Cloud SQL, PostgreSQL 16, project tribal-sign-487920-k0, region europe-north1)
Backup anchor taken before cleanup: ID 1781094321949, status SUCCESSFUL, 2026-06-10T12:25:21Z
Cleanup executed: 2026-06-10T12:50Z by FlowForge, authorized by CEO

Organizations on prod DB — post-cleanup (1 row only)

Org IDNameClassificationStatus
d9e364ca-e7fc-48ed-a836-821bcaf79c99Bilko E2E Test OrganisationSEED/TEST — V71 migration seeded 2026-06-10KEPT — CI/Playwright infrastructure (see caveat (a) below)

Seed orgs from V13/V14/V29 migrations (sentinel UUIDs) were already absent before this cleanup — removed in a prior operation. Two real trial orgs (ALAI Holding AS 53349d6a and "unknown's Organization" 4e96b6ff / [email protected]) were deleted per CEO authorization: "all data on bilko-demo-db is test data, no real customers."

Rows deleted in cleanup transaction

TableRows deletedMethod
organizations2Direct DELETE
users3CASCADE
entra_external_identities3Explicit DELETE (bilko_admin role required)
refresh_tokens26Explicit DELETE
chat_conversations1Explicit DELETE
logged_actions1Explicit DELETE (RLS had hidden this row from initial NO ACTION FK pre-check)
invoices1CASCADE
expenses1CASCADE
contacts1CASCADE
expense_documents1CASCADE
Total~40

Pre-commit guards 1-6: ALL PASSED. Post-commit SELECT confirmed organizations = 1 row (E2E org only).

System/catalog tables — do not touch

  • role_permissions — 158 rows (system catalog)
  • permissions — 54 rows (system catalog)
  • account_types — 5 rows (system catalog)
  • flyway_schema_history — 73 rows (migration history)
  • schema_version — 10 rows (migration registry)
  • adapter_config — 3 rows (system config)

Restore anchor

gcloud sql backups restore 1781094321949 --restore-instance=bilko-demo-db

Backup taken 2026-06-10T12:25Z, 10 minutes before cleanup. Contains full pre-cleanup state including both deleted orgs.


5. Known Caveats and Open Follow-ups

RefIssueMCSeverity
(a)E2E test org d9e364ca (Bilko E2E Test Organisation) still on prod DB. Must be moved to staging before first external CIAM customer is onboarded.#103374M — no external customers yet
(b)Stage → prod promotion gate (C4) not yet formalized. Current gcp-deploy.yml deploys on every main push with no UAT approval step. TODO comment exists in the workflow file.#103375M — mitigated by semver tag requirement for prod deploy
(c)api.bilko.cloud returns HTTP 000 — pre-existing Cloudflare Worker Host/SNI rewrite issue, unrelated to this cutover. Direct Cloud Run URL and bilko-demo-api.alai.no both return 200. App is healthy.openL — brand URL, not a functional path
(d)SECURITY REVIEW ITEM: POST /api/v1/auth/test/session test-auth endpoint is present on the prod API surface. Flagged as Securion F7 (MC #103371). Must be removed or hard-gated before any external users are onboarded.#103371H — Securion review required

6. C5 — AI Integration

GROQ_API_KEY bound to bilko-api-demo (rev00165). AI route is live. Evidence: /tmp/alai/7d24e9bf/evidence-bilko-ai-fix/verification.json. Full functional E2E (Entra login path) is pending.


7. Verification Summary (Proveo)

Agent: Angie Jones (Proveo)  |  Timestamp: 2026-06-10T15:03Z  |  Verdict: CUTOVER PASS

CheckResultDetail
app.bilko.cloud HTTP 200PASScurl confirmed
bilko-demo-api.alai.no /api/v1/health HTTP 200PASScurl confirmed
PR #334 — hostname recognition, all 3 filesPASSdual-mode confirmed on main
Vitest api-base-hostname-103300 (4 tests)PASS4/4, 831ms
tsc --noEmit (apps/web)PASS0 errors
MC #103323 routes auth-gated (401 not 404)PASSsupport_tickets POST + GET routes live
DB clean statePASS (evidence-reviewed)SQL SELECT output in cleanup.md is authoritative; Cloud SQL proxy not available in Proveo context
PR #334 merge conflict checkPASS — no conflict5 CI-only commits on main since branch point; zero file overlap with PR files

Full Proveo report: /tmp/alai/p2p-pairing-evidence/proveo-103300-c2c6-verdict.md


8. Cutover Status Table (C1–C7)

ItemStatusOwnerNotes
C1 — domain mapping (app.bilko.cloud + app-api.bilko.cloud → bilko-web-demo / bilko-api-demo)DONEFlowForgeBoth Ready/True, cert Ready/True, HTTP 200
C2 — hostname recognition (middleware / api-base / i18n)DONECodeCraftDual-mode on main; PR #334 adds test coverage
C3 — prod DB cleaned of test/seed orgsDONEFlowForge/DB1 org remains (E2E test org d9e364ca); ~40 rows deleted; backup 1781094321949
C4 — stage → prod promotion gate formalizedPENDINGFlowForgeMC #103375
C5 — AI fix (GROQ_API_KEY on bilko-api-demo)DONERev00165, route live
C6 — Proveo end-to-end validationDONE (C6-lite)ProveoFull E2E blocked on Entra login flow; C6-lite PASS
C7 — Skillforge BookStack documentationDONESkillforgeThis page

9. Evidence Index

ArtifactPath
C1–C7 delta state/tmp/evidence-103300/cutover-state.md
DB inventory (read-only probe, pre-cleanup)/tmp/evidence-103300-c3/inventory.md
DB cleanup execution record + post-commit proof/tmp/evidence-103300-c3/cleanup.md
Proveo C2 + C6-lite verdict/tmp/alai/p2p-pairing-evidence/proveo-103300-c2c6-verdict.md
C5 AI fix verification/tmp/alai/7d24e9bf/evidence-bilko-ai-fix/verification.json