Skip to content

test(baseline): record the parser output #2874 changed - #2884

Merged
robcohen merged 1 commit into
mainfrom
fix/baseline-after-2874
Nov 6, 2026
Merged

robcohen merged 1 commit into
mainfrom
fix/baseline-after-2874

Conversation

@robcohen

@robcohen robcohen commented Nov 6, 2026

Copy link
Copy Markdown
Member

What changed

One row of tests/baselines/parser-corpus.manifest: the output hash of tests/compatibility/files/fava/tests_data_example.beancount moves from 173f2e55d47debd5... to f284725b7f6844b1.... Its source hash (8b6a98acc06e3c82...) is unchanged. No other row and no CST manifest row moves.

Why

#2874 keeps one-letter transaction and posting flags out of ParseResult::currency_occurrences, and the parser corpus manifest hashes that field. #2874 merged with "Corpus output baseline / Parser baseline (strict)" failing on this file ("Parser-output drift on 1 file(s) with unchanged source"). That job is not a required check, so main now carries the drift.

I checked that the change is exactly the intended one:

  • The CI copy of the file is fava's current tests/data/example.beancount (fava commit 9ec4975a, blake3 8b6a98ac..., matching the manifest). The local corpus had an older version, so I used the CI copy.
  • I dumped __baseline_canonical_payload for that file at refactor: route currency-name checks through the lexer's rule #2874's parent (fe781a93aa4) and at its merge (f4fcdc40f43). The two hash to CI's expected and current values (173f2e55d47debd5, f284725b7f6844b1).
  • Field by field, directives, options, includes, plugins, comments, errors, warnings, account_occurrences and has_leading_bom are byte-identical. currency_occurrences goes from 48 entries to 46. The two that leave are the P header flag of 2012-12-17 P "Payee" "Narration" (bytes 2263..2264) and the P posting flag of P Expenses:Food (bytes 2444..2445). Nothing else in the list changes.
  • I regenerated both manifests with BASELINE_UPDATE=1. Among files whose source matches the committed one, this fava row is the only one that drifts. The CST row for the file is unchanged. I kept only this row and discarded the rest; those other rows differ only because the local corpus copy differs from CI's.

How to test

With the CI corpus in place:

STRICT_BASELINE=1 cargo test -p rustledger-parser --test corpus_baseline --test cst_baseline

This passes locally with the CI copy of the fava file.

🤖 Generated with Claude Code

#2874 keeps one-letter transaction and posting flags out of
`ParseResult::currency_occurrences`, which the parser corpus manifest
hashes. On fava/tests_data_example.beancount two `P` flags leave the
list: the header flag of `2012-12-17 P "Payee" "Narration"` (bytes
2263..2264) and the posting flag of `P Expenses:Food` (bytes
2444..2445). Every other field of the canonical payload is
byte-identical, the source hash is unchanged, and the CST manifest does
not move.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@robcohen
robcohen requested a review from a team as a code owner November 6, 2026 22:31
@github-actions

github-actions Bot commented Nov 6, 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 826
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 Nov 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@robcohen
robcohen merged commit 12ed204 into main Nov 6, 2026
46 of 47 checks passed
@robcohen
robcohen deleted the fix/baseline-after-2874 branch November 6, 2026 23:04
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.

1 participant