docs: the reference class, the detector's dot and longer-run rules, composed text masked (WB-partner-15)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-21 16:13:06 -07:00
1 parent 6f68835c3f
commit be23321971
3 files changed
+94 -32

No files matched your search

+24 -9
View File
@@ -766,11 +766,20 @@ What the books keep of a call, and what a repeat is told:
**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*
strings in 78 tools; 109 free text, 18 reference, 27 party field, 2 for the
vault, the rest exempt): *free text* (memos, notes, reasons, descriptions,
names of classes, projects and periods, a receipt's description and
annotations, a discount's reason, 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 or space, or by a dot between all of
an SSN's groups; a line break is a space and zero-width characters are not
counted); a *reference field*, an identifier by nature (an asset's `tag` and
`serial`, a bill's `vendor_ref`, an invoice's `customer_ref`, the `reference`
of `pay_bill`, `receive_payment` and `mark_sent`, an account's `code`, a
`file_name`, an instrument's `label`, where a W-9 or W-4 is `kept_at`), is
refused only for the printed 3-2-4 and 2-7 shapes and may hold a bare nine
digits, a serial or a check number (the owner's choice of 2026-11-21 as the
lead decided it within it); 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
@@ -779,8 +788,11 @@ vocabulary, the last four digits, a bank pattern or a link is exempt, and
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
more, an amount, a decimal (`47.6062095`) and a date, even followed by a
reference (`2026-11-21 0001234`), are no tax id. The refusal is in words, names
the table's own field ("the name of books.add_class looks like it holds a tax
id ..."; a key the caller chose is never quoted, it is "an unrecognised field
of" the tool), 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
@@ -2365,13 +2377,16 @@ posting.
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).
"Description"), and `masked_note` says so in words (WB-partner-15). A rule
matches the description as the bank wrote it, so a pattern keyed on a
nine-digit reference still matches; the draft keeps the masked text.
- `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. 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,
digits, another cell with a tax id's shape; a code may be nine digits, it
is a reference) 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
+69 -22
View File
@@ -120,10 +120,16 @@ is its TIN facts', else its W-9 facts'.
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.
dash or space between, and a dot between all of an SSN's groups); 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.
Within that choice the lead decided on 2026-11-21 that a *reference field*,
an identifier by nature (an asset tag or serial, an invoice, bill, payment
or send reference, an account code, a file name, an instrument's label,
where a W-9 or W-4 is kept), refuses only the printed 3-2-4 and 2-7 shapes
and allows a bare nine digits, which is how a serial number or a check
number is written. WB-partner-15 states it, with the downsides the owner
accepted.
**Enforced:** `crate::parties` (has_full_tin, check_text, W9Facts::check,
@@ -316,14 +322,31 @@ directory read W-9 facts only, so a member's read as missing).
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.
- *Free text* (entry and reversal descriptions, memos, notes, reasons, a
discount's reason, line descriptions, class, project, period, asset and
schedule texts, a receipt's description 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 or space (a line break is a space), in any Unicode form, with
zero-width and soft-hyphen characters not counted
(`settings::holds_printed_tin`). A dot joins an SSN's groups only when it
joins both (`000.00.0000`) and never an EIN's, so a coordinate
(`47.6062095`) passes; a group that starts or ends inside a longer run of
digits and dashes (a date's day then its reference, `2026-11-21 0001234`;
a part number) belongs to that run. An invoice number (`2026-11-0042`),
a phone number, an order number, a reference of ten digits or more, an
amount, a decimal and a date pass. Letters between digits, and a number
split across two fields, are left alone: an accident, not an evasion.
- *A reference field* (an asset's tag and serial number, a bill's and an
invoice's reference, a payment's and a send's reference, an account's
code, a file's name, an instrument's label, where a W-9 or W-4 is kept)
is an identifier by nature, and a bare run of nine digits is a legitimate
value there: only the printed SSN and EIN shapes are refused
(`settings::holds_printed_tin_in_reference`, the one detector without its
bare-nine group). The refusal's words are the same as for free text. An
entry's description, which is free text, shows a payment's reference with
such a run masked (`PaymentDetails::description`), and the audit reads
each journal field as its class.
- *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
@@ -333,13 +356,25 @@ text two ways, on purpose:
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.
`masked`, `masked_note`). A rule that categorizes a transaction matches the
bank's own words, so one keyed on a nine-digit reference still matches;
what is kept is the masked text. A *chart* file is typed by a person: a
cell that looks like a tax id refuses the file, naming its row and column
(an account code is a reference: a bare nine digits is a code).
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
catches an accident, not a deliberate evasion. The lead's, within them: a
bare nine digits in a reference field is kept, so a tax id written there
without its grouping is not caught.
Text the program composes from what the books already hold is never
refused: a depreciation or disposal entry's description names the asset as
the books hold it, and the asset's description may hold a shape from before
this reading, so such a composed line holds it masked to its last four
(`settings::mask_printed_tins`), as a reference in a payment's description
and an issued invoice's file name do. 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
@@ -348,8 +383,8 @@ 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
table that classes each string as free text, a reference, 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
@@ -361,23 +396,35 @@ Books that already hold such a line are never rewritten and always open;
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`,
`settings::holds_printed_tin_in_reference`,
`settings::mask_printed_tins_in_reference`, `settings::check_free_text`,
`settings::check_reference_text`, `parties::check_note`,
`parties::check_reference_note`, `PaymentDetails::check`,
`PaymentDetails::description`, `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`,
`Ledger::check_no_party_reason`, `Ledger::renumber_account`,
`Ledger::set_asset_tag`, `Ledger::set_asset_serial`; `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`, `Store::attach_receipt`, `Store::file_document`,
`Store::unlink_receipt`, `Store::withdraw_attachment`, `Store::review_entry`.
**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);
(every grouping with every separator is found, a dot between all of an
SSN's groups only, a date and its reference or a decimal never, a line break
or a zero-width character does not hide one, nine digits alone, a reference
takes nine digits, the allow-list passes, each command refuses, the engine
refuses a project's field, a payment's reference and a discount's reason, 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` (the store's own texts, and a journal line
an earlier version took opens and is named by the audit); `ledger-cli`
an earlier version took opens and is named by the audit) and
`tests/free_text_old_books.rs` (an old asset still depreciates and is
disposed of, the lines hold the masked form, the audit reads a reference as
one); `ledger-cli`
`tests/tin_in_text.rs` (through the real server: a refusal writes nothing,
a reference is kept, a bank file is masked, a chart file is refused).
+1 -1
View File
@@ -99,7 +99,7 @@ that would fail if it broke:
| A file with full TINs is never written to a path (handed over instead, D-29), and never filed into the books: every file the server read or wrote with TINs (from any session, after a restart, out of a CPA package), by every filing tool | `mcp_journeys.rs` `tin_bearing_files_are_refused_when_given_back_to_be_filed`; `spec_vault.rs` `a_package_is_handed_over_and_never_written`; `tin_files.rs` (tests) `a_tin_bearing_file_is_refused_from_every_session_and_after_a_restart`; unit test `a_recorded_tin_file_is_refused_by_every_reader_of_the_registry` |
| Text filed into the books is refused when it holds a TIN the vault keeps (nine digits, 3-2-4 by hyphen, space or dot, 2-7 by hyphen or space, anywhere) or a stand-alone printed SSN or EIN (123-45-6789, 12-3456789), and only then: a bank export (routing numbers, long references, a date next to an amount) and a longer number holding an SSN shape go in; a locked vault leaves the printed shapes (BS-partner-2) | `tin_files.rs` (tests) `text_with_a_vault_tin_or_a_printed_one_is_refused_and_a_bank_export_is_not`; unit tests `text_holding_a_vault_tin_is_refused_in_every_rendering`, `a_printed_ssn_or_ein_is_refused`, `a_longer_number_holding_a_tin_shape_passes`, `an_ordinary_bank_export_passes`, `binary_bytes_are_not_scanned` |
| Filing is no TIN oracle: text with more than two TIN-shaped numbers ending in a known TIN's last four (the books' TIN and W-9 facts, then the vault's own) is refused before the vault is opened, byte for byte alike whether one is the vault's TIN or none is, the vault open or locked, by every filing tool; one or two such numbers are compared against the vault, one number written many ways counts once, and other last fours never count (BS-partner-2) | `tin_files.rs` (tests) `text_probing_for_a_tin_is_refused_alike_by_every_filing_tool`; unit tests `text_probing_for_a_tin_is_refused_alike_whether_or_not_it_holds_it` (the vault never opened for a probe), `one_or_two_candidates_are_compared_against_the_vault` |
| Free text (a memo, note, reason, description, reference, a class, project or period name, a receipt's words) is refused when it looks like a tax id (nine digits alone, 3-2-4, 2-7, any dash, dot or space, in any Unicode form) and an invoice number, a phone number, a reference of ten digits or more, an amount and a date pass; a party's own fields stay strict; the refusal names the field, says where a tax id goes and never repeats it; every string of every write tool is classed in one table and a new one fails the build; a bank file is kept with the number masked to its last four and the answer says how many and where; a chart file is refused naming row and column; a journal line an earlier version took replays and the audit names it (WB-partner-15) | `tests/free_text_tin.rs` (ledger-core: every grouping, every separator, the allow-list, each command, replay); `text_fields.rs` unit tests `every_string_a_write_tool_takes_is_in_the_table`, `the_table_names_only_strings_the_tools_take`; `server_tests.rs` `a_call_with_a_tax_id_in_free_text_is_refused_unrun_and_writes_nothing`; `bank_csv.rs` and `chart_csv.rs` unit tests; `ledger-store` `tests/audit.rs` `the_store_refuses_text_that_looks_like_a_tax_id_and_journals_nothing`, `integrity_detects_each_seeded_defect`; `ledger-cli` `tests/tin_in_text.rs` |
| Free text (a memo, note, reason, description, reference, a class, project or period name, a receipt's words) is refused when it looks like a tax id (nine digits alone, 3-2-4, 2-7, any dash, dot or space, in any Unicode form) and an invoice number, a phone number, a reference of ten digits or more, an amount and a date pass; a party's own fields stay strict; the refusal names the field, says where a tax id goes and never repeats it; every string of every write tool is classed in one table and a new one fails the build; a reference field (tag, serial, invoice or payment reference, account code, file name, label) takes a bare nine digits and refuses the grouped shapes; a dot joins only an SSN's both groups, a date and its reference or a decimal pass, a line break or a zero-width character hides nothing; a bank file is kept with the number masked to its last four, a rule matches the bank's own words, and the answer says how many and where; a chart file is refused naming row and column; text composed from stored text is masked, never refused (an old asset still depreciates and is disposed of); a journal line an earlier version took replays and the audit names it (WB-partner-15) | `tests/free_text_tin.rs` (ledger-core: every grouping, every separator, the allow-list, the dot and the longer run, a reference, each command, a payment's reference, a project's field, replay); `text_fields.rs` unit tests `every_string_a_write_tool_takes_is_in_the_table`, `the_table_names_only_strings_the_tools_take`, `a_reference_takes_nine_digits_and_refuses_a_printed_tax_id`, `a_refusal_never_quotes_a_key_the_caller_chose`; `ledger-store` `tests/free_text_old_books.rs`; `ledger-cli` `tests/tin_in_text.rs` `a_bank_rule_keyed_on_a_nine_digit_reference_still_matches`; `server_tests.rs` `a_call_with_a_tax_id_in_free_text_is_refused_unrun_and_writes_nothing`; `bank_csv.rs` and `chart_csv.rs` unit tests; `ledger-store` `tests/audit.rs` `the_store_refuses_text_that_looks_like_a_tax_id_and_journals_nothing`, `integrity_detects_each_seeded_defect`; `ledger-cli` `tests/tin_in_text.rs` |
| The connect text fits its budgets, its lead stands alone, it states the receipt rule enforced (exact threshold in the base currency, required and exempt accounts, reversals) and the parties rule in force, and the company name can't break it (control and format characters) | `handbook.rs` `instructions_budget`, `a_typical_company_gets_the_whole_connect_text`, `the_company_name_is_one_plain_line`; `receipt_policy.rs` `the_rule_told_is_the_rule_enforced`, `a_long_or_odd_account_list_stays_short_and_plain`; a new session is told the settings in force: `a_new_session_is_told_the_settings_in_force` |
| No text the agent is given (whole tool JSON, resources, connect text, handbook, every error template and refusal) points at files, git, GitHub, repo docs, flags or helper commands; descriptions fit 700 characters (listed exceptions, P5; and what git itself said of a failed backup, which `books.backup` passes on to the human as git said it, its paths hidden) | `tool_text_lint`, `tool_descriptions_fit_700_characters`; `ledger-core` `an_unknown_year_threshold_is_never_guessed` |
| Every tool is annotated (openWorldHint false on all but `books.back_up_now`), and the read-only hint is true in behaviour (journal, every file of the books' folder but what every call writes by design: the access log, `ops/` (the viewer's side channel for `books.show`, which is not the books), the books' own backup and the files handed over; the database's rows and the vault unchanged) | `annotations_complete`; `spec_mcp.rs` `read_only_tools_change_nothing` (checked on every call in `Mcp::tool`) |