Skip to content

chore(v1): remove dead code and v0 leftovers - #2496

Merged
xeophon merged 2 commits into
mainfrom
chore/remove-dead-v1-code
Sep 2, 2026
Merged

chore(v1): remove dead code and v0 leftovers#2496
xeophon merged 2 commits into
mainfrom
chore/remove-dead-v1-code

Conversation

@hallerite

@hallerite hallerite commented Sep 2, 2026

Copy link
Copy Markdown
Member

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.toml are the vf-eval / DeepSpeed formats of the removed v0 stack. tests/v1/test_configs.py already excluded them; the filter goes with them.

pyproject. The [[tool.uv.dependency-metadata]] nemo-gym block is inert (nemo-gym stopped being a dependency in #2476; the PEP 723 header in tasksets/nemo_gym/server.py is the one that is used), so uv.lock loses its manifest entry. Markers integration, slow, unit, parsers, rubrics, environments are applied by no test; the cellpylib warning filter targets a package that is not in the lock.

Dead code.

snapshot_untracked was 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/Episode record model (Episode aggregates, PolicySpan.drift, Trace.last_message) — those have downstream consumers outside this repo; agent_config_fields (its _declared_agent_configs twin checks field defaults, not values, so swapping is not a pure deletion), WireTrace, InterceptionError, the Branch trainer-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, and pytest 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, and configs/zero3.yaml. Config validation in tests/v1/test_configs.py no longer special-cases endpoints.toml.

Tooling cleanup drops the unused nemo-gym [[tool.uv.dependency-metadata]] block from pyproject.toml (and the matching uv.lock manifest), unused pytest markers, and a cellpylib warning filter for a package not in the lock.

Dead v1 code paths are deleted without replacing callers: Harness.run() (segment dispatch now lives on HarnessSession.turn), Agents.__iter__/__len__, legacy resolved-config lookup in saved_config_path, narrowed eval/gepa CLI usage gates (no --taskset. / --harness. shortcuts), MCP sandbox install no longer honors ServerBase.EXTRAS or RUNTIME_PYTHON, and PrimeAgentHarness.SUPPORTS_RESUME (unused because ACP harnesses use session()).

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

  • Deletes leftover v0 configs under 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).
  • Restricts the typed-axis usage-gate bypass in main.py and gepa.py to --env./--serve. prefixes only; --taskset. and --harness. arguments no longer suppress the usage message.
  • Removes the configs/ fallback in output.py: saved_config_path now searches only configs/resolved/.
  • Changes non-subprocess MCP server launch in launch.py to always install a sandbox venv and use its Python, dropping the RUNTIME_PYTHON override and server-class extras suffix.
  • Risk: non-subprocess MCP servers no longer honor a prebuilt RUNTIME_PYTHON executable; saved_config_path returns None for runs with JSON only under configs/ rather than configs/resolved/.

Macroscope summarized 8389294.

@hallerite
hallerite marked this pull request as ready for review September 2, 2026 02:29
@hallerite
hallerite marked this pull request as draft September 2, 2026 02:30
@macroscopeapp

macroscopeapp Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 45d21a1

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.

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Sep 2, 2026
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
hallerite force-pushed the chore/remove-dead-v1-code branch from 60dd576 to 45d21a1 Compare September 2, 2026 08:37
@hallerite
hallerite marked this pull request as ready for review September 2, 2026 08:44
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes 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
xeophon merged commit b26fb4d into main Sep 2, 2026
13 checks passed
@xeophon
xeophon deleted the chore/remove-dead-v1-code branch September 2, 2026 14:54
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>
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.

2 participants