docs(spec): every CHOICE wanderbooks claims has a declared pick
Add the seven older CHOICE records (with a B number) that carried no declared pick in the adapter, taking each option from its record's options and the claims file's existing Pick line for its B section: - BS-arap-2 lines-that-stand, BS-arap-5 direct-write-off, BS-asset-3 tag-and-never-reuse, BS-ledger-6 reversible-once, BS-ledger-9 facts-in-the-books, BS-ledger-10 label-only, BS-statement-5 project-is-a-class - PICKS in crates/ledger-core/tests/bookspec/engine.rs gains all seven; each claims file gains a '**Pick (BS-...):**' line beside its B section's Pick - Widen rules_md.rs's pick check from b == 0 records to every non-retired CHOICE record wanderbooks claims, so no CHOICE can go undeclared again Co-Authored-By: Muse Wonder 1.0
This commit is contained in:
1 parent
03f667585d
commit
de57598df8
6 files changed
+45
-22
No files matched your search
@@ -48,6 +48,9 @@ pub(crate) const PICKS: &[(Area, u32, &str)] = &[
|
||||
(Area::Entry, 6, "check-when-line-added"),
|
||||
(Area::Entry, 7, "refuse-rather-than-crash"),
|
||||
(Area::Entry, 8, "bounds-bind-commands-never-replay"),
|
||||
(Area::Ledger, 6, "reversible-once"),
|
||||
(Area::Ledger, 9, "facts-in-the-books"),
|
||||
(Area::Ledger, 10, "label-only"),
|
||||
(Area::Ledger, 14, "book-in-the-smallest-unit"),
|
||||
(Area::Ledger, 15, "child-has-its-parents-type"),
|
||||
(Area::Ledger, 16, "on-or-after-the-original"),
|
||||
@@ -58,6 +61,7 @@ pub(crate) const PICKS: &[(Area, u32, &str)] = &[
|
||||
(Area::Ledger, 21, "round-once-on-the-total"),
|
||||
(Area::Period, 4, "nest-never-partially-overlap"),
|
||||
(Area::Period, 5, "fiscal-year-to-date-by-default"),
|
||||
(Area::Statement, 5, "project-is-a-class"),
|
||||
(Area::Statement, 6, "direct"),
|
||||
(Area::Statement, 7, "constructive"),
|
||||
(Area::Statement, 8, "year-through-as-of"),
|
||||
@@ -78,6 +82,7 @@ pub(crate) const PICKS: &[(Area, u32, &str)] = &[
|
||||
(Area::Partner, 15, "contract-is-property-vendor-paid-is-cash"),
|
||||
(Area::Partner, 16, "close-at-the-change"),
|
||||
(Area::Partner, 17, "book-amount-with-note"),
|
||||
(Area::Asset, 3, "tag-and-never-reuse"),
|
||||
(Area::Asset, 5, "straight-line-by-days"),
|
||||
(Area::Asset, 6, "lesser-of-value-and-basis"),
|
||||
(Area::Asset, 7, "books-recorded-amounts"),
|
||||
@@ -87,6 +92,8 @@ pub(crate) const PICKS: &[(Area, u32, &str)] = &[
|
||||
(Area::Tax1099, 3, "presumed-a-check-ach-or-transfer"),
|
||||
(Area::Tax1099, 4, "dated-by-the-payments-date"),
|
||||
(Area::Tax1099, 5, "payees-share-only"),
|
||||
(Area::Arap, 2, "lines-that-stand"),
|
||||
(Area::Arap, 5, "direct-write-off"),
|
||||
(Area::Arap, 7, "due-today-is-current"),
|
||||
(Area::Arap, 8, "as-of-the-day"),
|
||||
(Area::Arap, 9, "refuse-a-payment-before-its-document"),
|
||||
|
||||
@@ -28,30 +28,32 @@ pub(crate) fn rules_md_carries_every_id() {
|
||||
if rule.is_retired() {
|
||||
continue;
|
||||
}
|
||||
// Every non-retired CHOICE record wanderbooks claims -- whether
|
||||
// it carries a B number or was split out of another rule (P14
|
||||
// unit S-C7) -- has its pick recorded in its claims file, and
|
||||
// the engine's adapter declares the same option, which the
|
||||
// record names, so no CHOICE can go undeclared.
|
||||
if rule.status == Some(bookspec_checker::Status::Choice) {
|
||||
let marker = format!("**Pick ({}):** `", rule.id);
|
||||
let at = all
|
||||
.find(&marker)
|
||||
.unwrap_or_else(|| panic!("{} carries its pick in its claims file", rule.id));
|
||||
let option = all[at + marker.len()..].split('`').next().unwrap();
|
||||
assert!(
|
||||
rule.record().options.iter().any(|o| o.name == option),
|
||||
"{}'s pick {option:?} is one of its options",
|
||||
rule.id
|
||||
);
|
||||
assert!(
|
||||
engine::PICKS
|
||||
.iter()
|
||||
.any(|&(area, n, o)| RuleId::new(area, n) == rule.id && o == option),
|
||||
"{}'s pick {option:?} is declared in the adapter's claims()",
|
||||
rule.id
|
||||
);
|
||||
}
|
||||
if rule.b == 0 {
|
||||
// A rule born after the B numbering has no row in the index.
|
||||
// A CHOICE record split out of another rule (P14 unit S-C7)
|
||||
// has its pick recorded in its claims file, and the engine's
|
||||
// adapter declares the same option, which the record names.
|
||||
if rule.status == Some(bookspec_checker::Status::Choice) {
|
||||
let marker = format!("**Pick ({}):** `", rule.id);
|
||||
let at = all
|
||||
.find(&marker)
|
||||
.unwrap_or_else(|| panic!("{} carries its pick in its claims file", rule.id));
|
||||
let option = all[at + marker.len()..].split('`').next().unwrap();
|
||||
assert!(
|
||||
rule.record().options.iter().any(|o| o.name == option),
|
||||
"{}'s pick {option:?} is one of its options",
|
||||
rule.id
|
||||
);
|
||||
assert!(
|
||||
engine::PICKS
|
||||
.iter()
|
||||
.any(|&(area, n, o)| RuleId::new(area, n) == rule.id && o == option),
|
||||
"{}'s pick {option:?} is declared in the adapter's claims()",
|
||||
rule.id
|
||||
);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
assert!(
|
||||
|
||||
@@ -33,6 +33,8 @@ Rules: B-18, B-38, B-39, B-40, B-41, B-42.
|
||||
|
||||
**Claims:** yes
|
||||
|
||||
**Pick (BS-arap-2):** `lines-that-stand`, the owner, 2026-10-23.
|
||||
|
||||
**Pick:** `lines-that-stand`: CHOICE (the owner, 2026-10-23, plan D-45: "we kinda need stronger invoice support. Like make it a first class citizen"; hand entries to receivables and payables refused, the owner's answer 5). A control account agreeing with its subledger is the CONVENTION beside it (as B-23, `BS-ledger-8`). The sources are cited and not yet vendored (the Open list in `README.md`).
|
||||
|
||||
**Enforced:** `ledger_core::arap::{DocRef, DocTag, Movement, DocState,
|
||||
@@ -224,6 +226,8 @@ the viewer `a_numbered_invoice_shows_its_number_terms_bill_to_and_po`.
|
||||
**Claims:** yes
|
||||
|
||||
**Pick:** `direct-write-off`: CHOICE (the owner, 2026-10-23, plan 8.3.1 A-5: bad debts by the direct write-off method; and 8.3.2: for a small company's receivables a CPA accepts the direct method and notes it, where GAAP prefers an allowance under ASC 326-20). A recovery is not a new movement (plan D-49): the same year, the write-off is reversed; a later year, a plain entry to a bad-debt-recoveries revenue account.
|
||||
**Pick (BS-arap-5):** `direct-write-off`, the owner, 2026-10-23.
|
||||
|
||||
**Pick (BS-arap-11):** `reverse-then-plain-entry`, plan D-49.
|
||||
|
||||
**Enforced:** `ledger_core::Ledger::write_off` (and its replay
|
||||
|
||||
@@ -119,6 +119,8 @@ None.
|
||||
|
||||
**Claims:** yes
|
||||
|
||||
**Pick (BS-asset-3):** `tag-and-never-reuse`, the owner, 2026-10-15.
|
||||
|
||||
**Pick:** `tag-and-never-reuse`: CHOICE (the owner, 2026-10-15): each asset may carry one tag, generated `PREFIX-0001` or the human's own, unique ignoring case and never reused, and the register reconciles to the cost and accumulated depreciation accounts.
|
||||
|
||||
**Enforced:** `Ledger::set_asset_tag` / `check_asset_tag_for` /
|
||||
|
||||
@@ -116,6 +116,8 @@ None.
|
||||
|
||||
**Claims:** yes
|
||||
|
||||
**Pick (BS-ledger-6):** `reversible-once`, the owner, 2026-10-13.
|
||||
|
||||
**Pick:** `reversible-once`: CHOICE (the owner, 2026-10-13).
|
||||
|
||||
**Enforced:** `Ledger::check_reversal`. **Checked:**
|
||||
@@ -176,6 +178,8 @@ frees its code); the control guard and `Ledger::control_check` (B-38).
|
||||
|
||||
**Claims:** yes
|
||||
|
||||
**Pick (BS-ledger-9):** `facts-in-the-books`, the owner, 2026-10-16.
|
||||
|
||||
**Pick:** `facts-in-the-books`: CHOICE (plan/served.md I-3, owner decisions of 2026-10-16: "the journal holds all books state"; light governance: decisions are recorded with who made them and when, not as paperwork). IRS Pub. 538 and the rules of B-1 to B-28 say what each setting means.
|
||||
|
||||
**Enforced:** `ledger_core::settings` (`check`, `Settings::check_changes`,
|
||||
@@ -222,6 +226,8 @@ checked to change no figure or entry;
|
||||
|
||||
**Claims:** yes
|
||||
|
||||
**Pick (BS-ledger-10):** `label-only`, the owner, 2026-10-20.
|
||||
|
||||
**Pick:** `label-only`: CHOICE (the owner, `plan/served.md` 4.9 and P3 "Settled in design", 2026-10-20: "a new account named like a sibling (ignoring capitals), or holding a nine-digit number, is refused"). Posted is forever (B-8) stands behind it, and Rev. Proc. 98-25 §5.01 (`sources/irs-records.md`) for keeping the old name. The nine-digit refusal is B-26's: every report prints a name. The 200-character bound is `account::MAX_ACCOUNT_NAME`, the bound of the company's own name.
|
||||
|
||||
**Enforced:** `Ledger::rename_account` / `check_rename_account`,
|
||||
|
||||
@@ -217,6 +217,8 @@ given no accounts, uses the settings', as a package given none does.
|
||||
|
||||
**Claims:** partly (bookspec's record states the class, the figures, on-spec and document-line rules; the project facts and the snapshot presentation are wanderbooks product, below)
|
||||
|
||||
**Pick (BS-statement-5):** `project-is-a-class`, the owner, 2026-10-21.
|
||||
|
||||
**Pick:** a project is a class (the owner, 2026-10-21: "a Projects page that treats a class as a project ... Projects are entities too and can have name, description, whatever other metadata you think they should have"; the convention `link-to-projects` in the books: "whenever applicable, we link things to [projects]"); an invoice's or bill's lines take a project, each line one or none (the owner, 2026-10-22, plan D-43).
|
||||
|
||||
**Enforced:** `ledger_core::classes::{ProjectFacts, ProjectStatus,
|
||||
|
||||
Reference in new issue
Block a user