fix(core): the audit holds a close's split to under one unit once the count is trued up
BS-partner-1 statement 5 says that after a close that posts, each member's running total MUST be under one smallest unit from its exact share. The audit flagged drift only when it was greater than a unit, so exactly one unit passed. The looser bound is right only until the first true-up (statement 6, WB-partner-1): a count that still holds closes made under the older rules may carry their rounding until a cumulative close posts. A close records both facts replay needs: its rule (`MembersClosed.rule`) and whether it posted (`closing_entry`). `Ledger::member_close_trued_up` says a count has had a cumulative close that posted, at or before a given close, and `audit::check_split` flags drift of a unit or more once it has, drift beyond a unit before. Closes under the older rules are not read by the audit at all. Tests: both regimes at the edge in either direction, and a count walked through a per-close January, a non-posting February (not trued up), a posting March (trued up) and a non-posting April (still trued up). WB-ledger-16 gains invariant 8 for it. The same test file now cites WB-ledger-16 for the audit (BS-ledger-13 is retired), and audit.rs's own invariant and scenario where WB-ledger-16's numbering does not match. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5fd382450b
commit
7ac1ef8c5a
5 files changed
+180
-33
No files matched your search
@@ -196,6 +196,7 @@ fn seeds() -> Vec<(&'static str, Vec<Finding>)> {
|
||||
exact: dec("1.05"),
|
||||
}],
|
||||
dec("0.01"),
|
||||
true,
|
||||
),
|
||||
));
|
||||
|
||||
|
||||
Reference in new issue
Block a user