Outcome resolution
Traced at commit ffe4e48; extraction and review re-traced at e53d0dc ·
libs/contracts/src/lib/{vector-resolution,extractor,compliance,canonicalization,review-queue}.ts ·
libs/temporal/src/activities/call-attempt.ts
Summary
- A finished call becomes seven dimensions and one headline.
- Three dimensions come from facts the platform already holds. The platform decides these first.
- Three dimensions describe the conversation. These are less certain.
- The provider analysis fills what it can.
- A phrase list and then a language model fill only the dimensions that are still empty.
- A model can never overwrite a dimension that a certain source decided.
- The platform discards a model answer of
UNKNOWN. The platform does not store it. - An undecided headline, or a weak extraction, sends the call to a person.
Workflow 1 — the seven dimensions
Workflow 2 — the order of resolution
Step 1 — the certain dimensions
- D1, how the call connected. The system derives this from the carrier result and the answering-machine detection.
- D5, compliance flags. The system derives this from the provider analysis and from a fixed phrase list.
- D6, what the agent did. The system derives this from the tools the agent called and from confirmed system markers.
- These three dimensions are now fixed.
- No later step may change them.
Step 2 — the uncertain dimensions
- D2 records who answered.
- D3 records what the person intends.
- D4 records whether the person qualifies.
- The provider analysis fills these dimensions where it can.
- A phrase list then reads the transcript. A phrase match replaces the model answer.
- A language model reads the transcript too. The platform uses its answer only where no phrase matched.
- The model answers all four language dimensions. The platform keeps only the answers for empty dimensions.
- The platform discards a model answer of
UNKNOWN. - An absent answer therefore never displaces a real answer.
- A rehearsal runs the same steps against an impersonated model.
- See D2, D3 and D4 for the rules of each dimension.
The order is the safeguard. A model cannot overwrite a fact. The code never offers the model a dimension that a certain source decided. Change the order and a confident sentence in a transcript can overrule a carrier result.
D5 is different on purpose
- Every other dimension uses a waterfall. The first source to answer wins.
- D5 uses a union. Every source that answers contributes.
- The provider analysis can raise a flag.
- The fixed phrase list can raise a flag.
- One source is sufficient.
- A missed compliance flag is not a data-quality problem. It is a regulatory event.
- See D5 — compliance flags for the two sources and all seven flags.
- See Opt-outs for the flag that carries the most consequence.
Who writes the analysis, and how the transcript checks it
Traced at commit cf34e2f ·
libs/contracts/src/lib/{vector-resolution,compliance}.ts ·
apps/worker/src/main.ts
- On this page, “the provider analysis” means the answers to the post-call fields.
- In production the platform writes those answers itself, with
POST_CALL_ANALYSIS=platformand an OpenAI model. - The production and demo agents carry no post-call analysis fields at Retell.
- Retell still sends
call_analyzed. It holds only the default summary. - The resolver reads the three compliance facts against the transcript before it keeps the model answer.
groundedDisclosurereads each half of the disclosure, AI and recording.- The words of the half in the agent lines count as a delivery. The model answer does not matter then.
- A model
noon a call where the agent never spoke after the first caller turn becomes unknown. - That call ended before the disclosure. It is not a miss.
- In every other case the model answer stands. A real miss still reads
no. groundedClaimreadsmade_prohibited_claim.- A claim of
rate_or_term,funding_amountorapprovalneeds its words in the agent lines. - Those words are a figure, an amount or approval words.
- Without them the claim reads
no, and the call goes to compliance review. - A claim of
otherkeeps the model answer. - The disclosure alert and the campaign audit count a miss only on calls of 20 s or more.
- The constant is
DISCLOSURE_ALERT_MIN_CALL_SECONDS. The call row keeps the resolved value at any length.
Workflow 3 — when a person reviews the call
- The certain sources and the provider analysis run first. A headline that they decide never goes to review.
- A headline that stays
needs_reviewgoes to review with the reasonunknown_dimension. - The workflow disposes a call as
needs_reviewwhen the analysis never arrives. See A call from start to end. - Extraction can decide a
needs_reviewheadline. The platform then checks how firmly it decided. - The call goes to review with the reason
low_confidenceif D2, D3 or D4 stays empty. - The same applies if D2 or D3 is
UNKNOWN. - It also applies if a value that the headline used has confidence below 0.7.
- A phrase match has confidence 0.80 or more. A phrase match alone never triggers this check.
- A rehearsal attempt reaches the queue only inside a tagged simulation run.
- The code also holds
shouldRouteToReviewQueueand the reasonextraction_failure. No production path uses either one. - A person confirms or corrects each dimension.
- The platform records each correction against the original value.
- Those corrections are the only measurement of extraction quality against real calls.
- Review is a normal outcome. It is not a failure.
A call from start to end — how the transcript reaches
this point.
D2 — who answered, D3 — intent and
D4 — qualification — the three uncertain dimensions, one page each.