feat(ocap-kernel): add IO kernel service for vat I/O streams#840
Merged
feat(ocap-kernel): add IO kernel service for vat I/O streams#840
Conversation
2380261 to
95e5017
Compare
Add IO channels as kernel services with read()/write() methods, configured via a new `io` property on ClusterConfig. IO channels are ephemeral, created at subcluster launch and destroyed at termination. MVP implements socket type (Unix domain socket) with line unit only. - Add IOSpec/IOConfig types and ClusterConfig.io field - Add IOChannel/IOChannelFactory interfaces (platform-agnostic) - Add makeIOService() exo factory with direction enforcement - Add IOManager for per-subcluster channel lifecycle - Add KernelServiceManager.unregisterKernelServiceObject() - Add makeSocketIOChannel() Unix domain socket implementation (Node.js) - Integrate IOManager into Kernel and SubclusterManager - Wire makeIOChannelFactory into nodejs makeKernel() - Add unit tests for io-service, IOManager, socket-channel, unregister - Add integration test vat and test (io-vat, io.test.ts) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
95e5017 to
453ff26
Compare
Contributor
Coverage Report
File Coverage |
sirtimid
reviewed
Feb 16, 2026
sirtimid
reviewed
Feb 16, 2026
sirtimid
reviewed
Feb 16, 2026
sirtimid
reviewed
Feb 16, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
sirtimid
previously approved these changes
Feb 17, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
rekmarks
reviewed
Feb 17, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
OMG the Bugbot treadmill ended. |
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
Implements IO kernel services (#831) that enable piping data from the outside world into and out of vats via configurable IO channels.
IOChannel/IOChannelFactoryabstractions andIOManagerfor per-subcluster channel lifecycle managementmakeSocketIOChannel) in the Node.js package with line-delimited framing and single-client acceptanceKernel,SubclusterManager, andKernelServiceManager(including newunregisterKernelServiceObject)ioconfig property toClusterConfigfor declaring named IO channels, wired as kernel services to bootstrap vatsinoutChanges
packages/ocap-kernel/src/types.ts—IOSpec,IOConfigtypes andiofield onClusterConfigStructpackages/ocap-kernel/src/io/— NewIOManager,makeIOService,IOChannel/IOChannelFactorytypespackages/ocap-kernel/src/KernelServiceManager.ts—unregisterKernelServiceObject()methodpackages/ocap-kernel/src/Kernel.ts—ioChannelFactoryoption,IOManagercreationpackages/ocap-kernel/src/vats/SubclusterManager.ts— IO channel create/destroy in launch/terminatepackages/nodejs/src/io/—makeSocketIOChannel(Unix domain socket),makeIOChannelFactorypackages/nodejs/src/kernel/make-kernel.ts— Accepts and defaultsioChannelFactoryTest plan
makeIOService(9 tests) — direction enforcement, read/write delegationIOManager(6 tests) — create/destroy lifecycle, rollback on failure, error handlingunregisterKernelServiceObject(5 tests) — cleanup of krefs, KV entries, pinsmakeSocketIOChannel(12 tests) — connection, line framing, disconnect, cleanup@chainsafe/libp2p-quicmissing package issue)Closes #831
🤖 Generated with Claude Code
Note
Medium Risk
Touches core kernel lifecycle and service registration, adding new resource-management paths (socket servers/files) that can leak or break subcluster launch/termination if mis-handled.
Overview
Adds per-subcluster IO channel support by introducing
IOChannel/IOChannelFactory, anIOManagerthat creates/destroys channels, and aniosection onClusterConfigthat exposes declared channels to vats as kernel services.Integrates IO lifecycle into kernel/subcluster flows:
Kerneloptionally wires anioChannelFactory,SubclusterManagercreates IO services during launch (with rollback on failure) and destroys them on termination/reset, andKernelServiceManagernow supportsunregisterKernelServiceObjectfor proper cleanup.Implements the first Node.js IO backend as a line-delimited Unix domain socket channel (
makeSocketIOChannel) plus a defaultmakeIOChannelFactory, and adds unit/integration tests covering channel framing (including UTF-8 chunk splits), lifecycle cleanup, and end-to-end vat read/write.Written by Cursor Bugbot for commit cbe4883. This will update automatically on new commits. Configure here.