Implement Sandbox code mode runtime - #2
Conversation
|
@codex PTAL |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 83f83bee06
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a8470a0e63
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Why
@torkbot/code-mode@0.2.0exposes a substrate-neutralNode24RuntimeHostcontract and models runtime channels as standard Web Streams. This package can therefore own the complete Sandbox integration without copying code-mode internals, adapting between equivalent stream shapes, or teaching code mode about Sandbox.The integration starts with the composable primitive: a Sandbox implementation of
Node24RuntimeHostfor a caller-owned, already bootedSandboxInstance. Callers compose that host withNode24Runtime; booting, lifecycle ownership, and any future convenience API remain separate policy layers.What changed
createSandboxNodeRuntimeHost(), which returns the public structuralNode24RuntimeHostcontractNode24Runtime; do not add a runtime subclass or inheritance-only wrapperSandboxInstance, absolute guestcwd, and guestnodePathReadableStreamandWritableStream, preserving their identity@torkbot/code-mode@^0.2.0and@torkbot/sandbox@^0.14.0contractsValidation
npm ciwith zero audit findingsnpm run typechecknpm test— 8 passing launch, exact stream pass-through, path validation, ownership, failure, abort, and package-surface testsnpm run buildcreateSandboxNodeRuntimeHostnpm pack --dry-rungit diff --checkKnown external test boundary
The currently published
@torkbot/sandbox-image-alpine-3.23-agentpackage declares a peer dependency on@torkbot/sandbox@^0.13.0, while process pipes require Sandbox 0.14. A real-image conformance test would therefore require overriding an upstream package constraint. This PR does not add that workaround; its tests exercise the exact released Sandbox 0.14 process contract directly.