Repository navigation
Pin the verdict of every obligation in the golden suite - #23
Open
evertonfraga wants to merge 1 commit into
Open
evertonfraga wants to merge 1 commit into
evertonfraga wants to merge 1 commit into
Conversation
The golden files recorded only the section counts and totals, so a change that proved one property and refuted another, keeping the counts, passed: swapping the two verdicts in short_circuit.sol left CI green. A fixture without a golden file got one generated, so it ran unchecked, and a crash reported as `uncaught exception:` was not captured at all. test/run_tests.sh now compares, per fixture: - every obligation as `<verdict> <line>: <description>`, sorted by line and description, plus the totals line; - translation failures (`Exception:` and now `uncaught exception:`) and the first line of each internal `BUG:` diagnostic, from stderr; - the warnings, as before (`.warnings`). Fixture comments that state an intended outcome (`// Passes`, `// Fails`, `// Refuted`, `// Not proven`, 58 of them in 53 fixtures) are checked against the verdicts of the obligations below them, so a golden file cannot be regenerated into a contradiction of the fixture's own intent. Under CI (`CI` set) a missing golden or warnings file fails instead of being written. `UPDATE=1` rewrites every golden file after a deliberate change. The 53 golden files are regenerated in the new format. No verdict changed: each fixture lists the same number of proven, refuted and unknown obligations as its old section counts (414 in total), with the same totals and exception lines. environment.sol and external_calls.sol now also record the `BUG: static call to this_address …` diagnostic they print. internal_calls.sol: `depositWrong`'s comment said "Refuted"; its obligation has been unknown since the fixture was added, which still means it is not proven. The comment now says "Not proven".
This was referenced Oct 23, 2026
This branch has not been deployed
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.
Summary
The golden suite now compares each obligation's verdict, checks the fixtures' own intended-outcome comments, and fails in CI when a fixture has no golden file.
test/run_tests.shCompares, per fixture:
<verdict> <line>: <description>, sorted by line and description, plus the totals line;Exception:lines and, newly,uncaught exception:lines from stderr;BUG:diagnostic from stderr;.warnings).Previously only the section counts and totals were compared, so swapping a proven and a refuted verdict in
short_circuit.solstill passed.Checks fixture comments that start with
// Passes,// Fails,// Refutedor// Not proven(58 in 53 fixtures) against the verdicts of the obligations below them, up to the next such comment:PassesRefutedFails,Not provenUnder CI (
CIset), a missing.expectedor.warningsfile fails instead of being generated.UPDATE=1 bash test/run_tests.shrewrites the golden files after a deliberate change.Golden files
All 53 regenerated in the new format. No verdict changed: for every fixture the number of proven, refuted and unknown obligations equals its old section counts (414 obligations in total), and the totals and
Exception:lines are identical.environmentandexternal_callsnow also record theBUG: static call to this_address …line they print.Other changes
test/examples/internal_calls.sol:depositWrong's comment said "Refuted", but its obligation has been ❓ since the fixture was added. The comment now says "Not proven".README.md: explains the golden format, the outcome comments andUPDATE=1.Testing
CI=true bash test/run_tests.sh: 53 passed, 0 failed; exit-code contract 8/8.CI=true, a fixture with no golden file and one with no.warningsfile both fail, and nothing is written; locally both are generated;uncaught exception:crash is recorded in the golden.