Repository navigation
ci(tla): restore the TLC counterexample → Rust-test converter; check all specs per run - #1684
Merged
Merged
Conversation
… all specs per run Restores the formal-verification roadmap's 'Now' item (the workflow that once produced tla_fifo_bug_test.rs, whose converter was deleted in spring cleaning and documented in-workflow as 'removed pending someone porting it'). - scripts/tla-trace-to-test.py: parses TLC error traces (ports the retired tla_trace_to_json.py value parser) and emits Rust regression-test skeletons — concrete Inventory calls for the inventory/booking spec family (state diffs -> Add/Reduce), a pinned-trace #[ignore] skeleton for other specs. --self-test with canned traces. - tla.yml: the 16 uniform TLC steps become one loop that checks EVERY spec per run (fail-fast previously masked later spec failures), tees each output to tlc-logs/, and on failure converts every counterexample into a test skeleton in the job summary + artifact. - Fixes a stale trigger path: 'crates/rustledger-core/src/inventory.rs' predates inventory/ becoming a directory, so inventory changes (e.g. the #1677 reduction fix) stopped triggering the models entirely. Now inventory/**, plus the converter and the workflow itself. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
Restores the TLC counterexample → Rust regression-test converter and updates the TLA+ CI workflow to run all specs in one pass while capturing per-spec logs for counterexample conversion.
Changes:
- Added
scripts/tla-trace-to-test.pyto parse TLC error traces and emit Rust test skeletons (inventory-family inference + generic pinned-trace fallback). - Refactored
.github/workflows/tla.ymlto loop over all specs per run, tee each TLC output intotlc-logs/, and convert counterexamples into Rust skeletons on failure. - Fixed workflow trigger paths so inventory changes under
crates/rustledger-core/src/inventory/**correctly trigger model checking again.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripts/tla-trace-to-test.py | Adds the TLC trace parser + Rust test skeleton emitter for counterexample-driven regression pinning. |
| .github/workflows/tla.yml | Runs all specs in a loop, persists TLC logs, converts counterexamples to Rust skeletons, and fixes triggering paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
✅ Compatibility Test Results
What's tested
Full results available in workflow artifacts |
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.
Second of two formal-verification PRs (companion to #1683) — implements the roadmap's "Now" item: "Restore the TLA+ trace → Rust-test converter". The old converter was deleted in spring cleaning; the workflow itself carries a comment documenting the resulting dead step.
scripts/tla-trace-to-test.pyParses TLC error traces (porting the retired
tla_trace_to_json.pyvalue parser: sets, sequences, records, functions) and emits Rust regression-test skeletons:inventory/totalAdded/… vars): consecutive states are diffed into concreteInventory::add/reducecalls, in the exact style of the hand-madetla_fifo_bug_test.rs.#[ignore]d skeleton.--self-testwith canned traces (runs in CI before converting).tla.ymlimprovements (validated, not just moved)tlc-logs/; on failure, every counterexample becomes a Rust test skeleton in the job summary + artifact.crates/rustledger-core/src/inventory.rspredatesinventory/becoming a directory — meaning inventory changes stopped triggering the models at all (the fix(core): failed reductions must not mutate inventory + booking property tests #1677 reduction fix wouldn't have run TLC). Nowinventory/**+ the converter + the workflow itself.This PR touches
tla.yml, so the full 16-spec model check runs on this PR as its own verification.🤖 Generated with Claude Code