fix(core): a zero plan prints 0 every month, as the cent rule always has

The K-U5 review's probe compared 1.5 million plans as printed text,
legacy against new, and found one difference: a zero total's last month
printed -0 (the kernel's 0 - 0), where the old plan printed 0. A zero
total is never registered, so no journaled schedule is touched, but the
promise is that the same plan prints the same, so the zero plan now
prints a bare 0 every month; a test pins it (and fails without the fix).

Also from the review: the kernel's GOAL said no month is more than a
rounding from the rest, which the last month need not be (INVARIANT 4
bounds it); and WB-prepaid-2's Checked list lacked the fifth harness.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Opus 5.5 committed 2026-11-09 04:30:35 -07:00
1 parent 317c53fa00
commit d47bc47508
3 files changed
+29 -4

No files matched your search

+2 -1
View File
@@ -18,7 +18,8 @@ use super::{Amount, Rounding, plug_last, round_step};
/// ```text
/// GOAL: an equal-months schedule books exactly its total across its
/// months, each month a whole number of the currency's smallest
/// unit, and no month is ever more than a rounding from the rest.
/// unit: every month but the last the same rounded share, the
/// last what the others leave (INVARIANT 4 bounds how far it is).
/// SOURCE: BS-prepaid-1 (a schedule recognizes exactly its total over its
/// months, each month rounded to the currency's minor unit), BS-prepaid-2
/// (equal months is one of the two methods an engine picks),