← Back to Pull requests

fix(verification): read the document holder's name, never the issuer's #454

Open
unknown opened this pull request with 491 lines diff across 6 files
View on GitHub
unknown unknown commented on Nov 17, 2026 14:58 UTC
Author

What

The document check (document_check.py, _prompt) now asks the model for the holder's names:

  • given_names / surnames: the person the document is about or addressed to (holder, account holder or addressee). Never a person who signs for the issuer.

  • business_name: the company the document is about or addressed to. Never the company that issued it (a bank, phone company, utility, authority).

  • values: a person's or company's name is the holder's, never the issuer's.
  • Docs: one sentence in docs/operations/carrier-verification.md (Document check).

    Why

    The old prompt said "a company's name exactly as printed" but not whose. On a bill or bank statement the model often returned the issuer. So the company box could be filled with the bank's or utility's name, and the company name check could warn when the customer typed their own company.

    Probe (real model)

  • Model: eu.anthropic.claude-haiku-5-5 (the document reader's default), Bedrock eu-central-1. Fallback models turned off for the probe, so every answer is Haiku's.

  • Same request read_document sends, through check_documents, with the GB mobile forms from the saved Twilio fixtures (business form: proof of address slot; person form: proof of address slot).

  • 3 synthetic documents with made-up names: (a) image PDF phone bill from "Nordtel AB" to "Lumen Konsult AB", Att: "Erik Lind"; (b) PNG electricity bill from "Stadsel Energi" to "Anna Berg"; (c) PNG bank statement from "Kustbanken" to "Anna Berg", signed by a bank employee.

  • 5 runs per cell, old prompt vs new prompt. "Company box" = the business_name form value the console would fill.
  • | Document | Form | Old: names | Old: business_name | New: names | New: business_name |
    | --- | --- | --- | --- | --- | --- |
    | (a) phone bill | business | empty 5/5 | Lumen Konsult AB 5/5 (box 5/5) | empty 5/5 | Lumen Konsult AB 5/5 (box 5/5) |
    | (a) phone bill | person | empty 5/5 | Lumen Konsult AB 4/5, Nordtel AB 1/5 | empty 5/5 | Lumen Konsult AB 5/5 |
    | (b) electricity bill | business | Anna Berg 1/5, empty 4/5 | Stadsel Energi AB 5/5 (box 5/5) | Anna Berg 5/5 | empty 5/5 (box empty 5/5) |
    | (b) electricity bill | person | empty 5/5 | empty 5/5 | Anna Berg 5/5 | empty 5/5 |
    | (c) bank statement | business | empty 5/5 | Kustbanken AB (publ) 5/5 (box 5/5) | Anna Berg 5/5 | empty 5/5 (box empty 5/5) |
    | (c) bank statement | person | Anna Berg 5/5 | Kustbanken AB (publ) 5/5 | Anna Berg 5/5 | empty 5/5 |

  • The new prompt returned the holder in every run (30/30) and never the issuer.

  • The bank employee who signs the statement was never returned.

  • Contact person "Erik Lind" (Att line on the phone bill): the top-level names stayed empty with both prompts. With the new prompt he filled the form's first and last name 1 of 5 runs on the business form. Not graded.

  • The synthetic files are deleted.

  • Not probed: a text (not image) PDF, passports and ID cards, and other carriers' forms.
  • Tests

  • New: the prompt has the holder rule for names, company and values (person and business form).

  • New: an empty company name read gives no company warning (bill addressed to a person, sent for a company).

  • core/tests/providers/test_verification_document_check.py: 111 passed, 1 skipped.

  • api/tests/test_verification_document_check_api.py: 32 passed.

  • ruff 0.16.10 and black 26.10.0 pass.
  • What merge does by itself

  • Push to main runs the Deploy workflow (a core/ change is not in paths-ignore): it runs CI, rebuilds the 3 service images (API, voicebot, MCP) and rolls them on the VM. The API then sends the new prompt. No migration.
  • What merge does not do

  • No env var, secret, schema, OpenAPI or MCP change.

  • No hail-website change is needed for this fix. The console change that fills the company box from printed_name.business_name is separate and depends on this one shipping first.
  • Review: 0 of 1 commits.

    Diff: 491 lines (+368 / -123) across 6 files Reviewer: claude[bot] Review duration: 8m
    All Vouch review confidence checks passed
    Residual risk 0.32 = Change Risk (0.52) × (1 − Review Confidence (0.39)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 491 lines diff across 6 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 67% · Reviewer familiarity: 35%
    38%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.371
    Shallow Review Depth shallow_review_depth
    0.344
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #454"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 38.6% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52.4% (MEDIUM) · Higher = larger blast radius
    52.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 38.6% · Lower = rushed or shallow review
    38.6%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 32.1% · Safe to merge
    32.1%
    Repository