Skip to content

fix(scaffold): users service Prisma binds a stale Postgres endpoint — DB health check fails on a clean scaffold.runtime run #1202

Description

@rickylabs

Filed by the 0.0.5 orchestrator from two independent reproductions in the milestone run.

Observed twice, once with zero contention:

  1. Sagas slice merge-readiness run (PR fix(sagas): register KV adapter in generated runtime glue #1193 records): suite 51/1 — live Postgres on 44973, the users service's Prisma still bound to 50564 after the nominal preserve-AppHost gate.
  2. Orchestrator clean rerun (2026-08-04 ~07:13Z, nothing else on the machine, fresh scaffold): suite 51/1 — users health probe: https://localhost:44903/health → fetch failed; http://localhost:3001/health → 503 {database: unhealthy, Prisma raw query failed}; http://localhost:46361/health → 200 Healthy. Two instances of the service disagree; the DB-backed one binds a Postgres endpoint that is not the live one.

Class: the connection-string/endpoint wiring for DB-backed services goes stale across AppHost allocations — sibling of #1196 (ephemeral db-operation AppHost masking) and the reason the sagas slice's earlier suite run was mis-read as environmental churn. A clean-run reproduction retires that theory: this is a product defect in scaffold DB wiring.

Acceptance

  • On a fresh scaffold, the users service's Prisma endpoint matches the live Postgres allocation — health probe green on the first AppHost start, demonstrated on a clean scaffold.runtime one-pass
  • The stale-write path has a RED-first test proving no persisting path exists (identification split to fix(scaffold): identify what actually persisted the stale Postgres endpoint in the #1202 reproductions #1396 by owner ruling 2026-08-09 — the mechanism originally named for it was falsified in source; see the correction comment below)
  • A second consecutive AppHost start (fresh allocation, same scaffold) stays green — the re-allocation case is the trigger surface
  • Verified artefact-first per the owner's standing bar (health JSON + otel evidence, not exit codes)

Refs #1196 (family), #1193 + the orchestrator run log (evidence), #1191 (the previous layer of this onion: the DB service now starts, and hits the next defect).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions