Opt-outs
Traced at commit 51a6cfa ·
apps/api/src/app/webhooks/agent-tools.service.ts ·
libs/contracts/src/lib/{vector-resolution,compliance,canonicalization,scrub}.ts ·
libs/temporal/src/activities/{call-attempt,dial-gate}.ts
Summary
- A person asks the agent to stop the calls.
- Three mechanisms record the request. Each mechanism fails in a different way.
- Mechanism 1 writes a stop record during the call.
- Mechanism 2 reads the transcript after the call. It writes a stop record again.
- Mechanism 3 is the safety gate. It reads the stop records before each dial.
- Every join is an OR. One detector is sufficient.
- Mechanism 1 stops one client. Mechanism 2 stops all clients. This difference is a known conflict.
Mechanism 1 — the agent writes the record
- The agent calls the tool
submit_dnc_request. - The tool call arrives at
POST /v1/callback. - The system identifies the client from the call metadata.
- If the metadata is incomplete, the system finds the call id in the database.
- If the database has no record, the system accepts a client name from the agent. The system first confirms that this client exists.
- If all three steps fail, the system writes no record. The system tells the agent to do the task manually.
- The system writes the audit record before it writes the stop record.
- The system writes one stop record. The scope is
NUMBER. The reach is one client. - The system keeps the words of the person as evidence.
- The system sends an email to the administrator of the client.
Note. The audit record comes first. A failure after this point still leaves evidence of the request. The de-duplication key includes the arguments. The platform absorbs a retry from the provider. The platform does not absorb a changed request.
Mechanism 2 — the platform reads the transcript
- The call ends. The provider sends the transcript.
- The system verifies the signature before it reads the transcript.
- Two detectors read the transcript.
- Detector A is the analysis of the provider. Detector A understands meaning. Detector A can be wrong.
- Detector B is a fixed list of 16 phrases. Detector B cannot infer. Detector B does not change.
- One detector is sufficient to set the flag
DNC_REQUEST. See D5 — compliance flags. - The flag causes two actions:
HALT_CADENCEandSUPPRESS_LEAD. - The system writes three stop records. The scopes are
LEAD,NUMBERandGLOBAL. - The scope
GLOBALreaches every client on the platform.
Mechanism 3 — the safety gate
- The gate runs 13 checks before each dial.
- The stop-list check is number 2. It is the cheapest check and the most decisive check.
- The gate stops at the first refusal. A stopped person is never assessed for consent, list freshness or capacity.
- The check matches this lead, this client’s record for the number, or any client’s platform-wide record.
- If no stop record exists, the gate applies a second rule.
- The second rule refuses any lead whose earlier call raised a compliance flag.
- The gate evaluates the checks at dial time. The gate does not use the result from schedule time.
Known conflict
- Mechanism 1 writes the scope
NUMBER. The reach is one client. - Mechanism 2 writes the scope
GLOBAL. The reach is all clients. - The reach of one request therefore depends on which detector operates first.
- The reason for mechanism 1 is that a platform-wide stop from one machine judgement is a decision for a person.
- The reason for mechanism 2 is that the caller does not know that the platform serves several clients.
- Both reasons are correct. This is an open decision. It is not a defect. Do not change one side without a decision.
Known history
- A database constraint rejected every
GLOBALrecord. The write never completed in production. - A rehearsal found this defect. An engineer corrected it.
- The record counts still show the defect. The database holds approximately 20,100
LEADrecords and 1,600GLOBALrecords. - The
LEADcount includes all history. TheGLOBALcount starts at the correction.
Timing
- Mechanism 1 completes during the call.
- Mechanism 2 completes after the call and after the provider analysis.
- The measured delay for mechanism 2 is approximately 3,566 seconds.
- This measurement comes from rehearsal traffic. Use the magnitude, not the value.
- This delay is the reason for mechanism 1.
The dial gate — the 13 checks before each dial. The stop-list check is number 2.