docs(spec): claims restore enforcement sites and product rules (review)
B-14 (statement):
- The Pick records the kind order the record now restores: within a
section, the rest of its kinds, then interest received, then interest
paid (CONVENTION, as the engine splits it).
- Enforced restores `Ledger::reversal_chain`, rule 6's chains.
- WB-statement-8 is new: the statement's label strings and the
reconciliation's grouping are wanderbooks product, not accounting
("Reversal of #N — …", "Reinstatement of #A (reverses #B)", "Proceeds
from borrowing — …", "Contributions from members — …", "(Gain) loss and
other noncash changes in investing assets", "Depreciation", "Noncash:
through <account>", "Other noncash items", "Increase in"/"Decrease in").
B-37 (statement):
- WB-statement-6 says "a decision" again, not "a choice": a decision is a
record kind the books have.
- WB-statement-9 is new: a document's entry posts one line per project in
the order each is first named, the untagged sum as one line, a document
naming none posting exactly the one line documents always posted; its
journal events (`entry.line_class_set`, feature
`document_line_projects`) are recorded.
B-11 (period):
- Enforced says INVARIANT 5 (a close with nothing to close posts no entry
and still closes, D-73); Checked adds Lean `closingEntry_net` and
`a_close_with_nothing_to_close_posts_no_entry`, the rule the record now
states.
B-12 (period): Enforced restores `Ledger::create_period`
(`PeriodsOverlap`); Checked restores
`periods_nest_but_never_partially_overlap` and `periods_nest`.
B-30 (period): Enforced restores `InvalidDateRange` and
`StartAfterToday`, with what each refuses.
Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
This commit is contained in:
1 parent
73010c4acb
commit
1349bb478b
2 files changed
+64
-10
No files matched your search
@@ -12,10 +12,14 @@ Rules: B-11, B-12, B-30.
|
||||
|
||||
**Claims:** yes
|
||||
|
||||
**Enforced:** `Ledger::close_period_to`. **Checked:** Kani
|
||||
**Enforced:** `Ledger::close_period_to` (INVARIANT 5: a close with
|
||||
nothing to close posts no entry and still closes the period; the EM's
|
||||
decision, D-73, 2026-11-08). **Checked:** Kani
|
||||
`closing_line_zeroes`, `closing_entry_balances`; Lean
|
||||
`closingEntry_zeroes`, `closingEntry_accepted`, `close_zeroes`,
|
||||
`close_credits_net_income`; `a_close_sweeps_only_through_the_period_end`.
|
||||
`closingEntry_zeroes`, `closingEntry_accepted`, `closingEntry_net`,
|
||||
`close_zeroes`, `close_credits_net_income`;
|
||||
`a_close_sweeps_only_through_the_period_end`,
|
||||
`a_close_with_nothing_to_close_posts_no_entry`.
|
||||
|
||||
## B-12 A closed period takes no new postings; periods close in order
|
||||
|
||||
@@ -26,9 +30,12 @@ Rules: B-11, B-12, B-30.
|
||||
**Pick:** periods nest and never partially overlap (the owner, 2026-10-13).
|
||||
|
||||
**Enforced:** `closed_period_containing`,
|
||||
`CloseOutOfOrder`, `Store::rehearse`. **Checked:** Lean `Steps.frozen`;
|
||||
`CloseOutOfOrder`, `Ledger::create_period` (`PeriodsOverlap`),
|
||||
`Store::rehearse`. **Checked:** Lean `Steps.frozen`;
|
||||
store property `refused_commands_never_reach_the_journal` (no draft in a
|
||||
closed period).
|
||||
closed period); `periods_nest_but_never_partially_overlap`
|
||||
(`crates/ledger-core/tests/invariants.rs`) and `periods_nest`
|
||||
(`crates/ledger-core/tests/spec_ledger.rs`).
|
||||
|
||||
### Product rules
|
||||
|
||||
@@ -51,7 +58,12 @@ untouched.
|
||||
**Enforced:** `ledger_core::calendar` (`period_defaults`,
|
||||
`PeriodDefaults::statement`, `statement_range`, `as_of`,
|
||||
`calendar_year`, `fiscal_year_start_on`, `PeriodKind::describe`,
|
||||
`START_DOC`, `END_DOC`, `AS_OF_DOC`, `YEAR_DOC`); `ledger_package`
|
||||
`START_DOC`, `END_DOC`, `AS_OF_DOC`, `YEAR_DOC`), whose refusals are
|
||||
`LedgerError::InvalidDateRange` (both dates given, start after end) and
|
||||
`LedgerError::StartAfterToday` (only a start, after today, the end an
|
||||
omitted end would mean; the message says the end was defaulted: pass
|
||||
end); a resolved start after the resolved end is never swapped or
|
||||
clamped to fit. `ledger_package`
|
||||
`statement_range`, `as_of_date`, `pnl_statement`, `bs_statement`,
|
||||
`cash_flow_statement`, `build_package`; `ledger-mcp` `BooksServer::periods`,
|
||||
`statement_range`, `as_of`, every report tool, `books.show`, the
|
||||
|
||||
Reference in new issue
Block a user