Skip to content

Interface check: at every nominated commit, in the leg's own sandbox - #98

Merged
Thykof merged 1 commit into
mainfrom
feat/probe-at-sha-in-leg-env
Nov 20, 2026
Merged

Thykof merged 1 commit into
mainfrom
feat/probe-at-sha-in-leg-env

Conversation

@Thykof

@Thykof Thykof commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

What changed

The check follows the nomination. The driver used to check a champion once, the first time agent/CHAMPION appeared, and it checked the working tree. Now:

  • Each poll reads the commit agent/CHAMPION names (nominated_sha, which reads sha or commit for any kind) and runs the kind's probe whenever that commit changes.
  • BUDGET.md says check interface at <sha>: ….
  • When the agent exits, a commit that failed its check is checked once more. A failure caused by load at check time (the agent still training, a timeout) is therefore not handed back.

The monte-carlo probe runs where the champion will run.

  • It clones the workspace at the nominated commit with --no-local, so the clone holds only what the refs reach, the same objects the verdict's workspace.bundle carries. A commit the agent amended away fails the check now instead of failing the verdict later.
  • When the leg is sandboxed and the workspace has a .venv, simulate() runs in the leg's image with --network none. The tree is mounted as /workspace, the workspace's .venv read-only at /workspace/.venv, and the venv's interpreter runs python -m synth_lib.benchmark.nomination. The 120 s timeout stays, and a timed-out container is removed.
  • So a champion that imports a package the agent installed in its venv (xgboost, torch) passes, where the host check used to fail it.
  • No .venv: the check runs on the host interpreter, as before, and the message says so. A champion with no dependencies of its own still passes. One that has its own dependencies fails with the import error, the same as before this change.

Interface for kinds. CompetitionKind.probe now takes (agent_dir, snapshot, sandbox: LegSandbox | None) instead of (agent_dir, snapshot, python_exe). run_all builds one LegSandbox (image and limits) that both the leg's container and the probe use.

  • A kind registered by another package whose probe ignores its third argument keeps working at runtime.
  • Its type annotation needs updating when it moves its synth-lib pin.

Constitution.

  • The check reads the nominated commit with the agent's .venv and runs again each time sha changes.
  • A champion's dependencies are what pyproject.toml and uv.lock list at that commit, because the scoring rebuilds the environment from those two files.

Fake CLI. The fake CLI now commits its champion and nominates the real commit, so the fake-leg tests exercise the checkout.

Not in this PR

A uv sync --frozen --offline check that the venv matches the lockfile. A package installed with uv pip and not locked passes this check and is missing at the verdict. The constitution line above tells agents about this.

Testing

  • pytest tests: 608 passed, 1 skipped. black 26.5.1 and flake8 7.1.2 are clean on the changed files.
  • The sandboxed path is tested through a fake docker (tests/benchmark/conftest.py). It maps each mount to its host path and runs the command, covering four cases:
    • a package only in the workspace venv passes;
    • a package in neither venv fails with its ModuleNotFoundError;
    • the timeout fires and removes the container;
    • the calendar env reaches the champion.
  • It has not run against a real Docker daemon. A smoke leg on the campaign host should confirm it before the next campaign: nested read-only venv mount, GPU shared with the leg's container, root-owned files in the temp dirs.

🤖 Generated with Claude Code

https://claude.ai/code/session_016kmUsyYSEMPGiwbSuvR9hh

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

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Thykof
Thykof merged commit ce2c9af into main Nov 20, 2026
4 checks passed
Thykof added a commit that referenced this pull request Nov 20, 2026
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
@Thykof
Thykof deleted the feat/probe-at-sha-in-leg-env branch November 20, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant