Commit Graph

10198 Commits

Author SHA1 Message Date
Tianyi Cui
33312c6a89 Merge pull request #796 from deepseek-harness/worktree/e2b-poc-20260727
feat(e2b): add one-sandbox FS/subprocess POC
2026-08-08 23:15:49 +08:00
Tianyi Cui
450ec99325 fix(e2b): address the v7 review round
- restore the parent's AGENTS.md body around this branch's e2b row (the
  replay had resurrected the pre-profile-CLI layout, deleting the api/,
  bundle/, settings/, and credentials/ groups); the fs/lsp row
  condensations stay for the word budget
- aggregate the composite rollback failure, not the original error, when
  private state cleanup also fails — a surviving remote group is no
  longer hidden by a later cleanup error (triple-failure regression)
- own the state directory before the makeDir RPC, matching the terminal
  transaction, so a cancellation racing a committed creation still
  enters cleanup
- drop the hidden pollMs parameter defaults; the schemastery default is
  the one home, and tests pass the cadence explicitly
- restore spawn/spawnTerminal graceMs validation to the seam's
  documented bound (the earlier removal cited subprocess-local as not
  validating; it does), with rejection regressions
2026-08-08 22:52:25 +08:00
Tianyi Cui
10fc9405c7 docs(e2b): re-home the overlay section on master's README
Master rewrote the headless README around the profile CLI and removed
cli-demo; the replay had resurrected the old body. The branch's claim is
the E2B overlay section alone, now inserted into master's text with the
credential-gated live composition e2e as the runnable instruction (the
config-file demo runner no longer exists).
2026-08-08 22:19:14 +08:00
Tianyi Cui
0569437ff3 chore(rebase): regenerate third-party notices and the module graph
Master turned THIRD_PARTY_NOTICES.md into generator output (the branch's
hand-added e2b row carried a stale dotenv entry), and the cascade's
ours-side resolution flattened the module graph to the parent's content;
both regenerate from the current tree.
2026-08-08 22:19:13 +08:00
Tianyi Cui
e0a31475fc chore(rebase): re-record the packages-README pairing after the cascade
The parent's round-two replay restored master's pairing record while
this branch's e2b group row changes both sides; re-record the pair.
2026-08-08 22:19:13 +08:00
Tianyi Cui
72419bc333 test(e2b): cover the environment tombstone removal
The serializer's undefined-tombstone branch (from the seam's
NodeJS.ProcessEnv migration) removes an ambient entry; the composition
env test now exercises it against the scrubbed ambient KEEP entry.
2026-08-08 22:19:13 +08:00
Tianyi Cui
55c0a44bd9 fix(e2b): trim published files to the hardened allowlist
Master's publication hardening enforces the exact package files list;
the three E2B manifests still published src and d.ts maps.
2026-08-08 22:19:13 +08:00
Tianyi Cui
d488330ba4 fix(rebase): migrate the replayed E2B branch onto the rebased parent
The linear replay carried old-lineage content over parent-owned files;
this checkpoint restores them and adapts the branch to the parent's
post-rebase seam:

- restore all pty/lsp/subprocess/code-runtime surfaces to the parent's
  exact content (this branch claims none of them) and drop the net-zero
  code-runtime-e2b/pty-e2b/lsp-e2b residue and its registrations
- widen serializeRemoteEnvironment to the seam's NodeJS.ProcessEnv
  tombstone contract: an explicit undefined removes an ambient entry
- migrate the two E2B fixture Agent stubs to the Inbox-model interface
  and Session.create
- re-apply the branch's gen-doc-graphs roles, THIRD_PARTY_NOTICES e2b
  row, and packages/README group row (trimmed to the doc budget);
  regenerate catalogs and re-record bilingual pairings
2026-08-08 22:19:13 +08:00
Tianyi Cui
6e1ae76c9b test(e2b): satisfy the steer() receipt signature in Agent stubs
Master's steering-receipt API (agent.steer returns SteeringReceipt) reached
this branch through the parent sync; the two E2B live-fixture Agent stubs
return the same rejected-outcome receipt the pty test stubs use.
2026-08-08 22:19:13 +08:00
Tianyi Cui
f5866fc202 fix(e2b): address review round on cadence config, disposal, and SDK edge cases
- subprocess-e2b: the 20 ms remote poll cadence becomes a validated pollMs
  Config field (each tick is one control-plane request); the README documents
  the latency-versus-request-count trade.
