Repository navigation
Description
Problem Description
The implement job cannot install the hooks of a repository that has a pyproject.toml and .pre-commit-config.yaml but no uv.lock. bootstrap_checkout in src/devops_cli/roadmap/runner_tools.py runs no uv sync for such a checkout. src/devops_cli/roadmap/implement/implement_hooks.py then starts uv run --frozen pre-commit, and --frozen needs the lock file. The item stops at hooks with class ci_infra.
dan-petty/vibes is such a repository: it has no uv.lock, and it declares its test and lint packages in [project.optional-dependencies], not in a dev dependency group. Today the failure is hidden by #7924, which stops the same command earlier with a Python error.
Reproduction Steps
- Take the
pyproject.tomland.pre-commit-config.yamlof dan-petty/vibes into an empty git repository, in a runner image that holds the fix of fix(docker): a runner Job cannot build a Python 3.15 checkout #7924. - Run
bootstrap_checkoutin it. It exits with no error and runs no command. - Run
uv run --frozen pre-commit install-hooks --config .pre-commit-config.yaml.
Expected vs Actual Behavior
Expected: the job installs the hooks of the repository, or its stop names the missing lock file as the cause that the repository must fix.
Actual: the command exits 1 on the missing lock file.
Environment Diagnostics
devops-cli 0.264.1 with the change of #7924, runner image built from ghcr.io/dan-petty/devtools:1.6.1, uv 0.13.10. Measured with Podman on 2026-11-30.
Logs, Traces, or Terminal Output
error: Unable to find lockfile at `uv.lock`, but `--frozen` was provided. To create a lockfile, run `uv lock` or `uv sync` without the flag.
Proposed Solution
Decide which side changes. One way is that the repository commits a uv.lock with a dev dependency group that holds pre-commit, as dan-petty/homelab and dan-petty/infra do. Then devops-cli needs no change except a clear stop message. The other way is that devops-cli defines how a job builds the environment of a repository with no lock file.
Source
Source: #7924
Alternatives check of 2026-11-30: in-use.
The repository already uses this tool.
Tool: uv (https://github.com/astral-sh/uv), Apache-2.0, last activity 2026-11-30, maintained.
Reason: The facts of uv show that uv tool run --from pre-commit runs pre-commit in an isolated environment and reads no project lock file. That covers the hooks step, and the issue already proposes this command.
Covers:
- Runs pre-commit in an isolated tool environment
- Reads no project lock file, so no
--frozenfailure - Pins one pre-commit version, 4.7.0, for every checkout
- Writes no
uv.lockinto the checkout
Lacks:
- Does not build the checkout project environment
- Does not resolve pre-commit from optional dependencies
- Needs step code to choose the branch on
uv.lock
Proposed design
Problem statement
Change devops-cli, not the managed repository. The implement hooks step fails for a checkout that has pyproject.toml and .pre-commit-config.yaml but no uv.lock, because the step runs uv run --frozen pre-commit and --frozen requires the lock file. The change runs pre-commit in an isolated uv tool run environment when the checkout has no lock file, and keeps the project environment when it has one.
Acceptance criteria
Requirement: Hooks install without a lock file
The implement hooks step SHALL run pre-commit through uv tool run when the checkout has no uv.lock.
Scenario: A checkout with pyproject.toml and no uv.lock
- WHEN the hooks step builds the install-hooks command for a checkout that holds
pyproject.tomland nouv.lock - THEN the test in
tests/roadmap/implement/test_roadmap_implement_hooks.pyasserts that the command starts withuv tool run --from pre-commit==4.7.0and holds no--frozenargument.
Requirement: Locked checkout keeps the project environment
The implement hooks step SHALL keep uv run --frozen pre-commit when the checkout holds a uv.lock.
Scenario: A checkout with uv.lock
- WHEN the hooks step builds the install-hooks command for a checkout that holds
uv.lock - THEN the test in
tests/roadmap/implement/test_roadmap_implement_hooks.pyasserts that the command starts withuv run --frozen pre-commit.
Requirement: The hooks step writes no lock file
The implement hooks step MUST not create or change uv.lock in the checkout.
Scenario: No lock file before the step
- WHEN the hooks step builds the install-hooks command for a checkout with no
uv.lock - THEN the test asserts that the command holds neither
uv syncnoruv lock.
Requirement: Optional dependencies need no dev group
The implement hooks step SHALL install pre-commit for a checkout that declares pre-commit only in optional dependencies and has no dev group.
Scenario: A checkout with optional dependencies and no dev group
- WHEN the hooks step builds the install-hooks command for a checkout with no
uv.lockand nodevgroup - THEN the test asserts that the command uses
uv tool run --from pre-commit==4.7.0and holds no--group devargument.
Existing Tool Considered
uv (https://github.com/astral-sh/uv), verdict in-use: the alternatives check in the issue body records what uv covers and lacks. This change adds the step code that the check says uv lacks: the hooks step chooses uv tool run --from pre-commit==4.7.0 pre-commit when the checkout has no uv.lock, and keeps uv run --frozen pre-commit when it has one. It uses the pinned version, so it does not resolve pre-commit from optional dependencies, and it does not build the checkout project environment. The hooks step does not need that environment.
Key questions
- Which command does the implement hooks step run today?: It runs
uv run --frozen pre-commit install-hooks --config .pre-commit-config.yaml. [sources: src/devops_cli/roadmap/implement/implement_hooks.py:84, src/devops_cli/roadmap/implement/implement_hooks.py:127] - Which side changes to support a checkout with no
uv.lock?: devops-cli changes. The hooks step usesuv tool run --from pre-commit==4.7.0when the checkout has nouv.lock, and keepsuv run --frozen pre-commitwhen it has one. The managed repository needs no dev group and no lock file. (best practice) [sources: src/devops_cli/roadmap/implement/implement_hooks.py:84, src/devops_cli/roadmap/runner_tools.py:417]- Rejected: The repository commits
uv.lockand adevgroup. This forces each managed repository to adopt a uv lock and a dev group. It does not help a repository that declares tools in optional dependencies. - Chosen: devops-cli uses
uv tool runfor a checkout with no lock.uv tool runcreates an isolated environment and reads no project lock. It works with optional dependencies and writes nouv.lock. - Rejected: devops-cli runs
uv syncto create a lock. This writes a lock file into the checkout. It still installs no pre-commit from optional dependencies.
- Rejected: The repository commits
- Which pre-commit version does the isolated tool environment use?: It uses the pre-commit version that devops-cli pins in its dev group,
pre-commit==4.7.0. (best practice) [sources: pyproject.toml]- Rejected: Latest pre-commit. An unpinned tool can change without a code change.
- Chosen: The devops-cli pinned version. The project already pins and tests this version.
- Rejected: The version from the managed repository. The checkout has no lock file and no dev group, so the step cannot resolve a version from it.
- Does
bootstrap_checkoutneed auv syncfor a checkout with nouv.lock?: No. The hooks step installs pre-commit in an isolated tool environment. It does not need the checkout environment or a lock file. (best practice) [sources: src/devops_cli/roadmap/runner_tools.py:417, src/devops_cli/roadmap/implement/implement_hooks.py:84]- Rejected: Run
uv syncinbootstrap_checkout. This writes a lock file and still installs no pre-commit from optional dependencies. - Chosen: Install pre-commit with
uv tool runin the hooks step. This isolates pre-commit and needs no checkout environment.
- Rejected: Run
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 30, 2026
The implement job stops at the hooks step for any repository without a uv.lock.Both concern the uv bootstrap of a checkout, but #6517 built the bootstrap and the candidate reports a gap where no lock file exists.devops-cli-service commentedon Nov 30, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.
devops-cli-service commentedon Nov 30, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (5)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Dec 1, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
devops-cli-service commentedon Dec 1, 2026
Plan state: branch
fix/7926-the-implement-hooks-stop-with-no, draft pull request #7995. The pull request plans the item and closes no issue. The stage job and the step fix-plan edit this comment, and a comment of each run tells what the run did.The task groups, with the tokens of the inputs of each step, for a budget of 64000 tokens:
A model review of the plan found these points. They stop no draft, and a person judges them:
otherat tasks (1):_pre_commitwill choose the command fromhas_uv_lock(source). The shared test checkout (make_checkout) holds nouv.lock, so every existing test that expectsuv run --frozen pre-commitfor it gets theuv tool runcommand and fails. Group 1 adds only three new tests, and the verify runs one file. Group 2 only reads the other test modules and changes none of them. The plan does not update these tests. Examples aretest_roadmap_implement_job_scoped.py,test_roadmap_implement_job_hooks.py,test_roadmap_implement_step_hooks.py,test_roadmap_implement_project_steps.pyandtest_roadmap_implement_phase_marks.py. Their checkouts must either get auv.lockor the tests must expect the new command. Evidence: "STAGE = "uv run --frozen pre-commit run --hook-stage pre-commit""devops-cli-service commentedon Dec 1, 2026
The stage job staged the plan of draft pull request #7995. The plan state comment of #7995 holds the branch, the task groups and the findings.
The runs of the planner and the review made 104 model request(s), and used 8600032 input tokens and 85754 output tokens. The tool calls, in order:
Run 1 (stage):
read_file({"path":"src/devops_cli/roadmap/implement/implement_hooks.py"})read_file({"path":"src/devops_cli/roadmap/implement/implement_hooks.py","start_line":158,"end_line":260})search_code({"text":"pre_commit_command"})read_file({"path":"src/devops_cli/roadmap/implement/implement_scoped_ci.py","start_line":120,"end_line":175})read_file({"path":"src/devops_cli/roadmap/runner_tools.py","start_line":380,"end_line":470})callers({"symbol":"scoped_checks"})search_code({"text":"scoped_checks(","path":"src"})search_code({"text":"pre_commit_command","path":"tests"})read_file({"path":"src/devops_cli/roadmap/implement/implement_run.py","start_line":1208,"end_line":1232})search_code({"text":"BIN_PRE_COMMIT","path":"src/devops_cli/config"})search_code({"text":"--frozen","path":"openspec/specs"})read_spec({"capability":"roadmap-implement-runner","requirement":"The Job starts each pre-commit command through uv run --frozen"})read_file({"path":"openspec/specs/roadmap-implement-runner/spec.md","start_line":326,"end_line":376})search_code({"text":"scoped_checks(","path":"tests"})search_code({"text":"CONST_PRE_COMMIT_COMMIT_STAGE","path":"src/devops_cli/config"})read_issue({"number":7924})search_code({"text":"pre_commit_command\\|install_hook_environments\\|def test_","path":"tests/roadmap/implement/test_roadmap_implement_hooks.py"})file_symbols({"path":"tests/roadmap/implement/test_roadmap_implement_hooks.py"})Run 2 (stage):
search_code({"text":"BIN_PRE_COMMIT, *args","path":"src/devops_cli/roadmap/implement"})search_code({"text":"if (checkout / _UV_LOCK).is_file():","path":"src/devops_cli/roadmap/runner_tools.py"})Run 3 (stage):
search_code({"text":"BIN_PRE_COMMIT, *args","path":"src/devops_cli/roadmap/implement"})search_code({"text":"(checkout / _UV_LOCK).is_file()","path":"src/devops_cli/roadmap/runner_tools.py"})callers({"symbol":"pre_commit_command"})Run 4 (stage):
read_file({"path":"src/devops_cli/roadmap/implement/implement_hooks.py","start_line":75,"end_line":165})search_code({"text":"pre_commit_command(","path":"src"})read_file({"path":"src/devops_cli/roadmap/runner_tools.py","start_line":415,"end_line":435})read_file({"path":"src/devops_cli/roadmap/implement/implement_scoped_ci.py","start_line":105,"end_line":160})search_code({"text":"scoped_checks(","path":"src"})list_files({"directory":"tests/roadmap/implement"})read_spec({"capability":"roadmap-implement-runner","requirement":"The hook commands of a Job lock nothing"})search_code({"text":"CONST_PRE_COMMIT_PRE_PUSH_STAGE","path":"src"})Run 5 (stage):
read_file({"path":"src/devops_cli/roadmap/implement/implement_hooks.py","start_line":120,"end_line":175})search_code({"text":"if (checkout / _UV_LOCK).is_file():","path":"src/devops_cli/roadmap/runner_tools.py"})Run 6 (stage_verify):
read_file({"path":"src/devops_cli/roadmap/implement/implement_hooks.py","start_line":135,"end_line":300})search_code({"text":"def implement_checkout","path":"tests"})read_file({"path":"tests/support/implement_step.py","start_line":100,"end_line":150})search_code({"text":"uv.lock","path":"tests/support"})search_code({"text":"def make_checkout","path":"tests"})read_file({"path":"tests/support/implement_step.py","start_line":70,"end_line":100})search_code({"text":"--frozen","path":"tests"})search_code({"text":"The hook commands of a Job lock nothing","path":"openspec/specs"})callers({"symbol":"pre_commit_command"})read_file({"path":"tests/roadmap/implement/test_roadmap_implement_hooks.py","start_line":205,"end_line":245})search_code({"text":"uv.lock","path":"tests/roadmap/implement"})Run 7 (stage):
search_code({"text":"run --frozen pre-commit","path":"tests"})read_file({"path":"src/devops_cli/roadmap/implement/implement_hooks.py","start_line":70,"end_line":200})search_code({"text":"def make_checkout"})read_file({"path":"tests/support/implement_step.py","start_line":70,"end_line":115})read_file({"path":"src/devops_cli/roadmap/runner_tools.py","start_line":405,"end_line":470})search_code({"text":"make_checkout","path":"tests/roadmap/implement"})search_code({"text":"uv.lock","path":"tests/roadmap/implement"})read_file({"path":"tests/roadmap/implement/test_roadmap_implement_hooks.py","start_line":1,"end_line":130})read_file({"path":"tests/support/implement_step.py","start_line":112,"end_line":160})search_code({"text":"make_checkout\\|implement_checkout\\|PRE_PUSH","path":"tests/telemetry/test_roadmap_intake_implement_metrics.py"})read_file({"path":"tests/roadmap/implement/test_roadmap_implement_job_scoped.py","start_line":175,"end_line":205})search_code({"text":"def job_world"})read_file({"path":"tests/support/roadmap_implement.py","start_line":640,"end_line":760})search_code({"text":"CONST_PRE_COMMIT_COMMIT_STAGE","path":"src"})read_file({"path":"tests/telemetry/test_roadmap_intake_implement_metrics.py","start_line":55,"end_line":110})search_code({"text":"def stage_repo","path":"tests"})search_code({"text":"--frozen","path":"tests"})search_code({"text":"PRE_PUSH","path":"tests/telemetry/test_roadmap_intake_implement_metrics.py"})search_code({"text":"scoped_checks(","path":"src"})search_code({"text":"devops ci test tests/","path":"docs/TESTING.md"})read_file({"path":"tests/roadmap/implement/test_roadmap_implement_job_scoped.py","start_line":536,"end_line":560})callers({"symbol":"pre_commit_command"})read_spec({"capability":"roadmap-implement-runner","requirement":"The hook commands of a Job lock nothing"})Run 8 (stage):
file_symbols({"path":"tests/roadmap/implement/test_roadmap_implement_step_hooks.py"})search_code({"text":"run --frozen pre-commit","path":"tests"})search_code({"text":"STAGE_CMD","path":"tests/roadmap/implement/test_roadmap_implement_job_hooks.py"})search_code({"text":"def test_","path":"tests/roadmap/implement/test_roadmap_implement_step_repair.py"})search_code({"text":"def ","path":"tests/roadmap/implement/test_roadmap_implement_job_scoped.py"})search_code({"text":"HOOK_PRE_PUSH","path":"tests/roadmap/implement/test_roadmap_implement_project_steps.py"})read_file({"path":"tests/roadmap/implement/test_roadmap_implement_project_steps.py","start_line":100,"end_line":118})search_code({"text":"PRE_PUSH","path":"tests/roadmap/implement/test_roadmap_implement_phase_marks.py"})read_file({"path":"tests/roadmap/implement/test_roadmap_implement_phase_marks.py","start_line":208,"end_line":234})search_code({"text":"PRE_PUSH","path":"tests/telemetry/test_roadmap_intake_implement_metrics.py"})read_file({"path":"tests/telemetry/test_roadmap_intake_implement_metrics.py","start_line":366,"end_line":384})file_symbols({"path":"tests/roadmap/implement/test_roadmap_implement_job_hooks.py"})search_code({"text":"CONST_PRE_COMMIT_COMMIT_STAGE","path":"src"})Run 9 (stage_verify):
search_code({"text":"scoped_checks(","path":"src"})search_code({"text":"run --frozen pre-commit","path":"tests"})search_code({"text":"pre_commit_command"})search_code({"text":"--frozen","path":"tests"})read_file({"path":"tests/support/roadmap_implement.py","start_line":470,"end_line":530})search_code({"text":"install-hooks","path":"tests"})read_file({"path":"tests/roadmap/steps/test_roadmap_step_fix_checks_repair.py","start_line":790,"end_line":870})search_code({"text":"locked_world","path":"tests"})search_code({"text":"\"pre-commit\"","path":"tests"})read_file({"path":"src/devops_cli/roadmap/implement/implement_hooks.py","start_line":145,"end_line":290})read_file({"path":"src/devops_cli/roadmap/implement/implement_run.py","start_line":1205,"end_line":1230})search_code({"text":"BIN_PRE_COMMIT"})search_code({"text":"hook-stage","path":"tests"})read_file({"path":"tests/roadmap/implement/test_roadmap_implement_token_isolation.py","start_line":100,"end_line":150})Tool calls: callers=4 (empty=0), file_symbols=3 (empty=0), list_files=1 (empty=0), read_file=31 (empty=0), read_issue=1 (empty=0), read_spec=3 (empty=0), search_code=51 (empty=3)
The stage job read the open pull requests and their files in 1 GraphQL request(s).
The plan request held these comments of the item whole: #7926 (comment), #7926 (comment), #7926 (comment), #7926 (comment).
docs(spec): plan #7926 Run hooks through uv tool run with no uv.lock
docs(spec): archive the change of #7926
devops-cli-service commentedon Dec 1, 2026
Released in v0.268.2: https://github.com/dan-petty/devops-cli/releases/tag/v0.268.2
devops-cli-service commentedon Dec 1, 2026
Live since 2026-12-01 03:18 UTC