egui's default font set (the crate epaint_default_fonts, switched on by
the `default_fonts` feature) includes Ubuntu Light under the Ubuntu Font
Licence 1.0. Debian and Fedora class that licence as non-free, so a
package of wanderbooks carrying it could not go into either. The viewer
never drew a letter with it (all text is Inter), but the file was
compiled into the program all the same.
The feature is now off, on eframe and on egui, and epaint_default_fonts
leaves the lock file. The viewer names its whole font set in theme.rs:
- Inter (InterTab, as before) for all text: SIL OFL 1.1.
- Hack for fixed-width text: MIT, with the Bitstream Vera licence.
- Noto Emoji for symbols: SIL OFL 1.1.
- emoji-icon-font for the few symbols Noto Emoji lacks: MIT.
The last three are the files egui's set held, copied byte for byte
(SHA-256 in assets/fonts/README.md), each now beside its licence text.
They are files in this repository, not new dependencies. The OFL stays:
it is Inter's own licence, it allows bundling with software under any
licence, and Debian, Fedora, the FSF and the OSI accept it.
Without the default set a missing glyph is an empty box, and nothing
said so. A new test lays out every symbol the viewer's source draws and
fails on one no bundled font has. It compares what is drawn with what is
drawn for a code point no font has, since egui's `has_glyph` answers no
for every character of the font that holds the replacement glyph. The
test checks itself on a Cherokee letter, which no bundled font covers.
Shown: `cargo test -p ledger-gui --lib theme` 2 passed; the side
navigation's snapshot is unchanged (12 passed); the 33 screenshots of
the demo books (tests/screens.rs) show Inter, Hack in the journal's
hashes and JSON, and every arrow, check mark and icon drawn.
Co-Authored-By: Claude <noreply@anthropic.com>
`just prove` ran its 97 fast harnesses under one 30-minute `timeout` and
nothing else. On a machine busy with other builds the run was ended with
exit 124 and no harness named, so a proof that failed could not be told
from a proof that was only slow, and the answer was to run it again and
hope. A gate that cannot say which is not a gate.
Now each harness has its own cap (Kani's --harness-timeout,
KANI_HARNESS_CAP, 900 s: the fast harnesses each take under four minutes
on a busy machine, the longer ones are in kani_slow under their own
caps), the whole set's cap is KANI_FAST_CAP (1800 s as before), and a
run that does not verify every harness lists each one that failed, each
that ran past its cap, and each that never finished.
No proof changes: the caps bound how long a harness may take, not what
it must show, and the count of verified harnesses and the cover check
are as they were.
Checked: the report read against a real run in which one harness passed
and one hit a 15 s cap (the second named as past its cap); and
`KANI_FAST_CAP=2 just _kani fast` exits 1 naming all 97 as not finished.
A full `just prove` is the batch's gate.
Co-Authored-By: Claude <noreply@anthropic.com>
The release profile left overflow-checks off, so an integer that
overflows wrapped silently in the program that ships and panicked in
the build the tests run: the tests were checking a program nobody runs.
Money itself is Decimal and goes through the kernel's checked
arithmetic; this covers the integers around it (counts, sequence
numbers, minor units, lengths).
Checked: a release build passes -C overflow-checks=on to the workspace's
crates and to their dependencies.
Co-Authored-By: Claude <noreply@anthropic.com>
V-D3's test checked the bound B(n) = max(u, (n-1)u/2) at the bound and
one whole unit past it, so a bound a unit too wide would have passed.
It now refuses a drift a tenth of a unit past the bound, on both signs,
for two, three, four and five members: the bound is exactly the one
derived from BS-partner-1 statement 6, not something near it.
Co-Authored-By: Claude <noreply@anthropic.com>
The check job took 72 minutes on one runner for 0ef1ef2c2 (56 of them
tests, one binary at a time: the viewer's read_only.rs 901 s, its unit
tests 759 s, hostile_args.rs 294 s), so a red test was more than an hour
away and a morning of pushes queued behind each other.
`just check` is now a list of parts (lint, gui-unit, gui-tests, cli,
rest), each one `just check-shard <part>`. A laptop runs them in order;
CI runs each on its own runner. One definition serves both, so what CI
checks is what `just check` checks. Nothing can fall out of it:
- `rest` is the workspace less the crates another part names, so a new
crate is tested without being added to a list;
- the viewer's two parts are every target `cargo test -p ledger-gui`
runs (library, executable, each tests/ file, doc tests);
- the lint part fails unless check.yml's list of parts is the justfile's.
The parity floor's comparison runs once, in the lint part.
Co-Authored-By: Claude <noreply@anthropic.com>
The audit took a cent for every currency, so a JPY close (split in whole
yen) was checked a hundred times too finely, and a code with no minor
unit too coarsely. The unit now comes from the one helper the split
itself uses. Before the true-up, a last-absorbs close's last member may
carry half a unit for each of the others (BS-partner-1 statement 6), so
the bound is max(u, (n-1)u/2), derived and marked so, not one unit.
Co-Authored-By: Claude <noreply@anthropic.com>
Muse Ember was released today and the Muse Code provider does not list it
yet; only OpenCode does. The owner's rule: do not take the OpenCode
listing, check the Muse Code provider before each batch of delegations,
and route run-only work to Ember once it is there. Until then run-only
tasks stay on the scout row.
Co-Authored-By: Claude <noreply@anthropic.com>
The owner's rule from 2026-11-09: delegated work is routed by what the
task is (scouting, running things, bulk implementation, hard
implementation, review), not by a random draw, and the routing is
adjusted from evidence. `docs/routing.md` is the current table with the
exact provider and model ids; `docs/delegation-log.md` gets one line per
task once it is verified or abandoned.
One row is open: the plan names Muse Ember through Muse Code for run-only
tasks, and that provider does not list it here (OpenCode does). The file
says so, and those tasks go to the scout row until the owner chooses.
Co-Authored-By: Claude <noreply@anthropic.com>
The bar's first rule is that money arithmetic lives in `kernel/` and the
engine never gets a second copy: Kani and Lean prove the accounting laws
over the kernel's functions, so a sum or a sign flip written anywhere else
is arithmetic nothing has proved. Until now nothing measured how much of
it there is.
`scripts/raw-decimal-arith.sh [package [file.rs ...]]` lists every place
in a crate's own source, outside `kernel/` and the proof harnesses, that
does `Decimal` arithmetic without the kernel: raw operators, rust_decimal's
own `checked_*` and rounding methods, and `Iterator::sum`/`product`.
ledger-core today: 210 places. 101 raw operators, 104 calls to
rust_decimal's inherent `checked_add`/`sub`/`mul`/`div`, 4 `rescale`, one
`.sum()`. The earlier count of 100 saw only the operators, because
clippy's arithmetic lint does not look at method calls.
The method calls matter as much as the operators. `a.checked_add(b)` on a
`Decimal` is rust_decimal's method, not the kernel's, even with `Amount`
in scope, and rust_decimal rounds a result that needs more than 96 bits
where the kernel (K-U10) refuses it. A total that was rounded on the way
is not the sum of its lines, which is the one thing a ledger may not get
wrong quietly.
How it finds them: clippy cannot limit `arithmetic_side_effects` to one
type, so the script runs it twice, once flagging every type and once with
`Decimal` allowed, and keeps what drops out. The methods come from
`disallowed_methods`, which is exact about the type. A place under an
`#[allow]` for either lint is not listed; the last line counts those, so
a waiver cannot arrive unseen.
Not a gate yet: it exits 1 while the count is above zero, and `just check`
does not call it. K-U11 brings ledger-core to zero, then it goes in.
Co-Authored-By: Claude <noreply@anthropic.com>
A failure a property test once found is kept as a seed and replayed on
every run: that is what makes a fixed bug stay fixed. Proptest finds
the seed file from the test's source path and says nothing when the
file is not there, so a seed file left behind by a moved test is never
read again, silently.
Four findings, one cause:
- The kernel bridge's three recorded failures (the constructive split
with a short remainder, and two cash-application cases) sat in
tests/kernel_bridge.proptest-regressions. Since 0cf013b57 the bridge
is a folder (tests/kernel_bridge/main.rs), and a folder test reads
tests/proptest-regressions/main.txt. The three had not been replayed
since. Moved there.
- K-U8 found a control-total case (a sum that touches Decimal's top,
f = [0, -1, -79228162514264337593543950335, 0, 5]) and the seed was
never checked in; it lay untracked in the unit's worktree. Added as
tests/proptest-regressions/control.txt, where control.rs reads it.
- ledger-mcp's proptest-regressions/local_files.txt recorded failures
of a module removed in b26c099a6 (files reach the books as uploads
by hash now). No test can read it. Removed.
- Nothing checked any of this. tests/seed_files.rs walks every crate
and fails when a seed file has no property test that reads it.
How the reading rule was established, not assumed: a marker line in
each candidate file, and proptest's "unparsable line" warning names
the file it really opens.
With the seeds back, the bridge passes whole (101 tests), so nothing
had regressed behind the gap. The guard was red before the move (it
named both orphans) and is green after: 21 seed files, each read by a
property test.
Co-Authored-By: Claude <noreply@anthropic.com>
K-U7 moved payroll's net pay into the kernel and K-U8 moved the control,
aging and reconciliation identities there. Their laws were written once,
in bookspec's Lean: law 45 (net pay is gross less every deduction, and a
payroll plan balances at any number of employees) and law 46 (the control
difference, the aging total and the reconciliation total). The checker and
the Lean package move to that rev together, so the pin test holds.
Proved at this pin: the Kani fast set, 97 harnesses, none failed and every
cover reached; Lean, 212 theorems on the standard axioms only. The Kani
set was verified in two runs (93, then the 4 the whole-set time cap cut
off on a loaded machine), and the Lean half in a shell of its own.
Co-Authored-By: Claude <noreply@anthropic.com>
The engine-first section still listed ledger-store, ledger-import and
ledger-reader as future crates beside two that were never built
(ledger-oracle, books-app). It now names the ten crates around the core,
as docs/architecture.md does; the rule is unchanged: they depend inward
toward the core, never the reverse.
Co-Authored-By: Claude <noreply@anthropic.com>
The check job takes about fifty minutes and was cancelled by every newer
push to the same branch. On 2026-11-09 a morning of merges cancelled every
run, so main went hours with no finished check. On main the running check
now finishes and the newest push runs next (GitHub keeps only the newest
waiting run in a group), so no half-run check is thrown away and the tip is
always the next thing checked. Pull requests keep the old rule: a newer
push cancels the older run.
Co-Authored-By: Claude <noreply@anthropic.com>
The portable-windows gate has been red on main for four pushes
(7a5cb6873 to 652f9da87). The settings test V-D2 added set
backup.folder to /mnt/backup/books. A backup folder is a folder on the
server's own computer, so the key is checked by the host's path rules,
and on Windows that path names no disk: the check refused it, rightly,
and the test's unwrap panicked. The rule and the code are unchanged;
the test now names a folder the host takes (D:\backup\books there).
cargo test stops at the first failing test binary, so that one test hid
whatever fails after it. The two portable jobs take most of an hour
each; they now run with --no-fail-fast, so one red run shows every
failure.
Co-Authored-By: Claude <noreply@anthropic.com>
Before a count is trued up, check_split flagged any drift beyond one unit. BS-partner-1 statement 6 allows a legacy last-absorbs close more than that with four or more members, so the audit raised a false finding on legitimate legacy books.
The rule does not state an audit bound; this bound is DERIVED from statement 6's per-member facts, and the derivation is in check_split's spec block: with n members and unit u, each member but the last was rounded to within u/2, and the last absorbed the sum of those roundings, so |e_last| <= (n-1)*u/2. Floored at u (statement 6's allowance for each run break and each per-close close), the pre-true-up bound is B(n) = max(u, (n-1)*u/2): 1.5 units with four members, 2 with five. A drift of exactly B(n) is legitimate and not flagged; past it is. After the true-up, statement 5's strict bound still holds: a drift of a unit or more is flagged.
WB-ledger-16 invariant 8 now states B(n) and marks it derived.
Tests: a_legacy_last_absorbs_close_drifts_by_member_count_before_its_true_up (BS-partner-1 statement 6 before the true-up, statement 5 after it; WB-ledger-16 invariant 8): four- and five-member closes at their largest legitimate drift are not flagged, one unit past it they are, and after the true-up the strict >= unit bound holds.
Co-Authored-By: Muse Wonder 1.0
audit::closes took its unit as minor_units().unwrap_or(2), while the members allocation splits at allocation_places() (minor_units().unwrap_or(MAX_LINE_SCALE)). For a currency code with no minor unit the audit therefore checked a split made at the finest a line carries against a cent: far looser than the split it checks, so real drift passed.
Add Currency::allocation_unit(), the one helper that turns allocation_places() into an amount, and take the audit's unit from it, so the split and its check cannot drift apart (BS-partner-1 statement 4: the allocation is the split to the base currency's smallest unit). A JPY close is now checked at a whole yen.
Test: a_jpy_close_is_checked_at_the_allocations_unit (BS-partner-1 statement 4, WB-ledger-16 invariant 8).
Co-Authored-By: Muse Wonder 1.0
K-U7 and K-U8 found the same thing from two sides: the integer model's
subtraction negated the subtrahend first, so x - i64::MIN was refused
where it fits. K-U7 assumed the minimum away and asserted the refusal;
K-U8 made i64 and i32 subtract natively. With both merged the
assumption goes: the harness ranges over the whole i64 domain, minimum
included, and asserts -1 - i64::MIN = i64::MAX.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three identities the books rest on are kernel functions now, proved
rather than only summed: an aging's five buckets add to the document
total (aging_total), a control account's difference from its documents
and unattached lines (control_difference), and the K-1 reconciliation's
total (reconciliation_total). Kani proves each, None exactly on
overflow; bridge properties check them against an exact integer
reference and the replaced chains on 20,000 cases, scale included; law
46 in bookspec's Lean. The CPA package's aging now refuses a total past
exact arithmetic instead of panicking. The harnesses found the integer
model's subtraction negating first, so x - MIN was refused where it fits;
i64 and i32 now use the native subtraction.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Net pay is gross less the withholdings and deductions, now one kernel
fold (net_pay) with the plan's totals through the kernel's checked
totals; payroll_remit_plan refuses a total past exact arithmetic instead
of panicking. Proved: Kani (net pay equals gross less the deductions,
None exactly when a running difference overflows, the plan balances for
an employee), bridge properties against an exact integer reference at
every prefix, and law 45 in bookspec's Lean for any number of employees.
No figure moves; every golden unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Kani net_pay_none_iff_a_prefix_overflows proves what the doc claimed:
None exactly when some running difference leaves the i64 range, else
the exact i128 result. It found that i64's Amount::checked_sub negates
first, so a deduction of i64::MIN (no negation) is refused where the
difference would fit (-1 - i64::MIN). Conservative, and Decimal's range
is symmetric, so the engine is unaffected; the harness assumes it away
and asserts the refusal at the fixed case; the kernel doc says so.
- payroll_plan_balances: covers that the assumes did not already force
(net of one unit, payables holding employer shares alone, federal or
state posted); the harness doc says it rebuilds the plan on i64 rather
than calling payroll_entry_plan, and what that does and does not prove.
- Docs name the Lean theorems that carry any number of employees
(payroll_run_net_eq, payroll_run_plan_balances) where they had
claimed it.
- Bridge: compare to_string as well as value (Decimal equality ignores
scale); a strategy near Decimal::MAX/MIN where the reference also
returns None, which required the reference to check every running
difference as the kernel's fold does, not only the last.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The remittance plan totalled the payables with a raw `total +=`, which
panics on Decimal overflow, on a pub fn returning a bare plan. Its
callers refused first through sum_exact_of, but that was an unenforced
precondition (BS-entry-4: every derived figure is checked arithmetic).
It now returns Result<_, LedgerError>, totalling through
kernel::total_of and refusing TooLargeToCompute; Ledger and the store
propagate it and keep their pre-checks. A test shows payables past the
range, up and down, are refused, not a panic.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A rounded step can later return to scale 2, so the bound is four whole
units in cents, not one unit at the final scale.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The tightened harnesses assert Some whenever every i128 prefix fits in i64.
That found the default Amount::checked_sub refusing x - MIN on i32/i64 where
the difference fits; both now use the native subtraction. The bridge pins
aging_total(0,0,0,0,MAX) to Some(MAX), bounds the rounded figures to one
unit of the exact value, and covers scales 0..=28. Two smaller worksheet
harnesses (nine terms on i32, seven on i32) found no verdict in 400 s and
300 s: recorded, no harness.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
bookspec main now carries X-H1e2: the last examples slice, two rules left
without one (BS-asset-9, BS-partner-16, which the engine does not do).
112 of 139 examples run and pass, the other 27 are for options
wanderbooks did not pick.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The CSV total and the statement's column totals used raw Decimal += and a
five-term sum, which panic at the edge. They now go through
kernel::total_of and kernel::aging_total and return TooLargeToCompute as an
error (BS-entry-4). Only the error path changes; no golden moves.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Wanderbooks passes every bookspec example for its picks: 112 run, 112
passed, 27 for options it did not pick. A payout goes through the same
payout_plan the MCP tool uses, a tag through Store::set_asset_tag, the
K-1 contribution columns and the 1099 payments through the worksheet and
the report. No engine change. The claims say what the engine does not do
for BS-asset-9 (no 704(c) method unless a command gives one) and
BS-partner-16 (members are a setting handed to each close).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kani proves, on arbitrary i64s with an exact i128 specification, that
aging_total is the sum of its five buckets, control_difference is
balance - documents - unattached and vanishes exactly when the account
agrees with its subledger, and reconciliation_total is beginning + gain
+ without - distributed; in-range figures always total (law 45). The
book/tax worksheet statement did not finish in the solver (500 s at nine
terms, 110 s at seven), so Lean's reconciliation_identity carries it and
a bridge property checks it on i64 and Decimal; written down in
docs/proofs/k-u8.md rather than weakened.
The bridge compares i64 against Decimal and Decimal against an
independent exact i128 reference over the whole mantissa range, pins the
Decimal edges (each overflowing step is None, never a panic), and checks
the kernel against the three hand-written chains it replaced, as strings
including scale, on 20,000 random Decimals: identical. The reference
also shows rust_decimal rounds an add to a coarser scale wherever the
exact result needs more than 96 bits at the operands' scale (K-U4's
finding, wider than the MAX edge); pinned as a canary for K-U10.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Each claim's Checked line names the examples that now run it on the engine, and
the example for each option wanderbooks did not pick, which is skipped. Two
claims say what the engine does not: BS-partner-16's pick states what the books
do by convention at a close, since no command closes a period at a change of
shares, and BS-asset-9's is the books' convention, not an engine default (a
contributed asset's 704(c) method is unset until a command gives one), so no
example shows either pick apart.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The bookspec schema gained a `payout` event, a `tag_asset` event, an
`asset_tag` query and a note on the tax-basis property line (BS-revenue-1,
BS-asset-3, BS-partner-17). The adapter runs each through the engine and
rebuilds none of it: a payout goes through `payouts::payout_plan`, which
refuses unless gross less fee is the deposit to the cent, and its plan's lines
post as one entry; a tag goes through `Store::set_asset_tag`, which refuses a
tag of a wrong form and one another asset holds or ever held; the tax-basis
line's note is `Note::PrepaidAtBook` read off the worksheet. The engine's
InvalidPayout, InvalidAssetTag and AssetTagTaken are worded as the examples
word them.
Thirteen examples were added and every one the engine's picks reach passes:
five are for options wanderbooks did not pick (no-tags, every-prepaid-is-cash,
every-prepaid-is-property, left-open, whole-payment-to-each) and are skipped,
so the skipped count is 22 + 5 = 27 and 112 of 139 run. A prepaid contract
credited straight to capital is property (1,500.00 each) and a service paid
through Due to Members is cash (1,000.00 each); the contract enters the tax
capital at its book amount with the note; a 1,000.00 check naming Dana Studio
at 600.00 counts 600.00 toward Dana's 1099.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Three identities were still hand-written chains at their call sites:
an aging row's five buckets summing to what is owed (BS-arap-1), the
control check's difference, balance less documents less unattached
lines (BS-arap-2), and the K-1 reconciliation total, beginning plus
built-in gain plus property without a basis less property distributed
(BS-partner-4). They move to kernel::aging_total, control_difference
and reconciliation_total, generic over Amount, returning None on
overflow, so each is a named law with a harness and a Lean theorem
rather than a sum.
Behaviour is identical: the same checked steps in the same order, so
figures, scales and TooLargeToCompute refusals are unchanged; every
golden passes untouched. The next commit's bridge compares the old
chains and the kernel as strings on 20,000 random Decimals of any scale.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
bookspec main now carries X-H1e1: a schedule may leave its method to the
engine, yen schedules, the IIF export's choices, settings, role
assignments and the tax summary in the schema; eight rules remain
without an example. Lean audits standard axioms only; 104 of 126
examples run and pass, the other 22 are for options wanderbooks did not
pick.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The two-employee payroll_plan_balances timed out in CBMC: over 80
minutes at full CPU, killed with no result (sixteen symbolic figures
into eight totals and check_lines). The earlier note's 297.6s figure
came from a misattributed background result and is withdrawn here;
the harness as committed had never verified.
One employee reaches every plan line, both FICA shares on both sides,
net_pay and check_lines, and verifies in 62.0s (65.6s wall). Lean's
payroll_plan_balances carries the plan at its totals for any number
of employees, since a run's totals are sums of the same eight
figures. The bound and why are written in the harness and the note.
Co-Authored-By: Muse Wonder 1.0
Wanderbooks passes every bookspec example for its picks: 104 run, 104
passed, 22 for options it did not pick. A schedule plan is answered as
the engine holds it (a yen month 333, a dollar month 33.33); the IIF
line ending is cr-lf only when every line ends so; bookspec's setting
keys map to the engine's in one place.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bookspec now closes its setting keys (fiscal_year_start); the engine's key is
company.fiscal_year_start. The event and the query both go through one map
(BS-ledger-9).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
contains(CR LF) answered cr-lf for a file mixing CR LF and bare LF. Now the
count of LF must equal the count of CR LF for cr-lf, with none CR LF for lf,
and a mix is mixed. The claims say the engine has no host notion, so
host_line_ending is unused (BS-format-4).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The Checked lines gain the examples that now exercise each pick: the
schedule examples with no convention and a mid-month start (BS-prepaid-2,
and the equal-months one under BS-prepaid-3's start-on-any-day), the yen
schedules under the minor unit and the cent rule (BS-prepaid-4), the two
IIF line endings, DOCNUMs, spans, closes and the nameless receivable line
(BS-format-4, -5, -6, -8, -9), the setting recorded in the books
(BS-ledger-9), the role assignment read back from them (BS-ledger-18) and
the category rounding once and per account (BS-ledger-21). Each names the
enforcement it goes through and the two tests that run it, so the
traceability gate keeps every claim backed.
Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
A schedule may now leave its convention to the engine, so an example can
show BS-prepaid-2's pick: the adapter registers such a schedule by the
day, wanderbooks' method (D-11, D-37), and the equal-months examples are
skipped as the runner skips another engine's option. The yen examples run
through `Store::register_schedule`, whose `schedule_minor_unit` feature
rounds a monthly-even month to the currency's minor unit (D-72, K-U5);
`answer_schedule_plan` now prints each month as the plan holds it, so a
yen month is 333 and not 333.00.
The new events and queries go through the engine's own commands, never a
reimplementation: `set_setting` is `Store::change_settings` with its
`Source` (who decided and when), the setting query reads
`Ledger::settings`, the role account query reads `Ledger::role_account`,
the tax summary is `tax::tax_summary`'s once-rounded lines, and the line
ending is the `ledger_import` file's own CR LF. The BS-format-9 example
uses an entry posted as an earlier version wrote it, so its memo is the
example's and no document's wording stands between the file and the
check. The skip count moves from 16 to 22, the six new unpicked-option
examples (the cent rule, the file's place, one fiscal year, closes
written, the platform line ending and per-account rounding).
Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
Three Kani harnesses on i64, fixed arrays (five deductions, a
two-employee plan of eight lines): net_pay_is_gross_less_deductions
(19.5s verification), net_pay_nonnegative_when (7.0s) and
payroll_plan_balances through check_lines (297.6s), each with covers.
The bridge checks i64 against Decimal and Decimal against an
independent exact i128 reference, with the edges (Decimal::MAX/MIN,
mid-fold overflow) giving None, never a panic.
All three prove law 45 (bookspec, BS-entry-1/BS-entry-3/BS-entry-4).
The traceability gate passes against the k-u7 bookspec branch: 63
kernel functions, 48 fully backed, 45 law rows. docs/proofs/k-u7.md
is the unit's record.
Co-Authored-By: Muse Wonder 1.0
Net pay was a hand fold of Decimal::checked_sub in payroll.rs, and
payroll_entry_plan totalled its seven columns with local checked folds.
Both now go through the kernel: kernel::net_pay (gross less every
deduction, folded left to right, None past exact arithmetic) and
kernel::total_of/total_try for the plan's columns, the net over each
line's kernel net pay.
The fold order preserves the old behaviour exactly, including at the
edge: each running difference must be representable, so [MAX, MAX,
-MAX] from a zero gross refuses where summing first would cancel.
Figures, scale, zero-skipping and the TooLargeToCompute refusals are
unchanged; every golden and test passes as before. The rules are
BS-entry-3 (exact amounts), BS-entry-4 (every payroll figure computed
with checked arithmetic) and BS-entry-1 (the plan balances).
payroll_remit_plan's bare total and name_payroll_parties' grouped
checked_add stay: both callers refuse through sum_exact_of first, in
the same order, and a grouped accumulation has no kernel shape. See
docs/proofs/k-u7.md.
Co-Authored-By: Muse Wonder 1.0
bookspec dropped BS-statement-3's and BS-partner-3's Rule n labels,
which had drifted from their positions (S-C8: Rule 11 was statement 16).
Wanderbooks' cash-flow code, its tests, the claims and the docs cited
them by label; 110 now name the statement, each checked against the
pinned record by content (wrapped ones included). A test refuses a bare
old label beside those records' citations; 515 sub-references checked.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BS-statement-3 and BS-partner-3 no longer open their statements with
"Rule n", so a numbered rule label in the cash-flow or party files can
only be the drifted old citation. sub_refs now refuses a bare "Rule n" /
"rule n" there, and elsewhere only on a line that cites one of those two
records. Ordinary uses of the word ("this rule holds", "the run rule
0.02") are not labels, and a label straight after a bookspec id is
already the id check's finding. Self-tests cover both scopes and the
non-label cases. The checked-reference floor rises to 515, the count
after the citations moved to positions.
Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
bookspec unit S-C8 dropped BS-statement-3's and BS-partner-3's "Rule n"
labels: they had drifted from the statements' positions, and every
reference is now a position, "BS-statement-3 statement k". This rewrites
wanderbooks' citations from the old labels to the positions.
Method: the map was confirmed against the pinned records at b61fa50 by
reading each statement before use. BS-statement-3: Rule 1 -> statement 2,
2 -> 3, 3 -> 4, 4 -> 5; Rule 5 by the sentence's meaning (gross lines 6,
operating classes 7, governments 8, payroll 9, kinds 10, the family 6-10);
6 -> 11, 7 -> 12, 8 -> 13, 9 -> 14, 10 -> 15, 11 -> 16, 12 -> 17.
BS-partner-3: 1 -> 1, 2 -> 2, 3 -> 3-4, 4 -> 5-6, 5 -> 7, 6 -> 8, 7 -> 9,
8 -> 10, 9 -> 11. Each sentence was read against the statement it now
cites; a "rule n" meaning an IRS rule, an engine rule, or another
record's rule was left alone (odd_cent.rs's close true-up, the asset
register's note numbering, and testing.md's "run rule 0.02").
Rewritten: 44 references in src/cashflow.rs, 22 in
tests/spec_cash_flow.rs, 3 in tests/spec_reports.rs, 5 in
docs/spec/claims/statement.md (whose stale "rules 1-12" count is now
"18 statements"), 21 in the vendored ASC notes, 10 in docs/testing.md,
2 in docs/verification.md, 2 in kernel/entries.rs, and 1 in the CLI's
journey test.
Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
bookspec main now carries law 44 (K-U6): a percentage of a positive whole
within half a step of the exact ratio, a ratio split's sides summing to
the amount. Lean audits standard axioms only; the traceability gate
finds a law for all 62 kernel functions' harnesses it checks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A project's contribution margin as a percent of its revenue, and a
government's part of a payment split from the company's, are now kernel
functions (percent_of, split_ratio) with Kani harnesses, bridge
properties against an exact integer reference, and law 44 in bookspec's
Lean. A review fuzzed old against new as strings: no figure moves. Fixed
in review: a split's zero rest could be -0, and the split harness proved
divisibility at a step of 1, where every number divides. The viewer's
display percentages stay as they are; its f64 chart percentage is a
money path K-U9 must make Decimal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The part keeps the share's scale when the share is already a whole
multiple of the step and takes the step's otherwise, so callers that need
a fixed scale rescale (as contribution_margin_pct does for its one-place
display). Say so in `split_ratio`'s invariant list.
Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
The harness split with step 1, where every integer is a multiple, so its
"the rounded side is a whole multiple of the step" claim was vacuous and
the assertion absent. Step 3 makes it mean something, and the harness
asserts `part % step == 0`; the sum and the two covers are unchanged.
Record the re-run (3.1 s wall, 0.66 s verification), note that the Lean
model is total where the kernel is partial (a + b = 0), and refresh the
traceability counts from the merged bookspec branch.
Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>