P3: the cash flow statement by ASC 230 (defect 1, D-35, D-42)
check / check (push) Canceled after 0s

Direct method with the operating reconciliation and noncash schedules; it
foots by construction (Lean and Kani). Every non-cash account belongs to
one section; reversals net; a member or lender paying for the company is
cash borrowed and spent (D-42, constructive receipt and disbursement);
property a member contributes stays noncash. The bookspec seed: one loader
checks every example.

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-21 09:35:32 -06:00
1 parent 2c29d48ab9
commit eb4329bb2a
64 files changed
+12128 -1567

No files matched your search

+305 -45
View File
@@ -356,51 +356,309 @@ earnings the same running way, D-38, 2026-10-20)
`a_yen_members_page_splits_in_whole_yen`; the bookspec examples
`members-close.*`.
## B-14 Statements: P&L for a period; cash flow by the indirect method
## B-14 Statements: P&L for a period; cash flows by the direct method
**Status:** AUTHORITY
**Status:** AUTHORITY, except where marked CONVENTION or DECISION
ASC 230-10-45-28 (cited): an entity not using the direct method "shall
determine and report the same amount for net cash flow from operating
activities indirectly by adjusting net income … (the indirect or
reconciliation method)." ASC 230-10-45-16: "All of the following are cash
inflows from operating activities: Cash receipts from sales of goods or
services…". A closing entry is not income or spending (B-11), so period
statements exclude it.
The P&L covers a period; a closing entry is not income or spending
(B-11), so period statements exclude it.
Investing and financing are gross (ASC 230-10-45-7, read directly
2026-10-14, `sources/fasb-asc.md`:
"information about the gross amounts of cash receipts and cash payments
during a period is more relevant than information about the net
amounts"; 45-8 allows netting only where "the turnover is quick, the
amounts are large, and the maturities are short"). Financing inflows
include "Proceeds from issuing equity instruments" and "other short- or
long-term borrowing" (45-14(a), (b)); outflows include "distributions to
owners" and "Repayments of amounts borrowed" (45-15(a), (b)). Every cash
flow is investing, financing, or operating (45-10). Investing
"include[s] making and collecting loans and acquiring and disposing of
debt or equity instruments and property, plant, and equipment" (ASC
230-10-20). Which accounts hold loans made, investments, and debt is a
fact of each company's chart, so it is a setting: `[books]
financing_accounts` and `investing_accounts` in wanderbooks.toml (with
`cash_accounts`), read by the MCP tools and the viewer alike.
The statement of cash flows (P3 defect 1, D-35, D-42; the paragraphs were read
in public sources that reproduce the Codification, `sources/fasb-asc.md`):
Money an owner advances, by paying a company expense personally (a
"Due to owners" liability), is borrowing: PwC Viewpoint, Financial
statement presentation 6.9.3.1 (constructive receipts and
disbursements) presents cash a third party pays on the entity's behalf
"as though the transaction took place through the bank accounts of the
reporting entity": a financing inflow and an operating outflow. Listing
that liability in `financing_accounts` gives exactly that; repaying the
owner is then a repayment of amounts borrowed. "Judgment is required"
(PwC), so it is the company's setting, not a fixed rule.
1. **Cash receipts and payments.** The statement reports "the cash
effects" of operations, investing and financing (ASC 230-10-45-1; its
objective, 10-1: "cash receipts and cash payments"). An entry
contributes to the body only its net movement of the cash accounts,
and what a member or a lender paid or received for it (rule 11, which
nets to zero within the entry); an entry that moves neither
contributes nothing; a transfer between two cash accounts is no flow. The period is [start, end], inclusive. The
cash accounts are every account holding cash, cash equivalents or
restricted cash: the statement explains the change in their total
(45-4, as ASU 2016-18 amended it), and transfers among them "are not
reported as cash flow activities" (45-5). Which accounts those are is
the books' `books.cash_accounts`.
2. **Partition.** Every receipt and payment is investing, financing or
operating (45-10), so every non-cash account is in exactly one section:
investing (the cost and accumulated-depreciation accounts of every
registered fixed asset, and `books.investing_accounts`); financing
(equity, and `books.financing_accounts`); operating (every other
balance-sheet account, and revenue and expense, but see rule 4). The
roles must agree with the chart and each other, or the statement is
refused with the setting to change: cash and investing accounts are
assets; financing accounts are liabilities (equity listed is accepted:
it is financing anyway); no code twice in a list or in two lists; no
registered asset's account as cash; at least one cash account. One
check (`cashflow::role_problems`) is behind both the refusal and
`books.settings`' problems.
3. **Only the cash portion** of a part-cash transaction is reported
(50-5). An entry's cash `c` is applied to the sections moving against
it, in the order operating, investing, financing, each up to its own
movement; what is left of a section's movement is the entry's noncash
part, disclosed (rule 7). CONVENTION: the order (the ASC is silent on
allocating within one entry); it matters only for an entry with a
noncash source and two or more sections paid by cash, and is disclosed.
Within a section the same order splits the cash among its kinds (rule
5).
4. **Gains and losses on investing assets are investing**: receipts from
sales of PP&E are investing (45-12(c)), so the whole proceeds are, and
the gain or loss is taken out of net income (45-28(b)). In an entry that
credits a registered cost account or an investing account, the revenue
and expense lines are investing, except interest, received or paid (tax
categories `interest_income` and `interest_expense`): interest is
operating in any entry (45-16(b), 45-17(d)). The trigger is broad (a
return, a reclass or an impairment credits the cost account too), so the
reconciling line reads "(Gain) loss and other noncash changes in
investing assets".
5. **Gross lines by kind** (45-7; investing and financing inflows and
outflows "reported separately", 45-26). One line per entry, section and
kind, with the entry, date, label and the kind's accounts. Operating
lines carry the class 45-25 requires "at a minimum" (a)-(g), kind by
kind within the entry, by the direction of the cash: the cash an
entry's `interest_income` lines take is (b) interest received, and its
`interest_expense` lines' (e) interest paid, whatever else the entry
settles (a loan payment on an operating payable is (d) for the
principal and (e) for the interest, never all (e)); the rest of its
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
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).
Class (f) stays empty until a tax category marks an entity-level income
tax (a
partnership pays none "as such", IRC §701, but can under §6225 or a
state pass-through election). Investing and financing kinds (D-35):
purchases and sales of property and equipment, payments for and
collections on each investing account, contributions from and
distributions to each member (by name; equity not a member's by
account), proceeds of and repayments of each financing liability. An
original's direction is its nature (45-15(a): cash out of equity is a
distribution). The printed statement and the viewer show operating one
row per class, and investing and financing one row per kind with its
total, each transaction listed under it (D-35); `books.cash_flow` and
the exports carry every line. Known limits: an entry's other operating
lines take one class, so its mixed receipts and payments other than
interest net within it; class (b) relies on portfolio interest being
categorized `interest_income` (interest receivable collected is (c)).
6. **Reversals.** A reversal takes its chain root's sections, class and
kind, with its own sign (`Ledger::reversal_chain`). Pairing walks each
chain from its root: an entry and its reversal both in the period drop
out of every line and disclosure, when their flows are exact negatives
(proved, and checked at runtime), so a reversal of a reversal whose
partner is paired is shown. A reversal shown alone is labelled
"Reversal of #N — <N's description>", a reinstatement "Reinstatement
of #A (reverses #B)", listed under the original's kind: never a label
from a reversal's sign (D1-c).
7. **Noncash investing and financing activities are disclosed** (50-3,
50-4; placement, 50-6). Disclosed: every entry not netted whose noncash
part moves financing, or moves investing through an account that is
neither accumulated depreciation nor a rule-4 P&L line, or that
exchanges inside investing and financing without cash (50-4's
"converting debt to equity", a note for equipment, a trade-in): `x =
max(0, min(D - out, C - in))` over the net debits `D` and credits `C`
of its investing and financing balance-sheet accounts, `in` and `out`
the cash those two sections took in and paid out, what a member or
lender handled for the entry included (rule 11: equipment a bank paid
for is 1,000 in and 1,000 out, nothing exchanged). Amount: `max(Σ
max(r_k, 0), x)`. Depreciation is a
reconciling item, not an activity. Limit: a trade-in within one cost
account nets away.
8. **Net income reconciled to operating cash**, a separate schedule with
the direct method (45-30; major classes of reconciling items, 45-29;
what is removed, 45-28): operating = NI + G + X + W, over the period's
non-closing entries. NI, net income; G, the rule-4 P&L lines; X, each
entry's operating noncash part, as "Depreciation" (its investing and
financing balance-sheet lines all accumulated depreciation), "Noncash:
through <A>" (those lines, accumulated depreciation aside, all on A),
or "Other noncash items"; W, minus each
operating balance-sheet account's movement ("Increase in" / "Decrease
in"). An identity over balanced entries (Lean
`operating_reconciliation_ties`), checked at runtime.
9. **The sections foot** (45-24: the statement reconciles beginning and
ending cash). `reconciles {sections_sum, net_change, difference}`; any
difference, a section unequal to its lines, or a reconciliation unequal
to operating is `CashFlowDoesNotFoot`, an engine error: nothing is
produced. It can't happen on posted entries (Lean
`cashflow_sections_sum_to_cash_change`, `Reachable.cashflow_foots`).
10. **Closing entries are never in the statement** (B-11). A close moves
only revenue, expense and equity, and cash accounts are assets, so a
close has no cash line.
11. **What a member or a lender pays, or receives, for the company is
cash the company borrowed (or a member contributed) and spent**
(DECISION, D-42, the owner, 2026-10-20, revising D-35's first point;
bookspec's CHOICE: the standard leaves it open).
*Source.* The Codification does not address a payment a third party
makes on the entity's behalf (PwC Viewpoint FSP 6.9.3: "ASC 230 does
not address these situations"; BDO Blueprint 3.4: "While ASC 230 is
silent"; EY FRD 4.6.2: "judgment will be needed"; KPMG Handbook
Q8.3.10), so 105-10-05-2 sends the question to nonauthoritative
guidance. There the firms present it by substance, as constructive
receipt and disbursement: PwC 6.9.3.1, "a reporting entity should
include cash flows received or paid by a third party on behalf of the
reporting entity" (a bank paying a vendor: "a financing inflow ... and
an operating outflow"); DART Roadmap 7.2 (third-party financing,
Example 7-2: a lender paying an insurance premium, an operating outflow
and a financing inflow; the contrast, a supplier's own finance arm, is
AICPA TQA 1300.16 and the SEC staff's 2005 view: noncash); BDO 3.4
(Example 3-5: a bank paying for equipment, an investing outflow and a
financing inflow; it names "a parent might pay on behalf of a
subsidiary expenses"); EY 5.2.4 and 5.3.1 (third-party financing,
unlike the seller's, is a financing inflow and an operating or
investing outflow). KPMG Q8.3.10 also accepts a noncash presentation
for equipment a lender pays for. A CPA would present it as the firms
do; the change in cash is the same either way. The rule, entry by
entry, after its own cash (rule 3; `kernel::constructive`):
- **Paid for the company.** A financing liability
(`books.financing_accounts`: the members' financing account such as
Due to Members, a loan, a card listed as financing) credited against
operating or investing lines debited paid for them: a financing
inflow under the liability's kind ("Proceeds from borrowing — 2100
Due to Members", 45-14(b)) and the operating outflow (its class by
rule 5) or the investing outflow (45-13(c)), both on the entry's
date. A member's capital credited against revenue or expense debited
paid for them likewise, a contribution ("Contributions from members
— <member>", 45-14(a)): the expense-to-capital case below.
- **Received for the company.** A financing liability or a member's
capital debited against revenue, expense or the receivables control
credited (a customer paying a member, a vendor refunding to a
member's card): an operating inflow, and a repayment or a
distribution (PwC 6.9.3.1: cash "received or paid").
- Each line's `on_behalf` is the part of its cash so handled. The parts
net to zero within the entry, so the sections still sum to the
change in cash (rule 9; Kani `constructive_nets_to_zero`). Kinds take
it in order, operating before investing and, within operating,
balance-sheet lines before revenue and expense (CONVENTION, as rule
3's: it matters only for an entry whose sources cover part of its
uses, and then leaves capital the revenue and expense it can pay
for). A reversal mirrors its root (rule 6; Kani
`constructive_mirrors`), so a payment and its reversal net out, and
a reimbursement is the repayment it is (45-15(b)).
- **Stays noncash**, disclosed (rule 7): property a member contributes
that it already owned (capital credited against an asset, a prepaid
included: no cash moved, to anyone, 50-4); property handed over in
kind (an asset credited against a financing liability or capital
debited); a debt exchanged for another or for equity (50-4's
"converting debt to equity"); interest and guaranteed payments
charged into what the company owes the lender or member (tax
categories `interest_expense`, `interest_income`,
`guaranteed_payments`: their own charges, accrued, paid to no one;
"interest paid", 45-25(e), is cash paid); and a purchase on the
seller's own credit, an operating payable (50-4, "acquiring assets by
assuming directly related liabilities"; EY 5.3.1), flagged
`asset_on_operating_payable` (rule 12).
- **An expense a member pays into capital** (Dr expense / Cr the
member's capital, no cash) is a constructive contribution and an
operating outflow. The member paid cash to a vendor for the company;
whether the company owes it back (Due to Members) or not (capital)
is only the form of the financing, not the substance of the payment,
which the guides follow ("the same economic result", DART 7.2). BDO
3.4 lists a parent paying a subsidiary's expenses among the cases
for constructive cash flows without asking how the subsidiary
records what it owes back (a parent's payment is often booked as a
contribution), and none of the guides read presents an expense
someone paid on the entity's behalf as noncash. The books' own K-1
worksheet already counts it as a cash contribution (`k1.rs`
INVARIANT 3, DECISION 2026-10-15), so the two agree.
- **Card purchases** follow the card's classification (D-35,
unchanged): on a card listed as financing, the issuer is a lender
that paid the merchant, so the purchase is borrowed and spent and the
card payment a repayment; on a card that is an operating payable, the
purchase is an accrual and its payment operating (d).
- *Limits* (the books can't tell who was paid). A lender's or member's
own charge credited to what the company owes them, other than
interest and guaranteed payments (a card's annual fee, rent a member
charges), reads as paid for the company: its operating outflow shows
when charged, its repayment as financing (each section's total over
the charge and its payment is right; the timing is the charge's).
Post what the company owes a member for their own goods or services
to a payable, not to the members' financing account. A note to the
seller listed in `books.financing_accounts` reads as a lender's loan
(borrowed and invested, where 50-4 makes it noncash): keep a seller's
note out of it (its principal payments then show as operating, where
45-13(c) makes them financing; flagged). An expense a member
contributes in kind (an item already owned, expensed at once) reads
as paid: post it to an asset first. A debt a member or a new lender
pays off directly is a noncash exchange (disclosed), where PwC
6.9.3.1 and BDO Example 3-6 would gross it up. Debt issue costs, a
financing outflow (45-15(f)), posted to an expense account read as
operating: post them to a contra-liability listed as financing, so a
fee the lender withholds is a noncash exchange inside financing and
the loan reads as its net proceeds. An entry that moves revenue or
expense straight to capital by hand, as a close does, reads as paid
or received for the company: close periods with `books.close_period`,
whose entries are never in the statement (rule 10).
12. **Equipment paid for, or sold, later** (D-35; 45-12(c), 45-13(c)). A
bill payment carries its bill's split, equipment part first: the
payables line's equipment part is investing, so its payment is an
investing outflow, the reconciliation's payables change leaves it out,
and the purchase is disclosed only for what is unpaid at the period's
end (a payment reversed by then is unpaid again; EY FRD 5.3.3; DART
6.1.3; bills post to the general-expenses
control today, so this waits for bills with account lines). A card
purchase follows the card's classification: on an operating payable it
is disclosed and flagged (`asset_on_operating_payable`), on a financing
one it is borrowed and invested (rule 11) and its payment a repayment. A sale for an amount owed on an
operating receivable is disclosed and flagged with the fix
(`asset_sold_on_operating_receivable`: post it to an investing
account). The flags are the statement's `warnings`, and items in the
viewer's Needs attention. Limits: payments more than "soon after" purchase are
financing by 45-13(c) when the seller financed it, which the books
can't tell from a bill; unregistered equipment is operating (the asset
register's `unregistered_cost` flags it).
**Enforced:** `profit_and_loss_for_period`, `cash_flow`. **Checked:** Lean
`statements_add_up`; `prop_period_pnl_partitions`;
`cash_flow_reconciles_to_change_in_cash`;
`financing_is_gross_borrowing_apart_from_repayment`,
`a_loan_the_entity_makes_is_investing_gross`,
`an_expense_the_owner_paid_is_borrowing_then_operating`.
Scope: single-currency books (R-5). A foreign-currency cash account's
exchange effect would be a separate reconciling line (830-230-45-1); a
hand-posted revaluation of a cash account shows as an operating receipt.
**Enforced:** `profit_and_loss_for_period`; `cashflow::cash_flow` (with
`kernel::entry_flows`, `apply_cash`, `constructive`, `exchanged`),
`role_problems`, `foot`; `ledger_package::cash_flow_for` (the server, the
package and the viewer). **Checked:** Lean `statements_add_up`,
`cashflow_sections_sum_to_cash_change`, `entry_flows_sum`,
`flows_reversal`, `constructive_nets`, `constructive_neg`,
`constructive_sections_net`, `stmt_flows_sum`, `stmt_flows_reversal`,
`operating_reconciliation_ties`, `cashflow_reversal_nets`,
`Reachable.cashflow_foots`, `Reachable.cashflow_is_change_in_cash`; Kani
`entry_flows_*`, `no_cash_no_flow`, `take_is_odd_and_bounded`,
`apply_cash_mirrors`, `apply_cash_spends_exactly`,
`exchanged_is_bounded`, `constructive_nets_to_zero`,
`constructive_mirrors`; `prop_period_pnl_partitions`,
`prop_cash_flow_laws` (5,000 cases, reversals of reversals, rule 11's
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);
`disposal_proceeds_all_investing`,
`an_expense_a_member_paid_is_borrowed_and_spent`,
`reimbursing_a_member_is_a_repayment_of_borrowing`,
`equipment_a_lender_paid_for_is_borrowed_and_invested`,
`an_expense_a_member_paid_into_capital_is_contributed_and_spent`,
`property_a_member_contributes_stays_noncash`,
`equipment_on_the_sellers_credit_stays_noncash_and_flagged`,
`a_payment_made_for_the_company_and_its_reversal_net`,
`part_paid_by_a_member_and_a_refund_a_member_received`,
`a_lender_pays_balance_sheet_lines_first_and_a_customer_pays_a_member`,
`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_reversal_of_a_reversal_is_shown_and_foots`,
`a_reversal_three_levels_down_is_labelled_a_reversal`,
`operating_cash_is_classed_kind_by_kind`,
`two_kinds_of_one_class_are_one_line`,
`interest_paid_in_a_disposal_stays_operating`,
`a_loss_on_disposal_on_a_revenue_or_expense_account_is_investing`,
`an_investments_gain_is_investing`, `cash_goes_to_the_sections_in_order`,
`cash_goes_to_a_sections_kinds_in_order`,
`converting_member_debt_to_capital_is_disclosed`,
`a_bill_payment_carries_its_bills_split`,
`a_reversed_bill_payment_leaves_the_purchase_unpaid`, the role refusals,
`foot_refuses_any_difference` (`crates/ledger-core/tests/spec_cash_flow.rs`).
## B-15 Depreciation: straight line, salvage never depreciated, partial months by days
@@ -491,10 +749,11 @@ Attorneys' gross proceeds stay at $600 (not modeled).
What counts as paid: payments made in the calendar year (§6041(a)), so a
prepayment counts when made. A worksheet as of a day (the CPA package's,
B-33) counts the year's payments from January 1 through that day. The engine counts credits minus debits to the
payment sources on a vendor's tagged entries: `[books] cash_accounts` and
`financing_accounts` (a member or lender paying on the company's behalf;
the company is still the payer). A card charge leaves neither (1099-K); a
B-33) counts the year's payments from January 1 through that day. The
engine counts credits minus debits to the payment sources on a vendor's
tagged entries: `[books] cash_accounts` and `financing_accounts` (a
member or lender paying on the company's behalf; the company is still the
payer). A card charge leaves neither (1099-K); a
bill is not paid until it is (`form1099::vendor_1099_report_with`,
checked by `payments_come_from_cash_and_financing_only`). A W-9 is on
file by the vendor's flag or its party's W-9 facts.
@@ -1067,7 +1326,8 @@ fixed asset register, mid-year and at year end; `as_of_package_iif_stops_at_as_o
`iif_ties_to_the_trial_balance_as_of`, 2,000 cases); `ledger-mcp`
`oracle_mcp.rs` (`cpa_package_holds_the_year_and_its_evidence`); the
bookspec examples `bookspec/examples/as-of-package-stops-at-as-of.toml`
and `bookspec/examples/1099-worksheet-through-as-of.toml`.
and `bookspec/examples/1099-worksheet-through-as-of.toml` (`ledger-core`
`tests/bookspec.rs`).
## B-34 The QuickBooks Desktop file (IIF): plain ASCII, every entry through as_of, closes left out