Scoring — Phone

mercury.score.score_phone(link_phones: list[str], customer_phone: str) -> float

Normalization

Input strings are reduced by mercury.normalize.normalize_phone:

  1. Strip every non-digit character.
  2. Keep the last 10 digits (drops +1 and other country prefixes, any extension appended to the end).
  3. If fewer than 10 digits remain, the value is treated as empty.

Agreement rule

The score is 1.0 if any entry in link_phones normalizes to the same 10-digit string as the customer’s normalized phone; 0.0 otherwise. There is no partial credit — a phone either matches exactly or it doesn’t.

Inputs in the interview fixtures

All four formats present in third-party-banks.json collapse to the same normalized form:

RawNormalized
55576098705557609870
(555)-760-98705557609870
555 098 98705550989870
555-010-99885550109988
+1 (555) 760-98705557609870

Edge cases

  • Empty list on the link side → 0.0 (no signal).
  • Empty customer phone → 0.0 (defensive).
  • Multiple link phones — any one agreeing is sufficient; the function short-circuits on the first match.

Combiner contribution

Weight: PHONE_WEIGHT = 1.5 (see scoring-combiner). A phone match alone contributes 1.5 to the total — below the 2.5 threshold. Corroboration is required.