Skip to content

ci(compat): error-count metric on both-fail files + gate on check regressions - #1678

Merged
robcohen merged 1 commit into
mainfrom
chore/compat-check-gates
Jul 1, 2026
Merged

robcohen merged 1 commit into
mainfrom
chore/compat-check-gates

Conversation

@robcohen

@robcohen robcohen commented Jul 1, 2026

Copy link
Copy Markdown
Member

Implements improvement idea #3 — narrowed to the two genuine deltas after validating that check-verdict comparison already exists in compat.yml.

1. error_count_match metric (report-only)

On files both tools reject, compare exact error counts. check_match/error_presence_match are structurally blind to the #1668 classes — a duplicated diagnostic on one side (#1668.1 oversell ×2) or a missing dedicated diagnostic on the other (#1668.2 balance currency) leaves both verdicts agreeing. Exact counts catch both. Surfaced as a summary section (top mismatching files) + error_count_files/matches/pct outputs; promote to a gate once the live metric is clean.

2. Gate on check regressions

The BQL step already fails on baseline regressions (--baseline); check regressions were only printed and written to compat-regressions.txt. New final step fails the job when regression_count != 0 — positioned last so BQL, charts, the PR comment, and the compatibility-branch commit still run (one-shot red alert; details persist in compat-regressions.txt on the compatibility branch).

Verification

  • Workflow YAML parses; every inline-python heredoc compiles (py_compile).
  • New fields ride the existing asdict JSONL serialization; the regression detector's prev.get(...) reads are unaffected.

🤖 Generated with Claude Code

…ressions

Two deltas to the check-comparison step (validated against #1668's bug classes):

1. error_count_match — exact error-count agreement on files BOTH tools reject.
   check_match/error_presence_match are blind to a duplicated diagnostic on one
   side or a missing dedicated diagnostic on the other (both fail -> verdicts
   agree); exact counts catch both (#1668.1 duplicate oversell, #1668.2 missing
   balance-currency diagnostic). Report-only: summary section + error_count_*
   outputs; promote to a gate once the metric is clean.

2. Gate on check regressions — the job now fails when a file that matched on
   the previous run mismatches now, mirroring the BQL step's --baseline exit.
   Previously regressions were only printed + written to compat-regressions.txt.
   Runs as the LAST step so BQL, charts, the PR comment, and the
   compatibility-branch commit still happen (one-shot red alert).

YAML parses; all inline-python heredocs py_compile clean.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@robcohen
robcohen requested a review from a team as a code owner July 1, 2026 21:29
Copilot AI review requested due to automatic review settings July 1, 2026 21:29
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

✅ Compatibility Test Results

Metric Result
Check Compatibility 100%
BQL Compatibility 100%
Full AST Match 100%
Total Files 792
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

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 enhances the compatibility CI workflow by adding a diagnostic-level metric to detect “both tools fail, but error quality differs” cases, and by turning “check regressions vs previous run” into a hard CI gate (while still allowing charts/comments/baseline commit steps to run before failing).

Changes:

  • Add an error_count_match metric (evaluated only on files where both tools emit errors) and expose error_count_files/matches/pct as workflow outputs.
  • Add a final workflow step that fails the job when regression_count != 0 (check regressions), mirroring the existing BQL regression gate behavior.

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

Comment thread .github/workflows/compat.yml Resolved
@robcohen
robcohen merged commit 2cc69bd into main Jul 1, 2026
73 of 75 checks passed
@robcohen
robcohen deleted the chore/compat-check-gates branch July 1, 2026 22:07
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