docs(claims): the new bookspec examples that check the picks

The Checked lines gain the examples that now exercise each pick: the
schedule examples with no convention and a mid-month start (BS-prepaid-2,
and the equal-months one under BS-prepaid-3's start-on-any-day), the yen
schedules under the minor unit and the cent rule (BS-prepaid-4), the two
IIF line endings, DOCNUMs, spans, closes and the nameless receivable line
(BS-format-4, -5, -6, -8, -9), the setting recorded in the books
(BS-ledger-9), the role assignment read back from them (BS-ledger-18) and
the category rounding once and per account (BS-ledger-21). Each names the
enforcement it goes through and the two tests that run it, so the
traceability gate keeps every claim backed.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
This commit is contained in:
swaitsandDeepSeek V4.1 Flash committed 2026-11-09 10:49:49 -07:00
1 parent 688ab951d3
commit 695aee7a1e
3 files changed
+45 -7

No files matched your search

+11 -1
View File
@@ -332,7 +332,17 @@ appendix: the file line by line and its changes, derived by hand);
(`iif_declares_accounts_by_role_and_balances_every_transaction`,
`iif_without_as_of_is_as_of_today_and_ties_to_the_trial_balance`),
`mcp_journeys.rs` (`mcp_import_export`,
`the_default_period_never_shortens_the_iif_or_the_package`).
`the_default_period_never_shortens_the_iif_or_the_package`); bookspec
examples `format-cr-lf-on-an-lf-platform` and
`format-platform-line-ending-on-an-lf-platform` (BS-format-4),
`format-docnum-is-the-entry-id` and `format-docnum-is-the-files-place`
(BS-format-5), `format-everything-through-as-of-spans-years` and
`format-one-fiscal-year-holds-its-year` (BS-format-6),
`format-closes-left-out` and `format-closes-written` (BS-format-8) and
`format-no-customer-or-vendor-name` (BS-format-9), run by
`every_bookspec_example_holds` and
`the_runner_reports_every_claimed_rule_green`; the line ending is asked by
the iif_line_ending query (the adapter's answer_iif), the file's own CR LF.
### Product rules
+21 -5
View File
@@ -191,12 +191,15 @@ None.
`check_assign_role`, `Ledger::check_renumber_account` (an assigned role
frees its code); the control guard and `Ledger::control_check` (B-38).
**Checked:** `ledger-core` `tests/spec_roles.rs`, `tests/spec_documents.rs`;
`ledger-store` replay of `role.assigned`; bookspec example
`ledger-store` replay of `role.assigned`; bookspec examples
`ledger-a-role-on-a-header-or-wrong-typed-account-is-refused` (BS-ledger-19,
the option picked: the receivables role on a header account and the payables
role on a postable revenue account are refused through `Store::assign_role`
and `Ledger::check_assign_role`'s `ControlAccountMismatch`, and the chart is
as it was), run by
as it was) and `ledger-a-role-assignment-is-a-fact-in-the-books`
(BS-ledger-18, the option picked: the receivables role assigned to 1300 is
journaled by `Store::assign_role`, read back by the `role_account` query
from the books alone, and found again by the store's replay), run by
`every_bookspec_example_holds` and
`the_runner_reports_every_claimed_rule_green`.
@@ -235,7 +238,12 @@ per check, 2,000 by hand, with posts between records and every record
checked to change no figure or entry;
`the_fiscal_year_stays_under_closed_periods`); `ledger-cli`
`tests/spec_kept.rs`; Lean `Step.record_changes_no_figure`,
`Reachable.records`; fuzz `fuzz_settings_replay`.
`Reachable.records`; fuzz `fuzz_settings_replay`; bookspec example
`ledger-a-setting-is-a-fact-in-the-books` (the option picked: the owner's
fiscal-year change is journaled by `Store::change_settings` with who decided
it and when, read back by the setting query, and the trial balance before
and after is the same), run by `every_bookspec_example_holds` and
`the_runner_reports_every_claimed_rule_green`.
### Product rules
@@ -317,14 +325,22 @@ bookspec `examples/rename-changes-no-amount.toml`.
**Pick:** warn versus refuse: CHOICE (Pub. 583: "the law does not require any specific kind of records"; the owner, 2026-10-20: warn by default, header accounts exempt, the first company set to refuse at the P3 cutover). A category's deductible amount rounds once, on the category total: CHOICE (the owner, 2026-11-07, D-67). The arithmetic is `kernel::deductible_amount`, so Kani proves the one rounding and the bridge carries it to `Decimal`.
**Enforced:** `kernel::deductible_amount` (`tax::tax_summary`'s one
rounding). **Checked:** `ledger-core`
rounding; the bookspec `tax_summary` query answers its lines by category).
**Checked:** `ledger-core`
`tests/tax.rs` (the rounding: `a_category_rounds_its_deductible_amount_once_not_per_account`,
`a_category_rounds_once_across_different_percents`); Kani
`deductible_amount_rounds_once`, `deductible_amount_refuses_overflow`;
bridge `deductible_amount_agrees`; Lean `bookspec/lean/Bookspec/Deductible.lean`
(`Deductible.near`, `Deductible.tie_away_pos`, `Deductible.tie_away_neg`, `Deductible.sign`, `Deductible.neg`, `Deductible.of_sum`,
`Deductible.per_account_differs`, `Deductible.scale_books`, `Deductible.scale_percents`: the one rounding, at any
number of accounts and any sizes); bookspec `examples/tax-category-required.toml`.
number of accounts and any sizes); bookspec `examples/tax-category-required.toml`
and the two BS-ledger-21 examples
`ledger-a-categorys-deductible-amount-rounds-once` (the option picked:
two accounts of 1.01 at 50% give 1.01, the exact sum rounded once) and
`ledger-a-categorys-deductible-amount-rounds-per-account` (the other option:
0.51 + 0.51 = 1.02), whose `tax_summary` query is `tax::tax_summary`, run by
`every_bookspec_example_holds` and
`the_runner_reports_every_claimed_rule_green`.
### Product rules
+13 -1
View File
@@ -38,7 +38,19 @@ Rules: B-16.
`daily_plans_pin_month_end_clamping`,
`prop_daily_plan_sums_exactly_and_lands_on_month_ends`,
`prop_monthly_even_plan_is_unchanged`; `ledger-cli`
`mcp_daily_schedule`.
`mcp_daily_schedule`; bookspec examples
`schedule-daily-deferred-revenue`,
`schedule-daily-small-first-and-last-month`,
`schedule-equal-months-give-each-month-the-same-share` (each names no
convention, so it takes the pick, and starts mid-month where daily and
equal months differ; the equal-months one also names BS-prepaid-3's
start-on-any-day), `schedule-equal-months-start-on-the-first`,
`prepaid-a-new-yen-schedule-rounds-to-whole-yen` (BS-prepaid-4's minor
unit: 333, 333 and 334 yen) and
`prepaid-a-yen-schedule-under-the-cent-rule-keeps-cents` (the other
option: 333.33, 333.33 and 333.34), run by
`every_bookspec_example_holds` and
`the_runner_reports_every_claimed_rule_green`.
### Product rules