Skip to content

chore(baselines): add the four corpus files upstream added (#2473) - #2487

Merged
robcohen merged 2 commits into
mainfrom
chore/corpus-baseline-drift-2473
Oct 8, 2026
Merged

robcohen merged 2 commits into
mainfrom
chore/corpus-baseline-drift-2473

Conversation

@robcohen

@robcohen robcohen commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

What

Adds the four compatibility-corpus files that upstream added to tests/baselines/parser-corpus.manifest. They had no parser-output coverage since they appeared.

  • double-entry-generator/example_cib_debit_example-cib_debit-output.beancount
  • double-entry-generator/example_ibkr_example-ibkr-output.beancount
  • vrischmann-importers/synthetic_ccm-courant_current_output.beancount
  • vrischmann-importers/synthetic_fortuneo-bourse_expected.beancount

How

I followed the procedure in the issue: fetch-compat-test-files.sh (740 files; 3 clone failures, all repos that no longer exist: tarioch/beancern, LaunchPlatform/beancount-extract, iocoop/beancount), then regen-corpus-baselines.sh. The diff adds exactly four lines. No existing entry changed its output hash and none was removed. scripts/corpus-baseline-drift.py --dry-run now reports no drift.

scripts/fetch-compat-test-files.sh drops the three dead repositories. While they were listed, .fetch-failures was never 0, so the drift job suppressed every "file removed" entry (see the review comment).

cst-corpus.manifest is not changed, as in #2339. The regen script does not write it, because that baseline belongs to the parallel CST parser (#1262).

Review of each new entry against Python beancount 3

file beancount rledger postings (rledger query vs bean-query)
cib_debit accepts, 0 errors accepts, 0 errors identical (24 rows)
ibkr accepts, 0 errors accepts, 0 errors identical (17 rows)
fortuneo-bourse accepts, 0 errors accepts, 0 errors identical (21 rows)
ccm-courant rejects rejects identical (24 rows)

For the posting comparison, I ran SELECT date, flag, payee, narration, account, position, price, tags, links on both engines and normalized whitespace. One cib_debit difference is only ORDER BY position tie order between postings in different currencies on the same date. The rows match as a multiset.

ccm-courant is an importer-output fixture. It uses the root Actifs without option "name_assets", and its transactions have one posting each. Both engines reject it, but they classify the errors differently. beancount reports Invalid account name: Actifs:CCM:Courant 25 times, from its parser. rledger reports E1001 "never opened" 25 times plus E3001/E3004 for the unbalanced single-posting transactions. rledger does report E1005 "Invalid account name" when such an account is opened, but this file never opens it.

Tested

  • STRICT_BASELINE=1 cargo test -p rustledger-parser --test corpus_baseline: 4 passed.
  • Changing the new fortuneo entry's output hash to zeros makes parser_output_matches_baseline fail and name that file. So the new entries are enforced and not inert.

Closes #2473

🤖 Generated with Claude Code

https://claude.ai/code/session_012nNGPA44Dt32NyxWem26xr

A fresh fetch of the compatibility corpus adds four files with no
parser-output baseline. Regenerated with the procedure the drift issue
names (fetch-compat-test-files.sh, then regen-corpus-baselines.sh). The
manifest diff is exactly four added lines and nothing else: no changed
output hash on any existing entry, no removals.

Each new file was checked against Python beancount 3:
- double-entry-generator cib_debit and ibkr, vrischmann fortuneo-bourse:
  both engines accept the ledger with no errors, and every posting
  (date, flag, payee, narration, account, position, price, tags, links)
  agrees between rledger query and bean-query.
- vrischmann ccm-courant is an importer output fixture using the root
  "Actifs" with no name_assets option and one-posting transactions. Both
  engines reject it; the postings still agree. beancount reports
  "Invalid account name" for each posting, rledger reports E1001 (never
  opened), E3001 and E3004 for the same lines.

cst-corpus.manifest is left alone, as in #2339: the regen script does
not write it.

Closes #2473

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_012nNGPA44Dt32NyxWem26xr
@robcohen
robcohen requested a review from a team as a code owner October 7, 2026 20:03
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ Compatibility Test Results

Metric Result
Check Compatibility 100%
BQL Compatibility 100% (raw 93%, 179 masked)
Full AST Match 100%
Total Files 817
What's tested
  • Check: Exit codes and error counts match bean-check
  • BQL: Query results match bean-query
    The headline is the EFFECTIVE rate, after pairs where beanquery
    itself is wrong are masked. raw is the same run with nothing
    masked. A widening gap means the registry grew, not that rledger
    changed.
  • Files: ~800 test files downloaded from 10+ beancount repositories

Full results available in workflow artifacts

@codecov

codecov Bot commented Oct 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Review follow-up for #2473. tarioch/beancern,
LaunchPlatform/beancount-extract and iocoop/beancount return 404 and
contributed no corpus files (no manifest entry under their
directories). Failing to clone on every run, they kept
`.fetch-failures` at 3, and corpus-baseline-drift.py drops the whole
"removed" group whenever any clone failed, so the weekly drift report
could never say that upstream deleted a file.

With them gone a fresh fetch records 0 failures, the corpus is the
same 740 files, and `corpus-baseline-drift.py --dry-run` still reports
no drift.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_012nNGPA44Dt32NyxWem26xr
@robcohen

robcohen commented Oct 8, 2026 •

Copy link
Copy Markdown
Member Author

Review (adversarial pass)

Found and fixed in 15ceda5: three dead repositories hid every "file removed" report. tarioch/beancern, LaunchPlatform/beancount-extract and iocoop/beancount return 404, and none ever contributed a corpus file (no manifest entry under their directories). Because they failed to clone on every run, .fetch-failures was always 3. corpus-baseline-drift.py drops the whole removed group whenever any clone failed, since a missing file might just be a failed clone. So the weekly report could never say upstream deleted a file. The PR drops them from fetch-compat-test-files.sh, with a note. A fresh fetch now records 0 failures, the corpus is the same 740 files, corpus-baseline-drift.py --dry-run reports no drift, and the strict gate passes (4/4) on that fresh corpus.

After merge.

  • Editing the fetch script changes the Parser Baselines cache key (hashFiles('scripts/fetch-compat-test-files.sh')). So this PR's own Corpus output baseline run re-fetches the corpus fresh instead of replaying the frozen cache, and main inherits that fresh cache.
  • The weekly Corpus Baseline Drift job regenerates against a fresh fetch. With this manifest the diff is empty, so _report takes the no-drift path and closes the open corpus-baseline-drift issue. Closes #2473 also closes it at merge. If upstream moves again before the next run, the job opens a new issue, as designed.

Second pass: the "removed" path now reports a deletion

I deleted one manifested corpus file locally (vrischmann-importers/synthetic_fortuneo-bourse_expected.beancount) and ran corpus-baseline-drift.py --dry-run:

  • .fetch-failures = 0 (this PR's fetch script): it reports ### Manifest entries whose file is gone (1) and lists that file.
  • .fetch-failures = 3 (the old script's permanent state): 3 clone(s) failed during the fetch; suppressing 1 'file is gone' entry that may just be missing. followed by no drift.

So before this change a real upstream deletion was invisible to the weekly job, and now it is reported. I restored the file and the marker afterwards.

Cross-PR. This PR touches only tests/baselines/ and scripts/. It merged cleanly on top of #2496 and #2490.

Third pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parser corpus baseline has drifted

1 participant