docs: free text meets a tax id's shapes, bank files mask, chart files refuse (WB-partner-15)

The claim on BS-partner-2 gains a marked CHOICE (the owner, 2026-11-21:
shapes on free text, strict on party fields, masking on bank imports) and
the product rule WB-partner-15 with the downsides accepted; the tool
interface, the handbook sections an assistant reads (parties and TINs,
files in and out, attestations and audit) and the two import tools'
descriptions say what is refused, what is masked and what the audit
names.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-21 15:14:02 -07:00
1 parent 0c6b6586fc
commit d2384dfe7c
12 files changed
+129 -17

No files matched your search

+43 -5
View File
@@ -763,6 +763,30 @@ What the books keep of a call, and what a repeat is told:
counts, the books server stopped to protect the books, and sending the call
again with the same key answers what it answered and changes nothing.
**No tax id in a tool's text** (BS-partner-2, WB-partner-15). Before a write
tool runs (a preview included), every string in its arguments is checked once,
from one table of every string each write tool takes (`text_fields.rs`; 423
strings in 78 tools): *free text* (memos, notes, reasons, descriptions,
references, names of classes, projects and periods, a receipt's description,
file name and annotations, a decision's or an item's words) is refused when
it looks like a tax id (nine digits standing alone, an SSN's 3-2-4 or an
EIN's 2-7 grouping, joined by any dash, dot or space); a *party's own field*
(a party's or a customer's or vendor's name, the bill-to details, a
recipient, an account name) when it holds any run of nine digits; a string
that is a lookup key, an id, an amount, a date, a word from a fixed
vocabulary, the last four digits, a bank pattern or a link is exempt, and
`set_tin` and `set_w9` take their `tin` (the vault's input) unread. A
setting's value or a convention's structured body is read by the engine's own
checks (`company.ein` and the `ach` and `wire` routing lines are the only
exceptions). An invoice number, a phone number, a reference of ten digits or
more, an amount and a date are no tax id. The refusal is in words, names the
field ("the name of books.add_class looks like it holds a tax id ..."), says
tax ids are stored only with `books.set_tin` or a W-9 (`books.set_w9`), never
repeats the number, writes nothing, and is recorded as refused `tin_in_text`.
The same text meets the same check in the engine, so no other caller can
journal one; books that already hold such a line open as ever, and
`books.audit` names the line and the field (`tax_id_in_journal`).
Books an older version wrote take no write at all until the owner gives the
format upgrade its go-ahead (D-89, WB-format-11): every write is refused,
before it runs, with `format_upgrade_pending` and the words "nothing can be
@@ -1602,7 +1626,8 @@ statement 8).
**Rules the engine enforces** (each refusal changes nothing, the journal
byte for byte): no party field holds a full TIN (a run of nine digits,
single spaces or hyphens allowed between them); a W-9's TIN is its last
single spaces or hyphens allowed between them; free text such as a memo or a
note is read by a tax id's shapes only: "No tax id in a tool's text"); a W-9's TIN is its last
four digits only; W-9 facts need a 1099 role (contractor or landlord), W-4
facts the employee role; names are unique among parties not archived;
texts are at most 500 characters, no control characters.
@@ -2325,7 +2350,8 @@ posting.
- `books.import_bank_csv { upload_id, bank_account_code,
default_offset_code, rules?, date_order?, source_attachment_id? }` →
`{ imported: [{ entry_id, date, description, amount, offset_account }],
count, source_attachment_id, source_linked }`: one draft per
count, source_attachment_id, source_linked, masked_count, masked: [{ row,
column, numbers }], masked_note? }`: one draft per
transaction, all or none, from the QuickBooks bank-upload layout
(`Date,Description,Amount`, payments negative, or
`Date,Description,<money out>,<money in>`). `rules` maps description
@@ -2333,11 +2359,20 @@ posting.
else `default_offset_code`. `source_attachment_id` (the export as filed, category
`import_source`) is checked before any draft and linked to the bank
account (`source_linked`; false when it was already), never to the
drafts: a bank export is not a receipt.
drafts: a bank export is not a receipt. A bank's description is not typed
by a person and often carries a nine-digit reference, so the file is not
refused for one: a number in a description that reads as a tax id (nine
digits standing alone, an SSN's or an EIN's shape) is kept masked to its
last four digits (`•••-••-1234`), `masked_count` says how many values were
masked, `masked` on which lines of the file (`row`, `column`
"Description"), and `masked_note` says so in words (WB-partner-15).
- `books.import_chart_csv { upload_id }` → `{ created,
count, warnings? }`: creates accounts from
`code,name,type,parent_code[,tax_category]` CSV. All-or-nothing; the
name and tax category rules are `books.add_account`'s.
name and tax category rules are `books.add_account`'s. A chart is typed by
a person: a cell that looks like a tax id (a name with any run of nine
digits, another cell with a tax id's shape) refuses the whole file,
naming its row (the file's line) and column, never the number.
- Each takes the CSV only as an upload (`books.begin_upload` purpose
`import`; UTF-8; D-46). The CSV itself is not filed: file
it with `books.file_document` (category `import_source`) for
@@ -3069,7 +3104,10 @@ and the attestations wait for the books' format upgrade, refused with
depreciation, the asset register, each posted entry against the receipt
policy, open drafts, tax categories, 1099 decisions and the settings;
then the journal's chain, the database against a replay, the stored
files, the access log, duplicate files and the backups. The same books
files, the access log, duplicate files, a journal line whose text field
looks like a tax id (`tax_id_in_journal`, a warning naming the line and
the field, never the number; the journal is not rewritten) and the
backups. The same books
(the figure head), day, scope and programme return the run that exists
(`already_run`) and file and journal nothing. "The same books" means no
entry, document, close, settings or role change since: an audit, an
+73
View File
@@ -116,6 +116,15 @@ is its TIN facts', else its W-9 facts'.
**Pick (BS-partner-8):** `outside-the-books`, the owner, 2026-10-15.
**CHOICE (the owner, 2026-11-21):** how text is read for a tax id depends
on what the text is: free text (a memo, a note, a reason, a description, a
reference, a class or project name) is refused only when it *looks like* a
tax id (nine digits standing alone, an SSN's 3-2-4 or an EIN's 2-7, with any
dash, dot or space between); a party's own fields keep the strict reading
(any run of nine digits); a bank file's descriptions are kept with such a
number masked to its last four digits. WB-partner-15 states it, with the
downsides the owner accepted.
**Enforced:** `crate::parties` (has_full_tin, check_text, W9Facts::check,
W4Facts::check), `Ledger::add_party`, `update_party`, `set_party_role`,
@@ -303,6 +312,70 @@ directory read W-9 facts only, so a member's read as missing).
`books.export_cpa_package`, `books.party`. **Checked:** `ledger-core`
`tests/spec_parties.rs`; `ledger-cli` `tests/spec_vault.rs`.
**WB-partner-15** Free text meets a tax id's shapes, not every run of nine
digits (CHOICE, the owner, 2026-11-21). The refusal of BS-partner-2 reads
text two ways, on purpose:
- *Free text* (entry and reversal descriptions, memos, notes, reasons,
references, line descriptions, class, project, period, asset and schedule
texts, a receipt's description, file name and annotations, a decision's
or an item's words) is refused when it holds nine digits standing alone,
or an SSN's 3-2-4 or an EIN's 2-7 grouping joined by a hyphen or any other
dash, a dot or a space, in any Unicode form (`settings::holds_printed_tin`).
An invoice number (`2026-11-0042`), a phone number, an order number, a
reference of ten digits or more, an amount and a date pass.
- *A party's own fields* (a party's name and details, a customer's or
vendor's name, the customer's printed details on an invoice, a recipient,
an account name) keep the strict reading of WB-partner-4: any run of nine
digits (`has_full_tin`).
- *A bank file's description* is not typed by a person and often carries a
nine-digit reference, so a bank import is not refused for one: a number
that reads as a tax id is kept masked to its last four digits
(`•••-••-1234`, `settings::mask_printed_tins`), and the import's answer
says how many values were masked and on which lines (`masked_count`,
`masked`, `masked_note`). A *chart* file is typed by a person: a cell that
looks like a tax id refuses the file, naming its row and column.
The downsides the owner accepted: a nine-digit bank reference or routing
number typed into a memo is refused (write its last four), and a tax id
typed with unusual spacing could slip into a memo, since the reading
catches an accident, not a deliberate evasion. The vault, the party fields
and the file check of WB-partner-7 stand around it.
The reading is made in two places that agree. Every `Ledger` command that
takes free text refuses it (`LedgerError::FreeTextHoldsTin`), so a caller
other than the tools cannot journal one, and a journal line an earlier
version took still replays whatever it holds (BS-entry-4), so no books are
refused for opening. And the tools check every string of every write tool
once, before any call runs or writes anything (WB-format-10), from one
table that classes each string as free text, a party field, or exempt for a
named reason (the vault's input, a lookup key, an id, an amount, a date, a
fixed vocabulary, the last four digits, a bank pattern, a link, a value
the engine reads); a test fails when a write tool has a string the table
does not class. The refusal names the field, says it looks like a tax id and
that tax ids are stored with `books.set_tin` or a W-9 (`books.set_w9`), and
never repeats the number.
Books that already hold such a line are never rewritten and always open;
`books.audit` names the journal line and the field in a `tax_id_in_journal`
warning, and never the number.
**Enforced:** `settings::holds_printed_tin`, `settings::mask_printed_tins`,
`settings::check_free_text`, `parties::check_note`, `Ledger::try_create_entry`,
`Ledger::reverse_entry`, `Ledger::create_invoice_with`,
`Ledger::create_bill_with`, `Ledger::register_asset`,
`Ledger::create_period`, `Ledger::annotate_attachment`,
`Ledger::check_no_party_reason`; `ledger-mcp` `text_fields`,
`books.import_bank_csv`, `books.import_chart_csv`; `ledger-import`
`parse_bank_csv_masked`, `parse_chart_csv`; `ledger-store`
`integrity_findings`. **Checked:** `ledger-core` `tests/free_text_tin.rs`
(every grouping with every separator is found, nine digits alone, the
allow-list passes, each command refuses, a replay never does);
`ledger-mcp` the unit tests in `text_fields.rs` (every string a write tool
takes is classed) and `a_call_with_a_tax_id_in_free_text_is_refused_unrun_and_writes_nothing`;
`ledger-import` the unit tests in `bank_csv.rs` and `chart_csv.rs`;
`ledger-store` `tests/audit.rs`.
## B-35 A party's part of an entry, and a party's totals
**bookspec:** `BS-partner-3`