fix(core): free text's detector reads a dot, a longer run, a line break and invisible characters, and a reference takes nine digits
A dot joins an SSN's groups only when it joins both (000.00.0000), never an EIN's: a coordinate such as 47.6062095 is a number, not a tax id. A group that starts or ends inside a longer run of digits and dashes (a date's day then its reference, a part number) belongs to that run. A line break reads as a space and zero-width and soft-hyphen characters are not counted, as the strict party reading already has it. The reading is one detector with a parameter: a reference (tag, serial, invoice or payment reference, account code, label, where a W-9 or W-4 is kept) drops the bare-nine group, since a serial or a check number is nine digits. The engine now also refuses a payment's reference (printed shapes) and a discount's reason (free text), which only the tools' table covered; a payment entry's description, free text, shows the reference masked. A project's field has an engine-level test. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
657daf43da
commit
dd5f1befd6
8 files changed
+604
-78
No files matched your search
@@ -444,9 +444,15 @@ fn w9_check_refuses_full_tin_in_any_text() {
|
||||
let mut f = w9("6789");
|
||||
f.entity_type = "LLC 12-3456789".to_string();
|
||||
assert!(f.check().is_err());
|
||||
// Where the paper is kept is a reference, not a name or a detail: its
|
||||
// printed shapes are refused, and a bare nine digits (a binder's or a
|
||||
// file's number) is a number there (WB-partner-15).
|
||||
let mut f = w9("6789");
|
||||
f.kept_at = "drawer 123-45-6789".to_string();
|
||||
assert!(f.check().is_err());
|
||||
let mut f = w9("6789");
|
||||
f.kept_at = "drawer 123456789".to_string();
|
||||
assert!(f.check().is_err());
|
||||
assert!(f.check().is_ok());
|
||||
let mut f = w9("6789");
|
||||
f.exempt_payee_code = Some("123-45-6789".to_string());
|
||||
assert!(f.check().is_err());
|
||||
|
||||
Reference in new issue
Block a user