LeadRefinery — How the Platform Works

D5 — compliance flags

Traced at commit fd938cc · libs/contracts/src/lib/vector-resolution.ts lines 218–230 and 376–388 · libs/contracts/src/lib/{compliance,canonicalization,scrub}.ts · libs/temporal/src/activities/openai-provider.ts

Summary

  1. D5 is a list of flags. The other six dimensions each hold one value.
  2. D5 uses a union. The other six use a waterfall, where the first source wins.
  3. Two sources work today. They are not equal.
  4. The voice provider can raise exactly one flag: DNC_REQUEST.
  5. The platform’s own phrase list can raise any of the seven.
  6. One source alone is enough. Neither source can cancel the other.
  7. A third source exists in the code. Nothing calls it.
  8. Every flag stops the cadence. Six also write a stop record that reaches every client.

Workflow 1 — the two sources

D5 has two working sources and one that is built but not connected. The voice provider contributes two boolean fields: its own opt-out field, and a custom post-call field the platform asked it to fill. Either of those being true raises exactly one flag, DNC_REQUEST. The platform's own phrase list reads the transcript and can raise any of the seven flags. The two sources combine as a union in a set, so one source alone is enough and neither can cancel the other. A third source, a language-model second net, is written and has an interface, but nothing calls it, so it contributes nothing today.
Workflow 1 of 2 — the sources. The provider can only ever report a stop request. Every other flag comes from the platform.

What the voice provider contributes

  1. The provider returns two boolean fields on the call analysis.
  2. opt_out_sensitive_data_storage is a field the provider fills by itself.
  3. requested_do_not_call is a field the platform asked the agent to fill.
  4. The platform reads the first from the analysis and the second from the custom data.
  5. If either field is true, the platform adds DNC_REQUEST.
  6. The provider cannot raise any other flag.
  7. If two analysis messages arrive, the platform combines the booleans with OR.

What the phrase list contributes

  1. The platform reads the transcript with a word-boundary match.
  2. The list holds 83 phrases across the seven flags.
  3. A match raises the flag for that phrase.
  4. The list can raise any of the seven flags.
  5. The list cannot infer. It matches the words or it does not.
  6. The list does not change between calls, so two identical transcripts give the same flags.

The asymmetry is the part people miss. The provider understands meaning but reports only one flag. The phrase list understands nothing but reports all seven. Each one covers the weakness of the other, which is why the platform keeps both.

How the platform combines them

  1. The platform puts every flag into one set.
  2. A set removes duplicates, so two sources raising the same flag give one flag.
  3. The platform does not compare confidence between the sources.
  4. The platform does not let one source overrule the other.
  5. One source alone is enough to raise a flag.
  6. The result is a list. An attempt can carry several flags at once.

The third source

  1. The code contains a language-model second net for D5.
  2. It has an interface, a prompt and a provider that implements it.
  3. No code path calls it.
  4. It therefore contributes nothing today.
  5. Read a D5 flag as the output of two sources, not three.

Workflow 2 — what each flag does

A table of the seven compliance flags. Every flag halts the calling cadence. DNC_REQUEST with 16 phrases and CONSENT_REVOKED with 10 both write an opt-out stop record reaching every client. WRONG_NUMBER_SUPPRESS with 5 phrases writes a wrong-number record. ATTORNEY_LITIGATION with 16 phrases also keeps the recording and alerts an administrator, and writes a litigator record. DECEASED_BANKRUPTCY with 11 phrases keeps the recording and writes a manual record. INCAPACITY_MINOR with 16 phrases keeps the recording, alerts an administrator and writes a manual record. LANGUAGE_BARRIER with 9 phrases halts the cadence and writes no stop record at all.
Workflow 2 of 2 — the consequences. Every flag stops the cadence. Six write a stop record that reaches every client.

Reading the table

  1. Every flag halts the cadence for that lead.
  2. Six flags also write a stop record.
  3. Each of those six records a different reason.
  4. All six reach every client on the platform.
  5. Three flags also keep the recording for an audit.
  6. Two of those three also alert an administrator.
  7. LANGUAGE_BARRIER writes no stop record.
  8. The person did not ask the platform to stop. The platform cannot proceed in that language.

Why the six reach every client. Each one records a fact about the person or the number, not a fact about one client’s campaign. A person who died is dead for every client. A litigator is a litigator for every client. See Multi-tenancy and isolation for the two places the platform crosses client boundaries on purpose.

Limits worth knowing

  1. The phrase list is the whole vocabulary of the second source.
  2. A request phrased outside those 83 phrases reaches D5 only through the provider field.
  3. The provider field covers only DNC_REQUEST.
  4. So a request outside the phrase list, for any other flag, reaches D5 through nothing.
  5. The platform measures this gap in the evaluation harness, not in production.
  6. See Observability for what production does and does not measure.

Opt-outs — what happens after DNC_REQUEST, which is the flag with the most consequence.
Outcome resolution — how D5 differs from the six dimensions around it.