test(store): a write-off whose notice is another entry's receipt is refused before posting

The defect found merging S7 and P6: under P6's dedup the notice's
bytes resolve to the record already on file, and the one-receipt-one-
entry rule refused it only after the write-off had journaled its
entry. The store now checks the deduplicated record before the journal
line (`6c26160e`'s companion fix in `write_off_invoice`); this test
pins it: the refusal names the record and its entry, the head and the
journal are unchanged, no entry posts, the invoice stays open, and the
books verify. Also formats the B-27 test `ci-fixes` brought in.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
This commit is contained in:
swaitsandClaude Fable 5.1 committed 2026-10-29 08:23:51 -06:00
1 parent 95a54d69ab
commit 3a1f4fd4eb
2 files changed
+58 -1

No files matched your search

+2 -1
View File
@@ -1574,7 +1574,8 @@ fn an_unknown_convention_kind_is_newer_for_the_writer_and_the_viewer_alike() {
}
let store = ledger_store::Store::open(dir);
let snap = ledger_store::Snapshot::load(dir);
let newer = |e: &ledger_store::StoreError| matches!(e, ledger_store::StoreError::NewerJournal { .. });
let newer =
|e: &ledger_store::StoreError| matches!(e, ledger_store::StoreError::NewerJournal { .. });
match (store, snap) {
(Err(a), Err(b)) => assert!(
newer(&a) && newer(&b),