Files
wanderbooks/docs/parity.md
T
swaitsandClaude Opus 5.5 528c070605 feat: invoices and bills take a project, line by line (B-37 item 8)
A client project's invoiced revenue and a contractor's billed cost could
never count toward the project: books.create_invoice and books.create_bill
posted at once with untagged lines, and only a draft's line takes a class.
Job costing (B-37 item 3) collects a job's billings and the supplier
invoices for its direct costs on its cost sheet, so each document line
now takes an optional project.

The owner decided it on 2026-10-22 (plan D-43, rules.md B-37 item 8):
each line takes one project or none; a document spanning N projects is N
lines, each with its own amount; no percentage split, so every figure is
exact; a cost truly shared among projects names none on the document
and reaches projects only as entries of their own under the company's
monthly allocation convention, when books.conventions has one (otherwise
it stays untagged and the agent asks the human). The reasoning, stated
in B-37: job costing charges a job the costs traceable to it, whole, and
reaches shared costs only by allocation on a stated basis. ASC
340-40-25-7 counts as directly related both the costs traceable to a
contract (25-7(a), (b), (d), (e)) and allocations of costs that relate
directly to it (25-7(c)); 25-8 expenses general and administrative cost.
The books carry the first whole on the document's line and the second as
the allocation convention's own entries; neither is a percentage on the
document (sources/fasb-asc.md, 25-7 and 25-8 added). The handbook's
projects rule and the line's class parameter say the same, and no
handbook sentence lets a shared cost be split across a document's lines.

The accounting: the document's entry posts one revenue (an invoice's) or
expense (a bill's) line per project its lines name, in the order each is
first named, each the sum of that project's lines, and the untagged
lines' sum as one more line (arap::document_parts, conservation checked
by a proptest). A document naming no project therefore posts exactly the
one line every document posted before. The receivable or payable line is
never tagged: it is a balance-sheet line, which item 3 counts nothing;
the payments (receive_payment, pay_bill) move cash against it and take no
project either. Nothing but the projects moves: the P&L, the 1099
worksheet (payments made, B-19) and party totals (what moved the money,
B-35) read the same with or without the tags (twin-books test); the
projects with the untagged lines still partition the P&L.

- ledger-core: DocumentLine.class_id (serde-omitted when none, so old
  documents serialize as before); create_invoice / create_bill split the
  revenue or expense side by project and tag it; an unknown project is
  refused whole (atomically).
