Commit Graph
2 Commits
Author SHA1 Message Date
swaitsandClaude Sonnet 5.5 344e09933d test(core): cite the rule that states the fact, and assert the fact, not the wording
Review of V-D2's tests:
- S-E3's vocabulary: `item k` and `INVARIANT k` become `invariant k` of
  WB-ledger-15, WB-ledger-9 (no numbered parts: cited whole), and the statements
  and invariants of BS-arap-5 and BS-arap-6 that the tests actually pin.
- The split-group tests cite WB-entry-6, the only rule that says "as part of a
  split group", not BS-entry-5.
- A refusal is pinned by its variant plus the fragment that states the fact (a
  figure, "positive", "strictly greater"), not its whole sentence; the
  `ConventionKind::ALL.len() == 7` pin is dropped.
- `a_send...moves_no_figure` compared receivables with itself; it now asserts
  the bank unchanged and receivables at 500.00.
- The disposal test says a day before the asset was acquired is refused and
  now asserts DisposalBeforeAcquisition.
- Main's FeeAboveCash variant replaces the InvalidSettlement text the fee test
  matched; it now asserts the variant and both figures.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 06:15:38 -07:00
swaitsandClaude Sonnet 5.5 6048635c2f test(core): conventions refuse bad values
conventions.rs (and the check_*/apply_* commands in ledger.rs that front
it) ran 78% of lines, the gap being its validation refusals. Each test
asks the public check the store calls before it journals, names the rule
it encodes, and compares the books to a clone: a check, and an apply the
replay path refuses, change nothing.

- INVARIANT 1 / WB-ledger-6: an id is a slug and never a TIN; revising a
  live id counts up; a kind can't change; a retired id is gone for good;
  saying what is already said is refused.
- INVARIANT 2 / WB-ledger-9: a posting template is 2..50 lines, each share
  in (0,1], each side summing to exactly 1, slots lowercase names in
  braces, accounts in the chart and not headings; a template needs its
  structure and other kinds take none; drafting from one refuses a missing
  or surplus slot, a non-positive, over-limit, sub-cent or too-small
  amount, and splits what it can exactly (conventions::split).
- INVARIANT 3 / WB-ledger-10: an approval rule needs an approver and a
  limit; approvals bind only under enforcement, match the approver by
  name, notice any change to the draft (fingerprint over parties, shares
  and a no-party reason), and a rule this version can't read fails closed.
- INVARIANT 4: decisions and open items take ids in order, supersede or
  resolve once, name existing projects once each.
- INVARIANT 6 / WB-ledger-6: every text is bounded, control-free and
  TIN-free; sources are checked like a setting's; source corrections need
  a reason and change nothing but the source.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 02:36:24 -07:00