Repository navigation
fix(loader): run auto_accounts where it is declared, after booking, as beancount does - #3075
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?
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
✅ Compatibility Test Results
What's tested
Full results available in workflow artifacts |
…s 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]>
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
force-pushed
the
fix/auto-accounts-declared-order
branch
from
November 28, 2026 01:00
7ade281 to
98b6f33
Compare
robcohen
added a commit
that referenced
this pull request
Nov 28, 2026
Restacked on #3075 (v157). Co-Authored-By: Claude Opus 5.5 <[email protected]>
robcohen
added a commit
that referenced
this pull request
Nov 28, 2026
Restacked on #3075: the STRICT total-match posting-order mismatches now match, no regression. Co-Authored-By: Claude Opus 5.5 <[email protected]>
robcohen
added a commit
that referenced
this pull request
Nov 28, 2026
Restacked on #3075 (v157). Co-Authored-By: Claude Opus 5.5 <[email protected]>
robcohen
added a commit
that referenced
this pull request
Nov 28, 2026
Restacked on #3075: the STRICT total-match posting-order mismatches now match, no regression. 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
auto_accounts(and theautoplugin's two parts) is now a regular plugin, run at its declared place in the post-booking pass, as beancount runs it. Maintainer decision on open question 1 of #3071.AutoAccountsPluginimplementsRegularPlugin(it implementedSynthPlugin); the synth pass now runs document discovery alone. beancount runs that first (PLUGINS_PRE), and its documents carry no amounts, so its pre-booking place is unobservable.rustledger_loader::early_validation_view(new) returns a copy of the stream with the opens the plugin itself would insert (run through the same dispatch,only = auto_accounts), which Early judges posting accounts against and nothing downstream sees. Without it Early would hold "never opened" for every posting to an auto-opened account; Late drops those for the transactions it checks but reports them for a refused one. Costs one stream copy, only for a ledger that runs the plugin.pre_booking_directivesis that view, so WASMvalidateSourceholds the same judgments.run_ledger_validationruns Early on the same view.check --autoruns the plugin after the file's plugins (beancount'sPLUGINS_AUTO).PluginPass, theprocesspipeline comment,Phasein rustledger-validate, the plugin crate's pass notes, and AGENTS.md's pipeline pointer.Why
Running it pre-booking, ahead of every plugin, was visible in the output:
Assets:Brokernamed only by an oversold sale, bean-check opensAssets:CashandAssets:Stockand reports the booking error alone;nounusedthen also reported the extra open.Income:Gainsbeside a purchase). bean-check runs the plugin on the booked entry and opens nothing for it.close_treedeclared beforeauto_accountsdrops thecloseof a never-opened account in beancount; together with fix(plugin): close_tree closes a tree by a parent that was never opened, as beancount does #3073 this now matches.Semantic gate
The
entries|extra-in-impl|opencategory (8 ledgers) is gone: 97.73% → 97.82%, no regression, manifest ratcheted. With #3073 applied too,entries|extra-in-impl|close(15) goes as well. I measured both together locally; nothing new appears.Tests
test_auto_accounts_opens_nothing_for_a_transaction_booking_refuses(new; verified against bean-check 3.2.3).auto_plugin_test's two existing tests expected 3 opens for a ledger whose third account is an elided zero posting. bean-check 3.2.3 opens 2, and they now say so.find_synthusefind_regular.-D warnings, all features/targets); plugin, loader, validate, LSP, CLI (incl.upstream_checks_test), WASM, FFI (wasi, component, component-tests) and surface-parity suites; parse-error parity--check(no regressions); semantic gate--checkafter--update.WASM cache v157 (open PRs hold v151–v156; renumber at merge if needed): a
Ledgerarchives its processed directives. Loader cache unchanged (parsed directives).🤖 Generated with Claude Code