Skip to content

Two-column fixture phone (555-0142) not detected — 7-digit local format below PHONE_RE 10-digit floor #62

Description

@s-annam

Problem

The two-column sidebar fixture's phone number is present in the extracted plain text (555-0142) but the parser reports "Phone not detected" in the Contact card (3 of 5 detected). This drags Completeness scoring (the score's "Missing: phone, LinkedIn" line).

Surfaced during Playwright QA of the #60 two-column reading-order fix.

Observed (live UI, chromium-two-column-sidebar.pdf)

  • Extracted plain text contains: Jamie Rivera Software Engineering Leader 555-0142 jamie.rivera@example.com …
  • Contact card shows Phone — not detected (⚠).

Root cause

This is a fixture artifact, not a general parser gap. PHONE_RE in src/lib/heuristics/regex.ts:19:

export const PHONE_RE =
  /(?:(?:\+?\d{1,3})[\s.-]?)?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}\b/g;

requires a full 10-digit number (\d{3} area + \d{3} + \d{4}, optional country code). The fixture's 555-0142 is only 7 digits (\d{3}-\d{4}) → no match. A real US résumé phone is 10 digits, so the regex is correct for production; the fixture simply carries an unmatchable 7-digit local number.

Broadening PHONE_RE to accept bare 7-digit runs is not advised — it would false-match zip+4, ID numbers, and stray NNN-NNNN runs (e.g. a 1985 - 1989-style range with a dash).

Proposed fix

Primary — fix the fixture to a realistic 10-digit synthetic number. Re-export chromium-two-column-sidebar.pdf with a full synthetic 555 phone that a real résumé would use and that PHONE_RE matches, e.g.:

  • (512) 555-0142, or
  • 512-555-0142, or
  • 555-555-0142

(555-01XX is the reserved fictional block — keep the 555-0142 suffix, prepend a synthetic area+exchange so it's a valid 10-digit shape. Stays PII-free.)

Then re-bake the snapshot — Contact becomes 4/5 and Completeness improves accordingly.

Decision to confirm: should a 7-digit local number ever be surfaced? Recommendation: no — keep PHONE_RE 10-digit-only (production-correct, low false-positive), and fix the fixture. Document this in the fixture README so future synthetic personas use 10-digit numbers.

Affected files

  • tests/fixtures/pdfs/unknown/chromium-two-column-sidebar.pdf — re-export with a 10-digit synthetic phone.
  • tests/fixtures/pdfs/unknown/chromium-two-column-sidebar.expected.json — re-bake (npm run bake-fixtures); Contact field count + Completeness shift.
  • tests/fixtures/pdfs/README.md — add a one-line note: synthetic personas use full 10-digit 555 phone numbers so PHONE_RE matches.
  • src/lib/heuristics/regex.ts:19 — no change (documented as intentional 10-digit floor).

Acceptance criteria

  • chromium-two-column-sidebar.pdf re-exported with a 10-digit synthetic 555 phone; pdftotext confirms the new number and that name/email stay synthetic (Jamie Rivera / @example.com).
  • Live parse surfaces the phone — Contact card shows 4 of 5 detected; phone no longer in the score's missing list for this fixture.
  • chromium-two-column-sidebar.expected.json re-baked and committed alongside the PDF.
  • Fixture README documents the 10-digit synthetic-phone convention.
  • PHONE_RE left at 10-digit (no broadening); npm run test green.

Notes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtestingTests, test infrastructure, coverage

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions