Skip to content

feat(ocap-kernel): add evaluate RPC method for vat REPL#817

Draft
rekmarks wants to merge 2 commits intorekm/system-vats-reduxfrom
rekm/vat-evaluate
Draft

feat(ocap-kernel): add evaluate RPC method for vat REPL#817
rekmarks wants to merge 2 commits intorekm/system-vats-reduxfrom
rekm/vat-evaluate

Conversation

@rekmarks
Copy link
Member

@rekmarks rekmarks commented Feb 6, 2026

Add an evaluate RPC method to VatSupervisor that evaluates code in a vat's isolated compartment, enabling REPL functionality while maintaining security isolation from the supervisor.

Key changes:

  • New evaluate.ts RPC spec and handler
  • VatSupervisor creates a separate eval compartment with vat exports in scope
  • VatHandle.evaluate() method for kernel-side API
  • Result serialization for JSON-RPC transport (handles functions, symbols, bigints)
  • Errors return as { success: false, error } without crashing the vat

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

@rekmarks
Copy link
Member Author

rekmarks commented Feb 6, 2026

Warning

This PR is part of a stack and targets branch rekm/system-vats-redux, not main.
DO NOT MERGE until feat: Add system subclusters and kernel facet service #803 is merged into main.

Stack


Managed by gh-stack

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 77.58%
⬇️ -0.60%
6238 / 8040
🔵 Statements 77.52%
⬇️ -0.62%
6338 / 8175
🔵 Functions 76.12%
⬇️ -0.50%
1578 / 2073
🔵 Branches 76.94%
⬇️ -1.44%
2286 / 2971
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/ocap-kernel/src/rpc/vat/evaluate.ts 100% 100% 100% 100%
packages/ocap-kernel/src/rpc/vat/index.ts 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
packages/ocap-kernel/src/vats/VatHandle.ts 84.5%
⬇️ -1.21%
82.14%
🟰 ±0%
94.44%
⬇️ -5.56%
84.5%
⬇️ -1.21%
194-197, 318, 369-374, 376-378, 380-386
packages/ocap-kernel/src/vats/VatSupervisor.ts 52.63%
⬇️ -22.01%
23.07%
⬇️ -21.75%
53.33%
⬇️ -5.00%
53.09%
⬇️ -21.55%
131, 142, 150, 189, 227-231, 242, 251-252, 269-331, 348-350, 353, 357-359, 391-393, 410, 427-435
Generated in workflow #3599 for commit c6c235c by the Vitest Coverage Report Action

rekmarks and others added 2 commits February 6, 2026 15:04
Add an `evaluate` RPC method to VatSupervisor that evaluates code in a vat's isolated compartment, enabling REPL functionality while maintaining security isolation from the supervisor.

Key changes:
- New evaluate.ts RPC spec and handler
- VatSupervisor creates a separate eval compartment with vat exports in scope
- VatHandle.evaluate() method for kernel-side API
- Result serialization for JSON-RPC transport (handles functions, symbols, bigints)
- Errors return as { success: false, error } without crashing the vat

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Surface the vat REPL evaluate capability through the full stack:
- Add evaluateVat to VatManager, Kernel, and KernelFacet
- Add evaluateVat RPC handler in kernel-browser-runtime
- Add Vat REPL tab to kernel-ui with vat selector and code input
- Add useEvaluate hook for the UI

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rekmarks rekmarks force-pushed the rekm/system-vats-redux branch from 48ff5d1 to 31868d8 Compare February 6, 2026 23:04
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.

1 participant