- subprocess-e2b: extract src/remote.ts owning asError, signalOpts,
  commandOpts, delay, waitTick, and one tolerant signalRemoteGroups shared by
  the pgid-keyed process ladder and sid-keyed terminal ladder, so the two
  teardown paths keep identical error tolerance.
- subprocess-e2b: service disposal aggregates sibling cleanup failures into
  one AggregateError instead of discarding all but the first.
- subprocess-e2b: waitForProcessGroupId refuses published group ids <= 1, so
  a same-UID rewrite of the pid file cannot aim termination at kill -- -1;
  README documents the same-UID control-state limitation.
- subprocess-e2b: drain-grace expiry now releases an inherited-output E2B
  callback blocked on host backpressure before disconnecting, so the SDK
  settlement cannot stay pinned behind an unread host stream.
- subprocess-e2b: spawn/spawnTerminal stop validating typed spec fields
  (trust-TypeScript rule; pty-local validates its config before specs exist);
  resolveExecutable rejects separator-containing relative paths per the seam
  contract; terminal setups tracked as a Set of records.
- subprocess-e2b: PTY output push-without-backpressure is a documented
  contract (flowing consumer folds bytes; paused consumer buffers).
- fs-e2b: streamText normalizes the pinned SDK's empty-file '' return into an
  empty stream instead of throwing on getReader().
- e2b overlays: comment the one-world cwd invariant across e2b.cwd,
  workspaceRoot, and bash-local's implicit default workdir.
2026-08-08 22:19:13 +08:00
Tianyi Cui
e6b3afbee9 docs(e2b): remove code runtime residue 2026-08-08 22:19:13 +08:00
Tianyi Cui
26b18ba189 refactor(e2b): keep code runtime host-local 2026-08-08 22:19:13 +08:00
Tianyi Cui
258bd4456b test(e2b): poll sandbox list convergence 2026-08-08 22:19:13 +08:00
Tianyi Cui
b1b2d63785 refactor(e2b): drop speculative cleanup retry state 2026-08-08 22:19:13 +08:00
Tianyi Cui
de77310c6f refactor(e2b): narrow the sandbox POC 2026-08-08 22:19:13 +08:00
Tianyi Cui
bb0be75d85 refactor(e2b): drop obsolete host sandbox overlay 2026-08-08 22:19:12 +08:00
Tianyi Cui
e8d5599945 refactor(e2b): narrow settlement polling helper 2026-08-08 22:19:12 +08:00
Tianyi Cui
677541d123 fix(e2b): close proven provider boundary gaps 2026-08-08 22:19:12 +08:00
Tianyi Cui
917a7493f7 refactor(e2b): keep provider layer substrate-only 2026-08-08 22:19:12 +08:00
Tianyi Cui
65b345c96a test(e2b): tolerate real-provider runtime latency 2026-08-08 22:19:12 +08:00
Tianyi Cui
81e2e1f647 fix(e2b): harden SDK shell and cleanup boundaries
E2B starts command and PTY requests through login shells, so isolate each control shell behind a fresh randomized HOME and blank sandbox credential names before mutable profiles can run. Preserve the real remote HOME only for the requested argv.

