Repository navigation
chore(parser): pin includes/plugins/warnings/bom/alignment in green-red parity - #1738
Merged
Merged
Conversation
…ed parity The fuzz_green_eq_red differential target and its corpus-test sibling (parse_green_eq_red_corpus) compared six ParseResult fields — directives, errors, options, comments, and the two occurrence lists — leaving includes, plugins, warnings, has_leading_bom, and alignment uncompared. Today those come from the shared top-level walk, so the green path cannot diverge on them; but that invariant was unpinned, and a future green expansion touching any of them would ship without differential coverage. Add the five remaining observables to both comparison sites (same field list in both, cross-referenced). Verified against the corpus test and a one-off differential sweep of all 322 repo .beancount fixtures with the extended tuple — zero divergences, as expected. Co-Authored-By: Claude Fable 5 <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Pins additional ParseResult observables into the project’s green-vs-red parser parity guards, ensuring future expansions of the green path can’t silently diverge on these outputs without being caught by the differential corpus test and fuzz target.
Changes:
- Extends
parse_green_eq_red_corpusparity comparison tuple to includeincludes,plugins,warnings,has_leading_bom, andalignment. - Extends
fuzz_green_eq_reddifferential fuzz target with assertions for the same additional fields. - Updates the fuzz crate’s
Cargo.lockto reflect newerrustledger-core/rustledger-parserversions.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| crates/rustledger-parser/src/cst/green.rs | Adds remaining ParseResult observables to the green/red corpus parity tuple. |
| crates/rustledger-parser/fuzz/fuzz_targets/fuzz_green_eq_red.rs | Adds assertions for includes/plugins/warnings/BOM/alignment parity in the fuzz target. |
| crates/rustledger-parser/fuzz/Cargo.lock | Refreshes fuzz lockfile to updated internal crate versions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
📊 Benchmark Results
vs main branch (2026-07-10)
What do these numbers mean?
|
Contributor
✅ Compatibility Test Results
What's tested
Full results available in workflow artifacts |
Debug-string comparison stays only for warnings (ParseWarning has no PartialEq); everything else in the new parity fields compares directly — clearer failures and no formatting work in the fuzz hot path. Co-Authored-By: Claude Fable 5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
Adds the five uncompared
ParseResultobservables —includes,plugins,warnings,has_leading_bom, andalignment— to both green/red parity guards: thefuzz_green_eq_reddifferential fuzz target and theparse_green_eq_red_corpustest.Why
Phase-1 correctness sweep, green/red family (the cheap follow-up to #1737). The parity guards compared six fields (directives, errors, options, comments, account/currency occurrences) and skipped the rest. Today the skipped fields come from the shared top-level walk, so the green path cannot diverge on them — but that invariant was unpinned. If the green fast path ever expands to touch includes/plugins/warnings/BOM handling/alignment, a divergence there would ship with zero differential coverage. Now it trips the fuzzer and the corpus test instead.
How
Same field list added to both comparison sites, cross-referenced in comments so they stay in sync.
alignmentcompares viaPartialEqin the fuzz target (it derivesEq); everything else via the existingDebug-string convention.Testing
parse_green_eq_red_corpusgreen with the extended 11-field tuple..beancount/.beanfixtures throughparsevsparse_red_onlywith the extended tuple — zero divergences, as expected.cargo checkon its manifest); clippy/fmt clean.🤖 Generated with Claude Code