Hide the sandbox implementation from the harness's public API - #20
Conversation
The package exported MxcSandbox and MxcSandboxSettings, baking the @microsoft/mxc-sdk dependency into consumer code, and the settings and createHarnessPolicy signatures leaked the SDK's SandboxPolicy and SandboxSpawnOptions types. The sandbox is ours; which SDK enforces it is an implementation detail. - Rename MxcSandbox/MxcSandboxSettings to HarnessSandbox/HarnessSandboxSettings. - Fold the policy knobs (readonlyPaths, allowedHosts, timeoutMs) into the sandbox settings; the sandbox builds its SDK policy internally, so createHarnessPolicy, HarnessPolicySettings, and sandboxPolicyVersion leave the public surface. - Delete assertHarnessPolicy: with injection gone, the policy satisfies the harness invariants by construction. - Drop the unused spawn passthrough, the last SDK type in the settings. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TUJ2eCbU3JKNV4yZvvMJoE
|
Warning Review limit reached
Next review available in: 54 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
The harness package exported
MxcSandboxandMxcSandboxSettings, baking the@microsoft/mxc-sdkdependency name into consumer code — and the exported signatures leaked the SDK'sSandboxPolicyandSandboxSpawnOptionstypes directly. The sandbox is ours; which SDK enforces it is an implementation detail.Changes
MxcSandbox/MxcSandboxSettings→HarnessSandbox/HarnessSandboxSettings, matching the package's existing naming (defineTrainingHarness,WriteAheadAgentBus).readonlyPaths,allowedHosts, andtimeoutMsnow live onHarnessSandboxSettings; the sandbox builds its SDK policy internally.createHarnessPolicy,HarnessPolicySettings, andsandboxPolicyVersionleave the public surface, which also stops consumers from repeating the workspace path in two places.assertHarnessPolicy. With policy injection gone, every policy is built bycreateSandboxPolicyand satisfies the harness invariants (workspace-confined writes, no local network, allowlist-only outbound, no UI/clipboard/input) by construction.spawnpassthrough, the last SDK type in the settings; nothing used it.The public
index.d.tsno longer references@microsoft/mxc-sdkanywhere — the only remaining import is in the internal, unexportedpolicymodule.Verification
npm run typecheckpasses and all 81 tests pass (npm test), including the sandbox gating and symlink-escape suites, updated to the new constructor shape.🤖 Generated with Claude Code
https://claude.ai/code/session_01TUJ2eCbU3JKNV4yZvvMJoE
Generated by Claude Code