test(kernel): two-kernel revocation test - #1028
Open
sirtimid wants to merge 2 commits into
Open
Conversation
Add a two-kernel revocation test to both the fast integration harness and the full e2e suite, covering the five-step scenario from issue #995: export an object via ocap URL, assert the remote peer can invoke it, revoke it through the public kernel.revoke API, assert the peer's next invocation fails with OBJECT_REVOKED, and assert an unrelated bystander object is unaffected. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
sirtimid
enabled auto-merge
August 24, 2026 16:28
Contributor
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
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.
Closes #995.
Revocation is one of the core ocap properties, but nothing previously tested it across the boundary where it matters most — an object exported from kernel A and held by a remote kernel B. This PR adds that test at two levels.
Changes
packages/kernel-test/src/vats/revocation-target-vat.ts— new test vat that exports atargetexo and abystanderexo, issues ocap URLs for both inbootstrap, and exposesgetTarget()/getBystander()so the test can extract the kernel-level KRef for revocation.packages/kernel-test/src/remote-comms.test.ts— new integration test'revokes a cross-kernel object held by a remote peer'added to the existing two-kernel harness (DirectNetworkService, no relay required). Covers the five-step scenario from the issue: export → B invokes → A revokes viakernel.revoke()→ B's next call fails withOBJECT_REVOKED→ bystander unaffected.packages/kernel-node-runtime/test/e2e/remote-comms.test.ts— newdescribe('Revocation')block in the real-relay e2e suite. Uses two instances ofremote-vat.json kernel A (Target + Bystander) and a Sender vat on kernel B, exercising the same five steps over a live libp2p relay.Testing
The integration test runs in
yarn workspace @ocap/kernel-test testand passes in ~2.6 s using the in-memoryDirectNetworkServicemock. The e2e test runs viayarn workspace @metamask/kernel-node-runtime test:e2e:ci(which starts the relay + bundle server) and passes in ~5.9 s over a real libp2p relay. Both test suites pass with no regressions.🤖 Generated with Claude Code
Note
Low Risk
Test-only additions; no production kernel or remote-comms behavior changes in this diff.
Overview
Adds end-to-end and integration tests that exercise ocap revocation when an object exported from kernel A is held and invoked by kernel B.
A new
revocation-target-vattest vat issues ocap URLs for a revocable target and an unrelated bystander, and exposesgetTarget()so tests can obtain a KRef and callkernel1.revoke(). Both suites follow the same five-step flow: remote ping succeeds, revocation on the exporter, the peer’s next call rejects withOBJECT_REVOKED, and calls to the bystander still succeed.Coverage lands in
kernel-test(two-kernel harness with DirectNetworkService) andkernel-node-runtimee2e (real relay, Target/Bystander/Sender vats viasendRemoteMessage).Reviewed by Cursor Bugbot for commit 1ef30b6. Bugbot is set up for automated code reviews on this repo. Configure here.