Repository navigation
feat(ci): randomized nightly synthetic corpus with an absolute differential gate - #1754
Merged
Merged
Conversation
…ential gate The compat workflow generated 50 synthetic files with a FIXED seed (12345) every run — just another fixed corpus. And the only failure gate was baseline-relative (files that matched before and mismatch now), which is structurally blind to a divergence on a never-before-seen file: exactly what a fresh synthetic file is. Now: - nightly (schedule) runs generate 500 files from a FRESH seed (github.run_id); PR/push runs keep 12345/50 for deterministic, baseline-comparable results; - workflow_dispatch gains synthetic_seed/synthetic_count inputs, and the chosen seed lands in the step summary with the exact reproduce command — a nightly divergence is one dispatch away from replay; - a new ABSOLUTE gate fails the run when any synthetic file's check verdict disagrees with Python (synthetic_match != synthetic_total, outputs the comparison script already emitted), printing the divergent files and the seed; - on failure the generated corpus uploads as an artifact (synthetic-corpus-seed-<seed>, 30 days). Validated locally: generator accepts arbitrary seeds (27 files at seed 987654), and a full differential pass of that corpus through rledger check vs bean-check 3.2.3 agrees on every file. Co-Authored-By: Claude Fable 5 <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR upgrades the compat.yml workflow’s “synthetic” generation into a true nightly differential-testing harness by randomizing the seed and scaling the corpus size on scheduled runs, while adding an absolute gate that fails CI on any rledger-vs-Python synthetic verdict mismatch and provides a reproduction path.
Changes:
- Adds
workflow_dispatchinputs to reproduce nightly synthetic divergences via explicitsynthetic_seed/synthetic_count. - Chooses seed/count dynamically: scheduled runs use
github.run_idand 500 files; PR/push runs remain deterministic (12345/50). - Adds an absolute synthetic divergence gate plus an artifact upload of the generated corpus on relevant failures.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
✅ Compatibility Test Results
What's tested
Full results available in workflow artifacts |
- dispatch inputs enter only via env and are validated numeric before
use — inline ${{ inputs.* }} in run: is a shell-injection vector;
- outputs/summary written via quoted printf;
- the divergence lister errors clearly when the results jsonl is
absent instead of raising bare StopIteration;
- the corpus artifact uploads only when the synthetic gate itself
tripped, not on any late-step failure.
Co-Authored-By: Claude Fable 5 <[email protected]>
robcohen
added a commit
that referenced
this pull request
Jul 10, 2026
…nt sync (#1756) * fix(ci): channel-only rust-toolchain.toml — kill the implicit component sync The file listed components/targets, so rustup implicitly synced them on the first cargo invocation of EVERY CI job — a transactional install that intermittently fails on hosted runners ("detected conflict: bin/cargo-clippy", #1754 twice, while identical runs pass: per-runner dice roll). CI jobs already declare components/targets explicitly via dtolnay inputs; with the file channel-only the sync has nothing to do and the class is dead. Non-nix dev setup documented in the file. Co-Authored-By: Claude Fable 5 <[email protected]> * docs: pin the dev setup hint to the toolchain (review) Co-Authored-By: Claude Fable 5 <[email protected]> --------- Co-authored-by: Claude Fable 5 <[email protected]>
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
Turns the compat workflow's synthetic generation into a real differential testing harness: fresh random seed and 10× the corpus every night, with an absolute gate that fails on ANY rledger-vs-Python verdict disagreement — plus one-command reproduction.
Why
Two structural gaps made the existing setup a fixed corpus in disguise:
--seed 12345 --count 50on every run means the "synthetic" corpus never explores a new ledger shape. Every hard bug of the recent review (Correct balances and balsheet reports for reductions in holdings #1726's netting class, fix(validate): catch postings dated before their account's open #1742's use-before-open, the compound-cost class) was a shape no fixture had.How
github.run_id, count = 500. PR/push runs: unchanged (12345/50, deterministic and baseline-comparable).workflow_dispatchgainssynthetic_seed/synthetic_count; the chosen seed + exact replay command land in the step summary of every run.synthetic_match != synthetic_total(outputs the comparison script already emits) → red, with the divergent file list (parsed from the results JSONL, CWD/tmp both handled) and the seed.synthetic-corpus-seed-<seed>, 30-day retention), so the exact divergent inputs survive even without a replay.Validated locally
Generator accepts arbitrary seeds (27 files at seed 987654 = 7 edge-case collections + 20 random), and a full differential pass of that corpus —
rledger checkvsbean-check3.2.3 per file — agrees on all 27.Follow-up (out of scope here)
Generator richness: the synthetic generator's directive coverage (costs, pads, multi-currency) bounds what the harness can find; deepening it multiplies this PR's value and is the natural next step.
🤖 Generated with Claude Code