Repository navigation
Interface check fails when the champion's .venv differs from its uv.lock - #99
Merged
Merged
Conversation
The driver used to check a nomination once, when agent/CHAMPION first appeared, on the working tree, with the harness's Python. It now checks the commit CHAMPION names each time that commit changes, names it in BUDGET.md, and checks a failed commit again when the agent exits. The monte-carlo probe clones the workspace at that commit (only what its refs reach, as the verdict's bundle) and, when the leg is sandboxed and the workspace has a .venv, runs simulate() in the leg's image without network, with that venv mounted read-only and its interpreter. Without a sandbox or a .venv it runs on the host and says so. A kind's probe now receives the leg's LegSandbox (None on the host) in place of the interpreter path. The fake CLI commits its champion and nominates the real commit. The constitution tells agents the check reads the nominated commit with their .venv, and that the scoring rebuilds the environment from pyproject.toml and uv.lock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016kmUsyYSEMPGiwbSuvR9hh
The sandboxed check runs the workspace .venv, while the scoring builds the environment from pyproject.toml and uv.lock at the nominated commit. Before starting the container, compare the two on the host: a commit without uv.lock, a distribution the lock does not list or lists at another version, or a site-packages entry no distribution installed fails the check, naming each difference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016kmUsyYSEMPGiwbSuvR9hh
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
main's tree equals ce4aae2, this branch's base, so the branch's tree is kept unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016kmUsyYSEMPGiwbSuvR9hh
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.
Stacked on #98 (base
feat/probe-at-sha-in-leg-env); review that one first.What
#98 runs the interface check in the leg's sandbox with the workspace
.venv. The scoring does not use that venv: it builds the environment withuv syncfrompyproject.tomlanduv.lockat the nominated commit. So a package installed withuv pip installand never locked passes the check and is missing at scoring.Before starting the container,
probe_in_sandboxnow compares the venv with the commit's lock on the host (venv_differences). The check fails, naming each difference, when:uv.lock;uv.lockdoes not list (PEP 503 names), or lists at another version (lock entries without a version, such as a dynamic-version project, are not compared);site-packagesentry was installed by no distribution (a hand-written.pth, a copied package). uv's own_virtualenv.pth/_virtualenv.pyand__pycache__are exempt.The message tells the agent to
uv addwhat the champion needs and commit,uv syncto drop the rest, and delete what no package installed. Constitution rule 7 says the same.Why a strict comparison rather than hiding unlocked packages
The first version hid unlocked packages from the champion at import time, so unused extras would not fail the check. Two review rounds found blind spots in hiding at runtime:
find_specraising inside libraries that probe optional dependencies (transformers);.pthpaths;.pthpackage data;importlib_metadatabackport;PathFinderlookups by class.A host-side comparison has none of these. It also catches version drift, for example a CUDA build of torch installed over the locked one.
The trade-off: a venv carrying unused, unlocked packages now fails the check, where hiding would have passed it. The fix is
uv sync.Checks
pytest tests: 612 passed, 1 skipped (Docker stubbed, as in Interface check: at every nominated commit, in the leg's own sandbox #98).black26.5.1 /flake87.1.2 clean on the changed files.Not yet run against a real campaign workspace venv (Linux, root-owned); it needs a smoke run on a campaign host, like #98.
🤖 Generated with Claude Code
https://claude.ai/code/session_016kmUsyYSEMPGiwbSuvR9hh