Skip to content

Hide the sandbox implementation from the harness's public API - #20

Merged
Tyler-R-Kendrick merged 2 commits into
mainfrom
claude/simplify-harness-exports-wcdg6p
Jul 12, 2026
Merged

Hide the sandbox implementation from the harness's public API#20
Tyler-R-Kendrick merged 2 commits into
mainfrom
claude/simplify-harness-exports-wcdg6p

Conversation

@Tyler-R-Kendrick

Copy link
Copy Markdown
Owner

What

The harness package exported MxcSandbox and MxcSandboxSettings, baking the @microsoft/mxc-sdk dependency name into consumer code — and the exported signatures leaked the SDK's SandboxPolicy and SandboxSpawnOptions types directly. The sandbox is ours; which SDK enforces it is an implementation detail.

Changes

  • Rename MxcSandbox / MxcSandboxSettingsHarnessSandbox / HarnessSandboxSettings, matching the package's existing naming (defineTrainingHarness, WriteAheadAgentBus).
  • Fold the policy knobs into the sandbox settings. readonlyPaths, allowedHosts, and timeoutMs now live on HarnessSandboxSettings; the sandbox builds its SDK policy internally. createHarnessPolicy, HarnessPolicySettings, and sandboxPolicyVersion leave the public surface, which also stops consumers from repeating the workspace path in two places.
  • Delete assertHarnessPolicy. With policy injection gone, every policy is built by createSandboxPolicy and satisfies the harness invariants (workspace-confined writes, no local network, allowlist-only outbound, no UI/clipboard/input) by construction.
  • Drop the unused spawn passthrough, the last SDK type in the settings; nothing used it.
  • README updated: MXC is still credited (and its preview warning kept) as prose, just not in the API.

The public index.d.ts no longer references @microsoft/mxc-sdk anywhere — the only remaining import is in the internal, unexported policy module.

Verification

npm run typecheck passes 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

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
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Tyler-R-Kendrick, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fa75be6a-fa6f-4a3f-900e-9bb382201a54

📥 Commits

Reviewing files that changed from the base of the PR and between b751276 and 487e0f6.

📒 Files selected for processing (5)
  • packages/harness/README.md
  • packages/harness/src/index.ts
  • packages/harness/src/policy.ts
  • packages/harness/src/sandbox.ts
  • packages/harness/test/harness.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/simplify-harness-exports-wcdg6p

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Tyler-R-Kendrick
Tyler-R-Kendrick merged commit d5fc664 into main Jul 12, 2026
2 checks passed
@Tyler-R-Kendrick
Tyler-R-Kendrick deleted the claude/simplify-harness-exports-wcdg6p branch July 12, 2026 21:17
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