Scenario C — Admin Search Postgres Type Inference
Business symptom (real historical incident, commit 9f35f27): an ADMIN search feature passed every local (H2) test and still broke in real production PostgreSQL with "function lower(bytea) does not exist" — a textbook "works on my machine" defect. Engineering area: JPQL / Postgres bind-parameter type inference. Risk: LOW (historical, fixed). Isolation: every query below runs only against dedicated, disposable synthetic "Triage Scenario C" customer rows created fresh on reset — never real customer data.
Honest note: this specific defect does not currently reproduce on the live database — pgjdbc/Hibernate's type inference for this exact pattern has genuinely improved since the original incident. The steps below still walk through the real historical evidence, diagnosis, and fix; "Reproduce" reports the real, current outcome rather than a forced failure.
Other scenarios: Scenario A — Plan Enrollment Idempotency · Scenario B — Appointment Downstream Resilience
1. Reproduce
A real JPQL search query against the real database, using the currently-active query shape.
2. Investigate
Real evidence: whether the query succeeded, and the defective JPQL's actual source.
3. AI Diagnosis
One real, on-demand model call over the evidence above — not scripted, not told the answer in advance.
4. AI-Generated Candidate Patch
A real, on-demand model call writes the actual fix given the defective file and the evidence above — not told the answer. Applied and compiled in an isolated workspace, never the real repository.
4b. Production Reference
REFERENCE: the real, already-correct, already-tested query style already live elsewhere in this codebase for admin search — for comparison against the AI-generated candidate above.
5. Verification
Runs the real, focused regression test proving this fix's lifecycle mechanics (Test Impact Analysis: only the affected class, not the full suite). Note: this dev environment has no local Docker, so the specific Postgres type-inference proof itself runs only in CI/production — see the test's own honest evidence.
6. Human Approval Required
Applying this fix to the isolated triage scenario requires real ADMIN authorization — the same admin1/admin2 demo credentials used throughout this portfolio. An anonymous or USER-role attempt is rejected server-side, not just hidden in the UI.
Incident Resolved
7. Promote This Candidate to REAL Production (Advanced)
Distinct from Step 6 above (which only flips this isolated demo's own state): this commits the exact AI-generated candidate file shown in Step 4 to a dedicated branch, pushes it, deploys the REAL Customer App, and re-runs this exact reproduction against the newly-deployed production build. Requires real ADMIN authorization. A real human must exercise this — nothing in this system can promote a candidate on its own.