feat(provider): define exact process environments#65
Conversation
tangletools
left a comment
There was a problem hiding this comment.
✅ Auto-approved drewstone PR — eda63ce9
This PR was opened by the trusted drewstone account.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.
tangletools · auto-approval · reason: drewstone_author · 2026-07-18T14:08:47Z
tangletools
left a comment
There was a problem hiding this comment.
🟡 Value Audit — sound-with-nits
| Verdict | sound-with-nits |
| Concerns | 1 (1 weak-concern) |
| Heuristic | 0.0s |
| Duplication | 0.0s |
| Interrogation | 138.7s (2 bridge agents) |
| Total | 138.7s |
💰 Value — sound-with-nits
Adds a single optional provider-neutral exact-process execution contract (with a Tangle adapter and conformance harness) so approved candidates can run on any compliant provider without per-product sandbox plumbing — coherent and in-grain.
- What it does: Defines a new optional
AgentExactProcessProvidercapability on the existingAgentEnvironmentProvider(environment-provider.ts:196-206, :361) covering shell-free spawn, byte-bounded file IO, recoverable process handles, idempotent create with collision rejection, and terminal-reason status. Adds a Tangle Sandbox adapter (agent-provider-tangle/src/exact-process.ts) that maps the contract onto @t - Goals it achieves: Give higher-level runtimes one provider-neutral primitive for executing an approved
AgentCandidateExecution/AgentCandidateExecutionPlanMaterialon any compliant provider, instead of each product hand-writing Sandbox create + spawn + file + recovery + cleanup. README at agent-interface/README.md:65-70 states this explicitly: 'Higher-level runtimes can use this primitive for measured candidates - Assessment: Sound and in the grain of the codebase. The capability is added as an optional member of the existing provider interface rather than a parallel hierarchy, reuses
AgentCandidateTerminationfrom agent-candidate.ts as the terminal-reason type, and matches the existing testkit conformance pattern (runAgentEnvironmentProviderConformance). The Tangle adapter is one focused file with clean helpers, a - Better / existing approach: none — this is the right approach. I checked: (a) the existing
AgentEnvironment.exec?(command, options)at environment-provider.ts:299 is a loose shell-string one-shot tied to the agent-turn model — no recovery, no byte bounds, no idempotency, no attestation; the README at agent-interface/README.md:68 enumerates the seven guarantees that distinguish the new contract from it. (b) `AgentCandidateE - Model: opencode/zai-coding-plan/glm-5.2
- Bridge attempts: 2
- Bridge warning: opencode/kimi-for-coding/k2p7: bridge stream ended without value-audit content
🎯 Usefulness — sound
A provider-neutral, shell-free exact-process primitive that completes the candidate-execution runtime surface already encoded in this repo's schemas — clean, well-tested, no dead or competing surface.
- Integration: The new
AgentExactProcessProvider(environment-provider.ts:196-206) hangs off the establishedAgentEnvironmentProvidervia an optionalexactProcessfield (environment-provider.ts:361), mirrors the existingcreate/get/listshape, and is wired throughcreateTangleProvider({ exactProcess: {} })(index.ts:142-152). No in-tree product caller invokes it yet — by design: this is the SDK contrac - Fit with existing patterns: Fits the established pattern exactly. The repo already ships
agent-provider-{tangle,e2b,daytona,computesdk,cli-bridge}adapters aroundAgentEnvironmentProvider; the newexactProcesscapability is an opt-in extension on the same interface with the samecreate/get/listshape. It does NOT compete withAgentEnvironment.exec()— that one is a shell-exec for interactive agent sessions, while e - Real-world viability: The adapter covers realistic paths beyond the happy path: idempotent recovery via attestation equality (exact-process.ts:57-72), collision rejection when key is reused with different inputs (exact-process.ts:68-72), team-scoped list with pagination (exact-process.ts:89-104), immutable-image enforcement via sha256-digest regex (exact-process.ts:24, 115-117), bounded byte reads double-checked before
- Model: opencode/zai-coding-plan/glm-5.2
- Bridge attempts: 1
💰 Value Audit
🟡 PATH-required validation logic is written three times [duplication] ``
The 'relative executable/interpreter requires non-empty env.PATH' rule is implemented independently in agent-candidate-code-schema.ts:246-255, agent-candidate-execution-plan-schema.ts:423-430, and validateExactProcessLaunch at agent-provider-tangle/src/exact-process.ts:276. The two schema-level copies have nearly identical shape and message and could be extracted into a shared helper in agent-candidate-schema-common.ts (which already exists for shared schema utilities). The runtime check is at a
What this audit checks
It judges the change on its merits — not whether it was tasked out in an issue. Unticketed, fast-moving work is fine; the question is whether the change is good and whether a better or existing approach should be used instead.
| Pass | What it asks |
|---|---|
| Heuristic | Vague title? Whitespace-only or cruft-bearing diff? (content signals only) |
| Duplication | Do added function/class names already exist elsewhere in the repo? |
| Value Audit | What does it do? What goal does it achieve? Is it good? Better architecture or already-exists? |
| Usefulness Audit | Does it integrate and fit? Will it hold up in real use and actually get used? |
Findings are concerns, not blocks — the human reviewer decides what to do with them.
❌ Needs Work —
|
tangletools
left a comment
There was a problem hiding this comment.
❌ 2 Blocking Findings — eda63ce9
Full multi-shot audit completed 8/8 planned shots over 19 changed files. Global verifier still owns final merge decision.
Full immutable report for this review: trace
Summary comment for this run: full summary
tangletools · 2026-07-18T14:29:34Z · immutable trace
tangletools
left a comment
There was a problem hiding this comment.
✅ Auto-approved drewstone PR — 43e614b7
This PR was opened by the trusted drewstone account.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.
tangletools · auto-approval · reason: drewstone_author · 2026-07-20T21:27:44Z
tangletools
left a comment
There was a problem hiding this comment.
🟡 Value Audit — sound-with-nits
| Verdict | sound-with-nits |
| Concerns | 1 (1 weak-concern) |
| Heuristic | 0.0s |
| Duplication | 0.0s |
| Interrogation | 124.7s (2 bridge agents) |
| Total | 124.7s |
💰 Value — sound
Adds an opt-in, shell-free, replace-don't-extend exact-process provider contract plus a Tangle Sandbox adapter and shared lifecycle testkit; coherent with the codebase's optional-capability grain, no existing equivalent to reuse.
- What it does: Defines a new optional
AgentExactProcessProvidercapability onAgentEnvironmentProvider(packages/agent-interface/src/environment-provider.ts:76-206, 338-342, 361) that exposes an isolated, recoverable, shell-free process environment: idempotent create, explicit resources, blocked/strict egress, absolute-path file I/O with byte-bounded reads, terminal-reason-bearing process status, and kill-id - Goals it achieves: Give 'approved candidate execution' (which already has declarative schemas in agent-candidate-code-schema.ts and agent-candidate-execution-plan-schema.ts) one provider-neutral runtime contract, so products don't hand-write Sandbox create/process/file/recovery/cleanup logic each time. Once merged, any provider can declare
exactProcess, the testkit proves it conforms, and the candidate schemas' PA - Assessment: Good change, in the grain of the codebase. The optional-capability shape mirrors how
AgentEnvironmentalready surfacesexec/read/write/checkpoint/forkas optional methods, andexactProcesssits as the same kind of opt-in onAgentEnvironmentProvider. The contract is sharply stronger than the existingenvironment.exec()shell path — it pins immutable images (sha256 digest regex at - Better / existing approach: none — this is the right approach. Searched packages/ for
spawnExact|exactProcess|exact-process|agent:false|runtimeMode.*controland confirmed: no prior wrapper for the Sandbox SDK's control-runtime mode exists in this repo; the three other providers (daytona, e2b, computesdk) only implement the shell-basedexec()path and have nothing resembling this; the looseenvironment.exec()cannot enf - Model: opencode/zai-coding-plan/glm-5.2
- Bridge attempts: 2
- Bridge warning: opencode/kimi-for-coding/k2p7: bridge stream ended without value-audit content
🎯 Usefulness — sound-with-nits
A provider-neutral exact-process primitive that wires cleanly into the existing AgentEnvironmentProvider contract, fits the candidate-execution grain, and is robust under realistic edge cases; only minor capacity concern in list pagination.
- Integration: Wires in cleanly as an optional
exactProcessproperty onAgentEnvironmentProvider(environment-provider.ts:361) and anexactProcesscapability onAgentEnvironmentCapabilities(environment-provider.ts:339). The Tangle adapter exposes it via opt-inexactProcess: TangleExactProcessOptionsincreateTangleProvider(packages/agent-provider-tangle/src/index.ts:139,146-152), with a consistency - Fit with existing patterns: Fits the codebase's grain. It is added as an optional capability alongside the existing agent-backed
create()— not competing with it (README:65-70 says so explicitly: 'separate from agent-backed create()'). The Tangle adapter reuses the existing structural typesSandboxClientLike/SandboxInstanceLike/SandboxProcessLike(index.ts:40-121) rather than redefining sandbox shapes. The tighte - Real-world viability: Robust well past the happy path. Validates immutable image digest (regex sha256, exact-process.ts:20-21,122-126), positive integer resources with whole-GiB disk (184-209), whole-second maxLifetime (130-138), non-empty idempotency key and strict-mode allowDomains (149-153). Create failure path deletes the box and aggregates cleanup errors (66-80). Distinguishes process-only sandboxes by BOTH `runti
- Model: opencode/zai-coding-plan/glm-5.2
- Bridge attempts: 1
🎯 Usefulness Audit
🟡 List pagination caps at ~2000 environments before throwing [robustness] ``
exact-process.ts:23-24 sets LIST_PAGE_SIZE=1000 and MAX_LIST_OFFSET=1000, so the loop at 90-109 terminates after offset 0 and offset 1000 — ~2000 records — then throws 'Tangle exact process lookup exceeds the Sandbox list pagination limit' (110-112). The contract delegates pagination to the provider (environment-provider.ts:204-205), so this is a deliberate bound, not a bug. But for a measured-candidate execution workload at scale (many concurrent cells per benchmark), exceeding 2000 active exac
What this audit checks
It judges the change on its merits — not whether it was tasked out in an issue. Unticketed, fast-moving work is fine; the question is whether the change is good and whether a better or existing approach should be used instead.
| Pass | What it asks |
|---|---|
| Heuristic | Vague title? Whitespace-only or cruft-bearing diff? (content signals only) |
| Duplication | Do added function/class names already exist elsewhere in the repo? |
| Value Audit | What does it do? What goal does it achieve? Is it good? Better architecture or already-exists? |
| Usefulness Audit | Does it integrate and fit? Will it hold up in real use and actually get used? |
Findings are concerns, not blocks — the human reviewer decides what to do with them.
Problem
Approved candidate execution needs one provider-neutral contract instead of each product hand-writing Sandbox create, process, file, recovery, and cleanup logic.
Change
Local checks
agent-interface: TypeScript and 139 testsagent-provider-testkit: TypeScript and 4 testsagent-provider-tangle: TypeScript and 4 testsRelease order: publish Sandbox 0.12.0 before the Tangle adapter.