fix(cash flow): a payment to a government is other operating, by its payee

The P3 cutover review's open point 2: a state's LLC filing fee, booked
to an organization-costs account (tax category organization_startup),
read as "Cash paid to suppliers and employees". B-14 rule 5 sent a
payment to class (g) only when every operating line's account was
taxes_licenses, so the account, not the payee, decided.

ASC 230-10-45-17, read in EY's guide that reproduces it (Statement of
cash flows, July 2026, p. 43; the PDF re-fetched and its SHA-256
recorded in docs/spec/sources/fasb-asc.md), lists apart "(b) Cash
payments to other suppliers and employees for other goods or services"
and "(c) Cash payments to governments for taxes, duties, fines, and
other fees or penalties". 45-25's classes name only income taxes (f)
among the latter, so the rest are (g), other operating cash payments.
A formation filing fee is rightly an organization cost (its account and
tax line), and still a payment to a government: the payee is what
45-17(c) is about.

So rule 5 now sends a payment's government part to (g): of an
operating payment the structure classes (d), what went to a party with
the government_agency or tax_agency role (the chain root's parties, so
a reversal keeps its original's class) is (g), on any account; and, as
before, a payment whose every operating line is on a taxes_licenses
account is (g). Every party a government: the whole payment. A
government and a supplier named together: the payment is split by their
resolved shares (B-35), the government's part (g), the rest (d), since
ASC 230-10-45-22 has "each separately identifiable source or each
separately identifiable use" classed "on the basis of the nature of the
underlying cash flows" (EY p. 44; quoted in fasb-asc.md; it names the
three activities, read for 45-25's classes too as a CONVENTION). The
government's part is the payment x its share / the whole, rounded half
to even to the base currency's places, the rest exact, so the line still
sums to the payment and a reversal mirrors it. Shares that don't
resolve leave the whole payment (d). One naming no party is decided by
its accounts. Receipts are untouched (a refund from a government stays
(c)). No total changes, only which operating row a payment is in.

Two limits, from the review of this change: a government selling goods
or services (postage) is 45-17(b)'s supplier "for other goods or
services", so the rule says, and the handbook tells the agent, to add
such a payee as a vendor, never with the government_agency role (the
books can't tell what a payment bought; the role says it). And payroll
keeps its structure (CONVENTION): an entry with a line on the salary
expense or a payroll payable control account, or on a pay tax category
(salaries_wages, officer_compensation, employee_benefits,
pension_profit_sharing), stays (d) whoever it names: withheld taxes
remitted are the employees' pay, and the payables mix them with the
employer's taxes, which a remittance can't tell apart. So a remittance
to the IRS is (d) as it was before this change; the employer's payroll
tax paid on its own expense account is a tax, (g).

The first company's books have this case: their state filing fee moves
from "Cash paid to suppliers and employees" to "Other operating cash
payments" at every date once its entry names the state's agency with the
government_agency role and its own entry is the one whose cash the
statement lists (paid from the bank, or on a card that is a lender's
credit, D-42, or by a member through the members' account while it is
a financing account, B-14 rule 11, the way that fee was paid);
charged to an operating-payable card, its cash leaves in the card
payment, whose payee is the bank, and it stays with suppliers.
STATUS says how to check both, and that the cutover goldens' cash-flow
snapshots will differ on the two class lines only (totals the same),
so the next cutover diff isn't read as a regression.

Docs: rules.md B-14 rule 5 (the rule, its source quoted, the date and
what it was before); fasb-asc.md (45-17(b) and (c) quoted exactly, with
the guide's SHA-256); the handbook's entries section (name the agency as
the party on a tax, fee, fine or penalty paid to a government; a shared
payment named with both amounts; a government selling services added as
a vendor; payroll remittances stay with pay; a fee on a card follows the
card payment); fasb-asc.md also quotes 45-22 and 45-22A; bookspec
example cash-flow.government-fees.toml (a filing fee and a lawyer on
one organization-costs account, a license on taxes and licenses with no
party, a penalty to a tax agency on the wrong account, paper from a
supplier, an annual report paid through a registered agent, 37.00 the
state's and 100.00 the agent's; every figure by hand) with a new `class.<a..g>`
key in the
cash_flow query (bookspec README; the runner checks every class the
statement has is given); testing.md; STATUS.

Tests: ledger-core tests/spec_cash_flow.rs
`a_payment_to_a_government_is_other_operating` (the filing fee and a
penalty to a tax agency (g); the same account paid to a lawyer, or with
no payee, (d); its reversal next month keeps (g); a refund (c)),
`a_government_payee_moves_a_fee_on_any_account` (a taxes_licenses
license with no party (g); a payment shared half and half between a
government and a printer split 50.00 (g) and 50.00 (d), the government
alone all (g)), `a_shared_government_payment_splits_to_the_cent` (a
third by percent of 100.01: 33.34 (g), 66.67 (d); amounts split as
given; the reversal mirrors to the cent),
`a_payroll_remittance_to_a_tax_agency_stays_pay` (withheld taxes
remitted from a payable holding its payroll role, and pay on a
salaries_wages account, stay (d) with the IRS named; the employer's tax
on its own expense account is (g)),
`a_government_selling_services_is_a_supplier` (postage to a vendor (d);
given government_agency, (g): the limit the handbook guards); src
cashflow.rs `tests` `a_government_part_rounds_half_to_even` and the
proptest `a_government_part_sums_and_mirrors`; the bookspec example;
from the P4 review, `a_reversal_takes_its_originals_payee` (a fee and
its reversal next month land in one class, the chain's payee deciding:
the books keep a chain's parties one, so reading the reversal's own
parties is an equivalent mutant) and
`a_shared_government_payment_a_member_paid_splits_both_ways` (a shared
payment a member paid: each part with its own on_behalf; fails with
the on-behalf part unsplit). docs/mcp-interface.md: books.cash_flow
and the Roles paragraph say a government or tax agency payee makes a
payment other operating, and a shared one two operating lines.
Broken to confirm: without the payee check the five spec tests and the
example fail; without the split for mixed payees the two shared-payment
tests and the example (class.d -549.50) fail; without the payroll
exclusion the payroll test fails; rounding toward zero fails both unit
tests; without the tax-category route
`operating_classes_follow_asc_230_10_45_25`, the second test and the
example fail. The viewer's cash flow page,
rendered on made-up books before and after: the fee moved from "Cash
paid to suppliers and employees" to "Other operating cash payments",
every total the same; and on made-up books with an annual report
shared between the state and an agent: each part on its own class
line, every total the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T3gXMVt7XJPi6ens1or9Dj
This commit is contained in:
swaitsandClaude Opus 5.5 committed 2026-10-22 19:31:18 -06:00
1 parent 6c587086a0
commit 535874e0f3
11 files changed
+1049 -63

No files matched your search

+12 -2
View File
@@ -552,7 +552,13 @@ every tool over every book in ledger-store's `tests/fixtures/old-books`.
and kind: `{ entry, date, label, kind, amount, on_behalf?, accounts,
reverses?, class? }`; every transaction is listed (D-35), each under its
kind. An entry's interest is its own operating class, (b) or (e), apart
from the rest of its operating cash. What a member or a lender paid or
from the rest of its operating cash. A payment to a party with the
`government_agency` or `tax_agency` role is `other_payments`, (g),
on any account (rules.md B-14 rule 5; payroll remittances excepted);
one shared between such a party and a supplier gives two operating
lines for the one entry, `other_payments` and
`to_suppliers_and_employees`, split by the parties' shares and
summing to the payment. What a member or a lender paid or
received for the company with no cash account moving is cash borrowed
(or contributed) and spent, on the entry's date (D-42, rules.md B-14
rule 11): an expense a member paid personally through Due to Members
@@ -1192,7 +1198,11 @@ refused, never guessed.
`payout_platform`, `tax_agency`, `government_agency` (regulators and
registries that don't tax: a division of corporations, a licensing board),
`financial_institution`, `landlord`.
Vendor and customer follow the records and are never set by hand.
Vendor and customer follow the records and are never set by hand. A
`tax_agency` or `government_agency` payee also classes the company's
payments to it on the cash flow statement: other operating cash
payments, never cash paid to suppliers (`books.cash_flow`, rules.md B-14
rule 5).
**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,
+66 -5
View File
@@ -444,10 +444,63 @@ in public sources that reproduce the Codification, `sources/fasb-asc.md`):
operating cash, by its other operating lines: a receipt is (a) if a
line is revenue or the receivables control, or the entry's party is a
customer, else (c); a payment is (g) if every such line is on an
account whose tax category is `taxes_licenses` (payments to
governments for taxes and fees are 45-17(c), apart from suppliers'
45-17(b); 45-25 names only income taxes, (f)), else (d) if a line is
an expense, a liability or a non-receivables asset, else (g). (Interest paid back out
account whose tax category is `taxes_licenses`, else (d) if a line is
an expense, a liability or a non-receivables asset, else (g); then,
of a payment that is (d), what went to a government is (g): the
entry names a party with the `government_agency` or `tax_agency`
role (its chain root's parties, for a reversal), on any account. ASC
230-10-45-17 lists "Cash payments to governments for taxes, duties,
fines, and other fees or penalties" (c) apart from "Cash payments to
other suppliers and employees for other goods or services" (b) (EY FRD
p. 43, which reproduces the paragraph), and 45-25 names only income
taxes, (f), among them, so the rest are other operating cash payments.
The payee decides because the account need not: a state's filing fee
for forming the company is an organization cost (tax category
`organization_startup`), still paid to a government. Every party a
government: the whole payment is (g). A government and others named
together: the payment is split by their resolved shares (B-35), the
government's part (g), the rest (d), because 45-22 has "each
separately identifiable source or each separately identifiable use"
classed "on the basis of the nature of the underlying cash flows" (EY
p. 44; it speaks of the three activities, read here for the classes
too, CONVENTION), and the shares identify each part; the government's
part is the payment × its share ÷ the whole, rounded half to even to
the base currency's places, the rest exact, so the two always sum to
the payment and a reversal mirrors them (CONVENTION). Shares that
don't resolve leave the whole payment (d). Not a government's: a
government selling goods or services (postage, a park's entry fee) is
45-17(b)'s supplier "for other goods or services", so such a payee
is added as a vendor (the `vendor` role, books.add_vendor), never
given `government_agency` (the books can't tell what a payment
bought; the role says it). Payroll keeps its
structure (CONVENTION): an entry with a line on the salary expense or
a payroll payable control account (B-23's roles: `salary_expense`,
`federal_withholding`, `state_withholding`, `social_security_payable`,
`medicare_payable`, `other_deductions_payable`), or on an account of
a pay tax category (`salaries_wages`, `officer_compensation`,
`employee_benefits`, `pension_profit_sharing`), stays (d) whoever it
names, because taxes withheld and remitted are the employees' pay
(45-17(b), "to ... employees") and the payables mix them with the
employer's own taxes, which the remittance can't tell apart; the
employer's payroll tax paid on its own expense account is a tax, (g).
As before this change, a remittance from the payables is (d); a
payroll liability kept at a code of the chart's own needs its role
(books.assign_role) to be read so. P3 cutover review, open point 2,
2026-10-22: before, only the tax category counted, so a filing fee on
an organization-costs account read as cash paid to suppliers
(`a_payment_to_a_government_is_other_operating`,
`a_government_payee_moves_a_fee_on_any_account`,
`a_shared_government_payment_splits_to_the_cent`,
`a_payroll_remittance_to_a_tax_agency_stays_pay`,
`a_government_selling_services_is_a_supplier`,
`a_reversal_takes_its_originals_payee`,
`a_shared_government_payment_a_member_paid_splits_both_ways`, all in
ledger-core `tests/spec_cash_flow.rs`;
`a_government_part_rounds_half_to_even` and
`a_government_part_sums_and_mirrors` in ledger-core
`cashflow::tests`; bookspec `cash-flow.government-fees`). A
government's payment a member paid on the company's behalf (rule 11)
is classed and split the same way, its `on_behalf` part with it. (Interest paid back out
is (g); interest refunded to the company, (c).) The operating cash is
split among these kinds as a section's among its kinds (rule 3), in
the order: the rest, interest received, interest paid (CONVENTION).
@@ -665,7 +718,8 @@ shapes), `prop_pure_entries_sections_are_movements`; regressions
`defect1_reversed_contributions_foot_regression`,
`defect1_two_member_llc_first_year_regression`,
`defect1_two_member_llc_as_of_march_18_regression` (and bookspec
`cash-flow.*`, `cash-flow.paid-on-the-companys-behalf` for rule 11);
`cash-flow.*`, `cash-flow.paid-on-the-companys-behalf` for rule 11,
`cash-flow.government-fees` for rule 5's governments);
`disposal_proceeds_all_investing`,
`an_expense_a_member_paid_is_borrowed_and_spent`,
`reimbursing_a_member_is_a_repayment_of_borrowing`,
@@ -679,6 +733,13 @@ shapes), `prop_pure_entries_sections_are_movements`; regressions
`interest_and_guaranteed_payments_charged_to_a_creditor_stay_noncash`,
`a_fee_withheld_from_a_loan_follows_its_account`,
`odd_shapes_foot_and_net`, `operating_classes_follow_asc_230_10_45_25`,
`a_payment_to_a_government_is_other_operating`,
`a_government_payee_moves_a_fee_on_any_account`,
`a_shared_government_payment_splits_to_the_cent`,
`a_payroll_remittance_to_a_tax_agency_stays_pay`,
`a_government_selling_services_is_a_supplier`,
`a_reversal_takes_its_originals_payee`,
`a_shared_government_payment_a_member_paid_splits_both_ways`,
`a_reversal_of_a_reversal_is_shown_and_foots`,
`a_reversal_three_levels_down_is_labelled_a_reversal`,
`operating_cash_is_classed_kind_by_kind`,
+20 -3
View File
@@ -104,10 +104,27 @@ Quotes are short; the rest is paraphrase.
dividends received. 45-16(c): all other operating receipts. → rule 5,
rule 4's exception.
- **230-10-45-17** (EY pp. 43-44): operating outflows: payments for goods
for resale (a), to "other suppliers and employees" (b), to governments
for taxes, duties, fines and other fees (c), interest to lenders and
for resale (a), "Cash payments to other suppliers and employees for
other goods or services" (b), "Cash payments to governments for taxes,
duties, fines, and other fees or penalties" (c), interest to lenders and
other creditors (d), and others ((e), (ee), (f)). (Income taxes fall
under (c); 45-25 names them a class.)
under (c); 45-25 names them a class.) Quotes (b) and (c) checked
2026-10-22 against EY's guide as retrieved that day (SHA-256
`de9224a9e3ec7ef771e7ee076f99471ee727308c3dedb2df20ea1ee4e285fbdb`,
page 43). → rule 5: a payment to a government, decided by its payee or
a taxes-and-licenses account, is (g), not (d).
- **230-10-45-22, 45-22A** (EY pp. 44-45, the same copy): a receipt or
payment with "aspects of more than one class of cash flows" is
classed first by specific guidance; without it, "a reporting entity
shall determine each separately identifiable source or each separately
identifiable use within the cash receipts and cash payments on the
basis of the nature of the underlying cash flows" and classify each
"in financing, investing, or operating activities"; only what "cannot
be separated by source or use" goes by the predominant source or use
(45-22A). → rule 5: a payment shared between a government and a
supplier is split by the parties' resolved shares, each part classed
by its payee (the paragraph names the three activities; reading it for
45-25's classes too is a CONVENTION).
- **230-10-45-8, 45-9** (EY p. 12): only items whose "turnover is quick,
the amounts are large, and the maturities are short" (original maturity
"three months or less"; amounts due on demand count) may be reported
+42
View File
@@ -2178,6 +2178,48 @@ and the property. The property found (seed in
name yield to a changed one ("Café" twice beside "Cafe (1)" and "Cafe (1)
(1)"); the cap is gone, a tag that changes nothing is skipped instead.
**Point 2, payments to governments** (rules.md B-14 rule 5): `ledger-core`
`tests/spec_cash_flow.rs` `a_payment_to_a_government_is_other_operating`
(a filing fee on an organization-costs account paid to a government
agency, and a penalty on supplies paid to a tax agency, are (g); the
same account paid to a lawyer, or with no payee named, stays (d); its
reversal next month keeps (g); a refund from the state stays (c)),
`a_government_payee_moves_a_fee_on_any_account` (a `taxes_licenses`
license with no party is still (g); a payment shared half and half
between a government and a printer is split, 50.00 (g) and 50.00 (d),
and named to the government alone is all (g)),
`a_shared_government_payment_splits_to_the_cent` (a third by percent of
100.01 is 33.34 (g) and 66.67 (d), shares by amount split as given, the
reversal mirrors to the cent), `a_payroll_remittance_to_a_tax_agency_stays_pay`
(withheld taxes remitted from a payable holding its payroll role, and pay
on a `salaries_wages` account, stay (d) with the tax agency named; the
employer's tax on its own expense account is (g)) and
`a_government_selling_services_is_a_supplier` (postage to a payee with
the vendor role stays (d); given `government_agency`, it reads (g), the
limit the handbook guards); from the P4 review (2026-10-22),
`a_reversal_takes_its_originals_payee` (a state's fee and its reversal
next month are (g) both; tagging the reversal tags the chain, so both
move to (d), and untagged both stay (d): the books keep a chain's
parties one, Ledger::set_entry_parties INVARIANT 5, so reading the
reversal's own parties instead of the chain root's is an equivalent
mutant) and `a_shared_government_payment_a_member_paid_splits_both_ways`
(a state-and-agent payment a member paid, 37.00 of 137.00 by amount and
a third of 100.01 by percent: each operating part carries its own
on_behalf, financing the whole; it fails with the on-behalf part left
unsplit); `src/cashflow.rs` `tests`
`a_government_part_rounds_half_to_even` and the proptest
`a_government_part_sums_and_mirrors` (the two parts sum to the payment,
the government's within half a cent of exact, a reversal mirrors);
the bookspec example `cash-flow.government-fees.toml`, every figure
derived by hand, including a shared annual-report payment, read through
the new `class.<a..g>` key (bookspec README). Broken to confirm: without
the payee check the five spec tests fail and the example; without the
split for mixed payees the two shared-payment tests and the example
(class.d -549.50) fail; without the payroll exclusion the payroll test
fails; rounding toward zero fails both `cashflow::tests`; without the
tax-category route `operating_classes_follow_asc_230_10_45_25`, the
second test and the example fail.
## Benchmarks (baseline 2026-10-13)
No budget, by decision (the owner, 2026-10-13: the books do little work