Repository navigation
docs(migration): same-day lot pooling agrees with beancount since #2118 - #2488
Conversation
The migration guide's "Repeated same-day lots" item and the booking fuzzer's "expected" bucket still described #2118 as an open divergence. It was fixed in v0.23.0 (#2139): interchangeable lots are stored as one position, as Python beancount does. - docs/migration/from-beancount.md: the worked example now books the same on both engines (checked: 10 ACME {20.00 USD} + 5 ACME {10.00 USD} left, -150.00 USD gain, bean-check clean). The item now says the engines agree since v0.23.0 and what older releases did. - scripts/compat-booking-fuzz.py: the #2118 waiver is now a tripwire. A divergence on a ledger with a repeated lot identity within a date is labeled as a likely #2118 regression, counted on its own line, and fails the run. same_totals (only used by the waiver) is gone; a new classify() carries the verdict and has its own self-test cases. - compat.yml: the step comment no longer says #2118 does not fail CI. Verified: self-test passes; seeds 0-249 (the PR window) agree 250/250 with the current binary; the v0.22.0 release binary trips the tripwire on seed 117 (exit 1). Closes #2392 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_012nNGPA44Dt32NyxWem26xr
✅ Compatibility Test Results
What's tested
Full results available in workflow artifacts |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Review (adversarial pass): can the tripwire fire on a legitimate divergence?The shape test. Why it adds no false-positive risk.
Measured.
No code changes from this pass. Second pass: cross-PRIn a test merge onto main after #2496 and #2490, this PR conflicts only on the Third pass
|
…ooling-2392 # Conflicts: # CHANGELOG.md
…ooling-2392 # Conflicts: # CHANGELOG.md
What
#2118 was fixed in v0.23.0 (#2139): lots that agree on commodity, cost, date and label are now stored as one position, as Python beancount stores them. Two places still described it as an open divergence:
docs/migration/from-beancount.md: the "Repeated same-day lots" item under Known Differences said rustledger keeps one lot per purchase and consumes lots in a different order. It came with a worked example and advice to add labels. The item now says the two engines agree since v0.23.0, what older releases did, and that labels still keep same-day purchases apart.scripts/compat-booking-fuzz.py: theexpectedbucket waived any divergence on a ledger whose lots take the [Compat]: rustledger keeps a slot per acquisition where beancount pools identical lots — FIFO/LIFO consume in different orders #2118 shape. That bucket is now a tripwire. Such a divergence is labeled[#2118 REGRESSION? repeated lot identity within a date], counted on its own line (always printed, including 0), and fails the run.same_totalsexisted only for the waiver, so it is removed. A smallclassify()now holds the verdict, and the self-test checks it: a pooled-shape divergence must FAIL, not be waived..github/workflows/compat.yml: the step comment no longer says [Compat]: rustledger keeps a slot per acquisition where beancount pools identical lots — FIFO/LIFO consume in different orders #2118 does not fail the run.Verified
rledger checkandbean-checkare both clean. Both leave10 ACME {20.00 USD}and5 ACME {10.00 USD}and book-150.00 USDto Income:Gains. The sale consumes-15 ACME {10.00 USD}on both.compat-booking-fuzz.py --self-test: passed.compat-booking-fuzz.py --runs 250(seeds 0-249, the window CI runs on a PR) against current main:250/250 agreed,0 #2118-shaped divergence(s),0 other unexplained divergence(s), exit 0.[#2118 REGRESSION? ...]and exits 1. The current binary agrees on the same seed. Other old seeds can't be replayed against v0.22.0, because itsquery --format jsonpredates positional rows (query -f json silently drops a column when two columns share a name #2178).Closes #2392
🤖 Generated with Claude Code
https://claude.ai/code/session_012nNGPA44Dt32NyxWem26xr