fix(runtime): adopt the Sandbox run result - #913
Merged
Conversation
drewstone
marked this pull request as ready for review
August 21, 2026 00:37
tangletools
approved these changes
Aug 21, 2026
tangletools
left a comment
Contributor
There was a problem hiding this comment.
✅ Auto-approved drewstone PR — a14f3115
This PR was opened by the trusted drewstone account.
This approval is provisional and was applied by the local stand-in because the pr-reviewer webhook host is unreachable (2026-08-21). CI on this head is fully green. The full PR reviewer audit re-runs via the resweep when the service returns and will publish findings if it detects issues.
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.
Summary
Why
Consumers should receive one complete Runtime result from the public Sandbox contract.
Braid no longer needs a second parser for raw Sandbox events.
A recovered tool error does not incorrectly fail a completed turn.
Dependency cohort and release
Sandbox 0.31.0 is published and exports
createAgentRunOutcomeTrackerandAgentRunOutcomefrom itsruntimeentry, so the dependency update is part of this pull request.>=0.31.0 <0.32.0. The floor is 0.31.0 because this code requirescreateAgentRunOutcomeTracker, which 0.29 and 0.30 do not export.^1.3.0, because Sandbox 0.31.0 requires Interface^1.3.0. One consumer install therefore resolves one Interface copy.scripts/lib/packed-package-test.mjsstates the one supported Sandbox cohort (0.31.0), and the packed-cohort consumer install proves it.ci.ymlandpublish.ymlcheck out the Interface cohort source at@tangle-network/agent-interface@1.3.0(a3c31b98)../kernelremovesassertSandboxEventSucceededandsandboxEventFailure. It also addsSandboxExecutorToolCall, which names one retained tool call onSandboxLeafOut.Proof
Local, on the merge head:
pnpm run lint: 607 files checked, 0 diagnostics.pnpm run typecheck: clean (tsc --noEmitplus the examples project).pnpm run build: 151 files, 9.29 MB, complete.pnpm test: 2,780 passed, 6 skipped, 105 failed. Every failure is a local macOS artifact and reproduces unchanged onorigin/main: the same 20 files fail on both, and a per-test diff of the two runs lists zero failures unique to this branch. They are git-worktree and process-spawn timeouts intests/candidate-execution-*,tests/mcp/*-harness, andtests/version-bump-check.pnpm run check:version-bump: the minor bump is paid by 0.142.3 -> 0.143.0, and the bench patch by 0.8.18 -> 0.8.19.pnpm run verify:package: 2,087 exports across 17 entry points, record current; static-import, publint, attw, and edge tool loop pass.pnpm run docs:check: API reference regenerated with no diff, and the freshness gate passes on the version pin, 3 substrate peers, and 10 citations.pnpm run verify:primeintellect: pass.pnpm install --frozen-lockfile: clean after the lockfile regeneration.pnpm run verify:benchfails locally only where its tests read/proc/<pid>/statand resolve jail containment, which Linux provides and macOS does not. Theagent-benchCI job runs the same command on Linux and passes.Simplification
Simplification: the event-level failure parser is deleted with its tests (
sandboxEventFailure,assertSandboxEventSucceeded,describeSandboxError,TERMINAL_EVENT_TYPES), so the four Sandbox paths that used to each apply their own per-event failure rule now read one terminal state from the platform tracker;TERMINAL_FAILUREis left scoped to one tool call only.Net: +814 / -379 lines across 44 files (src and tests: +667 / -259 across 29 files); 103 lines of parser and its test block removed, 2 public exports dropped, 4 terminal-truth call sites collapsed to 1 owner.
Tests: +2 cases plus 5 table rows in the
streamAgentTurn: Sandbox outcome contractblock (afailedoutcome after stream recovery stays failed with its usage;blocked_on_approval/awaiting_question/awaiting_plan_decisionsettle as blocked, not completed; a recovered tool error does not fail a completed turn), -7 deleted with the parser they tested (4sandboxEventFailuredecoder cases, 2 per-event assert cases, 1 renamed). No test asserts the new range, the version, or a removed export —check:version-bump,check:api-surface, and the packed-cohort job prove those.Not done here: #912's remainder — served backend identity on settle records, and an explicit empty-vs-absent output marker beside
content. That is a separate PR in this program, tracked on #912.Closes #781