Repository navigation
feat(task): each attempt of a run records the code that ran it and what it was asked to do and read - #967
Open
earakely-scale wants to merge 5 commits into
Open
feat(task): each attempt of a run records the code that ran it and what it was asked to do and read#967earakely-scale wants to merge 5 commits into
earakely-scale wants to merge 5 commits into
Conversation
…at it was asked to do and read - task/run_lock.py: run_recorded writes, per attempt and by its attempt_epoch, a runtime entry (core, protocol and Python versions, installed plugins with their install kind, how the config file was found, the distribution of each type the run used; never a path) and a lock entry (intent: content hash, pins, each role's model and endpoint host, overrides without secrets, result rules version; resolved: each verifier's settings and version at the start and every entity version the run read, with each image's identity), at the start and again when the run ends. - agent_env.plugins: distribution_of, distribution_version, installed_plugins, install_origin, from metadata alone. - The config's found_by (environment, discovered, none); DockerImageArtifact.image_identity; recorded reads carry the entity's type, class and image identity. - eval/intent.py holds the intent helpers the eval plan and each run share; the verifier's grade takes its settings and version from the same functions the lock does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…de the run's own handling of one The start entries are written in step, as the run is registered, and the end entries on a thread the run doesn't wait for, so a cancel between registering and the first step, or after the result is recorded, is the run's own as before. The config tests that stand in for discovery patch discover_config, the function the snapshot now calls. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he settings each grade ran with, and a seed shows - The plugin scan reads each distribution's entry points: Python 3.11's entry_points() with no group yields group names, which left every run unrecorded there. - A verifier's lock entry gains graded_settings, the settings its grade records once a judge has called, beside those it started with. - The intent gains steps_hash, a hash of the steps as the run runs them, its seed applied, so runs of one task with different seeds tell apart without recording the seed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… in whichever order they land, and a resume names only the grades it made - The start entries are made on the event loop, reading metadata and the context but no store, and written on a thread like the end ones, so a slow store holds up neither the run nor the loop; a finished entry never gives way to a started one, so the two writes may land in either order. - graded_settings names only the grades this attempt wrote, not those a resume's restored context carries. - The public names of agent_env.plugins include the provenance helpers. 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.
What
The first of three pieces that let two runs of a task be told apart and compared.
Each attempt of a run now records, on its task instance, the code that ran it and what it was asked to do and read. The record is written by the process that runs the steps, so on a split deployment it describes the worker, not the machine that submitted the run.
It is written when the run starts and again when the run ends, however it ends. A run that dies midway keeps what it started with. A resume in another process adds its own entries beside the first run's. A write that fails is logged and never fails the run.
runtimehas one entry per attempt (task/run_lock.py), keyed by theattempt_epochthe process started under:index,vcs@<commit>,editableorlocal;environment(fromAGENT_ENV_CONFIG),discovered, ornone;No path is ever recorded.
lockhas one entry per attempt.intentis what the run was asked to do: the task's id, version and content hash, its pins, each role's model and endpoint host as this process's config resolves them, the overrides without secrets, and the result rules version. It is computed the way the eval plan computes its own (eval/intent.py), so the two can be compared.resolvedis what the process found: each verifier's settings and providing-package version at the run's start, and, once the run ends, every entity version the run read. Children are included, each with its type, whether it was read at its latest, and, for an image, itsimage_identity.agent_env.plugins:distribution_of,distribution_version,installed_pluginsandinstall_origin. They read installed metadata only and import nothing. Agent-env's own types map toagentenv-framework, a plugin's to the distribution whose entry point names the class, and a config-registered class to the distribution that holds its module.DockerImageArtifact.image_identity:source:<digest>, the build context's content hash, when the image has one, so a rebuild of an unchanged context is the same image. Otherwiseregistry:<digest>, the digest it's pinned to. An image held only as a tarball getsNone, since its artifact version already names it.Smaller changes:
found_by, andConfig.config_found_by()returns it.recorded_settings, formerly private) and version from the same functions the lock uses, so the two can't disagree.Choices made here, for review
intentis computed on the worker, not copied from the eval plan. The eval plan's intent lock describes the planning machine, while each run's lock describes what its own process resolved. Comparing the two is what catches a worker whose config differs from the planner's.pluginslists every installed agent-env plugin, not only the ones the task's types came from, because a plugin can change a run without supplying any of its types.typeslists only the types the run used, as the issue asks.found_bycan't name a package. A plugin that setsAGENT_ENV_CONFIGreads asenvironment; nothing records which package set it.run_recordedaround them, as it already has to setrun_pins.Not in this PR
Tests
tst/unit/task/run_lock_test.py:Task.runrecords:verifier_settingsandverifier_versionmatch the lock's.AGENT_ENV_CONFIGpointing at a private path, no path appears in the record.tst/unit/plugins/provenance_test.py: agent-env's own classes, an entry point's class identified without importing it, a class with no distribution, each install kind, and a distribution that isn't installed.tst/unit/config/config_found_by_test.py: a config found from the environment, discovered by walking up, and none.tst/unit/artifact/image_identity_test.py: every image form.tst/unit/eval/resolve_test.pyis unchanged and passes on the shared intent module.Tested on Linux hosts
Host e2e and chaos results follow once the run on a dedicated host finishes.
🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge, with a non-blocking gap in how resumed attempts record older verifier settings after a retry.Summary
Each task attempt now records the code, inputs, verifier settings, and entity versions it used.
Reviews (4) · Last reviewed commit: "fix(task): a run's records are never awa..." · Reviewed by Greptile