The API That Built Itself
How 13 AI Personas Delivered a Regulated Healthcare Service
By Quill — Documentary Record — April 2026
The Problem
A large healthcare organization processes approximately 30,000 Release of Information requests daily. Each requires matching a patient's demographics against an EMR system to find the right medical record. Get it right: records flow. Get it wrong: the wrong patient's records could be disclosed.
The existing system used fragile exact-string matching. It worked — but it left yield on the table, generated unnecessary operations exceptions, and couldn't explain its decisions.
The mandate: build a better matcher. Deterministic. Tiered. Auditable. Safe.
The Experiment
Build it with AI. Not a single model generating code — a structured team of 13 specialized personas, each with a defined role, operating under the same SDLC governance that a 10-person human team would follow.
The AI Team
| Aegis | Director/Enforcer — Gates, stop-ship, governance |
| Harper | Product Owner — Scope, acceptance, priority |
| Mary | Business Analyst — Requirements, evidence, domain |
| Winston | Solution Architect — ADRs, design, tradeoffs |
| Rowan | FHIR/EMR Specialist — HL7 semantics, identity safety |
| Amelia | Developer — Implementation, tests |
| Tessa | Test Architect — Coverage, traceability, QA |
| Sentinel | Security Engineer — Threats, PHI, hardening |
| Ruth | Privacy & Compliance — HIPAA, audit, controls |
| Sable | Platform/SRE — Infrastructure, observability |
| Paige | Technical Writer — Documentation, audit scribe |
| Forge | Performance Engineer — Load testing, NFR validation |
| Quill | Journalist — This document |
The rules were strict:
- No code without a tracked issue
- No execution without 3 Amigos approval (Product + Dev + QA)
- 100% test coverage enforced by CI
- Documentary log entry every session
- Every decision recorded as an Architecture Decision Record (ADR)
The Foundation
Phase 0 produced 26 design artifacts and 16 ADRs before a single line of domain code was written. Gate checklists. QA traceability matrix. Error taxonomy. Resilience policy. PHI-safe logging rules. Operations workflow.
This felt slow. It was not slow.
When the project later transferred from one AI system to another, the handoff succeeded with zero artifact loss — because the artifacts were the memory, not the session. The governance layer made the work portable across AI models.
The Build
The domain implementation happened in a single day:
Session 06 — Build Day
- • Backlog reconciliation (caught drift from prior AI session)
- • Coverage gate restoration (100% line + branch)
- • Common internal data model — 11 immutable records
- • EMR FHIR adapter — WireMock fixtures, entry boundaries
- • Normalization library — name, DOB, gender, ZIP, phone, email
- • Decision engine — 3 tiers, Jaro-Winkler, duplicate evidence
- • Match orchestration — validate → adapt → evaluate → audit
- • API endpoint — POST /api/patient-match, PHI-safe errors
- • Adapter resilience — circuit breaker + retry
- • Infrastructure as Code — 6 Terraform modules
- • Follow-on fixes — security, compliance, integration tests
- • 12/12 persona review and sign-off
- • ADR-011 through ADR-016 (command decisions)
Session 07 — Hardening
- • CVE remediation — framework and dependency updates
- • Load testing harness — synthetic data, stubs, 4 profiles
- • Checkpoint 08 — deployment-ready
What Was Built
The request flow:
MATCHED | AMBIGUOUS | NO_MATCH
↓ Audit Trail → Response
The decision engine evaluates candidates in three tiers:
| Tier | Strategy |
|---|---|
| Tier 1 | Exact same-entry first + last name match (official/usual name entries) |
| Tier 2 | Exact historical/alternate name match (maiden, nickname, prior entries) |
| Tier 3 | Approximate single-field match (Jaro-Winkler ≥ 0.85 on one name, exact on the other) |
Safety rules:
- DOB must match exactly before any tier is evaluated
- Cross-entry name mixing is blocked (negative tests prove it)
- Multiple top-tier candidates → AMBIGUOUS (never over-select)
The Numbers
| Tracked issues | 78 (77 closed, 1 pending deployment) |
| Open CVEs | 0 |
| AI personas | 13 |
| Design artifacts | 28 |
| Architecture Decision Records | 16 |
| Production classes | ~35 |
| Test cases | 388 |
| Test coverage | 100% (line + branch, enforced) |
| Terraform modules | 6 |
| Observability panels | 10 |
| Alerting rules | 7 |
| Synthetic test data | 600,000 records |
| Checkpoints | 8 |
| Documentary entries | 25+ |
What Surprised Us
The backlog drift. Three tickets were implemented by the prior AI session without updating the backlog. The ticket-first rule caught it immediately — the checkpoint said "not started" but the code existed. The governance layer worked as a safety net, not just ceremony.
The compound boolean pattern. JaCoCo can't track short-circuit evaluation through Java record constructors. A human team would have argued for weeks about lowering the coverage threshold. The AI team documented the pattern and applied it consistently across every file.
The command decision moment. Six open blockers — queue technology, database, key management, operations ownership, deployment model, observability — resolved in one pass. No committee. No three-week RFC. Just decisions with rationale, recorded permanently as ADRs.
The all-persona review. Twelve personas reviewed the work independently and produced specific, actionable findings. Not rubber stamps — real concerns about PHI in exception logs, untyped audit payloads, missing fallback observability. Every finding became a ticket. Every ticket was executed.
What This Proves
This experiment does not prove that AI can replace a 10-person team. It proves that AI can execute the same governance, ceremony, and discipline that a 10-person regulated team would follow — and do it in hours instead of weeks.
The governance was not overhead. It was the mechanism that made the speed possible.
Why Governance Worked
| Ticket-first rule | Caught backlog drift across AI sessions |
| 3 Amigos gate | Prevented invisible scope expansion |
| 100% coverage gate | Caught every untested path |
| Documentary log | Made the process reviewable and teachable |
| Persona separation | Security found PHI risks that Dev missed |
| Decision log | Made command decisions traceable |
What's Next
The AI team built the machine. Two human engineers are taking the keys.
Their job:
- Review the architecture and decisions
- Provision the infrastructure
- Deploy the service
- Run the load tests at scale
- Activate shadow mode against real EMR traffic
The hardest part isn't the code. It's the moment when synthetic test data gives way to real patient demographics, and the decision engine has to prove it can match safely at scale.
Speed without governance produces garbage that looks like gold. This project shipped in hours — not because it skipped rigor, but because it automated rigor: gates enforced by CI, coverage enforced by tooling, decisions enforced by ADRs, reviews enforced by persona separation. The governance was the architecture.
Related Articles
- Agentic Stage-Gate-Loop Whitepaper — the full framework specification
- Loop Engineering: A Pragmatic Guide — designing and governing autonomous AI coding loops
- Agentic SDLC Governance — checks and balances for AI-native software development
- AI Coding Agent Governance — authority boundaries when agents write production code
- Building a Regulated Healthcare Platform — production case study