fix(launch): bind runtime bytes to the verified RVF executable - #47
Merged
Conversation
The conflict resolution hand-wrote the widened arms in error.rs and witness.rs; rustfmt collapses both back to single-line bodies.
6 tasks
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.
Rebase of #22 by @proffesor-for-testing onto current
main, with the discriminant collision resolved. Original authorship preserved in the commit.The gap
Instance::startandInstance::restoreaccepted amodulebyte slice that was never checked against the RVF that had just been verified. Verification proved something about one set of bytes; execution could then run a different set. Nothing in the type system connected them.The fix
verify()now retains aVerifiedExecutableper executable segment — segment id, type, exact byte length, and SHA-256 of the payload — on theVerificationReport, explicitly execution-eligible only whenreport.okis true.Instancegainsguard_executable, called on bothstartand theCreatedbranch ofrestore, which refuses bytes that don't match and emits anExecutableRejectedwitness record before returningExecutableMismatch.Conflict resolution
mainhad independently addedContextPermitMismatch/ContextPermitRejected = 10in the same two enums. Both changes are wanted and both claimed discriminant 10. Resolved by keeping both and movingExecutableRejectedto11, updating the decode arm, wideningALLto 11, and folding the duplicated match arms inaction_kind,is_refusal, andFrom<LaunchError> for RvmErrorinto single arms listing both variants.proof_tierkeepsExecutableRejectedat tier 2 whileContextPermitRejectedfalls through to tier 1, matching each event's documented row.Verification
cargo check --workspace --lockedclean; 1,279 tests pass, 0 fail. The witness encode/decode round-trip covers the renumbered discriminant.Closes #22.
🤖 Generated with claude-flow
https://claude.ai/code/session_016QSCkKnxDjqU49NVVpWMK5