Build execution substrate for supervised processes#816
Draft
ghostwriternr wants to merge 1 commit into
Draft
Conversation
|
This was referenced Jul 15, 2026
Introduce the argv-only execution substrate that owns process supervision, byte-first output logging, cursor-based replay, process trees, and the PTY primitive. This package is the single source of Linux/Bun process mechanics and stays independent of shared contracts, capnweb, and Cloudflare types. Remove the persistent command-session, stateless runner, and legacy terminal modules; the Sandbox is the long-running computer and every command is a fresh supervised process rather than shell state carried across calls.
d4234c8 to
8c9028e
Compare
8c9028e to
edd3796
Compare
edd3796 to
de63c03
Compare
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.
Rebuild
@repo/sandbox-executioninto a byte-first, argv-only substrate for supervised processes and PTYs, replacing the persistent command-session machinery it used to carry.The old substrate tied execution to a long-lived shell, multiplexed output as interleaved text/base64, and kept a second, parallel PTY implementation. That coupling is what made recovery, cancellation, and output framing hard to reason about upstream. This replaces it with one supervisor that launches argv processes and owns the process tree (including reaping descendants), and one log engine — a sequenced byte log with bounded retention and cursor-based replay/follow — shared by both processes and the canonical PTY primitive. Output stays raw bytes end to end; decoding is a consumption-time concern for higher layers.
The package deliberately depends on nothing from
@repo/shared, capnweb, Cloudflare/Durable Object types, or SDK ID and readiness policy. It is the pure Linux/Bun execution layer; the container and SDK layers adapt it.The package itself typechecks and its Docker-backed tests pass. Repository-wide consumers are migrated in the following PRs, so the full monorepo is not expected to typecheck at this intermediate stack point. The process-group tests rely on the
tinireaper in the sandbox images, and a negative control proves the redirected-descendant test genuinely fails without it.Part of the unified process-execution stack.
Core stack — each builds on the previous:
nextMigrations — each builds on 5 #819: