Repository navigation
Record a format version in AuditResults.to_dict() - #132
Merged
SushantGautam merged 1 commit intoNov 3, 2026
Merged
Conversation
RepeatedExperimentResults already writes "version": "1.0"; a single run's export had no version, so a consumer of the saved JSON could not tell which shape it was reading. Add the same key to AuditResults. load() does not read it, so files written before it still load.
avalyset
pushed a commit
to avalyset/simpleaudit
that referenced
this pull request
Nov 4, 2026
Record a format version in AuditResults.to_dict()
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.
#114 asks for the export format to be versioned on purpose:
RepeatedExperimentResults.to_dict()writes"version": "1.0", butAuditResults.to_dict()writes no version, so a downstream converter reading a saved single run cannot tell which shape it has.This adds
"version": "1.0"as the first key ofAuditResults.to_dict(), sosave()writes it too.AuditResults.load()reads onlyresultsandtimestamp, so files written before this still load. This covers the first point of #114 only; the second (calling out export-shape changes in release notes) is for the release process, not code.The new test
TestSaveLoadRoundTrip::test_saved_json_carries_format_versionintests/test_audit_flow.pychecks the key into_dict()and in the saved file, and that a file without the key still loads.pytest -n auto(no API keys in the environment) gave 1 failed (the new test), 1861 passed, 4 skipped onmain, and 1862 passed, 4 skipped with the change;ruff check --select E9,F821 .is clean.Design questions:
RepeatedExperimentResultsexport now also carries"version": "1.0", and both document types say"1.0", so the number alone does not tell a converter which document it holds. Would you rather name the keyformat_version, or add a field naming the document type?RepeatedExperimentResultsmove to"1.1", since its nested runs gained a key?AI disclosure: implemented with Claude Code.