Collapse duplicate termination state, keep failed force cleanup retryable until quiescence is observed, and make terminal state allocation cancellable. Leave numeric PGID reuse as an explicit provider-level TODO because a userspace precheck would remain TOCTOU.
2026-08-08 22:19:12 +08:00
Tianyi Cui
091af03a81 fix(e2b): harden remote startup and teardown 2026-08-08 22:19:12 +08:00
Tianyi Cui
ca79f4364c test(e2b): prove stale interrupt isolation 2026-08-08 22:19:12 +08:00
Tianyi Cui
c122d984c4 fix(e2b): harden cancellation and teardown boundaries 2026-08-08 22:19:12 +08:00
Tianyi Cui
cf4b721a8d test(e2b): snapshot provider-neutral overlay surface 2026-08-08 22:19:12 +08:00
Tianyi Cui
896bcd64a1 fix(e2b): await teardown and honor published status 2026-08-08 22:19:12 +08:00
Tianyi Cui
d0648446c9 fix(e2b): close final lifecycle gaps 2026-08-08 22:19:12 +08:00
Tianyi Cui
219999cd2f fix(e2b): close adapter lifecycle review gaps 2026-08-08 22:19:12 +08:00
Tianyi Cui
f5306f6e89 docs(e2b): record subprocess teardown contract 2026-08-08 22:19:12 +08:00
Tianyi Cui
ed5d21277f test(e2b): observe disposal before spawn fence 2026-08-08 22:19:12 +08:00
Tianyi Cui
022841027f fix(e2b): fence teardown and terminal publication 2026-08-08 22:19:12 +08:00
Tianyi Cui
e9bef2967d fix(e2b): preserve signals after output drain 2026-08-08 22:19:11 +08:00
Tianyi Cui
ec0310ca1b fix(e2b): harden remote teardown transactions 2026-08-08 22:19:11 +08:00
Tianyi Cui
62df6d0c09 refactor(e2b): share environment scrubbing 2026-08-08 22:19:11 +08:00
Tianyi Cui
fd78d9bc58 fix(e2b): harden remote process lifecycle 2026-08-08 22:19:11 +08:00
Tianyi Cui
8877f5d582 fix(e2b): normalize relative executable paths 2026-08-08 22:19:11 +08:00
Tianyi Cui
2188cb908c refactor(e2b): delegate terminal lifecycle 2026-08-08 22:19:11 +08:00
Tianyi Cui
2abc9823e7 refactor(e2b): compose portable runtime consumers 2026-08-08 22:19:11 +08:00
Tianyi Cui
97496c3d00 fix(e2b): close remaining remote lifecycle races 2026-08-08 22:19:11 +08:00
Tianyi Cui
64b4669a74 docs(packages): fit merged group map budget 2026-08-08 22:19:11 +08:00
Tianyi Cui
3e343b4477 fix(e2b): harden remote adapter boundaries 2026-08-08 22:19:11 +08:00
Tianyi Cui
dc44f93c39 fix(e2b): simplify setup abort wait 2026-08-08 22:19:11 +08:00
Tianyi Cui
bccad1bb31 fix(e2b): normalize setup rejection reasons 2026-08-08 22:19:11 +08:00
Tianyi Cui
3dea36f1ce fix(e2b): close remote lifecycle gaps 2026-08-08 22:19:10 +08:00
Tianyi Cui
e64d40837c refactor(e2b): group remote providers 2026-08-08 22:19:10 +08:00
Tianyi Cui
6667102890 Add E2B PTY, LSP, and code runtime providers 2026-08-08 22:19:10 +08:00
Tianyi Cui
e7b682f1f6 feat(e2b): add remote runtime providers 2026-08-08 22:19:10 +08:00
Tianyi Cui
b9b25f81cb fix(subprocess-local): fence descendant adoption on the shell's start identity
A recycled shell pid could donate an unrelated process's children to the
terminal session's cleanup signalling: post-exit rescans queried
processTree/processSession by numeric pid alone. The handle now captures
the spawned shell's start identity at construction and adopts newly
scanned members only while the root pid still carries it; already-adopted
members keep their own identities, which every signal already rechecks.
Regressions cover a recycled root donating an imposter child and a shell
whose identity was never observable; the terminal fakes now model the
root row the real /proc and ps scans include.

Also from the review round: tool-pty's dependency list is re-sorted, and
the LSP renderer documents the deliberate drive-letter reading of
ambiguous file: URIs (display-only blast radius).
2026-08-08 22:17:54 +08:00
Tianyi Cui
d47df8ff9d chore(rebase): refresh generated docs after the round-two replay
Restores master's vitest config and packages-README pairing record (the
replay had carried old-lineage copies; this branch claims neither), and
regenerates the doc graphs, catalogs, and architecture pairing the
replay's ours-side resolutions had flattened to master's content.
2026-08-08 21:28:00 +08:00
Tianyi Cui
fbceb8dcd5 fix(pty-local): restore the session-resolved workspace policy
The linear replay resurrected the July spawn path: mode folded inline
and both confinement and the default cwd fenced to the deployment
workspaceRoot. Master (and the pre-rebase merge result) resolve the
policy once per spawn — resolve({ session }) — so session.header.cwd
is both the workspace-write boundary and the default shell cwd, as the
README already states. Restores the single resolve, threads the policy
through spawnArgv and the cwd fallback, re-expresses master's
session-root test on the terminal spec, and pins the recorded confine
policy in the explicit-cwd test.

Also from the same review round: the Python SDK exe build stages
pty.node from subprocess-local (node-pty's home since the relocation),
and fs-local's README counts the seam's eleven primitives.
2026-08-08 21:28:00 +08:00