P3: party totals by what moved the money, once (defects 14, 11, 24)

Each party's part of an entry is signed as its own account would show it,
with a direction and its cash and in-kind amounts; a reversal is its
original negated. Totals on a cash or all basis: for a member, all equals
the members' equity statement and cash the K-1's cash. Money is cash,
cards and the financing accounts, and a liability credit never pays its
own creditor (creditor_of), so accruals and declared distributions count
once. tin_last4 from the TIN or W-9 facts.

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 12:12:26 -06:00
1 parent 9ab003d0d1
commit c2ceabbae9
52 files changed
+7535 -560

No files matched your search

+90 -32
View File
@@ -856,12 +856,15 @@ texts are at most 500 characters, no control characters.
- `books.add_party { name, roles? }` → the party (below). Journaled as
`party.added`.
- `books.update_party { party, name?, display_name?, website?, address?,
notes?, archived? }` → the party. Give at least one field; `""` clears
`display_name`, `website`, `address`, or `notes`. Every field is checked
notes?, archived?, creditor_of? }` → the party. Give at least one field;
`""` clears `display_name`, `website`, `address`, or `notes`;
`creditor_of` (account codes or ids) replaces the party's list of the
liabilities the company owes it itself (below). Every field is checked
(in order, on a rehearsal) before any is written; each is journaled as
its own `party.updated`, in the order name, display_name, website,
address, notes, archived. Un-archiving is refused while another party
has the name.
address, notes, archived, then one `party.creditor_set` per account
added or dropped. Un-archiving is refused while another party has the
name.
- `books.set_party_roles { party, add?, remove? }` → the party. Adds apply
before removes (so a contractor's W-9 survives a swap to landlord); roles
it already has, or lacks, are skipped; each change is journaled as
@@ -919,22 +922,66 @@ texts are at most 500 characters, no control characters.
"require"`, any party (or the no-party mark) satisfies the check.
Reversals carry every share. There is no "joint" party: a joint member
transaction names both members and lets the shares derive.
- `books.parties { role?, include_archived?, year? }` → `{ year, parties:
[{ party_id, name, label, roles, vendor_id?, customer_id?, w9_on_file,
tin_last4?, w4_on_file, archived, paid, received }] }`, by id.
- `books.party { party, year? }` → `{ party, year, totals, entries,
invoices, bills, payroll }`: the facts; the calendar year's totals
(default this year); every entry it is on (drafts included, newest
first); its invoices and bills (`{ id, date, due_date, total, paid,
balance, status, entry_id }`); and the payroll lines naming it
- `books.parties { role?, include_archived?, year?, basis? }` → `{ year,
basis, parties: [{ party_id, name, label, roles, vendor_id?,
customer_id?, w9_on_file, tin_last4?, w4_on_file, archived, paid,
received }] }`, by id. `tin_last4` is the TIN's last four when the books
know it: its TIN facts' (`books.set_tin`; a member's SSN for the K-1),
else its W-9 facts' (the two never disagree), null with neither, kept
after `books.purge_tin` (P3 defect 11: it read W-9 facts only, so a
member's showed as missing).
- `books.party { party, year?, basis? }` → `{ party, year, totals,
entries, invoices, bills, payroll }`: the facts; the calendar year's
totals (default this year); every entry it is on (drafts included,
newest first); its invoices and bills (`{ id, date, due_date, total,
paid, balance, status, entry_id }`); and the payroll lines naming it
(`{ run_id, date, entry_id, gross_pay, net_pay }`).
- `basis` (both): `"cash"` (the default) or `"all"`; any other word is
refused (`basis is "cash" or "all"`). Echoed in the output. Not the
books' accounting method (`books.accounting_basis`).
The party (every mutating party tool returns it): `{ party_id, name,
label, display_name?, roles, website?, address?, notes?, archived,
vendor_id?, customer_id?, w9?: { received_on, entity_type,
exempt_payee_code?, fatca_code?, tin_last4, kept_at, in_vault }, w4?: { received_on,
state, kept_at } }`. `label` is the display name, else the name; `roles`
include vendor and customer when it has those records.
state, kept_at }, tin?, creditor_of }`. `label` is the display name, else
the name; `roles` include vendor and customer when it has those records.
`creditor_of` lists, by code, the liability accounts the company owes the
party itself on: the card it issued, the loan it made, what the members
advanced (each member). `books.update_party { creditor_of: [codes] }`
replaces the list (`[]` clears it), journaled as `party.creditor_set {id,
account_id, on}`, one line per account added or dropped (the journal's
feature `party_creditors` is declared before the first); refused,
journaling nothing, for an account that isn't a liability, is a
placeholder, or is payables or a payroll withholding (owed to many).
**Each party's part of an entry** (`books.get_entry`, the
`books.post_entry` preview, `books.set_entry_party`: `parties: [{ party_id,
party, share, amount?, percent?, resolved, direction, cash, in_kind }]`,
rules.md B-35):
- `resolved`: signed as a line on the party's own account would be
(debit-positive): positive, the company paid it or gave it value;
negative, the company received from it. A reversal's is exactly its
original's negated, never read from its own lines.
- `direction`: `paid`, `received` or `neither` (a promise not yet settled:
a bill, an invoice, a fee on the party's own card, a distribution still
owed; or an entry that moved nothing with anyone, like a close).
- `cash`: what of it moved as money; `in_kind`: what moved as property.
Both `"0.00"` for `neither`; `resolved − cash − in_kind` is a promise,
counted on neither basis. All four are null exactly when the shares
don't resolve (`parties_error` says why).
- What the shares split (B-35 item 3): a close, its parties' own-account
movement, neither; a reversal, its original's negated; an entry naming
only members that moves equity, what moved their capital (a
contribution received: the property in it, asset accounts that are
neither cash nor receivables, the K-1 worksheet's test, in kind and the
rest cash; a distribution paid: the money it paid as cash, the property
it gave in kind, the rest still owed, counted when it is paid); money
moved, the money (paid or
received); otherwise the parties' own-account movement (payables,
receivables, a liability owed to them: a bill −, an invoice +), else the
total debits, neither.
**Totals** (`books.party` `totals`; `paid` and `received` in
`books.parties`), from the journal:
@@ -943,24 +990,35 @@ include vendor and customer when it has those records.
record (bills and their payments); its customer record's invoices and
the payments received on them; and reversals of any of these. Only
posted entries dated in the year count.
- *Money accounts:* the `[books] cash_accounts` (every asset account but
receivables when none are set), and every liability account except the
payables and payroll withholding roles (`books.roles`). A liability
counts as how the company paid or was paid: a card, a member paying for
it, a loan.
- `paid` / `received`: each entry's money lines, credits minus debits
(`ledger_core::parties::entry_flow`), with a liability paid down
counting once, as paid to its creditor: by cash (a reimbursement to the
members, a card payment) or by another liability (a member paying the
card from their own funds, a loan paying it off); cash raised by a
liability is received from the lender. A positive net was paid to the
party, a negative one received from it; a reversal counts against its
root original's side (reversing the reversal counts on that side
again). A bill isn't paid until its payment is; a transfer between the
company's own cash accounts nets to zero. An entry naming several
parties counts this party's resolved share only (an entry whose shares
don't resolve counts for none). The year is the whole calendar year;
the viewer's party page and directory show these same numbers.
- *Money accounts* (B-35 item 5, P3 defect 24): the `[books]
cash_accounts` (every asset account but receivables when none are set),
the cards (liability accounts whose names say "card", not "gift card":
the rule the reconciliation reminders read), and the `[books]
financing_accounts` (what the members advanced, loans). Any other
liability (an accrued expense, deferred revenue, gift cards sold,
distributions payable) is a promise, counted when it is settled, never
also when it is booked. A liability owed to a party the entry names (`creditor_of`)
isn't money for that entry: a credit to it never counts as paying the
party.
- `paid` / `received`: each entry's part for the party, added up on its
root original's side (a reversal subtracts there, and reversing the
reversal adds back): on basis `cash`, the `cash` parts; on basis `all`,
`cash` plus `in_kind`. A cash payment, a card charge, a member paying
for the company: paid to the payee then; cash paying one of the money
liabilities down: paid to its creditor (a reimbursement to the members,
a card payment to the issuer); cash raised by one: received from the
lender. A bill or invoice counts on neither basis (a promise is not
payment); a transfer between the company's own cash accounts nets to
zero. An entry naming several parties counts this party's part only (an
entry whose shares don't resolve counts for none). For a member, basis
`all` over the entries that name only members and move their capital
(and the payments of distributions declared to them) is the statement
of members' equity's contributions and distributions, and basis `cash`
their contributions is the K-1 worksheet's cash contributions (B-35
item 4 gives the conditions: a distribution declared and not yet paid
is in the statement only). The year is the whole
calendar year; the viewer's party page and directory show these same
numbers, labelled "cash basis", with the in-kind figures beside them.
- `invoiced` / `billed`: its invoices' and bills' totals dated in the year.
`owed` / `receivable`: its open bills' and invoices' balances now (every
year).
+51 -16
View File
@@ -77,7 +77,10 @@ Rules (to vendor as B-26 with sources):
address, notes, archived), `party.role_set {id, role, on}`,
`party.w9_set {id, facts|null}`, `party.w4_set {id, facts|null}`,
`party.tin_set {id, facts|null}` (TIN facts: type, last four, vault
record, when purged), `entry.party_set {entry_id, party_id|null}`,
record, when purged), `party.creditor_set {id, account_id, on}` (P3: the
party is, or stops being, the creditor of a liability the company owes it
itself; the journal declares its feature, `party_creditors`, before the
first one), `entry.party_set {entry_id, party_id|null}`,
`entry.parties_set {entry_id, parties: [{party_id, share}]}` (a share is
`{"amount": "30.00"}`, `{"percent": "60"}`, or `"derived"`; `[]`
clears). Replayed and projected like
@@ -95,9 +98,24 @@ derived. Spec: `ledger_core::shares`.
(`set_entry_party`) is one derived share: all of it.
`Ledger::entry_party` means "the sole party"; `entry_parties` lists
them all.
- **What a share is of:** the entry's `entry_flow` net (what it moved
with its counterparties), or its total debits when the net is zero (a
member contributing property moves no money but is still theirs).
- **What a share is of** (rules.md B-35, P3 defect 14): one signed
target, debit-positive as a line on the parties' own account (positive:
the company paid or gave; negative: it received), with its direction
(paid, received, neither) and what of it was money and what property in
kind. A close: its parties' own-account movement, neither. A reversal:
its original's target negated, never re-read from its own lines. An
entry naming only members that moves equity: what moved their capital.
A contribution is received, the property in it in kind (the K-1
worksheet's test), the rest cash; a distribution is paid, the money it
paid cash, the property it gave in kind, the rest (declared to
distributions payable, or credited to what the members advanced once
they are named its creditors) still owed, counted when paid. Money moved: the money
(`parties::flow`), all cash. Otherwise its parties' own-account
movement (a bill −, an invoice +), else its total debits: neither,
counted in no total. Read from journaled facts only (the member role,
the chart, `creditor_of`), so leaving `[[company.members]]` never
changes a posted entry's reading. (Before P3 a property contribution
read +500.00, the sign of a payment, and its reversal the same.)
- **Amount:** exactly that, positive, in cents; the amounts must sum to
what the entry moved.
- **Percent:** more than 0, at most 100, summing to exactly 100. Each part
@@ -131,19 +149,32 @@ derived. Spec: `ledger_core::shares`.
checks only their form; the MCP server checks they resolve once the
entry has balanced lines, and `post_entry` refuses (`party_shares`)
until they do. Replay never consults settings.
- **Money:** `parties::activity_with` counts each party's resolved share;
an entry moving no money counts nothing; an entry whose shares don't
resolve counts for no one (listed as unresolved). Reversals carry
every share, so a reversal subtracts each party's part; re-tagging
either one (parties, shares, or vendor) re-tags the other, so the pair
always nets to zero.
- **Money:** `parties::activity_with` counts each party's part on two
bases (B-35 item 4): cash (its money: cash, a card, the members'
financing, a loan) and all (adding property contributed or distributed
in kind), the viewer labelling the first "cash basis". Money accounts
are the cash accounts, the cards and `[books] financing_accounts`; any
other liability is a promise, counted once, when settled (P3 defect
24). A party may be named the creditor of liabilities it is owed itself
(`creditor_of`: a card's issuer, a loan's lender, each member for what
the members advanced); a credit to one never counts as paying it. An
entry that counts nothing (a bill, an invoice, a close) is never
unresolved; an entry whose shares don't resolve counts for no one
(listed as unresolved). Reversals carry every share, so a reversal
subtracts each party's part; re-tagging either one (parties, shares,
or vendor) re-tags the other, so the pair always nets to zero.
A reversal counts on its root original's side, so reversing the
reversal reinstates the payment as paid (never a negative received).
For a member, basis all over their equity entries is the statement of
members' equity; basis cash their contributions is the K-1 worksheet's
cash contributions.
- **One number everywhere:** `books.party`, `books.parties`, and the
viewer's party page and directory read cash as the server does
(`[books] cash_accounts`, else every asset account but receivables)
and count the whole calendar year, so a posted entry dated later this
year counts in both. The viewer shows the year up to the later of today
viewer's party page and directory read money as the server does
(`[books] cash_accounts`, else every asset account but receivables;
the cards; `[books] financing_accounts`) and count the whole calendar
year, so a posted entry dated later this year counts in both. The
directory's TIN last four is the TIN facts', else the W-9 facts'
(`Party::tin_last4`, P3 defect 11), as everywhere the books show one. The viewer shows the year up to the later of today
and its last posted entry.
- **For the agent:** a joint member transaction (a reimbursement on Due
to Shareholders, a contribution or distribution from joint funds)
@@ -220,9 +251,13 @@ paid without W-9 facts; a 1099 party paid over the threshold.
Money with a party (the owner, 2026-10-15: "how much have I spent on Apple
versus how much did I get back"): paid out, received in, and net, for a
chosen period (this year, last year, any year, all time), from
`ledger_core::parties::activity`; what it was for (the non-money lines by
`ledger_core::parties::activity_with`, labelled cash basis, with "With
property contributed or distributed: paid $X, received $Y" under them
when anything moved in kind; what it was for (the non-money lines by
account); a monthly out-vs-in chart; the 1099 amount for the calendar
year. The directory shows the same columns, sortable.
year. An entry's page says each party's part in words ("received
$740.00, in kind"; "paid $1,480.00 (reversal of #12)"). The directory
shows the same columns, sortable.
## The TIN vault
+196 -5
View File
@@ -762,8 +762,11 @@ An entry naming several parties (a payment shared between a contractor
and a member; `ledger_core::shares`) counts only the vendor's share
toward its 1099: what was paid to the payee (§6041(a)), not what the
entry moved for others. The share is resolved (`shares::resolve`)
against the entry's flow, the same target the MCP server checks shares
against, then scaled to the 1099 payment: the share unchanged when the
against the entry's target (B-35: its money, or, when it moved none, its
parties' own-account movement; a reversal's is its original's negated),
the same target the MCP server checks shares against, then scaled to the
1099 payment (a ratio, so B-35's signs change no 1099 figure: a reversal
negates both the payment and the target): the share unchanged when the
payment equals the target (the usual case, an expense paid from cash or
by a member), else payment × share ÷ target, rounded to the nearest cent,
half away from zero (so a part charged to a card scales out, 1099-K). A
@@ -1010,7 +1013,13 @@ happen to end in a known last four is refused the same way (filed as a
PDF instead).
A locked vault or a missing TIN never fails
the package: it says which TINs are missing. `books.purge_tin` deletes a
party's vault records and journals that it did.
party's vault records and journals that it did. Wherever the books show a
party's last four (the directory, `books.party`, the 1099 and K-1
worksheets, the purge preview) it is the TIN facts', else the W-9
facts' (`Party::tin_last4`; the two never disagree; exactly four digits
or nothing, however the facts were built), kept after a purge
(P3 defect 11: the directory read W-9 facts only, so a member's read as
missing).
**Enforced:** `crate::parties` (has_full_tin, check_text, W9Facts::check,
W4Facts::check), `Ledger::add_party`, `update_party`, `set_party_role`,
@@ -1089,9 +1098,10 @@ features already in force (`Store::ensure_feature`): an earlier reader
stops at the declaration, and books that never use the feature stay
readable by it. P3's: `members_cumulative` (B-13: a members close counted
from its count's first close, `"rounding": "cumulative_since"`),
`account_renamed` (before the first `account.renamed`, B-31) and
`account_renamed` (before the first `account.renamed`, B-31),
`require_tax_category` (before the first `settings.set` naming
`policy.require_tax_category`, B-32). A later piece asks the owner's
`policy.require_tax_category`, B-32) and `party_creditors` (before the
first `party.creditor_set`, B-35). A later piece asks the owner's
go-ahead before the first such declaration (plan D-39).
**Enforced:** `ledger_store::format` (`JournalFormat::admit`, `declared`,
@@ -1646,3 +1656,184 @@ appendix: the file line by line and its changes, derived by hand);
`iif_without_as_of_is_as_of_today_and_ties_to_the_trial_balance`),
`mcp_stdio.rs` (`mcp_import_export_over_stdio`,
`the_default_period_never_shortens_the_iif_or_the_package`).
## B-35 A party's part of an entry, and a party's totals
**Status:** CONVENTION (the sign: B-2's, a line on the party's own
account); DECISION (the owner, 2026-10-15: `entry_flow`, money paid down
counted once; the owner, 2026-10-20, P3 design settled with each review's
recommendation: a member's entry counts what moved their capital, money
is cash, cards, the members' financing and loans, and a liability credit
never counts as paying that liability's own creditor); AUTHORITY for what
a member's capital counts (Treas. Reg. §1.704-1(b)(2)(iv)(b), (c);
Form 1065 Schedule K-1 instructions, Item L:
`sources/irs-capital-accounts.md`) and for a promise not being payment
(Helvering v. Price, 309 U.S. 409 (1940):
`sources/helvering-v-price-1940.md`). Not ASC 230's cash (see item 8) and
not the books' accounting method (`books.accounting_basis`).
1. **Sign.** A party's part of an entry is signed as a line on the
party's own account would be (debit-positive, B-2): positive, the
company paid it or gave it value; negative, the company received from
it. A bill is negative (owed to the vendor), an invoice positive.
2. **Direction, cash, in kind.** Every part carries its direction (paid,
received, neither) and what of it moved as money (cash) and as property
(in kind); what is neither is a promise still to be settled (a bill, an
invoice, a fee on the party's own card, a distribution still owed) or
moves nothing with anyone (a close), and counts in no total. A part's
cash and in kind have its sign and together never exceed it; what of a
paid part is neither (a distribution partly still owed) is a promise,
counted when it is paid.
3. **What the shares split** (`shares::target`), in order:
1. A period's closing entry: its parties' own-account movement (the
members' equity, when only members are named), else its total
debits; neither (B-11, B-13: a close allocates income, it moves
nothing with anyone).
2. A reversal: its original's target, negated, paid and received
swapped, from the root original down (B-9: "a mistake is corrected
by an opposite entry"); never re-read from its own lines, because
`entry_flow` isn't odd when one liability pays down another (a
member paying the card from their own funds, reversed, read as a
second payment: P3 design §1.4).
3. Every party named has the member role in the directory and the
entry moves equity other than retained earnings (E): E, a
contribution received (E < 0) or a distribution paid (E > 0).
- Of a contribution, in kind is the property in it, at most |E|:
what asset accounts that are neither cash nor receivables took in
(the K-1 worksheet's test, k1 INVARIANT 3), so property
contributed subject to a loan is the member's net property
(§1.704-1(b)(2)(iv)(b)(2)). The rest is cash, as the K-1 counts
it: money, or what the member paid for the company (an expense
booked straight to capital, a debt to them converted,
§1.704-1(b)(2)(iv)(c)(1)).
- Of a distribution, cash is the money it paid (case 4's net, at
most E: §1.704-1(b)(2)(iv)(b)(4)) and in kind the property it
gave up, at most what is left, as the books carry it (the
statement's figure; (b)(5) counts its fair market value, which
stays with the CPA). The rest, credited to a liability that
isn't money for the entry (distributions payable, or what the
members advanced once they are named its creditors), is still
owed: it counts as nothing until it is paid (Helvering v. Price;
before the P3 review a distribution declared to distributions
payable counted when declared and again when paid, and a
distribution of money with depreciated property read the money
as property).
Read from journaled facts only (roles, the chart, creditors), so a
member leaving `[[company.members]]` never changes a posted entry;
the settings' members matter only to a derived split among several,
which the server journals as amounts when the entry posts.
4. Money moved (`parties::entry_flow` net, item 5's accounts less the
liabilities owed to a party named): the net, paid (+) or received
(−), all of it cash.
5. Otherwise its parties' own-account movement (payables, receivables,
a liability owed to a party named), else the total debits; neither.
The parts split the target as `shares` INVARIANTS 7-12 say: a
reversal's parts are exactly its original's negated, and a member's in
kind is shared as the K-1 worksheet shares property (in proportion,
leftover cents by largest remainder, ties to the member listed first).
4. **Totals: `basis` cash (the default) or all, always labelled.** Cash
counts each part's cash; all adds what moved in kind (Item L counts
money and property alike). Each part counts on its root original's
side, so a reversal nets what it reverses, and reversing the reversal
brings it back. A bill or invoice counts on neither basis (a promise is
not payment: Helvering v. Price); `billed`, `invoiced`, `owed` and
`receivable` report those. An entry that counts nothing is never
unresolved (its target is found before its split). For a member, over
the entries that name only members and move their capital, plus the
payments of distributions declared to them: basis all's received and
paid are the statement of members' equity's contributions and
distributions for the same dates, and basis cash's received is the
K-1 worksheet's cash contributions, when
- each such entry names exactly the members whose capital it moves
(derived from their capital lines, or amounts equal to them) and
moves every one of them the same way (capital moved from one member
to another moves nothing with the company: neither, though the
statement shows a distribution and a contribution);
- no distribution declared in the span is still unpaid at its end (the
statement counts it when declared, party totals when paid); and
- no reversal in the span undoes an entry outside it (the statement
then counts the reversal by its side; party totals net it on the
original's side).
Over any span at all, even one a reversal straddles, received less
paid still agrees with contributions less distributions, given the
first two conditions (the property
`member_totals_are_the_members_equity_statement` checks every span).
5. **Money** (P3 defect 24): the cash accounts (`[books] cash_accounts`;
every asset account but receivables when none are set), the cards
(liability accounts whose names say "card" but not "gift card", the
rule the reconciliation reminders read, until payment instruments name
them), and `[books] financing_accounts` (what the members advanced,
loans). Every other liability (payables, the payroll withholdings, an
accrued expense, deferred revenue, gift cards the company sold) is a
promise: counted when it is settled, never also when it is booked
(before P3 an accrual through any liability but payables and payroll
counted twice). So a card account whose name doesn't say "card" is
not money until it is listed in `financing_accounts` or an instrument
names it, and with `financing_accounts` unset what the members
advanced is not money either: a purchase through either then counts
for no one until it is paid off (the handbook tells the agent to list
them).
6. **A party's own liabilities.** A party may be named the creditor of
the liabilities the company owes it itself (`creditor_of`: a card's
issuer, a loan's lender, each member for what the members advanced;
`party.creditor_set`, a journal feature). For an entry naming it, a
credit to one never counts as paying it (a fee on its card, interest on
its loan, equipment on the seller's note: neither, until paid; a
distribution credited to the members' financing: still owed), and a
debit to one is what the money paid for (a card payment, a
reimbursement: paid, as before).
7. **Known limits**, stated in the tools' text: an entry that both repays
a member and distributes to them counts the distribution only; money a
member lends under their own name through the members' financing and
later converts to capital counts both times (received as a loan, then
as a contribution), as does a distribution declared through it while
the members aren't named its creditors (paid when declared, and again
when paid); an entry naming a payee together with the creditor of the
liability that paid it (a vendor and the member who paid it through
the members' financing) reads neither for both; an expense a member
paid that is booked straight to capital and tagged with the vendor
reads neither (the vendor isn't counted as paid; tagged with the
member, it is the member's cash contribution). Record them apart, and
a member's payment for the company through the members' financing,
tagged with the payee: the house conventions already do.
8. **How party totals relate to the cash flow statement** (B-14, D-42,
P3 defect 1). The statement reports the company's cash, ASC 230's: a
member paying a vendor for the company is cash borrowed from the member
and spent, on that date (a financing inflow and an operating or
investing outflow); paying the member back is a financing outflow;
property a member contributes, and a debt to them converted to
capital, are noncash (disclosed). Party totals report what moved with
each party: the vendor is paid when the member pays it (the same date
and amount as the statement's outflow); the member is paid back when
the statement shows the financing outflow; and a member's capital
counts when it moves, a conversion as the cash contribution the K-1
calls it (the money they paid for the company), property in kind; a
distribution counts when it is paid, as on the statement. Where both
show a payment they agree on its amount and date. The statement shows
more than party totals do in two places: the financing inflow from a
member who pays a vendor is in no party's totals (the entry names the
vendor; the member's totals show only the repayment), and an expense
booked straight to capital and tagged with the vendor isn't counted
as paid to the vendor (item 7). "Cash" in party totals is money
through the company's cash accounts, cards and financing (and, on a
member's contribution, the K-1's cash), not the statement's ASC 230
cash.
**Enforced:** `kernel::party_target`, `kernel::reverse_target`,
`shares::{target, split, resolve}`, `parties::{flow, money_accounts,
card_accounts, MoneyAccounts::for_parties, activity_with, Activity::totals,
Basis}`, `Ledger::set_party_creditor`, `Store::set_party_creditor` (the
`party_creditors` journal feature, declared before its first line);
`ledger-mcp` `books.get_entry` (`resolved`, `direction`, `cash`,
`in_kind`), `books.party` and `books.parties` (`basis`), `books.update_party`
(`creditor_of`); the viewer's party pages and entry page.
**Checked:** `ledger-core` `tests/spec_party_totals.rs` (the audit's
table, the members' equity and K-1 identities over every span, the
reversed card payment, accruals, a gift card, a party's own liabilities,
distributions declared or of depreciated property, the properties), Kani
`party_target_direction_is_its_sign`, `party_target_is_odd`,
`reverse_target_is_an_involution`, bridge `party_target_agrees`; Lean
`reverseTarget_involutive`, `capitalTarget_odd`, `partyTarget_odd`,
`sumOver_movement_reversal`; `ledger-store` `tests/party_creditors.rs`;
`ledger-mcp` `tests/spec_party_totals.rs`; `ledger-gui` `tests/parties.rs`.
@@ -0,0 +1,11 @@
# A promise to pay is not payment: Helvering v. Price, 309 U.S. 409 (1940)
Governs why a party's totals never count a promise as a payment (rules.md B-35): a bill, a fee charged on the party's own card, equipment bought on the seller's own note, or a distribution still owed counts when it is paid, not when it is promised. The Supreme Court held that a taxpayer reporting on the cash basis who gave his own note, even a secured one, had not paid. Opinions of the Supreme Court are works of the United States Government (`us-public-domain-status.md`).
## Helvering v. Price, 309 U.S. 409, 412-413 (1940)
Source: <https://tile.loc.gov/storage-services/service/ll/usrep/usrep309/usrep309409/usrep309409.pdf> (United States Reports, Library of Congress)
Retrieved: 2026-10-20
SHA-256 of the retrieved file (`usrep309409.pdf`): `ac58d7cb0fbe1257c7ad5e75152e540544194c6accabe261b02068f6cebd7efe`
> As the return was on the cash basis, there could be no deduction in the year 1932, unless the substitution of respondent's note in that year constituted a payment in cash or its equivalent. There was no cash payment and under the doctrine of the Eckert case the giving of the taxpayer's own note was not the equivalent of cash to entitle the taxpayer to the deduction.
> Respondent urges that his note was secured, but the collateral was not payment. It was given to secure respondent's promise to pay, and if that promise to pay was not sufficient to warrant the deduction until the promise was made good by actual payment, the giving of security for performance did not transform the promise into the payment required to constitute a deductible loss in the taxable year.
+35
View File
@@ -0,0 +1,35 @@
# Partners' capital accounts: what a member's money and property count as
Governs what a member's party totals count (rules.md B-35): a member's capital account rises by the money and the property (net of liabilities on it) the member contributes, and falls by the money and property distributed to them; a partnership liability the member pays for it is money the member contributed. The K-1's capital account analysis (Item L) reports the same contributions and distributions. wanderbooks counts these from the books as they are; the tax-basis figures stay with the CPA.
## Treas. Reg. §1.704-1(b)(2)(iv)(b): basic rules of capital accounts
Source: <https://www.ecfr.gov/api/renderer/v1/content/enhanced/current/title-26?part=1&section=1.704-1>
Retrieved: 2026-10-20
SHA-256 of the retrieved file (`ecfr7041.html`): `0eafa6f27d7df3a3cc93ebad7cbdc0c37a49b055c53a43d5e5e8efa29f80beeb`
> (b) Basic rules. Except as otherwise provided in this paragraph (b)(2)(iv), the partners' capital accounts will be considered to be determined and maintained in accordance with the rules of this paragraph (b)(2)(iv) if, and only if, each partner's capital account is increased by
> (1) the amount of money contributed by him to the partnership,
> (2) the fair market value of property contributed by him to the partnership (net of liabilities that the partnership is considered to assume or take subject to), and
> (3) allocations to him of partnership income and gain (or items thereof), including income and gain exempt from tax and income and gain described in paragraph (b)(2)(iv)(g) of this section, but excluding income and gain described in paragraph (b)(4)(i) of this section; and is decreased by
> (4) the amount of money distributed to him by the partnership,
> (5) the fair market value of property distributed to him by the partnership (net of liabilities that such partner is considered to assume or take subject to),
## Treas. Reg. §1.704-1(b)(2)(iv)(c): treatment of liabilities
Source: as above (the same retrieved file).
> (c) Treatment of liabilities. For purposes of this paragraph (b)(2)(iv),
> (1) money contributed by a partner to a partnership includes the amount of any partnership liabilities that are assumed by such partner (other than liabilities described in paragraph (b)(2)(iv)(b)(5) of this section that are assumed by a distributee partner) but does not include increases in such partner's share of partnership liabilities (see section 752(a)), and
> (2) money distributed to a partner by a partnership includes the amount of such partner's individual liabilities that are assumed by the partnership (other than liabilities described in paragraph (b)(2)(iv)(b)(2) of this section that are assumed by the partnership) but does not include decreases in such partner's share of partnership liabilities (see section 752(b)).
## Partner's Instructions for Schedule K-1 (Form 1065), Item L
Source: <https://www.irs.gov/instructions/i1065sk1>
Retrieved: 2026-10-20
SHA-256 of the retrieved file (`i1065sk1.html`): `87d46c0e6c07eb0b642e9479f72aed7c35ed005cab0b1c644af5572a9df22d7c`
> The partnership must report your beginning capital account and ending capital account for the year using the tax-basis method, including the amount of capital you contributed to the partnership during the year, your share of the partnership’s current-year net income or loss as computed for tax purposes, any withdrawals and distributions made to you by the partnership, and any other increases or decreases to your capital account determined in a manner generally consistent with figuring the partner’s adjusted tax basis in its partnership interest (without regard to partnership liabilities), taking into account the rules and principles of sections 705, 722, 733, and 742.
+49
View File
@@ -1237,6 +1237,55 @@ range, `export_journal`'s period, `described`, `uncategorized_warning`,
`handbook::period_rule`. The viewer is not mutated (owner, 2026-10-18):
`view_model.rs` and `show.rs` cover it.
## P3: parties (defects 14, 24, 11; 2026-10-20)
A party's part of an entry is signed as a line on its own account, with a
direction and its money and property; party totals take a basis; money is
cash, cards and the financing accounts; a credit to a liability a party is
owed itself never pays it; the directory's TIN last four comes from TIN or
W-9 facts (rules.md B-35, B-26). Built, reviewed and checked under D-33:
no mutation run here; what P12 must cover is at the end.
| What | Where | Oracle |
|---|---|---|
| The audit's table (F36, F37), row by row: resolved, direction, cash, in kind; reversals the exact opposite; bills and invoices signed; totals on both bases | `ledger-core/tests/spec_party_totals.rs` `defect14_shares_take_the_partys_side_and_reversals_flip` | B-35, by hand |
| Basis all is the members' equity statement, cash the K-1's cash contributions | `basis_all_is_the_members_equity_statement_and_cash_the_k1s`; property `member_totals_are_the_members_equity_statement` (members contributing and taking out money and property, alone and jointly, subject to a loan, through 2100 then converted, through their distributions accounts, depreciated property with money, declared to distributions payable and paid later, reversed later in the year; checked over every span from the year's start and, received less paid, over every span) | `reports::members_equity`, `k1::k1_detail` |
| A reversed member card payment nets to zero (brief §1.4) | `defect14_a_reversed_member_card_payment_nets_to_zero` | B-9 |
| Accruals through another liability count once (defect 24) | `defect24_an_accrual_through_another_liability_counts_once` | B-35 item 5 |
| A credit to a party's own liability never pays it: a card fee, a distribution owed, a seller's note, property subject to a loan | `defect24_a_credit_to_a_partys_own_liability_never_pays_it`; the documented limit, pinned: `a_distribution_owed_counts_twice_until_the_members_are_named_its_creditors` | B-35 item 6; Treas. Reg. §1.704-1(b)(2)(iv)(b)(2); Helvering v. Price |
| Review, 2026-10-21: a distribution declared to distributions payable counts once, when paid (it counted twice); a distribution of money and depreciated property splits by what moved (the money read as property); a gift card sold is received once (it was a "card": twice); a refund is received; tin_last4 never shows more than four digits | `defect24_a_distribution_declared_to_a_payable_counts_once_when_paid`, `a_distribution_of_money_and_depreciated_property_splits_by_what_moved`, `defect24_a_gift_card_sold_is_received_once`, `a_refund_is_received_from_the_vendor`, `defect11_a_partys_tin_last4_is_its_tin_facts_else_its_w9s` (SCENARIO 6) | B-35 items 3, 5; B-26 |
| A mixed contribution splits as the K-1 does, ties to the first member | `a_members_mixed_entry_splits_as_the_k1_does` | k1 INVARIANTS 3, 4 |
| Read from journaled facts: an archived member, a one-member company | `a_members_entry_keeps_its_reading_after_they_leave` | review R2 |
| A close is neither; a basis is cash or all; creditor_of's checks; tin_last4's five scenarios; the kernel's cases | `a_close_tagged_with_its_members_is_neither`, `a_basis_is_cash_or_all`, `a_creditor_is_named_only_on_a_liability_with_one_owner`, `defect11_a_partys_tin_last4_is_its_tin_facts_else_its_w9s`, `party_target_cases_by_hand` | specs |
| Properties: a reversal's target, parts and flow are the original's negated; parts sum to the target, each with its sign; a sole party's money part is the flow as before P3; tin_last4 is every source present | `a_reversal_is_the_exact_opposite`, `a_sole_partys_money_part_is_the_flow_as_before`, `tin_last4_is_every_source_present` (`PROPTEST_CASES`, default 256; 5,000 run clean) | B-35, B-9 |
| Decimal and i64 agree on party_target and reverse_target | `kernel_bridge.rs` `party_target_agrees` | the bridge |
| Kani: the direction is the sign, the target is odd, reverse_target an involution | `proofs.rs` `party_target_direction_is_its_sign`, `party_target_is_odd`, `reverse_target_is_an_involution` | the kernel spec |
| The journal: party.creditor_set after its feature, declared once; refusals journal nothing; books without creditors never change; corrupt lines refused | `ledger-store/tests/party_creditors.rs` | the format gate |
| Over the MCP: get_entry's direction, cash, in_kind; party totals by basis, echoed, others refused; basis all equals members' equity; creditor_of round trips and a card fee isn't a payment; the post_entry preview's parts are what it posts | `ledger-mcp/tests/spec_party_totals.rs` | the tool docs |
| Defect 11 over the MCP: a member's TIN last four in the directory, a W-9's, none, after a purge | `ledger-mcp/tests/spec_vault.rs` `defect11_the_directory_shows_a_members_tin_last4` | B-26 |
| The viewer shows the tools' numbers, labelled cash basis, with the in-kind line; its what-for reads a reversal as `parties::flow` does | `ledger-gui/tests/parties.rs` `the_party_page_shows_the_basis_and_in_kind`, `a_reversed_member_card_payment_is_nothing_on_the_issuers_page` | `activity_with`, `flow` |
| bookspec | `bookspec/examples/p3-party-*.toml` | the same cases, by hand |
**For P12 (mutation targets, none run, D-33):** `kernel::party_target`
(each branch, the `!= 0` and `< 0` tests, the property and money clamps,
the neither-when-nothing-counts test), `kernel::reverse_target` and
`Direction::{flip, of}`; `shares::target` (the closing check, the reversal
arm and its parity, members_only, the equity filter and the retained
earnings exclusion, the property test, the own sums),
`shares::split` (the member-order tie-break, the cash shortcut, the zero
sign); `parties::{flow, root_original, money_accounts, card_accounts,
MoneyAccounts::for_parties}` (the negation of what_for, the walk's
guard, cards and financing as money, the gift-card exclusion); `activity_with` (the target before
the split, the skip of nothing-counts, the bucket by side and basis, the
overflow checks); `Activity::totals`; `Basis::parse`;
`Ledger::{set_party_creditor, check_set_party_creditor, creditors_of,
is_closing_entry}`; `Store::{set_party_creditor, ensure_feature}`; the
server's `parse_basis`, `party_activity`, `entry_parties_out` (direction,
cash, in_kind) and `update_party`'s creditor_of diff; the viewer's
`party_what_for` and `share_text`. Expected equivalent:
`Party::tin_last4`'s `or_else` order swapped (TIN facts and W-9 facts
never disagree, parties INVARIANT 2a, enforced on replay).
## Benchmarks (baseline 2026-10-13)
No budget, by decision (the owner, 2026-10-13: the books do little work
+26
View File
@@ -256,6 +256,32 @@ their numbers are assigned when P3 lands:
year, closed and never closed), the viewer's
`a_members_page_shows_the_same_capital_before_and_after_a_close`
### Parties
19. **A party's part of an entry is signed as its own account would be,
with a direction that is its sign**: paid exactly when what counts is
positive, received when negative, neither exactly when nothing counts;
the money and property in it each carry the whole's sign and never
exceed it; a money target is all cash; a contribution counts all of
itself; a distribution counts no more money than it paid and no more
property than it gave, the rest still owed (rules.md B-35).
- Kani `party_target_direction_is_its_sign` · bridge
`party_target_agrees`
20. **A reversal is the exact opposite of what it reverses**: the target
is odd (negating the lines' capital movement, money and own-account
movement gives the original's reverse, but for the debits fallback and
a member's entry whose cash isn't exactly its money: an expense booked
straight to capital, a debt converted, a distribution still owed; the
engine never reads those off a reversal's lines: its reversal arm
takes the original's target), reversing twice gives the original
back, and a reversal's movement over any accounts is the original's
negated (B-9).
- Kani `party_target_is_odd`, `reverse_target_is_an_involution` ·
Lean `partyTarget_odd`, `capitalTarget_odd` (with `cashIsMoney`
shown satisfiable), `reverseTarget_involutive`,
`sumOver_movement_reversal` · property
`a_reversal_is_the_exact_opposite`
## What the proofs found
The engine already had 190+ tests, property tests, mutation testing,