Repository navigation
fix: make run state and comparison verdicts match their evidence #202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Dong1017
merged 5 commits into
InferMatrixLab:main
from
Dong1017:fix/issue179-runstate-verdict
Oct 28, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
612e7d4
fix: make run state truthful and enforce the metric contract
Dong1017 709066e
fix: make atomic JSON writes survive Windows replace contention
Dong1017 c226765
fix: derive comparison authority instead of trusting stated fields
Dong1017 01bd59c
fix: record unexpected termination failures and re-derive comparison …
Dong1017 d5fd02c
fix: record interruption inside the termination path
Dong1017 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] Handle interruption inside termination as well.
except Exceptiondoes not catchKeyboardInterrupt, and the finalterminate()call (line 196) is outside the outer try/KeyboardInterrupt handler (lines 184–185). Ctrl-C during final snapshot can leave the persisted run running; Ctrl-C inwrite_reportcan leave it marked completed without the report. This is #179's existing terminal-artifact contract and the interruption handling requested in the prior finding. Explicitly persist cancelled/termination-failed state and preserve any original measurement error for termination KeyboardInterrupt, then re-raise; add regressions for interruption in final snapshot and report writing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in
d5fd02ca.terminate()now has an explicitexcept KeyboardInterruptbeforeexcept Exception. It recordsstate: termination_failed,phase: termination, therequested_state, the original measurementerror, andtermination_error: KeyboardInterrupt: ..., then re-raises.Two regressions, both failing on
01bd59c4:test_interruption_while_writing_the_report_is_recorded_as_termination—write_reportraisesKeyboardInterruptaftercompletedwas written. Before: status stayedcompleted. After:termination_failedwithrequested_state: completed.test_interruption_during_final_snapshot_is_recorded_as_termination— the snapshot hook raises on its fourth call, insideterminate(). Before: status stayedrunning. After:termination_failed, and noevaluation.jsonis left behind.Observed before/after on the parent commit:
AssertionError: 'running' != 'termination_failed'andAssertionError: 'completed' != 'termination_failed', both now passing.The pre-existing
KeyboardInterrupthandling for the measurement loop (which recordscancelledand still writes the report) is unchanged, since that path reachesterminate()normally.