fix: accept software-only platform at Level 0, reject with clear message at Level 1+ (#16)#17
Merged
Merged
Conversation
…age at Level 1+ (#16) - schemas/trace-claim.json: add "software-only" to the platform enum so the JSON Schema validator no longer rejects it outright. - tr_rte.py: introduce _DEV_PLATFORMS set; check() now accepts an optional level parameter (default 0, matching the TR-SIG pattern). software-only passes TR-RTE-001 at Level 0 and fails with a "development-mode" message at Level 1+, replacing the misleading "unknown platform" error. - runner.py: pass level to tr_rte.check() so the runner propagates the conformance level correctly. - tests/test_software_only_platform.py: 7 new tests covering Level 0 pass, Level 1 and 2 fail, message content, schema acceptance, and default-level behavior. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
schemas/trace-claim.json: addssoftware-onlyto theplatformenum so the JSON Schema no longer rejects it.src/trace_tests/modules/tr_rte.py: introduces_DEV_PLATFORMS;check()gains an optionallevelparameter (default 0, same pattern as TR-SIG).software-onlypasses TR-RTE-001 at Level 0 and fails with a clear "development-mode and not acceptable for hardware-attested levels" message at Level 1+.src/trace_tests/runner.py: forwardsleveltotr_rte.check().tests/test_software_only_platform.py: 7 new tests covering Level 0 pass, Level 1/2 fail, message content, schema acceptance, and default-level behavior.All 105 existing tests continue to pass (112 total with the 7 new ones).
Closes #16.
Test plan
python -m pytestpasses locally (112 passed, 5 xpassed)software-onlyat Level 0 passes TR-RTE-001software-onlyat Level 1 fails TR-RTE-001 with "development-mode" in the messagesoftware-onlyat Level 2 fails TR-RTE-001 with "development-mode" in the messagesoftware-onlyaccepted by JSON SchemaGenerated with Claude Code