Skip to content

Build execution substrate for supervised processes#816

Draft
ghostwriternr wants to merge 1 commit into
nextfrom
naresh/process-stack/01-execution-substrate
Draft

Build execution substrate for supervised processes#816
ghostwriternr wants to merge 1 commit into
nextfrom
naresh/process-stack/01-execution-substrate

Conversation

@ghostwriternr

@ghostwriternr ghostwriternr commented Jul 15, 2026

Copy link
Copy Markdown
Member

Rebuild @repo/sandbox-execution into 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 tini reaper 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:

Migrations — each builds on  5  #819:

@changeset-bot

changeset-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: de63c03

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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.
@ghostwriternr ghostwriternr force-pushed the naresh/process-stack/01-execution-substrate branch from d4234c8 to 8c9028e Compare July 15, 2026 10:28

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@ghostwriternr ghostwriternr force-pushed the naresh/process-stack/01-execution-substrate branch from 8c9028e to edd3796 Compare July 15, 2026 11:58
@ghostwriternr ghostwriternr marked this pull request as ready for review July 15, 2026 13:26
@ghostwriternr ghostwriternr marked this pull request as draft July 15, 2026 14:58
@ghostwriternr ghostwriternr force-pushed the naresh/process-stack/01-execution-substrate branch from edd3796 to de63c03 Compare July 15, 2026 14:59
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