- ledger-store: a document line's project is journaled as class_id on
  invoice.created / bill.created, and the entry's line as
  entry.line_class_set right after its entry.line_added (the entry.posted
  lines carry class_id, as a hand-built entry's do). Behind a NEW journal
  feature, document_line_projects (KNOWN_FEATURES, declared by new books,
  asked for before the first journaled line, not even the control
  accounts written on refusal); not `projects`, which the live books
  already declared: the owner consents again at the next upgrade. A
  malformed class_id is corrupt; null or absent is none. Untagged
  documents journal byte for byte as before; old journals replay
  unchanged.
- ledger-mcp: each line takes class (id or name, resolved like
  add_line's, every one before anything is written); the result gains
  notes for a finished or abandoned project, and on an invoice for an
  on-spec project (is there now an agreement? on spec a hoped-for
  payment is no receivable, B-37 item 4), tagged anyway; books lacking
  the feature refuse with format_upgrade_pending. books.get_entry shows a
  line's class_id and project. The handbook's "an invoice or bill takes no
  project yet" caveat now depends on the books: gone where the feature is
  declared, an "until their format upgrade" note where it isn't.
- ledger-gui: an invoice's or bill's page (its entry's) lists the
  document's lines, each project a link that opens it; the demo's client
  invoices are tagged to "Client work", whose snapshot is now its revenue
  less its contractors. Looking at the page in a narrow window found a
  tagged line's tag pushing the amounts past the pane (any tagged entry):
  the name is now cut to leave the tag room, the tag itself at most half
  the cell.
- bookspec: an `invoice` event, and `lines` with `project` on a bill or
  an invoice; example projects-invoice-and-bill-lines-count-by-project,
  worked by hand, both projects client work (Zeta 3,500.00 - 1,200.00 =
  2,300.00; Harbor 200.00;
  untagged -1,750.00; together the P&L's 750.00; Dana's 1099 payments
  1,250.00).
- fuzz: fuzz_store_replay can declare journal features.
- Tests: core, store, MCP, viewer, the P2-served cutover fixture and a
  viewer/server parity test (its month lists the same length, not
  empty); a tagged document's reversal nets its projects to zero, live
  and replayed; books.get_entry's class_id; the handbook served as a
  resource both ways; each fix broken to confirm its test fails
  (docs/testing.md). Docs: rules.md B-27 and B-37 items 3 and 8,
  sources/fasb-asc.md, plan/served.md D-43,
  mcp-interface.md, testing.md, parity.md, plan/STATUS.md.

No proof changed (no kernel arithmetic: document_parts sums with the
existing document_total).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T3gXMVt7XJPi6ens1or9Dj
2026-10-22 19:28:40 -06:00

5.8 KiB

Parity catalog

Every semantic feature we intend to clone, with its status. Updated in the same commit as the feature. The floor never decreases: the count of done items is monotonic across commits.

Statuses: done = implemented + invariant-tested + golden-covered. partial = implemented but missing tests or goldens. todo = not started. No other statuses.

Floor: 10 done (2026-10-10; fixed-asset register added).

Area GnuCash counterpart (a cross-check, not the spec) Status Notes
Chart of accounts (5 types, codes, hierarchy) Accounts tab done account.rs; placeholder support in
Double-entry validation (balanced, ≥2 lines) Journal validation done journal.rs::validate
Exact decimal money, no floats — (we go further) done money.rs; Currency ISO codes
Posted-entry immutability Read-only posted txns done reversal via reverse_entry
Trial balance Reports → Trial Balance done golden-covered
Balance sheet (A = L + E) Reports → Balance Sheet done current earnings folded in pre-close; golden-covered
Profit & loss Reports → Income Statement done golden-covered
P&L for a date range, line per account (closing entries excluded) Reports → Income Statement (custom dates) partial hand-verified fixture + property tests; no golden file yet
Balance sheet as of a date, line per account Reports → Balance Sheet (as of) partial hand-verified fixture + property tests; no golden file yet
General ledger by account (running balance, split) Reports → General Ledger partial hand-verified fixture, ties to trial balance; no golden file yet
Trial balance as of a date Reports → Trial Balance (as of) partial hand-verified fixture; no golden file yet
Statement of changes in members' equity Reports → Statement of Changes in Equity partial hand-verified two-member fixture incl. rounding and a close; no golden file yet
Tax line mapping + tax summary Accounts → Tax line mapping; Tax reports partial hand-verified fixture (50% meals, nondeductible, contra income); no golden file yet
Reversing entries Reverse transaction done linked via reversal_of
Canonical report snapshots (JSON) — (our oracle format) done reports::snapshot
Fixed-asset register + straight-line depreciation Fixed Asset register done assets.rs; golden-covered schedule; idempotent runs; disposal with gain/loss; posted (the books') vs scheduled, in-service vs acquired dates, the §723, depreciable and §704(c) figures (P3)
Cash flow statement (direct, with the reconciliation schedule and noncash disclosures) Reports → Cash Flow done R-FUTURE-3; rules.md B-14 (P3 defect 1)
Foreign-currency lines (base + foreign stored) Multi-currency accts done R-FUTURE-1
Period close (closing entry to Retained Earnings) Close books done R-FUTURE-2
Bank reconciliation (cleared flags + report) Reconcile done —
QuickBooks CSV import (bank txns, chart of accounts) Banking → Upload done R-FUTURE-4
QuickBooks IIF + XLSX export Export / reports done R-FUTURE-4
A/R invoices + payments + aging Business → Invoices done R-FUTURE-5
A/P bills + payments + aging Business → Bills done R-FUTURE-5
Payroll runs (accounting only, no tax tables) + tax remittance Payroll done —
Tracking classes (divisional P&L) Class tracking done invoice and bill lines take a class too (projects, rules.md B-37 item 8; QBO/Xero class or tracking per line)
CPA handoff package (TB + GL xlsx, P&L + BS pdf, zip) Reports → export done —
Budgets Budgets todo R-FUTURE-6 (declined as bloat)
Scheduled transactions (recurring entries → drafts) Scheduled txns / Recurring transactions partial hand-verified fixture incl. month-end dates; drafts only, by design
Payout gross-up (deposit → revenue, fees, adjustments) Bank deposit with fee lines; Xero/QBO Stripe & Shopify integrations partial hand-verified fixture incl. classes and a negative payout; no statement parsers yet
1099 vendor tracking + year-end worksheet Vendors → Track payments for 1099; 1099 report partial hand-verified fixture (bill payments, card exclusion, reversal, year boundary); no golden file yet
Prepaid expense + deferred revenue amortization Amortization schedules (Xero/QBO add-ons) partial hand-verified fixture, to the cent; no golden file yet
Automated cross-implementation diff harness (GnuCash first) — (our xtask oracle) todo roadmap phase 3

Workflow/UI parity (QuickBooks/Xero reference) gets its own catalog when the egui phase starts; semantics come first.

P0 guard rails (2026-10-16)

P0 (plan/served.md) changed no feature in the catalog above, so no status moved and the floor stands. It hardened what exists: an older version refuses books from a newer one as newer, not corrupt (rules.md B-27); the MCP server fails closed after an internal error, and no input reaches one (dates are four-digit years, amounts at most a line's, B-28); local files were read only from the import roots, never the books, the vault or its key (P2 slice 5 removed local paths: files now come in as uploads or inline bytes); no file with a full TIN is filed into the books (B-26); the agent is told the rules in force in a short connect text and a handbook, and no agent text points at the books' files, git or the repo.

Capability parity (AI-first phase)

Semantic parity (above) is about correctness: the engine computes the right numbers. Capability parity is about usefulness: can the new system do everything the GSheet+GDrive system does today? Tracked separately in docs/capability-parity.md, with its own cutover rule (parallel run + the owner's approval). The two catalogs converge: when both are green, the sheet retires.