chore: move the legacy scripts into legacy/ (v2.0.1) - #243
luca-belli wants to merge 5 commits into
Conversation
`vera generate` imported `run_for_user_models` from the legacy root `generate.py`, so the new CLI depended on a deprecated script. Move it and its `_legacy_model_config` helper into `generate_conversations/main.py`, where it calls `run_generation` directly instead of going through the legacy `main` wrapper, and export it from the package. Tests that patched `generate.main` for the `vera` path now patch `generate_conversations.main.run_generation`; the keyword arguments are the same, since `main` only forwarded them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pure renames, so git history follows each file. The tree does not run between this commit and the next, which updates every reference; skip it when bisecting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The legacy entry points now run as modules from the repository root: `uv run python -m legacy.generate`, `-m legacy.judge`, `-m legacy.score`, and `-m legacy.run_pipeline`. - Move `judge/score.py`'s CLI (`main`) to `legacy/score.py`; the scoring domain (`run_scoring`) stays in `judge/score.py`. - Add `legacy/README.md`: deprecated, may be removed at any time. - `legacy/run_pipeline.py` imports `legacy.generate` and loads its sibling `judge.py` by path relative to itself, not to the working directory. - Update tests, shell scripts, Dockerfile `CMD` (now `vera.py --help`), CODEOWNERS, the Claude slash commands and permissions, and the docs. With `generate.py` out of the root, `generate_conversations/` can be renamed to `generate/` without shadowing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| return results, output_folder | ||
|
|
||
|
|
||
| async def run_for_user_models( |
There was a problem hiding this comment.
where is this coming from?
There was a problem hiding this comment.
It is moved from the root generate.py (lines 66–143 on main), where it was added in ea1f2c13 ("derive run-defining flags and move fan-out downstream") as part of #191, vera generate. That is the first commit of this PR, e82bf13f. _legacy_model_config moved with it.
Why it had to move: vera_cli/generate.py did from generate import run_for_user_models, so the new CLI depended on the legacy script. With generate.py in legacy/, that import would have tied vera to legacy/.
The code is unchanged except for one call. It used to go through the legacy main(), a pass-through wrapper with the same keyword arguments, and now calls run_generation directly. The rest of the diff is docstrings that named main, plus one paragraph that described this exact move, which no longer applies. You can check it with git diff origin/main:generate.py: the 80 lines removed there are what appears here.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Version 2.0.1. Moves the deprecated pre-2.0 entry points into
legacy/. This breaks their current commands:python generate.pybecomesuv run python -m legacy.generate, and so on.Three commits, ordered so git history follows each file:
refactor: move run_for_user_models into the generation package.vera generateimportedrun_for_user_modelsfrom the legacy rootgenerate.py, so the new CLI depended on a deprecated script. It now lives ingenerate_conversations/main.pyand callsrun_generationdirectly. Tests patch that instead ofgenerate.main; the arguments are the same.chore: move the legacy scripts into legacy/ (rename only).generate.py,judge.py,run_pipeline.py, andscripts/run_recommended_vera_pipeline.shmove intolegacy/, unchanged. The tree doesn't run at this commit alone; skip it when bisecting.chore: run the legacy scripts from legacy/ and update every reference.judge/score.py's CLI (main) moves tolegacy/score.py; the scoring domain (run_scoring) stays injudge/score.py.legacy/README.md(deprecated, may be removed at any time) andlegacy/__init__.py.legacy/run_pipeline.pyloads its siblingjudge.pyrelative to itself, not the working directory./run_pipeline.py→/legacy/), and the DockerfileCMD(python vera.py --help; the oldgenerate.pyexited with a usage error when run without arguments). Also the/run-generator,/run-judge, and/verifycommands (now pointing atvera), the.claude/settings.jsonpermissions (same grants, new paths), and the docs.Plus a
v2.0.1changelog entry.uv run python generate.py …uv run python -m legacy.generate …uv run python judge.py …uv run python -m legacy.judge …uv run python -m judge.score …uv run python -m legacy.score …uv run python run_pipeline.py …uv run python -m legacy.run_pipeline …./scripts/run_recommended_vera_pipeline.sh./legacy/run_recommended_vera_pipeline.shWith
generate.pyout of the root,generate_conversations/can next be renamed togenerate/without the package and the script sharing a name.Merge order
Merge #242 first. Both PRs edit the lines right under
## [Unreleased]inCHANGELOG.md; this one gets a one-hunk rebase after #242 lands.Test plan
uv run pytest -m "not live": 1181 passed, 81% coverageruff format --checkandruff checkpass--helpworks for-m legacy.generate,legacy.judge,legacy.score,legacy.run_pipeline, andvera.py;bash -npasses on the moved shell scriptpython -m legacy.*. Not run: they need the internal gateway.🤖 Generated with Claude Code