fix(core,mcp,store): a phone number is kept and a ZIP+4 is kept; only a tax id's printed shapes are refused in a phone

A telephone is ten digits or more, so the strict reading of a party's fields
(any run of nine digits) refused every phone number: the bill-to snapshot's
check, new with the free-text change, refused `503-555-0100` and failed the
window's invoice test. The party's own phone (since D-55) and the tool's
bill-to phone had always been refused the same way; only 7-digit test
numbers hid it.

A phone field (a party's, a bill-to's, the seller's) is now its own class,
read as a reference is: refuse the printed SSN 3-2-4 and EIN 2-7 and nothing
else, since a nine-digit national number is ordinary. A postal address
keeps the strict reading except a ZIP+4 (`98101-1234`, five and four, nine
digits), a postal code. The formation state's entity number is a
registration number (a Washington UBI is nine digits) and is read as a
reference. The tools' table, the engine, and the audit's keys agree; the
audit reads `phone` and `fax` as a phone.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-21 20:50:23 -07:00
1 parent 1dbca94bd2
commit c206652abe
12 files changed
+725 -52

No files matched your search

+6
View File
@@ -159,6 +159,9 @@ enum TextClass {
/// account code): only the grouped shapes are found, a bare nine digits
/// being a legitimate number there (WB-partner-15).
Reference,
/// A telephone or fax number: read as a reference is (only the grouped
/// shapes), by its own name so that a phone is never read as words.
Phone,
}
/// The journal fields that hold words someone wrote (never an id, a digest
@@ -197,6 +200,8 @@ const TEXT_KEYS: &[(&str, TextClass)] = &[
("display_name", TextClass::Free),
("address", TextClass::Free),
("contact", TextClass::Free),
("phone", TextClass::Phone),
("fax", TextClass::Phone),
("kept_at", TextClass::Reference),
("approver", TextClass::Free),
];
@@ -566,6 +571,7 @@ impl Store {
TextClass::Reference => {
ledger_core::settings::holds_printed_tin_in_reference(&text)
}
TextClass::Phone => ledger_core::settings::holds_printed_tin_in_phone(&text),
};
if looks {
out.push(found(