Both were named checked but only checked the currency; the amounts went
through raw Decimal + and -, which panic past Decimal's range. A sum or
difference too large for exact arithmetic is now refused with
TooLargeToCompute, as everywhere else in the engine: never rounded,
wrapped or crashed. Currency mismatch still reports as a mismatch.
Test: checked_arithmetic_refuses_overflow_instead_of_panicking (MAX+MAX,
MIN+MIN, MIN-MAX, MAX-MIN refused; MAX+MIN and MAX-MAX exact).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Law 39 said no Lean theorem was needed because the Books model has no
tax categories. That reasoning was wrong: the law is pure kernel
arithmetic, like Prorate's roundUnit laws, and needs no Books model.
verify/lean/Wanderbooks/Deductible.lean now proves it at any size.
verification.md law 39 lists the Lean theorems in the usual format and
states the split plainly: Lean proves the law on integers over a common
denominator (one rounding, Prorate.roundUnit on the magnitude, signed
after); Kani proves the code on i64; the bridge and exact-reference
properties carry it to Decimal; overflow stays outside the model.
rules.md B-32's Checked line and plan/STATUS.md name the Lean file.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Law 39 (kernel::deductible_amount, B-32, D-67) was proved by Kani only
for up to three accounts and books to 2^20 cents. Like the proration
kernel, its arithmetic needs no Books model: Deductible.lean states it
on integers, for any number of accounts and any sizes.
Model: a share is a pair of integer numerators over one positive common
denominator D (10^(p+s) for books at p places and percents at s). The
category in cents is N / D, N = sum of book x percent; the /100 of the
percent and the x100 of dollars-to-cents cancel, so there is one
rounding: roundHA N D, the magnitude rounded by Prorate.roundUnit (unit
one, reused, not a second rounding function) and signed after, which is
what checked_div_round_cent does with a_mag, b_mag and `negative`.
Theorems (all on the exact sum, none by cases on the list):
- near: |2(D c - N)| <= D, any size
- tie_away_pos / tie_away_neg: at exactly k + 1/2 cents the result is
k + 1 (resp. -(k + 1)), the cent farther from zero
- sign: never the opposite sign; zero when the sum is zero
- neg: negating every book negates the result (odd symmetry)
- of_sum, of_perm, append, split_percent: the result depends on the
shares only through their exact sum
- per_account_differs (+ _mixed, tie_example): the kernel's three
scenarios by decide: 1.01+1.01 at 50% is 1.01 once, 1.02 by account;
1.05 at 50% and 30% is 0.84 vs 0.85; 333.33 at 50% is 166.67
- scale_books / scale_percents: a finer common denominator (books or
percents carrying more decimal places) changes nothing
The Lean proves the law, not the Rust: Kani proves the code on i64, the
bridge and exact-reference properties carry it to Decimal. Overflow
(None) is outside the model. 20 headline theorems added to Audit.lean,
standard axioms only; no sorry.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Pins the re-check's adversarial rows (each matched exact fractions):
Decimal::MAX over 1 and 10 (two and one trailing-zero reductions), over
2 and 4 (no scale holds .50 or .75, so None), 1 over 1e-28 (the widest
exponent), and a half-cent tie written at scale 28, both signs, with the
value just under it. The 2,000-case property stays in the ordinary band;
these hold the edges it doesn't reach.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Say which part of the Decimal path the new exact-reference property covers (decimal percents, sub-cent books, multi-share categories) beside deductible_amount_agrees, note the negative-tie cover, and record that Decimal checked_div_round_cent now rounds from mantissa and scale by exact i128 arithmetic with None left for a product or sum overflow or a quotient Decimal cannot hold. That is the spec change the overflow fix makes in law 39's text.
Co-Authored-By: Muse Wonder 1.0
No committed test exercised decimal percents or sub-cent books: Kani proves the integer shape, the bridge used 2-decimal books and integer percents, and the tax tests use integer percents. Add deductible_amount_matches_exact_reference_on_decimal_shares, over books at 0-6 decimal places and percents in hundredths 0.00-100.00 (half at 4 places), several shares per category, against an independent reference computed as an exact i128 scaled numerator over a power of ten, rounded half away from zero by integer arithmetic. Pin the review's unit table (ties, sub-cent and FX-precision books, a 6-decimal percent, the Finding 1 regression, and a genuinely unrepresentable quotient) in kernel_bridge, and cover the negative half-cent tie (exact % 100 == -50) in the slow deductible_amount_rounds_once harness, whose Rust % only fired the existing cover for a positive tie.
Co-Authored-By: Muse Wonder 1.0
The Decimal checked_div_round_cent formed self * 100 before dividing, so a book of 10^25 - 1 at 100% -- whose exact deductible 9999999999999999999999999.00 is representable, and which the code before the kernel move returned -- overflowed that intermediate and came back None, making tax_summary report TooLargeToCompute. That breaks the function's own spec: None only for a product or sum that overflows, or a quotient Decimal cannot hold.
Round from the two mantissas and scales by exact i128 arithmetic instead: cents are round(a / b * 10^(sb - sa + 2)), half away from zero, with no x100 intermediate ever formed. Scale 28 is settled by the integer remainder, so digits a Decimal division by 100 would have to round away to fit still decide the half-cent tie. A trailing zero may let a past-mantissa quotient fit at scale 1 or 0; anything else past the mantissa is genuinely unrepresentable and stays None, and a zero result is never a negative zero.
Co-Authored-By: Muse Wonder 1.0
The kernel function's doc now says a percent is a deductible percentage
in 0..=100 and that an override may carry decimals (33.33 is exact), the
fact the tax API allows. docs/verification.md's harness table records the
new harness at 992 s alone and 1,207 s inside the 2026-11-08 prove-slow
run, both under the 1,800 s cap.
Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
B-32's CHOICE now says the category rounding is
`kernel::deductible_amount`, and its Enforced/Checked lines name the two
Kani harnesses and the bridge property. docs/verification.md adds law 39
(the exact sum, rounded once to the cent, never share by share), its
harnesses, the bridge, and the harness table row and the new prove /
prove-slow counts. It records why this law has no Lean model: it is a
report figure's arithmetic, like `discount_max` and `unrecovered_cost`,
not a `Ledger` command or a law about posted entries; the model's Books
has no tax categories, and the arithmetic it would restate is the kernel
function's own definition.
Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
`deductible_amount_rounds_once` model-checks up to three accounts at i64
cents: the result is exactly the reference round-half-away-from-zero of
the exact numerator, within half a cent of the sum, never the opposite
sign, and (a cover) not the sum of per-account roundings; it also covers
a half-cent tie and a negative numerator (a refund). It is slow (992 s
alone on 2026-11-08), so it joins the justfile's kani_slow.
`deductible_amount_refuses_overflow` proves the two overflow paths give
None, not a wrapped figure.
The bridge property `deductible_amount_agrees` checks the i64 cents
result against the Decimal dollars result on the same accounts, and the
Decimal result against the exact sum within half a cent, with the sign
law and no negative zero: what Kani proved on i64 holds on Decimal, the
type the engine runs.
Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
A category's deductible amount is the exact sum of its accounts' shares
(book × deductible percent ÷ 100), rounded once to the cent, half away
from zero (rules.md B-32's CHOICE, owner 2026-11-07, D-67; B-21's "round
off only the total"). That rounding was the last money arithmetic outside
kernel.rs: tax.rs accumulated Decimal shares and called
round_dp_with_strategy itself, so nothing proved the round-once law.
`kernel::deductible_amount` now takes the (book, percent) pairs and sums
their products exactly, then `Amount::checked_div_round_cent` divides by
100 and rounds once to the cent. The trait method is the explicit step:
exact quotient and remainder on a machine integer, cents-then-remainder
on Decimal (no double rounding through Decimal's 28-place division),
halves away from zero, no negative zero, None on overflow. The amount is
the nearest cent of the exact sum, never the sum of per-account
roundings, and its sign follows the sum.
tax.rs keeps the same output and the same TooLargeToCompute error; it
now gathers the shares and asks the kernel for the category total. The
18 tax tests, the golden Form 1065 summary and the two round-once tests
pass unchanged.
Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
cargo-mutants exits 2 when mutants were missed and 3 when some timed out.
The runner treated every non-zero exit as a failure, and a failed step
starts fresh, so a crate with even one equivalent mutant would have been
mutated from scratch every night and never marked done. Exits 2 and 3 now
record the counts as findings to triage and mark the step done; any other
exit (a usage error, a failing baseline) still fails. A resumed run's
failure note now says its counts are this run's (cargo-mutants rotates
earlier catches into previously_caught.txt). Review of 3b989916 (Muse),
F1 and F2; checked with a stand-in just exiting 2 and 4.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A mutation step stopped at P12_STOP (or by `just p12-stop`) is marked
partial and used to restart from scratch the next night: run_mutants
rm -rf'd the crate's output directory and the recipes did not pass
cargo-mutants' --iterate. A crate whose run takes longer than one night
could never finish.
cargo-mutants 27.1.0 writes caught.txt, unviable.txt, timeout.txt and
missed.txt incrementally, and --iterate reads caught.txt, unviable.txt
and previously_caught.txt before rotating the output directory. A killed
run therefore resumes: mutants already caught or found unviable are
skipped, while missed, timed-out and never-reached mutants are retested.
Verified on a scratch crate: a run killed after 19 of 42 mutants; the
--iterate rerun found 23 to test, excluded the 19, retested the mutant
killed mid-test and the unreached ones; a third run excluded 38 and
retested only the 4 missed.
A partial mutation step now keeps its output directory and the runner
sets P12_MUTANTS_ITERATE=--iterate; every mutation recipe forwards that
variable to cargo-mutants. Fresh and failed steps still rm -rf and start
over, and the empty-name guard stays before the rm. The step result
records that it resumed and how many mutants were already tested.
Also resolve cargo-mutants' output layout while here: -o NAME puts the
files in NAME/mutants.out, so the state copy, the counts and the resume
skip count now use that inner directory instead of counting zero. The
core recipe's default output is already the repo's mutants.out.
Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
Review notes on the round-once change: B-32's Status line now lists the
owner's 2026-11-07 CHOICE and its Checked line the two tests that pin
it; the Form 1065 worksheet's two remarks that no rule stated the
rounding now say D-67 settled it (the golden, one account per
category, is unchanged).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Record the owner's 2026-11-07 decision in rules.md B-32 and as D-67 in plan/served.md 10.1: a category's deductible amount is the exact sum of its accounts' shares, rounded once to the cent, following B-21's 'round off only the total'.
Co-Authored-By: Muse Wonder 1.0
Per-account rounding could put a category a cent per account away from the return's figure. The IRS adds with cents and rounds only the total (rules.md B-21), so each account's share now accumulates exactly (checked arithmetic, TooLargeToCompute on overflow) and the category rounds once, half away from zero. The golden is unchanged: one account per category there.
Co-Authored-By: Muse Wonder 1.0
It waited on a hand-verified golden covering a workpaper. One small book
seeds five findings in five check areas (a missing receipt, an open
draft, a schedule three months behind, an uncategorized account, an
undecided 1099 vendor paid 900.00), with the 1099 and cash-flow inputs
derived from the books as the MCP tool derives them. A second model
(Sonnet) recomputed every finding; its review moved the 1099 input from
a hand-fed string to a posted payment and corrected the worksheet: B-45
fixes a deterministic, ordered list, and the severities are the code's
own CODES table, a CONVENTION the golden pins.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The audit golden used to hand the vendor and amount to the audit; the
ledger held no payment to that vendor. Now the fixture adds the vendor
(Ledger::add_vendor, which makes its party) and posts entry 5, 900.00 of
supplies paid from the bank on 2026-03-10 with a receipt, 1099 decision
left undecided. The audit's 1099 input is built as ledger-mcp's
audit_findings builds it: ledger_package::vendor_1099_report(year 2026,
as of 2026-03-31), keeping the vendors with decision_needed. Because the
books name the bank as their cash account, the cash-flow footing is tried
the same way instead of handed in as None.
Recomputed by hand (worksheet): opening raised to 3,000.00 so the bank
stays positive (860.00 = 3,000 - 40 - 1,200 - 900); trial balance 3,000.00
= 3,000.00; assets 2,060.00 = equity 3,000 - 940; net income -940.00 =
current earnings; cash flow operating -2,140.00 + financing 3,000.00 =
+860.00 = change in cash. The vendor's 900.00 is under the 2026 threshold
of 2,000.00 (B-19, status under_threshold), yet decision_needed is
has_undecided && hi(U) > 0, so the code flags it; the worksheet records
that this is the code's rule, which B-19 does not state separately. The
payment debits Supplies (already categorized) and is entry 5 so the draft
stays entry 4: no other finding changes, and the golden JSON is unchanged.
The worksheet no longer says B-45 gives the severities or the checks'
list: B-45 asks for a deterministic, fixed-order list; the severities are
the CODES table's, the code's own CONVENTION, which this golden pins. It
also lists which checks the golden leaves silent and that tests/audit.rs
seeds each one.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Both rows waited on a hand-verified golden covering a discard. One store
fixture now pins every draft's state, each entry's evidence requirement
(a reversal exempt by origin above the threshold, D-47), the gate's two
refusals, a discard that moves no balance and spends no id, and a close
refused while a draft holds the period and accepted after its discard.
A second model (Muse) recomputed every value independently from B-43
and D-47 and showed a wrong balance, a flipped exemption and a bypassed
gate each fail the test. Worksheet: the closing entry is pinned under
close_after_discard, not posted_entries (review note).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One fixture serves both parity rows (draft states and discard; the one
evidence gate). A Store fixture, because the gate's receipt-on-file half
lives in the store. New fixture, built like books_for_drafts and extended.
Hand-computed in plan/golden-worksheets/draft-states-and-evidence-gate.md,
before serializing anything:
- Requirement (B-43 inv. 2, threshold strictly > 25.00): drafts of 40.00,
60.00 and 100.00 are Required; 12.50 is Exempt (policy); the reversal
(debits 100.00) is Exempt by origin (D-47, D-12); the closing entry
(52.50) is Exempt by origin. Receipt counts are pinned beside them: the
gate refuses the 40.00 and 60.00 drafts (no receipt) with the journal
head unchanged, then lets the rest post; the reversal has no receipt.
- Trial balance 2026-01-31 before and after the discard of the 60.00
draft: Cash 447.50 Dr, Equity 500.00 Cr, Software 52.50 Dr, totals
500.00; identical after the discard, next entry id 7 both times.
- The close is refused while the draft is open (B-12), accepted after the
discard: Dr Retained Earnings 52.50 / Cr Software 52.50 (a loss), id 7;
trial balance then 447.50 Dr, 500.00 Cr, 52.50 Dr.
Code and hand values agreed on the first run. Strength: four scratch edits
of the golden (a balance, a decision, a discard reason, the next id) each
fail the test.
Adds serde::Serialize to evidence::Requirement (tagged, snake_case) so the
gate's result can be pinned.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The audit's statements programme (rules.md B-45) now has a golden for one
small book, hand-worked from B-45 in plan/golden-worksheets/audit-workpaper.md:
2,000.00 of capital, a 40.00 purchase with no receipt, a year of prepaid
insurance never posted, a 5.00 draft, and one Revenue account with no tax
category. Through 2026-03-31 that gives one failure (evidence_missing,
entry 2, debits 40.00 over the 25.00 threshold) and four warnings: draft 4
on 2026-02-10, schedule 1 with 3 months / 300.00 due from 2026-01-31,
account 4100, and vendor Tobin Harlow Supply at 900.00. Trial balance,
equation, P&L articulation, control accounts, closes, assets, settings and
the receipted entries are all silent.
The golden holds the workpaper's statements data (scope, through, summary,
findings). Hashes, the figure head and the programme version are not
hand-verifiable, and the static check catalogue is not a finding, so they
stay out; the worksheet says so. The first draft mis-marked evidence_missing
a warning: the table and CODES say failure, the prose was wrong, and both
the worksheet and the golden were corrected to the books.
Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
Both rows lacked only a golden file. Each now has one computed by hand
before the engine's output was read; a second model (Sonnet) recomputed
both independently. The review found the 1099 golden pinned no card
exclusion (the fixture never records its card, so by B-19 the charge
counted for no one); the golden test now records the card as a business
card, so Sam's 5,000 is excluded and listed, and the unrecorded case is
asserted in cash_paid_per_vendor_and_who_is_reportable.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The golden's fixture charged Sam's 5,000 to 2100 Credit Card with no
business-card payment method recorded, so by B-19 ("anything else" row)
the charge landed in no bucket and the golden pinned no excluded_card
figure at all, though the parity row claims card exclusion.
The golden test now records 2100 as a business-card method (books() is
untouched; other tests rely on its unrecorded card). Worked by hand from
B-19's table before running: #8's Cr 2100 is a company card's account, so
the line is card (excluded) 5,000; Dr 6000 is an expense, no payment
line; the entry nets to card 5,000 alone. So in 2026 Sam gets
excluded_card 5,000, paid 0, undetermined 0, still under_threshold
(F = U = 0; a card is never the vendor's reason), and
excluded_card_payments lists entry 8, 2026-04-01, vendor 3, 5,000,
instrument null (untagged). Every bank payment, the untagged note and all
of 2025 are unchanged. The code agreed with every hand figure; the golden
differs from its predecessor in exactly those two fields.
cash_paid_per_vendor_and_who_is_reportable now also asserts that on the
unrecorded books() Sam's card charge is in no exclusion bucket and the
card list is empty, keeping the unrecorded case covered.
Vendor1099Report, Vendor1099Line and Payment1099 drop the unused
Deserialize derive (Serialize stays for the golden).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The two hand-verified amortization fixtures in schedules.rs now have one
golden covering both plans, their rounding, their remaining balance and
the statements they move. Recomputing them by hand from rules.md B-16
(monthly_even: each period total/months to the cent, the last period
taking the remainder) before serializing:
- Prepaid: 1,200.00 of insurance from 2026-03-01 over 12 months is
100.00 a month exactly. March-May are posted, so 300.00 is expensed and
900.00 remains; the balance sheet carries 900.00 of prepaid.
- Deferred: 1,000.00 from 2026-01-01 over 3 months is 333.33, 333.33 and
333.34 (the last period absorbs the 0.01 remainder), summing to
1,000.00 exactly. All three are posted, so 1,000.00 is revenue and
nothing remains a liability.
Every period, cumulative and remaining figure agrees with the hand
worksheet in plan/golden-worksheets/amortization-plans.md. No existing
golden or assertion changes.
Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
The `books()` fixture's worksheet is now a golden: 2025 and 2026, so the
year boundary and both thresholds (600 and 2,000) are pinned. Recomputing
it by hand from rules.md B-19 before serializing the report:
- Dana: 1,500 bill payment + 700 direct = 2,200 in 2026 (reportable at
2,000); the 300 dated 2025-12-30 counts only in 2025 (under 600).
- Ace Rentals: 1,200 in January; the February 1,200 and its reversal net
to zero, so 1,200, under 2,000.
- Sam: 5,000 charged to 2100, which no cash, financing or business-card
method names, so no payment line: paid 0, under. The card exclusion is
the fixture's documented "nothing counts" case.
- Bigco: 9,000 from the bank while never decided: undetermined, a decision
needed, never reportable until one is made.
- The untagged 50.00 contract-labor payment is the quieter note.
Every field agrees with the hand worksheet in
plan/golden-worksheets/1099-worksheet.md. `Vendor1099Report`,
`Vendor1099Line` and `Payment1099` gain serde derives so the report can be
serialized; no existing golden or assertion changes.
Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
The four rows lacked only a golden file. One fixture (the fixture
company plus a three-leg purchase, the engine's own January close and a
February entry) now backs four goldens computed by hand before the
engine's output was read; a second model (Sonnet) recomputed all four
independently, confirmed the P&L drops the close by its closing-entry
id and not by date, and showed a cent, a missing line or a reordered
posting fails each test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both rows lacked only a golden file. Each now has one whose every
number was computed by hand from the fixture before the engine's output
was read, and a second model recomputed both independently (Muse) and
showed a 0.01 change to the golden fails the test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add a golden for general_ledger over [2026-01-01, 2026-01-31] on the
shared extended January fixture, with running balances, each posting's
split, per-account totals, and entry ids. The close is a posting like any
other here; the Feb 5 entry is after the period end and is out.
Hand recomputation (plan/golden-worksheets/general-ledger.md): cash has
five postings (begin 0, debits 11,500, credits 4,300, ending 7,200);
receivables 4,000 - 1,500 = 2,500; equipment 2,500 + 1,500 = 4,000;
payable 500; owner's equity 10,000; retained earnings 3,200; service
revenue 4,000 credit then the close's 4,000 debit, ending 0; rent 800
debit then the close's 800 credit, ending 0. Entry 6's equipment debit
has two accounts on the credit side (cash and payable), so its split is
"-Split-"; the same for entry 7's revenue debit (rent and retained
earnings) and for the close's two other lines the split is the single
account 4000 Service Revenue. Every ending balance ties to the as-of
trial balance.
Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
Add a golden for trial_balance_as_of on 2026-01-31 over the shared
extended January fixture. The as-of applies before the close is read, so
this is the post-closing trial balance: revenue and rent net to zero and
the close's 3,200 sits in retained earnings; the Feb 5 entry is after the
as-of date and is out.
Hand recomputation (plan/golden-worksheets/trial-balance-as-of.md):
cash net debit 10,000 + 1,500 - 2,500 - 800 - 1,000 = 7,200;
receivables 4,000 - 1,500 = 2,500; equipment 2,500 + 1,500 = 4,000;
payable credit 500; owner's equity credit 10,000; retained earnings
credit 3,200. Service revenue and rent expense each have equal debits and
credits after the close, so neither is listed. Totals: debits 13,700,
credits 500 + 10,000 + 3,200 = 13,700. The Feb 5 entry would have added
600 to each column; the golden pins the January figures.
Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
Add a golden for balance_sheet_as_of on 2026-01-31 over the shared
extended January fixture. Closing entries count on a balance sheet, so
the January close's 3,200 to retained earnings is in; the Feb 5 entry is
after the as-of date and is out.
Hand recomputation (plan/golden-worksheets/balance-sheet-as-of.md):
asset balances are debits minus credits -- cash 10,000 + 1,500 - 2,500 -
800 - 1,000 = 7,200, receivables 4,000 - 1,500 = 2,500, equipment 2,500 +
1,500 = 4,000, total assets 13,700. Liabilities: payable 500. Equity:
owner's equity 10,000 plus retained earnings 3,200. Current earnings is
zero because the close zeroed revenue (4,000 credit and 4,000 debit) and
rent (800 debit and 800 credit). Total equity 13,200, and 13,700 = 500 +
13,200. The Feb 5 entry would have shown AR 3,100 and current earnings
600; the golden pins the January figures instead.
Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
Add a golden for the P&L over [2026-01-01, 2026-01-31] on an extended copy
of the hand-verified January fixture: the original five entries, plus a
multi-leg equipment purchase, a January close, and a February entry. (The
original fixture has no closing entry and no entry after an as-of date, so
a copy was extended; the first five entries are unchanged.)
Hand recomputation (plan/golden-worksheets/profit-and-loss-period.md):
revenue account 4000 is credited 4,000 by the Jan 10 invoice; expense
account 6000 is debited 800 by the Jan 15 rent. The Jan 31 closing entry
(Dr revenue 4,000, Cr rent 800, Cr retained earnings 3,200) lies inside
the range but is excluded because a close moves earnings rather than
earning or spending, and the Feb 5 entry after the range is excluded too.
So revenue 4,000.00, expenses 800.00, net income 3,200.00 -- exactly the
3,200 the close moved. The golden pins those numbers.
Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
Golden for the Form 1065 first-quarter fixture (tax.rs books()), Jan 1 to
Mar 31. Every number was recomputed by hand from the entries
(plan/golden-worksheets/tax_summary_form_1065.md) before the engine's output
was compared:
Income: sales 10,000.00; refunds 250.00 are an expense-type account in an
income category, so a contra: -250.00 (Form 1065 line 1b). Income 9,750.00.
Deductions, book / deductible: fees 1,500 / 1,500; guaranteed payments
2,000 / 2,000; meals 333.33 at 50% = 166.665 = 166.67 (cent, half away from
zero; Schedule C line 24b: "in most cases, the percentage is 50%"); software
600 / 600; penalties 40 at 0% = 0 (Schedule C Part V: no deduction for
fines). Totals 4,473.33 book, 4,266.67 deductible. Misc 75.00 has no
category and is listed apart, in no total (B-32).
Book net 9,750.00 - 4,473.33 = 5,276.67; tax net 9,750.00 - 4,266.67 =
5,483.33; the 206.66 difference is the disallowed meals half (166.66) plus
penalties (40.00).
Decimals compare by value (normalized), as the existing snapshot golden
writes them; no existing golden or assertion changed.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Golden for the two-member 50/50 fixture (statements.rs partnership()),
January and February, with and without January's close. Every number was
recomputed by hand from the entries (plan/golden-worksheets/
members_equity_two_member.md) before the engine's output was compared:
January: NI 1000.00 - 333.33 = 666.67 = 66667 cents; half is 33333.5, so
largest remainder with the tie to Alice (listed first, B-13 CHOICE) gives
Alice 333.34, Bob 333.33. Alice 0 + 600 + 333.34 = 933.34; Bob 0 + 400 +
333.33 = 733.33; Total 1666.67 = balance-sheet equity.
February: undistributed earnings to date 666.67 + 100.01 = 766.68 split
cumulatively is 383.34 each, so Alice earns 383.34 - 333.34 = 50.00 and Bob
383.34 - 333.33 = 50.01 (sum 100.01). Alice 933.34 + 50.00 = 983.34; Bob
733.33 + 50.01 - 100.00 = 683.34; Total 1666.68 = equity (1000 + 766.68 -
100). Ending of January = beginning of February (B-13 3a). "Other" is 0 in
both. Same numbers whether or not January is closed (B-13 3c).
Decimals compare by value (normalized), as the existing snapshot golden
writes them; no existing golden or assertion changed.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The earlier note said the property hard-codes 256 cases. It does not:
its proptest! block sets no config, so proptest's default reads
PROPTEST_CASES (proptest's contextualize_config), and docs/testing.md
was right all along. The props-max step now runs it at 2,000 like the
other documented maxima, and the wrong note is gone. (Worker branch
t3/party-totals-proptest-cases, 3f66b373, also added an explicit config
to a different proptest block; that part is redundant and is dropped.)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One detached command walks fuzzing, the proofs, the GnuCash oracle, the property maxima and the nine mutation recipes. Each step's status, timing, log and key result live under ${XDG_CACHE_HOME:-$HOME/.cache}/wanderbooks/p12; done markers make the next night resume, and P12_STOP stops the running process group at the deadline so the machine is free in the morning.
The property maxima are the env-controlled ones docs/testing.md names: STORE_CASES=5000, WB_ORDERS_DEPTH=6 (plan 8.2/STATUS), CF_CASES=5000, PROPTEST_CASES=5000 for spec_party_totals and 2000 for settings_replay_is_pure. The form1099 property's documented 2,000 has no env knob (it hard-codes 256) and is recorded as a gap rather than guessed at. Mutation runs do not use --iterate because the recipes as written do not pass it, so a cut-off crate restarts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HEAD^1 is only the new tip's parent: a push of several commits could lower
the floor in an earlier one and pass. github.event.before is what main was
before the push; a new branch (all zeros) falls back to HEAD^1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>