Skip to content

fix(launch): bind runtime bytes to the verified RVF executable - #47

Merged
ruvnet merged 2 commits into
mainfrom
fix/19-bind-executed-module
Aug 23, 2026
Merged

fix(launch): bind runtime bytes to the verified RVF executable#47
ruvnet merged 2 commits into
mainfrom
fix/19-bind-executed-module

Conversation

@ruvnet

@ruvnet ruvnet commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Rebase of #22 by @proffesor-for-testing onto current main, with the discriminant collision resolved. Original authorship preserved in the commit.

The gap

Instance::start and Instance::restore accepted a module byte 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 a VerifiedExecutable per executable segment — segment id, type, exact byte length, and SHA-256 of the payload — on the VerificationReport, explicitly execution-eligible only when report.ok is true. Instance gains guard_executable, called on both start and the Created branch of restore, which refuses bytes that don't match and emits an ExecutableRejected witness record before returning ExecutableMismatch.

Conflict resolution

main had independently added ContextPermitMismatch / ContextPermitRejected = 10 in the same two enums. Both changes are wanted and both claimed discriminant 10. Resolved by keeping both and moving ExecutableRejected to 11, updating the decode arm, widening ALL to 11, and folding the duplicated match arms in action_kind, is_refusal, and From<LaunchError> for RvmError into single arms listing both variants.

proof_tier keeps ExecutableRejected at tier 2 while ContextPermitRejected falls through to tier 1, matching each event's documented row.

Verification

cargo check --workspace --locked clean; 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

The conflict resolution hand-wrote the widened arms in error.rs and
witness.rs; rustfmt collapses both back to single-line bodies.
@ruvnet
ruvnet merged commit 2c4a076 into main Aug 23, 2026
7 of 8 checks passed
@ruvnet
ruvnet deleted the fix/19-bind-executed-module branch August 23, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants