Commit Graph
1077 Commits
Author SHA1 Message Date
swaitsandClaude Opus 5.5 4090d70a49 merge: the GnuCash oracle comes from the pinned bookspec (S-K1; branch t3/bookspec-self-contained-oracle, 6b275601; reviewed, fixes applied)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 13:13:28 -07:00
swaitsandClaude Opus 5.5 6b27560115 fix(just): oracle finds the pinned bookspec through cargo metadata
Review of S-K1: the recipe looked for cargo's checkout by the full
40-character rev, but cargo names the directory by its short rev, so
just oracle could never succeed. cargo metadata gives the dependency's
own manifest path, whatever the directory is called and however many
checkouts there are; jq (now pinned in mise.toml, as every recipe's
tool is) reads it. The error now says what to do when the pin predates
the oracle's move. Three docs still named the deleted oracle/gnucash/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 13:13:04 -07:00
swaitsandMuse Wonder 1.0 10e6ccf899 feat(oracle): build the GnuCash image from bookspec, delete the copy
bookspec now owns the oracle (gnucash/oracle/, image
bookspec-gnucash-oracle; unit S-K1). just oracle resolves the pinned
bookspec rev from ledger-core's Cargo.toml, fetches it, and builds
bookspec's image from that checkout: one source of truth, no copy here.
Until the batch pin bump lands a rev that contains gnucash/oracle, the
recipe fails loudly saying so. oracle_gnucash.rs uses the new image name.

Co-Authored-By: Muse Wonder 1.0
2026-11-08 13:01:39 -07:00
swaitsandClaude Opus 5.5 435cb9aa9b merge: A/R and A/P claims and the draft rule reduced (S-C5; branch t3/arap-rules-draft-discard, b4d0c07a; reviewed, fixes applied)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:55:00 -07:00
swaitsandClaude Opus 5.5 f7c245ac64 build: pin bookspec at 09b81b9, four areas of rules complete there
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
bookspec now states the entry, ledger, statement, period, prepaid,
revenue, partner, asset and 1099 rules completely as records (P14 units
S-C1 to S-C4, each reviewed by a second model and fixed), with the
executable Lean model (L-G1) and the owner's D-73 reversal-date rule;
the matching wanderbooks claims files are reduced to wanderbooks' picks,
enforcement sites and WB product rules (merged above). All four pins
move together; Lean builds and audits 151, the adapter (53) and the
package (29) pass on the new rev.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:54:41 -07:00
swaitsandDeepSeek V4.1 Flash b10804fb07 test(core): rust_decimal checked against exact rationals
The engine trusts Decimal for every money path, and docs/verification.md
said so without checking it: Kani cannot explore Decimal arithmetic, and
the bridge tests only tie the Decimal kernel to the i64 one. This adds a
property test that compares the operations the books use against
num-rational/num-bigint, an independent exact reference: checked_add and
checked_sub over signed line amounts (1e15 at up to ten places),
1,000-line sums, checked_mul while the true product fits 28 digits
(including the top of the line range and FX-style rates),
round_dp_with_strategy for every strategy the workspace uses at every
scale 0..=28, rescale's half-away rounding, normalize, comparison and
equality across scales (1.0 = 1.00), and from_str/to_string round trips
at every scale.

