Skip to content

chore: move the legacy scripts into legacy/ (v2.0.1) - #243

Open
luca-belli wants to merge 5 commits into
mainfrom
chore/legacy-folder
Open

luca-belli wants to merge 5 commits into
mainfrom
chore/legacy-folder

Conversation

@luca-belli

Copy link
Copy Markdown
Collaborator

Summary

Version 2.0.1. Moves the deprecated pre-2.0 entry points into legacy/. This breaks their current commands: python generate.py becomes uv run python -m legacy.generate, and so on.

Three commits, ordered so git history follows each file:

  1. refactor: move run_for_user_models into the generation package. vera generate imported run_for_user_models from the legacy root generate.py, so the new CLI depended on a deprecated script. It now lives in generate_conversations/main.py and calls run_generation directly. Tests patch that instead of generate.main; the arguments are the same.
  2. chore: move the legacy scripts into legacy/ (rename only). generate.py, judge.py, run_pipeline.py, and scripts/run_recommended_vera_pipeline.sh move into legacy/, unchanged. The tree doesn't run at this commit alone; skip it when bisecting.
  3. chore: run the legacy scripts from legacy/ and update every reference.
    • judge/score.py's CLI (main) moves to legacy/score.py; the scoring domain (run_scoring) stays in judge/score.py.
    • Adds legacy/README.md (deprecated, may be removed at any time) and legacy/__init__.py.
    • legacy/run_pipeline.py loads its sibling judge.py relative to itself, not the working directory.
    • Updates tests, shell scripts, CODEOWNERS (/run_pipeline.py → /legacy/), and the Dockerfile CMD (python vera.py --help; the old generate.py exited with a usage error when run without arguments). Also the /run-generator, /run-judge, and /verify commands (now pointing at vera), the .claude/settings.json permissions (same grants, new paths), and the docs.

Plus a v2.0.1 changelog entry.

Before After
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.sh

With generate.py out of the root, generate_conversations/ can next be renamed to generate/ without the package and the script sharing a name.

Merge order

Merge #242 first. Both PRs edit the lines right under ## [Unreleased] in CHANGELOG.md; this one gets a one-hunk rebase after #242 lands.

Test plan

  • uv run pytest -m "not live": 1181 passed, 81% coverage
  • ruff format --check and ruff check pass
  • --help works for -m legacy.generate, legacy.judge, legacy.score, legacy.run_pipeline, and vera.py; bash -n passes on the moved shell script
  • Live tests still collect; their subprocess commands now use python -m legacy.*. Not run: they need the internal gateway.
  • CI green, including the Docker build (the Dockerfile changed)

🤖 Generated with Claude Code

luca-belli and others added 4 commits October 1, 2026 16:24
`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>
@luca-belli
luca-belli requested a review from a team as a code owner October 1, 2026 23:28
return results, output_folder


async def run_for_user_models(

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

where is this coming from?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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>

@jgieringer jgieringer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

easy

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