Repository navigation
feat(task): record each sandbox a run creates, by step and provider, as evidence that is never drift - #1007
Open
earakely-scale wants to merge 3 commits into
Open
feat(task): record each sandbox a run creates, by step and provider, as evidence that is never drift#1007earakely-scale wants to merge 3 commits into
earakely-scale wants to merge 3 commits into
Conversation
…as evidence that is never drift Each attempt's lock gains an evidence part: every sandbox the run created, with the step whose work created it, its provider, mode, platform and id, and whether it served the deploy that created it. Every provider's create_sandbox, create_vm and create_container note what they return (SandboxProvider.__init_subclass__), in the run's context, so a judge's own sandbox and a multi env's child computers are listed, and a sandbox made outside a run isn't. A sandbox didn't serve when its create raised, the deploy on its chain link failed, the chain refused it, or a probe made it. The runtime's sandbox provider types now include every provider that created a sandbox. In the comparator, the sandboxes each step created are never drift, and so is a sandbox provider only one attempt used, as a fallback's next link serving a deploy changes where it ran, not what ran; a package change of a provider both used stays soft. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he sandbox as one that served nothing A2AAgent.deploy owns the sandbox once its create returns: loading the image, starting the agent or waiting for its card can still fail, and the deploy then closes the sandbox, which the run now lists as discarded, a judge's own included. A sandbox a provider allocates and tears down itself inside a create that raises isn't listed: no create handed it to the run, and nothing of the run ran in it; the docs say so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r attempt can name its package A run records a type's package as None when it can't name one, as for a class configuration registers, a sandbox provider among them. The comparator read that as the type's absence, so a type only one attempt used went unreported; it now compares as "unknown". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Each attempt's run records now say where it ran. The lock gains a third part,
evidence, which lists every sandbox the attempt created. Each entry gives:The comparator classes all of this as never drift.
This is the first half of the last run-records PR. The second half, the image digest each sandbox actually ran, comes next as its own PR.
Why
Before this PR, the records listed sandbox providers only from the deployments a run's context keeps. That missed:
sandbox_typewas read;modal,localactually served a deploy.How
providers/sandbox_providers/created.py: a run-scoped collector, set up byrun_recorded, that works the way the entity-read recorder does.step_dispatchedsets the step, so a judge's sandbox belongs to its verifier step.SandboxProvider.__init_subclass__: wraps every provider'screate_sandbox,create_vmandcreate_container, the base class's own included, so each notes what it returns.SandboxProvider's own still work: an inherited method is still the base's, and an override is still its own.served: false. That happens when:create_vminside a VM backend'screate_container;_SandboxEnvironmentProvider._attempt);A2AAgent.deploy, which covers a judge's own deploy);types.sandbox_providersnow includes every provider that created a sandbox.Noneagainst an absent key and go unreported; it now compares asunknown.sandboxes created, compared step by step, isnever. A sandbox provider only one attempt used is alsonever, because a fallback serving on another link changes where a run ran, not what ran. A package change of a provider both attempts used stayssoft, and an override that asked for another provider stayssoftin the override row.verify_sandboxandrun_container_unit_tests_verifiermake their own sandboxes. They don't; they only reattach. The docs now say what is recorded.Decided
Tests
tst/unit/providers/sandbox_providers/created_test.py:tst/unit/task/run_lock_test.py: a run throughTask.runrecords a deploy's sandbox and a judge's own, by step, with the provider in the runtime types. The round trip covers the new fields, and an older lock reads without them.tst/unit/task/drift_test.py:tst/unit/cli/task_diff_test.py:task difflists a fallback asneverand exits 0.tst/unit/a2a_agent/deploy_cleanup_test.py: an agent deploy that fails or is cancelled while waiting for its card lists its sandbox as not served. This test fails without the fix.drift_test.pyalso checks that a type only one attempt used shows as a difference though neither can name its package.tst/integration/task_step/test_verify_sandbox_local.py: a run on a local sandbox records the sandbox its deploy created.Testing on VMs
Runs on fresh agent-environments-admin EC2 hosts, with the stores on SQLite, MongoDB 7 (a one-node replica set) and DynamoDB Local:
test_mcp_cli_buildercodegen ×2, the chromium install's execute bits, a local sandbox's context zip).agent-env task run, on each backend:no differences.kitflaky,local, wherekitflakyis a config-registered kit provider whose VMs can't pull. When it refuses before making anything, local's container alone is listed. When it fails after making its VM, that VM is listed as discarded beside local's container.task diffbetween the two exits 0 with twoneverlines: the step's sandboxes, andtype's package sandbox_providers kitflaky: - -> unknown.agent-env task diff#974's scenarios, which write these records):agent-env run, with a Claude Code rubric judge on its own local sandbox: each run lists the deploy's sandbox and the judge's own under their steps, the judge graded, and the two runs diff tono differences.CI
The failing checks here are failing on
mainthe same way: fastapi 0.165.1 can't call the installed opentelemetry-api.integration-local-slow (10/12)andintegration-local-gateway(1, 3, 4/5): a test website image fails its health check. test(website): the slack website image keeps opentelemetry-api below 1.46, which fastapi 0.165.1 can't call #1005 pins that image.Once #1005 merges I'll merge
mainand rerun.🤖 Generated with Claude Code
Confidence Score: 5/5

The PR appears safe to merge; no new actionable issues were found.Summary
Records each sandbox returned to a run, including its step, provider, mode, platform, ID, and whether it served.
Reviews (8) · Last reviewed commit: "fix(task): a type only one attempt used ..." · Reviewed by Greptile