The dial gate
Traced at commit 51a6cfa ·
libs/temporal/src/activities/dial-gate.ts · refusal counts from
dial_gate_audit, 2026-09-09
Summary
- The gate runs 13 checks before each dial.
- The checks run in a fixed order.
- The gate stops at the first refusal.
- The cheapest and most decisive checks run first.
- All 13 checks read one database snapshot.
- The gate evaluates the checks at dial time. It does not use the result from schedule time.
- The gate writes every verdict to the audit record.
- Check 11 refuses more dials than checks 13, 6 and 7 together. Caller-ID health stops most traffic, not compliance.
The 13 checks
state_check— refuses a lead that is not in a dialable state. 6,958 refusals.suppression_check— refuses a stopped person. 36,047 refusals. See Opt-outs.consent_check— refuses a lead with no consent record. No refusals yet.scrub_freshness— refuses a number with an old do-not-call scrub. 40,836 refusals.exclusion_check— refuses a number on the exclusion list of the client. No refusals yet.geo_check— refuses a number outside the permitted area. 79,055 refusals.jurisdiction_check— refuses a dial that breaks a state rule or a federal rule. 50,886 refusals.holiday_check— refuses a dial on a holiday at the location of the person. No refusals yet.frequency_check— refuses too many attempts from one client. 772 refusals.global_freq_check— refuses too many attempts from all clients. No refusals yet.did_check— refuses a dial when no healthy caller ID is free. 354,514 refusals.provider_capacity— refuses a dial at the concurrency limit. No refusals yet.breaker_check— refuses a dial when a safety breaker is open. 90,462 refusals.
Read the counts correctly. “No refusals yet” usually means that the condition has not occurred. It does not mean that the check is inactive.
Rules
- The order is a design decision. Do not change the order without a decision.
- Check 2 is early so that a stopped person is never assessed for consent, list freshness or capacity.
- All 13 checks use one transaction and one security context.
- Each check formerly opened its own transaction. Each check then read different data.
- One snapshot makes the recorded inputs explain the recorded verdict.
- A person can stop a lead on Tuesday that the pacer scheduled on Monday. Eligibility from schedule time is always old.
Exception for rehearsals
- Check 13 returns early for a rehearsal.
- Without this exception, a rehearsal cannot test the other checks while a breaker is open.
- A breaker has been open since 4 September. All current measurements come from rehearsal traffic.
- The system records
breakerBypassedForDryRunon the attempt. - This record prevents confusion between a rehearsal and a live dial.
Opt-outs — check 2 in full, and the two mechanisms that write the records it reads.