You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
load/load-file do not report balance-assertion failures (only validate does) #1663
ledger.load (and load-file) do not report balance assertion failures, and emit no diff on the balance directive. Only ledger.validate reports them. Embedders that load via load/load-file (rustfava does) therefore surface no error for a failing balance — the user is told their books reconcile when they don't.
Beancount's loader.load_file runs balance checking as part of loading and returns the errors; rustledger's load should match so the primary load path is safe for embedders.
Repro (v0.17.3, FFI component)
Ledger — real balance of Assets:Cash is -5 USD, but asserts 999 USD:
2024-01-01 open Assets:Cash USD
2024-01-01 open Expenses:X USD
2024-01-02 * "t"
Expenses:X 5 USD
Assets:Cash
2024-01-03 balance Assets:Cash 999 USD
load(src) → errors: [], and the returned balance directive carries no diff ({type: balance, date, account, amount: {999 USD}, tolerance: null, meta}).
Include balance-assertion failures in errors (same as validate), so embedders that don't separately call validate still see them; and
Ideally attach the computed vs asserted difference to the returned balance directive (a diff-amount/diff field), so UIs can render per-assertion pass/fail without re-deriving it.
If the load/validate split is intentional, please document that embedders must call validate for balance-check errors — but matching beancount's load-includes-balance-checks behavior is the safer default.
Impact
In rustfava this means every failing balance directive renders green/"passed" in the journal (its red/green keys off the directive diff) and produces no error banner — a silent correctness failure on the feature users rely on to catch bookkeeping mistakes.
Activity
feat(ffi)!: load reports balance-assertion failures + diff on balance…
chore: release v0.18.0 (#1665)
fix(booking,validate): lot-label on reduction, balance currency, dedu…
ci: downstream rustfava job — run the embedder's tests against the PR…
test(ffi): corpus-driven CLI<->FFI parity sweep (#1680)
fix(core): try_reduce is now reduce-on-a-clone — equivalent by constr…
feat(query): #balances exposes the checker's discrepancy (#2238)
fix(ffi): a balance diff belongs to its own assertion
fix(ffi): a balance diff belongs to its own assertion (#2242)