merge: tests where coverage was thinnest, the audit's strict close bound, WB-ledger-17 (V-D2; reviewed, fixes applied)
Ninety-six tests, each encoding the rule it covers, reach what the core and store suites left untouched: the evidence requirement (34% to 100% of its lines), the store's reconcilable accounts (0% to 100%), the command steps' refusals, conventions, settings and the audit's branches. ledger- core's line coverage rises from 89.79% to 95.49%, and the floor with it. Found: the digest listed cash accounts found by name in hash order, so the same books could list them differently; they come in ascending account id now. The audit now holds a close's member split to under one unit (BS-partner-1 statement 5) once the count has been trued up, a close records its rule, and only drift beyond one unit before; the reconciliations rule is written down as WB-ledger-17. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
045e70bb0d
17 files changed
+5422
-26
No files matched your search
@@ -5,21 +5,25 @@
|
||||
//! ```text
|
||||
//! GOAL: the monthly close's reconciliation step can't be forgotten, and
|
||||
//! the digest and the viewer never disagree on what is due.
|
||||
//! SOURCE: docs/parties-and-attachments.md "Reconciliations" (Needs
|
||||
//! attention: an account with activity not reconciled through last
|
||||
//! month's end); CONVENTION (bank and card statements close
|
||||
//! monthly); AGENTS.md's monthly close.
|
||||
//! SOURCE: WB-ledger-17; docs/parties-and-attachments.md "Reconciliations"
|
||||
//! (Needs attention: an account with activity not reconciled
|
||||
//! through last month's end); CONVENTION (bank and card statements
|
||||
//! close monthly); AGENTS.md's monthly close.
|
||||
//! DEFINITIONS:
|
||||
//! cash accounts: `[books] cash_accounts`, resolved; when none are set,
|
||||
//! the asset accounts (not placeholders) whose names say they hold
|
||||
//! cash ("cash", "bank", "checking", "savings", "money market").
|
||||
//! cash ("cash", "bank", "checking", "savings", "money market"), in
|
||||
//! ascending account id; the configured ones keep the order given.
|
||||
//! card accounts: `ledger_core::parties::card_accounts`: the
|
||||
//! liabilities of the business-card payment methods the books record,
|
||||
//! else (none recorded) the liabilities whose names say "card" but
|
||||
//! not "gift"; never a member's card or a platform's account.
|
||||
//! not "gift"; never a member's card or a platform's account; in
|
||||
//! ascending account id.
|
||||
//! INVARIANTS:
|
||||
//! 1. reconcilable_accounts: the cash accounts, then the card accounts,
|
||||
//! then every other liability with a recorded statement, each once.
|
||||
//! then every other liability with a recorded statement (in the
|
||||
//! order the statements are given: the store's are by period end,
|
||||
//! then file), each once.
|
||||
//! A card is expected before its first statement, so its first
|
||||
//! reconciliation is asked for; a liability named otherwise (an Amex)
|
||||
//! joins once its first statement is recorded.
|
||||
@@ -45,7 +49,9 @@ pub fn cash_accounts(ledger: &Ledger, configured: &[String]) -> Vec<AccountId> {
|
||||
.filter_map(|c| ledger.chart().find_by_code(c).map(|a| a.id))
|
||||
.collect();
|
||||
}
|
||||
ledger
|
||||
// In ascending account id, as `card_accounts` sorts: the chart's own
|
||||
// iteration order is unspecified (`ChartOfAccounts::all`).
|
||||
let mut found: Vec<AccountId> = ledger
|
||||
.chart()
|
||||
.all()
|
||||
.filter(|a| {
|
||||
@@ -55,7 +61,9 @@ pub fn cash_accounts(ledger: &Ledger, configured: &[String]) -> Vec<AccountId> {
|
||||
&& CASH_WORDS.iter().any(|w| n.contains(w))
|
||||
})
|
||||
.map(|a| a.id)
|
||||
.collect()
|
||||
.collect();
|
||||
found.sort_unstable();
|
||||
found
|
||||
}
|
||||
|
||||
/// The card accounts (`ledger_core::parties::card_accounts`: the
|
||||
|
||||
Reference in new issue
Block a user