Repository navigation
fix(plugin): close_tree closes a tree by a parent that was never opened, as beancount does - #3073
Merged
Merged
Conversation
Contributor
📊 Benchmark Results
vs base, measured in this run
A difference counts only when it clears the combined spread of the two measurements, per shape (2σ: What do these numbers mean?
|
Contributor
✅ Compatibility Test Results
What's tested
Full results available in workflow artifacts |
robcohen
force-pushed
the
fix/close-tree-unopened
branch
from
November 27, 2026 17:00
5cf2584 to
09f62aa
Compare
…ed, as beancount does Closing Assets:Bank when only Assets:Bank:Checking was opened is how the plugin closes a whole tree. rledger closed the sub-account but kept the parent close, which then failed as closing an account never opened (E1001), where bean-check is clean. The close of an account no open opens is now dropped once its descendants are closed, and only opened accounts are closed (a posting to an account never opened is the validator error, and closing it too reported it twice). Found by the semantic differential (scripts/compat-semantic-parity.py). Co-Authored-By: Claude Opus 5.5 <[email protected]>
A Ledger archives its processed directives, which close_tree now changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
robcohen
force-pushed
the
fix/close-tree-unopened
branch
from
November 28, 2026 00:27
09f62aa to
1d45fe8
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
robcohen
added a commit
that referenced
this pull request
Nov 28, 2026
With close_tree (#3073) on main, auto_accounts at its declared place clears both entries|extra-in-impl|open (8) and entries|extra-in-impl|close (12): 99.50% -> 99.74% of judged ledgers match, no regression. Co-Authored-By: Claude Opus 5.5 <[email protected]>
robcohen
added a commit
that referenced
this pull request
Nov 28, 2026
…s beancount does (#3075) * fix(loader): run auto_accounts where it is declared, after booking, as beancount does auto_accounts (and the auto plugin) ran in the pre-booking synth pass, ahead of every other plugin whatever the declared order, and over transactions booking then refused. It opened the accounts of a refused transaction and of an elided posting booking drops, where bean-check opens neither, and a plugin declared before it saw its opens. It is now a regular plugin, run at its declared place. Early validation still judges posting accounts against the opens it will insert, through rustledger_loader::early_validation_view: a copy of the stream with them, computed by the plugin itself, that nothing downstream sees. The LSP reads the same view. check --auto runs it after the file plugins, as bean-check --auto does. Document discovery stays in the synth pass (beancount runs it first; its documents carry no amounts). WASM cache v157. Maintainer decision on question 1 of #3071. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(compat): ratchet the semantic parity manifest With close_tree (#3073) on main, auto_accounts at its declared place clears both entries|extra-in-impl|open (8) and entries|extra-in-impl|close (12): 99.50% -> 99.74% of judged ledgers match, no regression. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
close_treefollows beancount 3.2.3's plugin on two points:closeof an account that noopenopens is dropped, once its opened descendants are closed;Why
Closing a parent that was never opened is how the plugin closes a whole tree (
close Assets:Bankwith onlyAssets:Bank:Checkingopened). rledger closed the sub-account but kept the parent'sclose, which then failed as closing an account never opened (E1001), where bean-check is clean. And a posting to an account never opened (already the validator's error) also got aclose.Black-box, beancount 3.2.3 with
plugin "beancount.plugins.close_tree":close Expenses:R(never opened)open Expenses:R:X+close Expenses:Ropen Expenses:R:X,close Expenses:R:X(plugin), no erroropen Expenses:R+close Expenses:RExpenses:R:X(never opened) +close Expenses:RExpenses:R:X; the unknown-account errorFound by the semantic differential (#3071), category
entries|extra-in-impl|close.What this does not change: rledger runs
auto_accountsin the pre-booking synth pass, so withauto_accountsdeclared afterclose_treethe never-opened account is still opened first and itsclosekept, where beancount runs the two in declaration order. That ordering is listed as an open question in #3071, not decided here.How to test
New:
test_close_tree_drops_the_close_of_an_unopened_parent,test_close_tree_drops_the_close_of_a_never_opened_account,test_close_tree_closes_only_opened_descendants,test_close_tree_closes_a_tree_by_an_unopened_parent.docs/reference/plugins.mdupdated. No cache change: the plugin runs on every load.🤖 Generated with Claude Code