chore(v1): remove dead code and v0 leftovers - #2496
Merged
Merged
Conversation
hallerite
marked this pull request as ready for review
September 2, 2026 02:29
hallerite
marked this pull request as draft
September 2, 2026 02:30
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a narrowly scoped cleanup removing unused v0 configurations and superseded v1 code paths. Current runtime behavior is preserved, with only bounded removal of obsolete compatibility and extension hooks. You can add or adjust custom eligibility rules. Learn more. |
Pure deletions; no behaviour change. - configs/eval, configs/gepa, configs/rl, configs/zero3.yaml, configs/endpoints.toml: v0 `vf-eval` / training formats, unreferenced since the v0 stack was removed; drop the test filter that skipped them - pyproject: inert nemo-gym dependency-metadata (not a dependency since #2476), pytest markers no test applies, cellpylib warning filter - Harness.run: superseded by HarnessSession.turn, zero callers - Agents.__iter__/__len__: no reader in verifiers, prime-rl, or the env repos - utils.git.snapshot_untracked: never called - cli.output.saved_config_path: drop the pre-#2429 configs/<cli>.json fallback; eval/gepa usage gate: drop the --taskset./--harness. prefixes of flags removed in #2157/#2237 - mcp: ServerBase.EXTRAS and RUNTIME_PYTHON hooks that no server declares - prime_agent: SUPPORTS_RESUME is never read on an ACP harness Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
hallerite
force-pushed
the
chore/remove-dead-v1-code
branch
from
September 2, 2026 08:37
60dd576 to
45d21a1
Compare
hallerite
marked this pull request as ready for review
September 2, 2026 08:44
This was referenced Sep 2, 2026
prime-envs #792 snapshots image-supplied untracked files in four SWE tasksets and passes them to capture_patch(ignore=...). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
xeophon
approved these changes
Sep 2, 2026
xeophon
pushed a commit
that referenced
this pull request
Sep 2, 2026
Stacked on #2505 → #2503 → #2496. Every third-party harness installed its program with the same routine: `mkdir -p <dir>`, take a lock on `<dir>/install.lock`, run `[ ready ] || ( install )`, raise `RuntimeError("<name> install failed: " + stderr[-500:])`. Nine copies, and they had drifted into three different locks: | lock | harnesses | |---|---| | `"$(command -v flock \|\| command -v lockf)"` | claude_code, codex, kimi_code, openclaw, pool, prime_agent | | hand-rolled symlink spinlock with dead-owner check + `EXIT` trap | pi, `node.py` (shared Node install) | | bare `flock` | rlm | Around it: the `version: str = Field(default=..., pattern=...)` field nine times, and an `rm -rf` + raise cleanup six times. **After this PR** - `harnesses/utils/install.py`: `ensure_installed(runtime, directory=, install=, env=, label=, ready=None, lock=None, shell=("sh","-c"))` and `remove_dir(runtime, path, label)`. `ready` is the optional skip test (openclaw passes none: its `SETUP` script from #2485 self-guards and must always run the transcript patch), `lock` lets the Node installer keep its lock beside the directory it replaces, `shell` lets pool and openclaw keep `bash -o pipefail`. Directory and lock paths are `shlex.quote`d, as #2485 started doing for openclaw. - `configs/harness.py`: `PinnedVersion = Annotated[str, Field(pattern=r"^[A-Za-z0-9._+-]+$")]`; the nine configs declare `version: PinnedVersion = "<default>"` and keep their own docstrings. rlm keeps its git-ref field. - claude_code, codex, kimi_code, pool, openclaw, prime_agent, pi, rlm and `ensure_node` install through the helper; claude_code, codex, openclaw, prime_agent and hermes_agent clean up through it. hermes_agent, terminus_2 and mini_swe_agent install via `prepare_uv_script` and only pick up `PinnedVersion`. **Intended behaviour changes** (all in the lock and error path, none in install scripts): 1. Every harness locks with `flock || lockf` when one is present (they release on holder death natively; every common base image ships one, Alpine via busybox) and falls back to the symlink spinlock that pi and the Node installer used before when neither is. The fallback records its owner as `pid:starttime` (from `/proc`, pid alone where unreadable) so a reused pid is not mistaken for the live holder, and reaps a lock that is a regular file or whose owner is gone; the original spinlock spun forever on a regular lock file because `kill -0 ""` succeeds under busybox ash, and would wait on a reused pid until that process exited (e19f2c8). 2. rlm gains the lockf fallback it lacked. 3. Install failures report stdout when stderr is empty or whitespace-only (three harnesses already did the former). Cleanup failures share one phrasing, `failed to clean up <label>: …`. 4. `mkdir -p /var/tmp/vf-node` now precedes the Node install; its script creates the directory itself anyway. Rebased onto main after #2496 merged; the OpenClaw 2.0 (#2485), RLM (#2507) and prime-agent (#2502) changes on main are preserved. **Verification.** I replayed `setup()` and `cleanup()` for all nine harnesses plus `ensure_node` against a recording fake runtime on the base branch and this branch and diffed every command and environment. Against the rebased base, 17 of 23 replays are byte-identical (openclaw included, since #2485 already uses `flock || lockf`); the six that differ (the four Node installs, pi, rlm) differ only in the lock prefix and are identical from `sh -c` onward. `PinnedVersion` rejects `""`, `"a/b"` and `"bad version!"` and accepts `"0.147.0"`. Also `ruff check`, `ruff format --check`, `ty check verifiers`, `pytest tests/v1 -m "not e2e"` (82 passed). Both lock branches were exercised on `alpine:latest`: two concurrent installs serialize, the install's exit code propagates, a dead-owner symlink, a leftover regular lock file and a live process holding a lock with a stale identity (pid reuse) are reaped, a live owner with its true identity is waited on (a4f4ea5). The docker e2e job runs on this PR as well. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- Macroscope's pull request summary starts here --> <!-- Macroscope will only edit the content between these invisible markers, and the markers themselves will not be visible in the GitHub rendered markdown. --> <!-- If you delete either of the start / end markers from your PR's description, Macroscope will append its summary at the bottom of the description. --> > [!NOTE] > ### Consolidate harness install-lock and cleanup into shared helpers > - Adds `ensure_installed` and `remove_dir` to [install.py](https://github.com/PrimeIntellect-ai/verifiers/pull/2506/files#diff-5ddaf01b8cbb0ded4d3d42b42549b45ad9866136f071e72e14cde15c105d8417); `ensure_installed` handles directory creation, optional readiness checks, `flock`/`lockf` serialization with a PID/start-time symlink fallback, stale-owner cleanup, and label-specific errors. > - Adds a shared `PinnedVersion` type alias in [harness.py](https://github.com/PrimeIntellect-ai/verifiers/pull/2506/files#diff-c5b409466f272f39cbab9228a91d9b6de6c8a0cdd33ad73f05e7fd690966e478) and replaces inline version field declarations across all harness config classes. > - Migrates `setup` installers and `cleanup` handlers in the Claude Code, Codex, Hermes, Kimi Code, Node, OpenClaw, Pi, Pool, Prime Agent, and RLM harnesses to the shared helpers, passing through their existing scripts, environments, and labels. > - Risk: all harnesses now share one locking and removal implementation; verify per-harness lock paths and readiness conditions passed to `ensure_installed`, especially `ensure_node` in [node.py](https://github.com/PrimeIntellect-ai/verifiers/pull/2506/files#diff-4117aae0a7b4023c32f09206611f0bf2149b2a51e264157bd24339df2166dfa8) where the lock lives outside the installed directory. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 93a2100.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here --> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > All harness program installs and several cleanups now share one locking and error path; lock location and readiness checks (especially Node’s external lock) affect every concurrent rollout on a shared runtime. > > **Overview** > Introduces **`ensure_installed`** and **`remove_dir`** in `harnesses/utils/install.py` and routes harness `setup`/`cleanup` through them instead of nine copy-pasted `mkdir`, lock, `[ ready ] || install`, and `rm -rf` blocks. > > **`ensure_installed`** centralizes concurrent install serialization (`flock` / `lockf`, with an improved symlink spinlock fallback using `pid:starttime`), optional readiness skips, configurable shell (`bash -o pipefail` where needed), and consistent install failure messages (stderr or stdout). **`remove_dir`** standardizes cleanup errors as `failed to clean up <label>: …`. > > Harness configs that pin npm/release versions now use shared **`PinnedVersion`** in `configs/harness.py` instead of repeated `Field(..., pattern=...)` declarations (RLM keeps its git-ref field). > > Migrated installers: Claude Code, Codex, Kimi Code, Pool, OpenClaw, Prime Agent, Pi, RLM, and shared **`ensure_node`**. Cleanup via **`remove_dir`**: Claude Code, Codex, Hermes, OpenClaw, Prime Agent (plus OpenClaw staged-skills clear). Hermes, mini-swe-agent, and Terminus 2 only pick up **`PinnedVersion`**. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 93a2100. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Claude Fable 5.1 <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.
Pure deletions. Every item has zero references in verifiers, prime-rl, prime-envs and community-environments (grep + GitHub code search); nothing here changes behaviour.
v0 config trees (−820 lines).
configs/eval/,configs/gepa/,configs/rl/,configs/zero3.yaml,configs/endpoints.tomlare thevf-eval/ DeepSpeed formats of the removed v0 stack.tests/v1/test_configs.pyalready excluded them; the filter goes with them.pyproject. The
[[tool.uv.dependency-metadata]] nemo-gymblock is inert (nemo-gym stopped being a dependency in #2476; the PEP 723 header intasksets/nemo_gym/server.pyis the one that is used), souv.lockloses its manifest entry. Markersintegration,slow,unit,parsers,rubrics,environmentsare applied by no test; thecellpylibwarning filter targets a package that is not in the lock.Dead code.
Harness.run(): the pre-session launch/resume dispatch, superseded byHarnessSession.turn.Agents.__iter__/__len__: no reader anywhere; every env addresses agents by attribute.saved_config_path: the fallback to the pre-feat: split run configs into launch TOML and resolved dir #2429configs/<cli>.jsonlocation. Onlyconfigs/resolved/is written.eval/gepausage gate: the--taskset./--harness.prefixes kept alive for flags removed in feat(v1)!: two-level concurrency, and serving as its own config block #2157/feat!: remove the serve CLI, rename ServingConfig to ServeConfig #2237.ServerBase.EXTRASand theRUNTIME_PYTHONhook inmcp/launch.py: declared by no server anywhere.PrimeAgentHarness.SUPPORTS_RESUME:ACPHarnessoverridessession(), so both sites that read the flag short-circuit before reaching it.snapshot_untrackedwas removed in the first revision and restored in the second: prime-envs #792 calls it from four SWE tasksets (capture_patch(ignore=...)). Open PRs in the env repos are now part of the check.Deliberately not in this PR: anything on the
Trace/Episoderecord model (Episodeaggregates,PolicySpan.drift,Trace.last_message) — those have downstream consumers outside this repo;agent_config_fields(its_declared_agent_configstwin checks field defaults, not values, so swapping is not a pure deletion),WireTrace,InterceptionError, theBranchtrainer-side properties, and every docs/docstring wording fix. Those are separate PRs.Checks run on the branch:
ruff check,ruff format --check,ty check verifiers, andpytest tests/v1 -m "not e2e"(82 passed).🤖 Generated with Claude Code
Note
Low Risk
Mostly deletions of unreferenced configs and code; the only behavioral tweaks are stricter CLI axis detection, resolved-config-only replay paths, and always running full MCP sandbox installs.
Overview
Removes v0-era configuration that is no longer part of the v1 stack: the entire
configs/eval/,configs/gepa/,configs/rl/trees,configs/endpoints.toml, andconfigs/zero3.yaml. Config validation intests/v1/test_configs.pyno longer special-casesendpoints.toml.Tooling cleanup drops the unused
nemo-gym[[tool.uv.dependency-metadata]]block frompyproject.toml(and the matchinguv.lockmanifest), unused pytest markers, and acellpylibwarning filter for a package not in the lock.Dead v1 code paths are deleted without replacing callers:
Harness.run()(segment dispatch now lives onHarnessSession.turn),Agents.__iter__/__len__, legacy resolved-config lookup insaved_config_path, narrowedeval/gepaCLI usage gates (no--taskset./--harness.shortcuts), MCP sandbox install no longer honorsServerBase.EXTRASorRUNTIME_PYTHON, andPrimeAgentHarness.SUPPORTS_RESUME(unused because ACP harnesses usesession()).Reviewed by Cursor Bugbot for commit 8389294. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Remove v0 config files, dead code, and fix CLI usage-gate bypass in v1
configs/(endpoint registry, eval/gepa/rl TOMLs,zero3.yaml) and removes unused pytest markers, dependency metadata, and dead class members (Agents.__iter__,Agents.__len__,ServerBase.EXTRAS,PrimeAgentHarness.SUPPORTS_RESUME).--env./--serve.prefixes only;--taskset.and--harness.arguments no longer suppress the usage message.configs/fallback in output.py:saved_config_pathnow searches onlyconfigs/resolved/.RUNTIME_PYTHONoverride and server-class extras suffix.RUNTIME_PYTHONexecutable;saved_config_pathreturnsNonefor runs with JSON only underconfigs/rather thanconfigs/resolved/.Macroscope summarized 8389294.