Skip to content

test(compat): print the raw BQL match rate next to the effective one - #1929

Merged
robcohen merged 1 commit into
mainfrom
fix/compat-print-raw-percentage
Aug 3, 2026
Merged

robcohen merged 1 commit into
mainfrom
fix/compat-print-raw-percentage

Conversation

@robcohen

@robcohen robcohen commented Aug 3, 2026

Copy link
Copy Markdown
Member

The compat run reports "BQL match: 93%". That is the effective rate, after KNOWN_PYTHON_DIVERGENCES and KNOWN_RUST_DIVERGENCES absorb pairs where the upstream tool is the one that's wrong. The raw count was printed, but only the effective figure carried a percentage — and the percentage is what gets quoted: release notes, the badge, the job summary.

That's precisely the doubt #1902 raised about this metric: is the headline real, or is the registry doing the work? A reader couldn't answer without opening the script.

The gap also moves, and just moved a lot. #1927 pinned 51 more pairs — every one a proven beanquery#279 case — taking masked pairs from 108 to ~159 and widening the raw-vs-effective difference by roughly 2 points in a single PR. Nothing in the output would have shown that happening.

What changes

Raw match:           2282/2550 (89%)  [nothing masked]
Effective match:     2441/2550 (95%)  [+159 masked, 6 pts over raw]

Same treatment everywhere the number is actually read:

  • GITHUB_OUTPUT gains bql_raw_pct alongside bql_pct
  • the step-summary table gains BQL match (raw, nothing masked) and BQL known divergences masked rows under the existing BQL match — this is the table people quote
  • compat-results.yaml gains raw_match_pct and known_divergences
  • the console recap prints 93% (raw 89%, 4 pts masked)

Scope

Reporting only. No pin is added or removed, the stale-mask gate is untouched, and bql_pct keeps its meaning so the history series and badge stay comparable across runs.

Verified by running the harness, not by reading the diff

Runs tested:         68
Raw match:           0/68 (0%)  [nothing masked]
Known Python diffs:  4
Effective match:     4/68 (5%)  [+4 masked, 5 pts over raw]

Run against a file set chosen because it carries known-divergence pins, so the masked-vs-raw split is genuinely exercised rather than both reading zero. bql_raw_pct=0 and bql_pct=5 were written to GITHUB_OUTPUT in that same run.

  • compat-bql-test.py --self-test: OK (stale/dangling detection unaffected)
  • compat.yml parses

Refs #1902.

The compat run reports "BQL match: 93%". That is the EFFECTIVE rate, after
KNOWN_PYTHON_DIVERGENCES and KNOWN_RUST_DIVERGENCES absorb pairs where the
upstream tool is the one that is wrong. The raw count was printed, but only
the effective figure carried a percentage - and the percentage is what gets
quoted, in release notes, in the badge, and in the job summary.

That is the exact doubt #1902 raised about this metric: is the headline real,
or is the registry doing the work? A reader could not answer it without
opening the script.

The gap also moves, and just moved a lot. #1927 pinned 51 more pairs, every
one a proven beanquery#279 case, taking masked pairs from 108 to about 159
and widening the difference between raw and effective by roughly 2 points in
a single PR. Nothing in the output would have shown that.

So the summary now prints both, plus the size of the masking:

  Raw match:           2282/2550 (89%)  [nothing masked]
  Effective match:     2441/2550 (95%)  [+159 masked, 6 pts over raw]

Same treatment where the number is actually read:

- GITHUB_OUTPUT gains `bql_raw_pct` alongside `bql_pct`
- the step-summary table gains "BQL match (raw, nothing masked)" and
  "BQL known divergences masked" rows under the existing "BQL match"
- compat-results.yaml gains `raw_match_pct` and `known_divergences`
- the console recap prints "93% (raw 89%, 4 pts masked)"

This changes reporting only. No pin is added or removed, the stale-mask gate
is untouched, and `bql_pct` keeps its meaning so the history series and badge
stay comparable across runs.

VERIFIED by running the harness, not by reading the diff:

  Runs tested:         68
  Raw match:           0/68 (0%)  [nothing masked]
  Known Python diffs:  4
  Effective match:     4/68 (5%)  [+4 masked, 5 pts over raw]

on a file set chosen because it carries known-divergence pins, so the
masked-vs-raw split is actually exercised rather than both reading zero.
`bql_raw_pct=0` and `bql_pct=5` were written to GITHUB_OUTPUT in the same run.
Self-test still passes; compat.yml still parses.
@robcohen
robcohen requested a review from a team as a code owner August 3, 2026 11:37
Copilot AI review requested due to automatic review settings August 3, 2026 11:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the visibility and interpretability of the BQL compatibility metric by reporting the raw (unmasked) match percentage alongside the existing effective (masked) match percentage across console output, GitHub Actions outputs, the step summary table, and compat-results.yaml. This directly addresses concerns from #1902 that the headline percentage could be misread without showing how much is attributable to KNOWN_*_DIVERGENCES masking.

Changes:

  • Add raw_pct computation and print raw-vs-effective match details (including masked count and percent-point delta) in scripts/compat-bql-test.py.
  • Export bql_raw_pct via GITHUB_OUTPUT alongside the existing bql_pct.
  • Extend compat.yml to carry bql_raw_pct into YAML results, job outputs, console recap, and the GitHub step-summary table.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
scripts/compat-bql-test.py Computes and prints raw BQL match % and exports it to GITHUB_OUTPUT as bql_raw_pct alongside effective bql_pct.
.github/workflows/compat.yml Threads bql_raw_pct through job outputs, console recap, YAML summary, and the step-summary table (plus shows masked divergence count).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

⚠️ Compatibility Test Results

Metric Result
Check Compatibility 100%
BQL Compatibility 95%
Full AST Match 100%
Total Files 812
What's tested
  • Check: Exit codes and error counts match bean-check
  • BQL: Query results match bean-query
  • Files: ~800 test files downloaded from 10+ beancount repositories

Full results available in workflow artifacts

@robcohen
robcohen merged commit cf93c8e into main Aug 3, 2026
42 checks passed
@robcohen
robcohen deleted the fix/compat-print-raw-percentage branch August 3, 2026 12:45
robcohen added a commit that referenced this pull request Aug 3, 2026
#1929 added the raw rate to the step summary, compat-results.yaml,
GITHUB_OUTPUT and the console recap - but not to the PR comment, which is the
most-read surface in the repo and the one that produced the "BQL
Compatibility 93%" that prompted the change.

The gap this closes is not hypothetical. #1927 pinned 51 proven-upstream
pairs in a single PR and moved the effective figure from 93% to 95% with raw
unchanged underneath. Anyone reading only the headline saw compatibility
improve when nothing about rledger had.

The cell now reads: 95% (raw 89%, 159 masked)

Raw goes INSIDE the existing cell rather than in a new row, so the headline
cannot be quoted without it.

Degrades to the old single-figure cell when the raw key is absent, which is
what a re-run against a pre-#1929 artifact produces - an N/A would be noise.

Verified by running the script logic in node against both shapes: current YAML
gives "95% (raw 89%, 159 masked)", a pre-#1929 one gives "93%", and the
effective key is not shadowed by the raw key (bql_raw_match_pct does not
contain the substring bql_match_pct).

Refs #1902.
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.

2 participants