Repository navigation
feat(eval): an eval instance resolves its tasks' entity versions before its first run, and every run reads them - #961
Merged
Conversation
…re its first run, and every run reads them A resolver (eval/resolve.py) walks each task's declared refs, the default agent for an agent field left unset, an agent image override and the infra envs a deploy runs on, reads each once per instance with the children it loads, and records an intent lock on the instance and a task lock on each slot (eval/lock.py). Runs receive the versions read at their latest as user_overrides["pins"], which Task.run sets and Env.get, A2AAgent.get and Artifact.get read when asked for no version (entity/pins.py), so every replica reads the same versions while newer ones are published. eval run resolves once and hands each task's runs their pins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…'s pins Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hey land, and keep credentials out of the lock - TaskStep.run_fields gives a step's fields as a run reads its refs; deploy_agent, install_agent and deploy_env apply their own override rules there with the methods their runs use, so an agent id overridden without a version is pinned at its latest and a run-wide a2a_agent_id is resolved. - recording(pins) pins each read at its latest as it lands, so siblings in one load that share a floating child read one version; a read counts as pinned only at the resolver's pin. - The intent lock's overrides drop a URL's user and password at any depth and keep each endpoint override as its host, step_params included. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ersion, so a republished task hashes the same Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ole, read by the steps and the intent lock - config/model.py holds each role's model, endpoint and key override names (RUN_MODEL_KEYS, RUN_ENDPOINT_KEYS, RUN_API_KEY_KEYS, read with run_model, run_endpoint, run_api_key, and role_model_overrides for the CLI's writers). The rubric judge, the user-sim gate, prompt_agent's and always_on's user models, deploy_user_sim_agent and deploy_agent (by its model_role) read them, as the intent lock does, so the lock can't drift from the steps. - config/runtime.py's infra_env_ids lists the infra envs a deploy runs on once. - without_credentials, the scrub a record of a run's overrides goes through, moves to config/model.py beside endpoint_host. No behaviour changes; run_container_unit_tests_verifier keeps its own key-and-URL pairing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 eval engine's third piece: before an eval instance's first run, every env, agent and artifact its runs read is resolved once and recorded as its intent lock. Every run then gets those versions as pins, so all k replicas (and, once the driver lands, every resume) read the same versions, even when newer ones are published mid-eval.
entity/pins.py). A run carriesuser_overrides["pins"], shaped{"env" | "agent" | "artifact": {id: version}}.Task.runsets them for the run (run_pins), besiderun_env_ids.Env.get,A2AAgent.getandArtifact.getread a pin whenever they are asked for no version. A version given explicitly, by the task or by an override, still wins.eval/resolve.py).resolve(tasks, user_overrides, agent_model=, agent_artifact_id=)reads each task's refs as its runs will. The refs are:entity_refs), in the fields a run reads:TaskStep.run_fields(context), which by default is the stored fields with the run'sstep_paramsover them.deploy_agent(and the user-sim step),install_agentanddeploy_env, whose overrides follow rules of their own, override it with the methods their runs call. So an agent id overridden without a version is read at its latest, and the run-widea2a_agent_idis read as the step reads it;agent_artifact_idimage;eval/lock.py).EvalInstance.intent_lockholds:solver,user_simulator,judge);step_paramsincluded), and no URL keeps a user or password;result_rules_version;agentenv-frameworkandagentenv-framework-protocolversions.Slot.lockholds the task's part:sha256:content hash, without its id and version, so a republished task hashes the same;planned_slots(..., locks)puts each task's lock on its slots.config/model.py).RUN_MODEL_KEYS,RUN_ENDPOINT_KEYSandRUN_API_KEY_KEYShold each role's model, endpoint and key override names. A judge's own endpoint and key win for the judge, then the run's.run_model,run_endpoint,run_api_keyand, for the CLI's writers,role_model_overrides.prompt_agent's andalways_on's user models,deploy_user_sim_agentanddeploy_agent(by its newmodel_role) now read the table, as the intent lock does, so the lock can't drift from the steps. Behavior is unchanged.run_container_unit_tests_verifierkeeps its own rule, which pairs the judge URL with the judge key.config/runtime.py'sinfra_env_idslists the infra envs once.without_credentials, the scrub the lock's overrides go through, lives besideendpoint_host, for other record writers to use.eval runresolves once, before its first submit, and hands each task's runs their pins. It prints how many versions it pinned, and names any ref missing from the store and any step whose type declares no refs.intent_lockand the locked slots when it creates an instance, before its first submit.Choices made here, for review
run_fields), not by re-deriving override rules here, so a step's rules and its plan can't drift apart. The default is a superset where a step's rule is narrower (an extra read is harmless); a step whose rule drops a version overrides it.A2AAgent.getrefuses a version for an alias.missing, and its runs read what they find, failing as they would have.EvalInstance.runner, which already records it, rather than being copied into the lock.Follow-ups
Task.run, so it must wrap them inrun_pins(user_overrides), as it does with the other run context. That is a change in the hub.Tests
tst/unit/eval/resolve_test.py(27 tests):step_paramsand agent image override read them. The infra envs a deploy runs on are included, with the run's overrides.deploy_agentandinstall_agent, an id overridden without a version is pinned at its latest. A run-widea2a_agent_idkeeps the step's stored version, as the step reads it, and is pinned when the step stores none. A run-widea2a_agent_versionis read as given, and so isdeploy_env's version override.Task.runwhile a newer version of each is published after every run. An unpinned run afterwards reads the newest.env_vars. It round-trips through the store on the instance, and each slot carries its task's lock.tst/unit/config/run_overrides_test.py: each role reads its own model; a judge's own endpoint and key win for the judge alone; empty overrides name nothing; the CLI names only the models it was given; and a record keeps no URL's user or password at any depth, with each endpoint recorded as its host.Also:
tst/unit/eval/instance_store_test.py's round-trip test covers every field of the lock records, andtst/unit/cli/submit_runs_test.pychecks thateval runresolves once and every replica receives its task's pins.Tested on Linux hosts
On fresh EC2 hosts at 5c12661, with the stores on SQLite, MongoDB 7 (a one-node replica set) and DynamoDB Local. Model spend was a few cents of Haiku.
test_chromium_app's install test, which needs anunzipbinary the host lacks; it passes in CI.tst/unit/evalran clean 10 times out of 10.eval run --k 4of three tasks (one floating, one pinned by the eval) ran 3 rounds per backend, 36 runs each. Meanwhile a publisher wrote new versions of the env, both its servers, the agent, its image, the artifact and the floating task, about 330 times per backend, about 300 of them after the pins were resolved.LocalRunnerwith 16 workers, each submitted with pins of its own (versions 1 to 5 of each entity, at random). Each run read its own pins, steps on threads included. Problems: 0 on each backend.AutoReconnect, so no lock was made and nothing ran on a partial one.bundle registerof a Claude Code task, then a copy naming the agent at its latest, run byeval run --k 3sequentially on Claude Haiku. Once the first replica finished, a new version of the agent was published. The two replicas that started after it deployed v1, the planned version, like the first (read from each run's agent instance record), and all three passed.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no new blocking issue was found.Summary
The PR resolves entity versions before an eval starts and passes those versions to every replica.
All three earlier threads are addressed: agent selection uses the steps’ own methods, shared child reads are pinned immediately, and nested endpoint credentials are removed. No new actionable issues were found in the changes since the previous review.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Tasks and run overrides] --> B[Resolve entity reads] B --> C[Instance intent lock] B --> D[Task locks] D --> E[Per-run pins] E --> F[Task.run] F --> G[Entity getters] G --> H[Resolved versions]Reviews (10) · Last reviewed commit: "refactor(config): one table of what a ru..." · Reviewed by Greptile