Accounting reason: a draft that waits on its receipt, and one thrown
away, are facts about the books' working papers that must survive a
restart and replay identically, or a discarded draft would come back and
hold its period open. entry.draft_state_set and entry.draft_discarded are
drafts_v2's (an older version stops at the declaration instead of
misreading them); no figure moves. Schema 19 (taken at merge as the next
after the current last): entries.posted_seq, and a draft_states table
(drafts are not rows of entries, so the plan's entries.draft_state column
has nowhere to live). posted_seq is the journal line that posted each
entry (entry.posted, entry.reversed, the line that closed a period or
posted a schedule month), identical live and on replay.
8.0.6: a hand-written line of each new shape in
books_written_under_older_rules_still_open; fixture old-books/p4_before
written by 25b52580 (hand entries posted late, a reversal, a document, a
schedule month, a recurring draft, open drafts, a close) opens to the
same figures (serialized entries omit a building state, so no golden
moved); drafts_v2_is_its_own_feature; the fuzzer and GUI journal know the
types.
Tests: draft_states_replay_and_project, drafts_v2_waits_for_the_upgrade,
posted_seq_is_the_posting_lines_seq, an_older_version_stops_at_the_draft_events.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
37 lines
1.8 KiB
TOML
37 lines
1.8 KiB
TOML
# The harness that wrote tests/fixtures/old-books, through the Store API of
|
|
# the version that wrote them (main 188c90ea, 2026-10-17), and that version's
|
|
# expected.json (bin/expect). Not a workspace member: point the two paths at
|
|
# a checkout of the writing version (`git archive 188c90ea | tar -x -C
|
|
# wb-main`), then
|
|
# cargo run --bin writer -- OUT (the P0 review's thirteen and control)
|
|
# cargo run --bin extras -- OUT (the edges of chrono and Decimal)
|
|
# cargo run --bin extras2 -- OUT (depreciation for 10000-01; 1,044 drafts)
|
|
# cargo run --bin older -- OUT (x_older_rules, with its JournalWriter)
|
|
# cargo run --bin s5_before -- OUT (p4_s5_before: run against eeee9658,
|
|
# the revision before P4b S5)
|
|
# cargo run --bin p2_1099 -- OUT (p2_vendor_1099: P2's 1099 marks, run
|
|
# against 9c99a0cf, the revision before P3)
|
|
# cargo run --bin p4_before -- OUT (p4_before: run against 25b52580, the
|
|
# revision before P4: hand entries posted
|
|
# late, a reversal, open drafts, a close)
|
|
# cargo run --bin expect -- OUT (expected.json beside each journal)
|
|
# and copy each journal.jsonl, blobs/ and expected.json into old-books/.
|
|
# x_member_closes was written later, the same way, by main 00226a4c
|
|
# (2026-10-20, before P3's odd cent): `cargo run --bin members -- OUT`
|
|
# (members closes under every rounding rule main wrote; P3 review R-2).
|
|
[package]
|
|
name = "writer"
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
|
|
[dependencies]
|
|
ledger-core = { path = "wb-main/crates/ledger-core" }
|
|
ledger-store = { path = "wb-main/crates/ledger-store" }
|
|
chrono = "=0.4.45"
|
|
rust_decimal = "=1.43.0"
|
|
serde_json = "1"
|
|
|
|
[workspace]
|
|
# main's crates (wb-main) keep their own workspace.
|
|
exclude = ["wb-main"]
|