Judge proof
How the CALL-E integration works
Four surfaces do the real work. Each one is load-bearing for the result you see.
Price extraction and comparability normalization are heuristic and advisory. Confirm the final price with the clinic. The one guarantee we keep precisely: a price is never ranked unless it traces back to a real quoted sentence in the transcript.
1. Multi-recipient parallel calls
One CALL-E task fans out to every clinic at once via recipients[], so the whole shortlist is dialed in parallel and rolls up into a single result.
lib/calle.ts · createQuoteCall
2. Per-recipient structured extraction
GoodFaith requests structured fields (cash_price, price_basis, includes/excludes, quoted sentence). Because the current CALL-E API tier does not accept JSON result schemas (400 not supported), it does not send them; instead it derives each field deterministically from the call transcript and summary. Extraction is heuristic and advisory, so confirm the final price with the clinic, but a price is never ranked unless it traces to a real quoted sentence.
lib/schemas.ts + lib/extract.ts
3. Completion-confidence gating
CALL-E's model completion_confidence score is used as a gate, not a correctness guarantee: any call below 0.6 is held back for review and never ranked, fail-closed.
lib/normalize.ts · CONFIDENCE_THRESHOLD
4. Evidence / transcript audit trail
Every ranked price is traced back to the exact transcript turn it was said in. A price with no traceable utterance is refused, not ranked.
components/AuditTrail.tsx + lib/normalize.ts · findEvidence
Also implemented
- Idempotent webhook receiver keyed on CALL-E-Event-Id: a re-delivered terminal event is a no-op (api/calle/webhook).
- Live call-events stream surfaced to the console (api/quotes/[id]/events → calls.listEvents).
- metadata.rfq_id correlation carried across the call and the webhook.
- Server-side credentials only + mock-first default: no key ever reaches the browser (lib/env.ts).
Optional / stretch
- Optional Goals API path (runAndWait, per-run idempotency key) when CALLE_GOAL_ID is set: a reusable published Goal per clinic (lib/calle.ts · maybeRunGoal).
Winner traced to the transcript
$438Lone Star Open MRI
“For a self-pay lumbar MRI without contrast our all-inclusive cash price is four hundred and thirty-eight dollars, and that includes the radiologist reading.”
at 14s in the transcript
Sample rollup (derived from the transcript)
{
"clinics_reached": 3,
"quotes_obtained": 2,
"lowest_all_inclusive": 438
}