It also pins the one inexact edge: when a product's scale does not fit,
checked_mul rounds to 28 decimal places, ties to even, rather than
failing; None comes only when the integer part cannot fit. That case is
reachable through Ledger::add_line_fx, whose foreign amount and rate are
unbounded positive Decimals (the base amount is then rounded to the
currency's minor unit). No property failed: 256 cases by default,
PROPTEST_CASES=5000 passed, plus hand cases at 28-digit mantissas, scale
28 and negative ties.

The two dev-dependencies are test-only and already in the lockfile
(through proptest and the PDF stack); they are the exact reference the
whole check rests on.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-08 12:53:01 -07:00
swaitsandDeepSeek V4.1 Flash 280d3a1b6d docs(spec): format claims reduced to wanderbooks' picks and product rules
B-27's journal format gate is wholly the product's: its full text is now
WB-format-1 to WB-format-4 (the gate and the frozen envelope; the journal
features and when a command asks for one; the format upgrade with the
owner's passphrase and a proven backup; one SQLite projection file per
schema), with the enforcement and tests split among them. Its id
BS-format-1 stays retired, and the one engine-independent sentence it
carried — a reader that does not know a record's format version refuses
it, never misreads it and never calls it corrupt — is now bookspec's
BS-ledger-4, statement 4.

B-34 keeps its pick (plain ASCII transliterated and reported, CR LF,
DOCNUM the entry's id, closes left out, every entry through the as-of
day, D-36), its enforcement and its tests; what is wanderbooks' only is
WB-format-5 to WB-format-7: the export tool's as_of and warnings, the
package README's words and the names of entries on A/R and A/P, the rest
of the package's text and fonts, and the pinned deunicode 1.6.0 table.
The accounting text itself (encoding, line structure, signs, accounts by
name, classes) lives in bookspec's BS-format-2.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-08 12:49:50 -07:00
swaitsandClaude Sonnet 5.5 b4d0c07a59 docs(spec): entry claims, B-43 reduced to wanderbooks' picks and product rules
B-43 keeps its heading, BS-entry-5 id, Pick (D-47, cross-referenced to
BS-ledger-7 and B-20's claims rather than restated), Enforced and Checked. The
draft/evidence/discard principle moved to bookspec's BS-entry-5 (branch s-c5).
WB-entry-5..9 keep what is wanderbooks' only: evidence::requirement as the one
function and its callers, the exempt-by-origin list with the policy.evidence.*
settings (threshold, required accounts, split groups), the building and
awaiting_evidence states and their journal event, what a discard drops and
journals, and the receipt_required refusal with confirm-against-preview.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 12:45:38 -07:00
swaitsandClaude Sonnet 5.5 c81a21faf5 docs(spec): arap claims reduced to wanderbooks' picks and product rules
B-18 and B-38..B-42 keep their heading, their bookspec id, Claims, Pick,
Enforced and Checked; the accounting text moved to bookspec's records
BS-arap-1..6 (branch s-c5). What stays here as WB-arap-1..17 is only
wanderbooks': the replay derivation of document tags and the projection
that keeps no figure, the default account codes 1200/2000/6990/6995, the void
description, journal feature document_standing and documents_v2 and the
invoice.written_off event, the net-days range and settings fallback, the INV-
number format, the issued PDF filed as receipt.attached with its sha256, the
vendor reference's duplicate_reason, the write-off evidence filed in the same
call and its Needs-attention flag, the settlement's row order and event
fields, and the aging CSV exports. The picks stay: due today is Current and
the as-of reading (owner, 2026-10-13), lines-that-stand (D-45, 2026-10-23),
the direct write-off (A-5) with D-49's recovery, the gross discount (A-8) and
fee (A-4).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 12:45:38 -07:00
swaitsandClaude Opus 5.5 0aeb913756 merge: asset and 1099 claims reduced (S-C4; branch t3/s-c4-asset-1099-spec, d5b589c3; reviewed, fixes applied)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:31:07 -07:00
swaitsandClaude Sonnet 5.5 d5b589c324 docs(spec): asset and 1099 claims, review fixes
- B-25: the lesser-of pick for personal-use property is named as the MAY of
  BS-asset-4, taken by analogy to Treas. Reg. 1.168(i)-4(b)(1) (a taxpayer's
  own conversion); the choice stays wanderbooks', the CPA to confirm.
- WB-asset-1 points at BS-asset-1 rules 25-26, which now hold the engine-neutral
  refusals (link after the in-service date or disposal, in-service date before
  the linked entry, disposal before the acquired date); the replay carve-out
  stays here.
- WB-1099-4: the worksheet's card accounts are the recorded business-card
  methods only; the liabilities named "card" are the party-totals fallback,
  and a charge to one counts for no one either way on the worksheet.
- WB-1099-5 (new): attorney gross proceeds ($600) and royalties ($10) are not
  modelled, and the worksheet says so, as the original B-19 stated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 12:30:05 -07:00
swaitsandClaude Sonnet 5.5 5ae26f1288 test: totals past exact arithmetic are refused, never a panic
ledger-core/tests/exact_totals.rs: the engine's sum/add/sub helpers, arap's
document_total, audit::check_articulation (current_earnings + closed was a
raw + that panicked for a public caller's MAX figures) and the frozen
close splits' try_ twins refuse at Decimal::MAX with TooLargeToCompute,
and give the infallible rules' exact result for ordinary input.
ledger-store/tests/exact_totals.rs: an invoice or a bill of enormous
lines is refused and journals nothing. (A posted entry's lines are capped
when it posts, restored or new, so report sums over posted lines cannot
reach the edge; documents are the figures that can.)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 12:26:05 -07:00
swaitsandClaude Sonnet 5.5 5230585e53 refactor(gui): the cash page's average net refuses oversized months
The burn-and-runway card subtracted each month's out from in with a raw
- inside a map and summed raw; it totals with kernel::total_try and shows
a note when the figures are too large to compute. Display unchanged
otherwise.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 12:23:11 -07:00
swaitsandClaude Sonnet 5.5 e6104b49d6 refactor(mcp): previews and totals refuse oversized sums instead of panicking
preview_lines_for (balance before + line), the disposal preview's debits,
the depreciation run's catch-up difference, the digest's account movement
and the payroll remittance total used raw + / - / .sum() on stored or
replayed figures; they now go through ledger_core::money's checked
helpers and return the tool's string error (TooLargeToCompute). Unchanged
for ordinary input.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 12:23:11 -07:00
swaitsandClaude Sonnet 5.5 afc7c545da refactor(package): exported totals are exact or say so
The K-1 members' total row, the receipts index amount and the 1099
worksheet's payments text summed with a raw .sum(); they use
kernel::total_of and print 'too large to compute' if a sum is past exact
arithmetic (text::total_text), so an export of restored books never
crashes. Unchanged text for every ordinary input.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 12:23:11 -07:00
swaitsandClaude Sonnet 5.5 7aa0cc68f3 refactor(store): invoice, bill, payroll-remit and disposal totals use the kernel's checked sum
Store::create_invoice / create_bill summed their lines with a raw .sum()
before arap::document_total (which is checked) ran; a document restored
from its journal is bounded only by what the version that wrote it
checked (rules.md B-28), so two lines near Decimal::MAX panicked the sum.
They now call document_total (itself now kernel::total_of). The
remittance and disposal-run sums go through money::sum_exact_of and
refuse with TooLargeToCompute. No figure changes for any ordinary input.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 12:23:11 -07:00
swaitsandClaude Opus 5.5 8bae4e41a0 merge: partner claims reduced (S-C3; branch t3/partner-area-s-c3, cba264d7; reviewed, fixes applied)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:21:21 -07:00
swaitsandClaude Opus 5.5 7a6cc9cbd6 merge: statement, period, prepaid and revenue claims reduced (S-C2; branch t3/s-c2-statement-period-revenue, 1349bb47; reviewed, fixes applied)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:21:21 -07:00
swaitsandClaude Sonnet 5.5 3376c3d549 refactor(core): every report and book total goes through the kernel's checked sum
A raw Decimal + / += / .sum() panics at Decimal::MAX, and a replayed
journal line is accepted of any size (rules.md B-28), so a total of
restored figures must be exact or refused (B-21), never a crash. The
reports (P&L, balance sheet, general ledger, members' equity, asset
register), K-1 lines, tax-basis wholes, payouts, the 1099 split, the
audit's articulation check, the members close split and arap's
document_total now sum with kernel::total / total_of / total_try and
add or subtract with checked arithmetic, refusing with TooLargeToCompute.
money::sum_exact* and add_exact/sub_exact are the engine's thin wrappers
over the kernel (no second copy of the sum). form1099::sum3 was a copy of
the kernel's sum and is now kernel::total.

periods::allocate and allocate_last_absorbs (frozen replay rules) keep
their signatures and results to the cent; each gains a try_ twin that
returns TooLargeToCompute where the raw amount * share used to panic, and
the ledger's close split calls the twins.

Behaviour for every ordinary input is unchanged: no figure moves, no test
or golden edited. Infallible public signatures (trial_balance,
ProfitAndLossStatement::net_income, tax book_net, project_entries,
cash-flow kinds, the Regime) keep their raw sums; making them fallible
would change ~100 callers and is a decision, not a refactor.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 12:17:58 -07:00
swaitsandDeepSeek V4.1 Flash ce02a44bb0 docs(spec): 1099 claims reduced to wanderbooks' picks and product rules
B-19's accounting text (thresholds, payor, card and network exclusion, the
bucket table, decisions and dates, the status function, shares) now lives
in bookspec's `rules/1099/`; this file keeps the four embedded choices'
picks, the enforced and checked evidence, and the product rules.

The picks: an unknown year is refused, never guessed (the owner,
2026-10-13); a cash-account payment with no recorded method is presumed a
check, ACH or transfer (D-40, 2026-10-20); a shared entry counts only the
payee's share (2026-10-15); decisions are dated and a payment takes the
one in force on its reversal chain's first date (D-40).

Product rules: WB-1099-1 (the untagged-entry note), WB-1099-2 (the dated
registry of known threshold years and its staleness alarm), WB-1099-3 (the
recording of payment methods, entry tags, decisions and their sources),
WB-1099-4 (the card-account fallback and the card charge listed, not
dropped).

The Enforced and Checked lists carry over the engine's sites and the
buckets' 16-case check, unchanged.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-08 12:17:48 -07:00
swaitsandDeepSeek V4.1 Flash 6f19d4018c docs(spec): asset claims reduced to wanderbooks' picks and product rules
The accounting text of B-15, B-22, B-24 and B-25 now lives in bookspec's
records (`rules/asset/`); this file keeps what is wanderbooks': the option
each CHOICE picks, the Enforced and Checked evidence, and the product
rules.

Picks: B-15's straight-line-by-days (the owner, 2026-10-13, the arithmetic
settled from ASC 360-10-35-4 on 2026-10-20); B-24's tag-and-never-reuse
(the owner, 2026-10-15); B-25's register-carries-tax-figures and the D-41
options (lesser-of for personal use, the traditional section 704(c)
method, the books' recorded contribution values).

Product rules: WB-asset-1 (a run's and a disposal's bounds are the
commands', replay accepts what earlier versions wrote), WB-asset-2 (the
store and the viewer read every run the books recorded), WB-asset-3 (the
tag and serial-number events and the label sheet), WB-asset-4 (a legacy
basis record reads its book cost; Needs attention asks for the value),
WB-asset-5 (the tools never assume a contributed property's value).

B-22 is procedural: the bookkeeper is bound, the engine is not, so it
claims no engine behaviour and has no product rule.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-08 12:17:48 -07:00
swaitsandClaude Sonnet 5.5 cba264d717 docs(spec): partner claims, review fixes
WB-partner-1 now carries what is engine history rather than law: the
true-up bound for closes made under the earlier journaled rules (under
one unit per break in a "cumulative" run and per "largest_remainder"
close; a last-absorbs close's half unit each, a unit with three members)
and the two-unit bound when replaying books written before whole minor
units were required (B-3, BS-ledger-1).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 12:17:44 -07:00
swaitsandDeepSeek V4.1 Flash 1349bb478b docs(spec): claims restore enforcement sites and product rules (review)
B-14 (statement):
- The Pick records the kind order the record now restores: within a
  section, the rest of its kinds, then interest received, then interest
  paid (CONVENTION, as the engine splits it).
- Enforced restores `Ledger::reversal_chain`, rule 6's chains.
- WB-statement-8 is new: the statement's label strings and the
  reconciliation's grouping are wanderbooks product, not accounting
  ("Reversal of #N — …", "Reinstatement of #A (reverses #B)", "Proceeds
  from borrowing — …", "Contributions from members — …", "(Gain) loss and
  other noncash changes in investing assets", "Depreciation", "Noncash:
  through <account>", "Other noncash items", "Increase in"/"Decrease in").

B-37 (statement):
- WB-statement-6 says "a decision" again, not "a choice": a decision is a
  record kind the books have.
- WB-statement-9 is new: a document's entry posts one line per project in
  the order each is first named, the untagged sum as one line, a document
  naming none posting exactly the one line documents always posted; its
  journal events (`entry.line_class_set`, feature
  `document_line_projects`) are recorded.

B-11 (period):
- Enforced says INVARIANT 5 (a close with nothing to close posts no entry
  and still closes, D-73); Checked adds Lean `closingEntry_net` and
  `a_close_with_nothing_to_close_posts_no_entry`, the rule the record now
  states.

B-12 (period): Enforced restores `Ledger::create_period`
(`PeriodsOverlap`); Checked restores
`periods_nest_but_never_partially_overlap` and `periods_nest`.

B-30 (period): Enforced restores `InvalidDateRange` and
`StartAfterToday`, with what each refuses.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-08 12:17:01 -07:00
swaitsandClaude Opus 5.5 7e855f16cc merge: entry and ledger claims reduced to wanderbooks' picks and product rules (S-C1; branch t3/s-c1-entry-ledger-rules, 738995a0; reviewed, fixes applied)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:10:06 -07:00
swaitsandClaude Opus 5.5 c5fc16cad6 docs(plan): D-73, every reversal is dated on or after its original
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:07:04 -07:00
swaitsandMuse Wonder 1.0 738995a0bc fix(spec): entry and ledger records, review fixes
- B-20 (BS-ledger-7): claims Pick now names CHOICE D-47, a reversal's evidence is its original's (2026-10-26), matching the bookspec status_note

Co-Authored-By: Muse Wonder 1.0
2026-11-08 12:06:55 -07:00
swaitsandMuse Wonder 1.0 40e433104c docs(spec): partner claims reduced to wanderbooks' picks and product rules
Each B-13/B-26/B-35/B-36 section keeps its heading, bookspec id, Claims, Pick, Enforced and Checked; the accounting text moved to bookspec BS-partner-1..4. What stayed is numbered WB-partner-1..14: the members_cumulative journal feature and legacy-close replay, the close tool and members pages, the TIN vault, TIN masking and text scanning, project-text TIN rules, TIN-bearing downloads, the TIN-file registry and its two-candidate probe bound, money/creditor/member settings and journaled derived splits, labelled party/1099 tool presentation, and the CPA package's K-1 tax-basis file.

Co-Authored-By: Muse Wonder 1.0
2026-11-08 12:06:52 -07:00
swaitsandClaude Sonnet 5.5 b3d504067f feat(kernel): total, total_of and total_try, the exact checked sum with Kani proofs and a bridge
A raw Decimal + / += / .sum() panics at Decimal::MAX; a replayed journal
line is accepted 'of any size' (rules.md B-28) so a restored figure is the
realistic path to that edge, and amounts are exact (B-21): a total is the
exact sum or it is refused. kernel::total sums any figures, total_of a
mapped field, total_try a fallible mapping (a difference), each None on
overflow. The signed sum of (Side, amount) lines stays kernel::net/totals.

Kani (proofs/total.rs, fixed arrays): total_empty_is_zero, total_append,
total_is_sound (any i64), total_of_is_map_sum (= net), total_try_is_map_sum,
total_overflow_is_none, each with covers. Bridge (kernel_bridge/total.rs):
i64 vs Decimal on random runs, a Decimal edge table, and a canary for the
finding that rust_decimal rounds dust when a sum lands on Decimal::MAX.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 11:59:32 -07:00
swaitsandClaude Sonnet 5.5 1a61472f7b docs(spec): ledger claims reduced to wanderbooks' picks and product rules
B-3, B-4, B-5, B-8, B-9, B-10, B-20, B-23, B-29, B-31, B-32, B-44 and
B-45 keep their heading, the bookspec id, Claims, Pick, Enforced and
Checked; the accounting text lives in bookspec's BS-ledger-1..13 (branch
s-c1, 461a440). The owner's picks are recorded per rule (minor-unit
booking, a child's type, reversible once, role assignment journaled,
facts in the books, label-only rename, warn by default and D-67's one
rounding). Product rules WB-ledger-1..16: the hash-chained journal; the
role list, default codes and refusal wording; the journal events, TIN
guard, settings adoption, newer keys, posting-template slots and approval
rules of B-29; the account.renamed event and the by-name picks of B-31;
the tax-category policy, Needs attention and control-role categories of
B-32; and the full text of B-44 and B-45, whose bookspec ids are retired
(D-71). B-20 is claimed partly: the receipt policy lives in the tool
layer, not the engine.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 11:53:41 -07:00
swaitsandClaude Sonnet 5.5 edb1d6baf3 docs(spec): entry claims reduced to wanderbooks' picks and product rules
B-1, B-2, B-21 and B-28 keep their heading, the bookspec id, Claims,
Pick, Enforced and Checked; their accounting text now lives in bookspec's
BS-entry-1..4 (branch s-c1, a00e968). B-1's pick is the owner's
2026-10-13 choice to check a line's account when the line is added;
B-28's pick carries the 1,000-draft recurring bound and the P0 review
provenance. The wanderbooks-only parts of B-28 become WB-entry-1 (replay
accepts what an earlier version accepted, with the command/replay
function pairs), WB-entry-2 (the full-TIN detector's replay), WB-entry-3
(the earlier version's projection files stay untouched) and WB-entry-4
(derived figures refuse, the server stays up). B-43 is unit S-C5's and
is untouched.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 11:53:41 -07:00
swaitsandClaude Opus 5.5 3cd251255d docs(plan): S-C7, embedded CHOICEs become their own records
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:47:03 -07:00
swaitsandMuse Wonder 1.0 73010c4acb docs(spec): revenue claims reduced to wanderbooks' picks and product rules
B-17's accounting text moved to bookspec (BS-revenue-1). What stays:
the Enforced/Checked evidence and WB-revenue-1, the
books.record_payout tool surface.

Co-Authored-By: Muse Wonder 1.0
2026-11-08 11:45:32 -07:00
swaitsandMuse Wonder 1.0 fd1c4ae018 docs(spec): prepaid claims reduced to wanderbooks' picks and product rules
B-16's accounting text moved to bookspec (BS-prepaid-1). What stays:
the daily pick (D-11/D-37), the equal-months-from-the-first pick
(D-37), the minor-unit rounding pick for new monthly-even schedules
(D-72), Enforced/Checked evidence, and WB-prepaid-1..2: the
books.schedule_convention setting and D-72's versioning (schedules
written before the change replay the cent rule; the engine change is
unit K-U5's).

Co-Authored-By: Muse Wonder 1.0
2026-11-08 11:45:32 -07:00
swaitsandMuse Wonder 1.0 3344c9cf60 docs(spec): period claims reduced to wanderbooks' picks and product rules
B-11, B-12 and B-30's accounting text moved to bookspec
(BS-period-1..3). What stays: the nesting pick (2026-10-13), the
fiscal-year-to-date default pick (2026-10-20), Enforced/Checked
evidence, and WB-period-1..4: refused commands never reach the journal,
the surfaces the one default binds, the package and viewer presets
that do not follow the default, and the surfaces with no default.

Co-Authored-By: Muse Wonder 1.0
2026-11-08 11:45:32 -07:00
swaitsandMuse Wonder 1.0 79291c6927 docs(spec): statement claims reduced to wanderbooks' picks and product rules
The accounting text of B-6, B-7, B-14, B-33 and B-37 moved to bookspec
(BS-statement-1..5). What stays: B-14's picks (direct method, the
operating/investing/financing allocation order, constructive on-behalf
cash per D-42, the government split rounding, payroll's class), B-33's
pick (the 1099 worksheet stops at as_of, D-36) and B-37's picks
(project-is-a-class; document lines name one project or none, D-43),
each rule's Enforced/Checked evidence, and WB-statement-1..7: the
account designation settings and role refusal, the statement warnings
and printed layout, rule 11's bookkeeping limits, the CPA package, the
project facts, the link and notice behaviour, and the snapshot
presentation.

Co-Authored-By: Muse Wonder 1.0
2026-11-08 11:45:32 -07:00
swaitsandClaude Opus 5.5 05702b5a34 merge: verify/lean requires bookspec's Lean; the laws live once (L-F2; branch t3/lean-laws-bookspec-dependency, 4d9c73de)
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
The ten Lean files were code-identical to bookspec's (checked per file);
wanderbooks keeps a thin Wanderbooks.lean importing Bookspec and audits
the same 151 theorems. The Lean pin moves to 62c0bf26 at the merge,
the rev the Rust checker was pinned to after S-B (the new pin test
caught the difference), and lake-manifest.json is regenerated. Conflicts
with K-U0 and S-D0 resolved: the proofs/ path and the bookspec Lean path
both kept, L-F2's Deductible path fix applied to the claims file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:37:48 -07:00
swaitsandDeepSeek V4.1 Flash 4d9c73deef docs: the Lean laws, and their paths, are bookspec's
The laws are proved once in bookspec (D-69), so the documents that said
"put the new theorem in `verify/lean`" or cited
`verify/lean/Wanderbooks/<File>.lean` now say otherwise:

- AGENTS.md's formal-methods bar: a new law is written in bookspec's
  `lean/Bookspec/`; wanderbooks requires it and moves its pin (the lakefile,
  the manifest, and the crates' Cargo.toml together; the pin test fails if
  they drift). `Audit.lean` lists every theorem.
- docs/verification.md: the model and every cited Lean file are
  `bookspec/lean/Bookspec/<File>.lean`; "Running it" says the dependency is
  fetched and that all 151 theorems are audited.
- docs/testing.md and docs/spec/rules.md: the same paths, and the apportion
  row records where its law moved.
- README's repo map and the two test comments that named the Lean peer.

No accounting behavior changes; only where the proofs and their names live.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-08 11:36:00 -07:00
swaitsandClaude Opus 5.5 959464ec53 docs(plan): product rules are WB-<area>-<n>; each content unit reduces its own claims file
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:35:26 -07:00
swaitsandDeepSeek V4.1 Flash e431791bbc build(lean): verify/lean requires bookspec's Lean; the laws live once
D-69 puts the accounting laws in one place: bookspec's Lean, namespace
`Bookspec`. L-F1 landed there every file of `verify/lean/Wanderbooks/`.
Before deleting the copies, each was checked: comments stripped, namespace
normalised, blank lines dropped, and diffed against its bookspec peer --
all ten are identical (Basic, Entry, Statements, Closing, Ledger,
Apportion, Parties, Prorate, Deductible, Documents). There is nothing
wanderbooks-only left to keep.

So `verify/lean/lakefile.toml` now `[[require]]`s bookspec as a git
dependency at 77e046334eea29e082b53bbe907017d9ffef5a0a -- the same rev
`crates/ledger-core/Cargo.toml` pins the Rust checker to -- with
`subDir = "lean"`. The generated `lake-manifest.json` is committed, because
Lake builds from it and it must not float.

`Wanderbooks.lean` is now a thin local target that imports `Bookspec`:
`lake build` builds and checks the whole law set, and the file says where
a law is edited and how wanderbooks picks it up (move the pin). The
duplicated modules and the `Wanderbooks/` directory are gone.

`Audit.lean` imports `Bookspec` and audits all 151 theorems (the 118
headline laws plus the 33 named laws in `Laws.lean` that cite them) --
the whole set bookspec itself audits. `just prove` still checks standard
axioms only; its summary now says "theorems", since the set is more than
headline ones.

The new `tests/bookspec/pin.rs` reads the rev out of the lakefile, the
manifest, and both crates' Cargo.toml, and fails unless all four name the
same repository at the same commit, and bookspec's `lean/` package. Without
it the Lean laws and the Rust checker could silently be different spec
versions.

Verified: `lake build` from a clean `.lake` (fetches and builds in 7 s);
`just prove` 871 s (Kani 53 harnesses, then 151 theorems, standard axioms
only); `cargo test -p ledger-core --test bookspec pin`; `cargo fmt --check`;
`cargo clippy -p ledger-core --tests -D warnings`.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-08 11:35:07 -07:00
swaitsandClaude Opus 5.5 75c666a7ce merge: the kernel and its proofs become modules, one file per sweep unit (K-U0; branch t3/kernel-modules-scaffold, 0cf013b5; same 1,096 tests, 27 bridge properties, 53 harnesses, 118 theorems)
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
Conflicts with X-H0 and S-D0 resolved: both new paths kept
(tests/bookspec/, tests/kernel_bridge/, src/proofs/); K-U0's two path
fixes in rules.md applied to the claims file the rule moved to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:32:32 -07:00
swaitsandClaude Opus 5.5 e0e8b9c5fe build: pin bookspec at 62c0bf2, the sources vendored there with checked pins
bookspec now carries the 21 authorities its rules cite (IRS texts,
Pacioli, ISO 4217 facts, FASB and Intuit notes, each with an accurate
licence line) and checks every one of its 40 citations verbatim itself
(P14 unit S-B, reviewed, licence fixes applied). Adapter 52 and package
29 tests pass on the new rev.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:32:07 -07:00
swaitsandDeepSeek V4.1 Flash 0cf013b578 refactor(core): the kernel and its proofs become modules, one file per sweep unit
kernel.rs is now kernel/: mod.rs keeps the laws and re-exports entries
(the old file, unchanged) plus one file per kernel-sweep unit (U1 fx, U2
round, U3 allocate, U4 total, U5 schedule, U6 ratio, U7 payroll, U8
control). proofs.rs is proofs/: mod.rs holds the original 63 harnesses and
each unit gets a file of its own. tests/kernel_bridge.rs is now
tests/kernel_bridge/main.rs plus one file per unit; Cargo still builds the
single test target named kernel_bridge.

`_kani` now scans proofs/mod.rs and proofs/*.rs and passes the fully
qualified name each file gives its harness (Kani's --exact matches only a
fully qualified name), so a harness resolves wherever it lives. It fails
when kani_slow names no harness, or when two harnesses share a name and
would make the slow list ambiguous; `just prove-list` prints every harness
with its module path and set, showing the slow list resolved without
running it.

Nothing moves in the books: the same 53 fast Kani harnesses and 118 Lean
theorems verify, and the same 1096 tests pass (27 in the bridge).

Docs: verification.md gains the kernel-sweep policy (each unit writes
docs/proofs/<unit>.md; the integrator folds the notes into
verification.md and Audit.lean in one edit per batch), and the file
references in AGENTS.md, testing.md, architecture.md, oracle.md and
spec/rules.md follow the new paths.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-08 11:30:47 -07:00
swaitsandClaude Opus 5.5 b4479036a5 merge: rules.md splits into one claims file per bookspec area (S-D0; branch t3/split-rules-md-claims-by-area, ca8d676d; lossless, rebuilt byte for byte)
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:11:03 -07:00
swaitsandDeepSeek V4.1 Flash ca8d676d53 docs(spec): rules.md splits into one claims file per bookspec area
P14 unit S-D0 (plan/bookspec-audit.md D0) is a mechanical split, no
content change. bookspec is becoming the definitive spec, and later
units move each rule's accounting text there and reduce wanderbooks'
copy to the engine's claim (the pick, where it is enforced, which
tests check it) plus product rules. Several workers reduce different
areas in parallel; one 3,696-line file blocks them, so the file is
split first by bookspec area (the B -> area map is bookspec's
spec/rules-index.md).

Every `## B-n` section moves verbatim, in B order, into
docs/spec/claims/<area>.md: entry 5, ledger 13, statement 5, period 3,
partner 4, asset 4, prepaid 1, arap 6, revenue 1, 1099 1, format 2.
docs/spec/rules.md keeps its preamble and becomes the index (B,
bookspec id, area, link to the claims heading), so the existing
"rules.md B-n" references still resolve until S-E rewrites them. The
bookspec test now reads every claims file and the index, so every
stated rule's id is still verified where it is carried.

The split is proved lossless: the preamble plus the 45 claims sections
concatenated in B order is byte-identical to the old rules.md. No WB-n
product rules exist in rules.md, so no docs/spec/product.md is created
(D0's other half) until product rules are written.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-08 11:10:16 -07:00
swaitsandClaude Opus 5.5 7a3860de73 build: pin bookspec at 77e04633, rule records and every law in its Lean
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
bookspec now keeps one structured record per rule (rules/, each with a
plain-English description, generated index and per-area pages, link
checks, ids never reused) and proves all 118 headline theorems plus 33
named laws in its own Lean (P14 units S-A and L-F1, reviewed, with the
review fixes). The checker's public API is unchanged: the adapter (52
tests) and the package tests (29) pass on the new rev.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:05:28 -07:00
swaitsandClaude Opus 5.5 539ef8a345 merge: the bookspec adapter becomes modules by area (X-H0; branch t3/split-bookspec-adapter-modules, f9cdf4d7; same 52 tests, same functions)
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:49:40 -07:00
swaitsandDeepSeek V4.1 Flash f9cdf4d718 refactor(core): the bookspec adapter becomes modules by area
The bookspec adapter was one 4,647-line test file, and every later unit
that adds a query or an event touches it. Split it by its own sections,
with no behaviour change: `main` keeps the crate doc, the shared imports
and the module list; `common` holds the shared vocabulary (dates,
refusals, exact decimals, figure formatting); `books` the example's
books and setup; `events` the application of each event; `queries/` the
answers and checks per query family (statements, parties, tax, assets,
formats, commands, dates); `engine` the `Engine` impl; `check` and `run`
the drivers; and `examples`, `loader_tests`, `sources` and `rules_md`
the tests by area. Every `#[test]` keeps its function name (52 tests,
same names), and Cargo still builds one test target named `bookspec`.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-08 10:49:03 -07:00
swaitsandClaude Opus 5.5 69cfc81bb4 merge: Money::checked_add and checked_sub return an error on overflow (branch t3/fix-money-checked-overflow, bac0ea22; reviewed)
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:14:00 -07:00
swaitsandClaude Opus 5.5 66d9b7ac54 docs(plan): P13 step 6 names bookspec's pin after the history rewrite
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:11:47 -07:00
swaitsandClaude Opus 5.5 54c710bc43 build: pin bookspec at 4eb99123, its history purged of build output
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
bookspec's first push committed 1,979 files of cargo build output
(target/). At the owner's request its history was rewritten to drop
them (git filter-branch, every commit) and force-pushed: the repository
went from 105 MB to under 400 KB. Every commit got a new hash, so the old
pin 74f2853d no longer exists upstream. Its rewritten twin is 6b309306,
with an identical tree apart from target/ (checked against a mirror
backup); the pin moves to the new tip 4eb99123, which only adds a
.gitignore. The bookspec adapter (52 tests) and the package tests (29)
pass on it. Older wanderbooks commits still name 74f2853d and will not
fetch bookspec from scratch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:11:32 -07:00