The API That Built Itself

How 13 AI Personas Built a Regulated Healthcare Service

Douglas Jones · April 2026

Disclosure

This article describes generalized engineering patterns from production experience in regulated healthcare. Specific system names, architectures, client identifiers, thresholds, and proprietary implementation details have been removed or abstracted. The engineering lessons are the author's own.

Status

The service was built by the AI personas described below. Deployment and production hardening were handled by two human engineers, and one of the 78 tracked issues (see the table below) was still pending deployment at the time of writing. The service was deployed on 1 September 2026; this page reports no production results. It is the author’s account of one project, not a measured result of the framework.

The Problem

A large healthcare organization processes tens of thousands of medical records requests daily. Each requires matching a patient's demographics against an EMR system to find the right record. Get it right: records flow. Get it wrong: the wrong patient's records could be disclosed.

The existing system relied on exact-string matching. It worked for the common case — but it missed matches that a more sophisticated approach would catch, and it couldn't explain its decisions to operators.

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

AegisDirector/Enforcer — Gates, stop-ship, governance
HarperProduct Owner — Scope, acceptance, priority
MaryBusiness Analyst — Requirements, evidence, domain
WinstonSolution Architect — ADRs, design, tradeoffs
RowanFHIR/EMR Specialist — HL7 semantics, identity safety
AmeliaDeveloper — Implementation, tests
TessaTest Architect — Coverage, traceability, QA
SentinelSecurity Engineer — Threats, PHI, hardening
RuthPrivacy & Compliance — HIPAA, audit, controls
SablePlatform/SRE — Infrastructure, observability
PaigeTechnical Writer — Documentation, audit scribe
ForgePerformance Engineer — Load testing, NFR validation
QuillJournalist — This document

The rules were strict:

The Foundation

Phase 0 produced 26 design artifacts and the first ten ADRs before a single line of domain code was written; ADR-011 through ADR-016 followed on build day, for 16 in total. 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 no artifact loss that we detected — 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 — RESTful patient-match service, PHI-safe errors
  • • Adapter resilience — circuit breaker + retry
  • • Infrastructure as Code — Terraform modules
  • • Follow-on fixes — security, compliance, integration tests
  • • 12/12 AI-persona reviews recorded (all on the same model family; human sign-off is separate)
  • • 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:

Request → Validate → EMR FHIR Search → Normalize → Decide

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 (fuzzy string similarity on one name, exact on the other)

Safety rules:

The Numbers

Tracked issues78 (77 closed, 1 pending deployment at the time of writing)
Open CVEs0
AI personas13
Design artifacts26
Architecture Decision Records16
Production classes~35
Test cases388
Test coverage100% (line + branch, enforced)
Terraform modulesYes
Observability panels10
Alerting rules7
Synthetic test data600,000 records
Checkpoints8
Documentary entries25+

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. The team restructured those conditions into a documented pattern so that every branch is measurable. This is a workaround for a tool limitation. It means the “100% branch coverage” figure is the most the tooling can report, not evidence that every behavior is correct.

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 each reviewed the work from their own role and produced specific, actionable findings. All twelve ran on the same model family, so this was separation of roles, not independent review: same-model review adds little independent signal, and a human signed off separately. 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 Suggests

This is one project, reported by its author, and it does not show that AI can replace a 10-person team. It suggests that AI can follow the same governance, ceremony, and discipline that a 10-person regulated team would follow — and do the implementation in a single build day. The service was deployed on 1 September 2026, but this page reports no production results, so it does not show how the service performs in production.

The governance was not overhead. It was the mechanism that made the speed possible.

Why Governance Worked

Ticket-first ruleCaught backlog drift across AI sessions
3 Amigos gatePrevented invisible scope expansion
100% coverage gateFlagged the untested paths the coverage tool could see
Documentary logMade the process reviewable and teachable
Persona separationSecurity found PHI risks that Dev missed
Decision logMade command decisions traceable

What's Next

The AI team built the machine. Two human engineers are taking the keys.

Their job:

  1. Review the architecture and decisions
  2. Provision the infrastructure
  3. Deploy the service
  4. Run the load tests at scale
  5. Activate shadow mode against real 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.

The governance insight

Speed without governance produces garbage that looks like gold. The implementation took a single build day — not because it skipped rigor, but because it automated rigor: gates checked by CI, coverage checked by tooling, decisions recorded in ADRs, reviews structured by persona separation. The governance was the architecture.

Related Articles


Douglas Jones · Codifide