Files
wanderbooks/bookspec/examples/rename-changes-no-amount.toml
T
swaitsandClaude Opus 5.5 9ab003d0d1
check / check (push) Canceled after 0s
P3: rename accounts, one set of period defaults, tax categories warn or refuse (defects 15, 16, 8)
books.rename_account; account names trimmed, bounded, refused when a
sibling's or TIN-shaped; books.show refuses what its target ignores. A
report asked for without dates covers this fiscal year so far, everywhere
(one rule for tools, descriptions and the viewer; the IIF and CPA package
keep their own dates). policy.require_tax_category warns or refuses; a
Form 4797 gain is shown apart on every return.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T3gXMVt7XJPi6ens1or9Dj
2026-10-21 10:41:24 -06:00

150 lines
4.7 KiB
TOML

# Renaming an account changes its label, never an amount.
#
# wanderbooks: P3 defect 15 (an account could not be renamed); rules.md
# B-8, B-31; regression tests `rename_account_changes_only_the_name_defect_15`
# and `prop_rename_changes_no_figure` (ledger-store tests/store.rs),
# `rename_account_end_to_end_defect_15` (ledger-mcp tests/mcp_stdio.rs).
# The journal's record of the old name beside the new (`account.renamed`)
# is the store's, checked there.
#
# Expected values (bookspec/README.md): the same trial balance before the
# rename (`after = 2`) and after it; `account_names` gives each account's
# name as every report prints it, past periods included; each
# `rename_account` is tried on a copy of the books, after the rename.
id = "rename-changes-no-amount"
title = "Renaming an account changes its label, never an amount"
rule = "Entries name accounts by identity, not by name, so renaming an account MUST change no posted entry, line, balance or statement amount, and every report, past periods included, MUST print the new name. A new name MUST be refused when it is blank, the name the account has, one another account under the same parent has (ignoring capitals and surrounding space), one that holds a run of nine digits, or not one line of at most 200 characters."
status = "AUTHORITY"
sources = [
"Pacioli, Summa de arithmetica (1494), ch. 36: \"You should not write backward, but always forward\" (posted is forever: AUTHORITY; docs/spec/sources/pacioli-1494.md)",
"Rev. Proc. 98-25 §5.01: \"the relationship (i.e., audit trail): (a) between the total of the amounts in the taxpayer's machine-sensible records by account and the account totals in the taxpayer's books\" (an amount never moves with a name: AUTHORITY; docs/spec/sources/irs-records.md)",
"Intuit IIF Import Kit, !ACCNT: accounts are identified by NAME, so two siblings of one name would be one account in QuickBooks (CONVENTION; docs/spec/sources/intuit-iif.md)",
"DECISION, the owner, 2026-10-20 (wanderbooks plan/served.md P3, \"Settled in design\"): the name rules (wanderbooks docs/spec/rules.md B-31)",
]
tags = ["chart", "rename", "audit-trail", "posted-is-forever"]
[setup]
currency = "USD"
fiscal_year_start = "01-01"
basis = "accrual"
rounding = "half-even"
[[setup.accounts]]
code = "1000"
name = "Cash"
type = "asset"
[[setup.accounts]]
code = "3000"
name = "Capital"
type = "equity"
[[setup.accounts]]
code = "6000"
name = "Operating"
type = "expense"
header = true
[[setup.accounts]]
code = "6150"
name = "Software"
type = "expense"
parent = "6000"
[[setup.accounts]]
code = "6160"
name = "Hosting"
type = "expense"
parent = "6000"
# Entry 1.
[[events]]
date = "2025-11-04"
description = "Capital contributed"
lines = [
{ account = "1000", side = "debit", amount = "800.00" },
{ account = "3000", side = "credit", amount = "800.00" },
]
# Entry 2: posted to 6150 under its old name.
[[events]]
date = "2025-11-20"
description = "Software"
lines = [
{ account = "6150", side = "debit", amount = "29.00" },
{ account = "1000", side = "credit", amount = "29.00" },
]
# After entry 2, the owner renames 6150.
[[changes]]
after = 2
rename = { code = "6150", name = "Software subscriptions" }
# Before the rename.
[[expect]]
query = "account_names"
after = 2
values = { "1000" = "Cash", "3000" = "Capital", "6000" = "Operating", "6150" = "Software", "6160" = "Hosting" }
[[expect]]
query = "trial_balance"
as_of = "2025-11-30"
after = 2
values = { "1000" = "771.00", "3000" = "-800.00", "6000" = "0.00", "6150" = "29.00", "6160" = "0.00" }
# After it: every amount as before; the new name, past periods included.
[[expect]]
query = "account_names"
values = { "1000" = "Cash", "3000" = "Capital", "6000" = "Operating", "6150" = "Software subscriptions", "6160" = "Hosting" }
[[expect]]
query = "trial_balance"
as_of = "2025-11-30"
values = { "1000" = "771.00", "3000" = "-800.00", "6000" = "0.00", "6150" = "29.00", "6160" = "0.00" }
[[expect]]
query = "profit_and_loss"
from = "2025-11-01"
to = "2025-11-30"
values = { "6000" = "0.00", "6150" = "29.00", "6160" = "0.00", net_income = "-29.00" }
# Refused, changing nothing.
[[expect]]
query = "rename_account"
code = "6150"
name = " "
refused = "blank"
[[expect]]
query = "rename_account"
code = "6150"
name = " Software subscriptions "
refused = "unchanged"
[[expect]]
query = "rename_account"
code = "6150"
name = "HOSTING"
refused = "sibling_has_it"
[[expect]]
query = "rename_account"
code = "6150"
name = "Card 123456789"
refused = "holds_a_tin"
[[expect]]
query = "rename_account"
code = "6150"
name = "Software\nsubscriptions"
refused = "not_one_line"
# A name an account under another parent has is no sibling's: accepted,
# moving no amount.
[[expect]]
query = "rename_account"
code = "6150"
name = "Cash"
accepted = true