Skip to content

fix(roadmap): the implement hooks stop with no uv.lock #7926

Done

Description

@dan-petty

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

  1. Take the pyproject.toml and .pre-commit-config.yaml of 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.
  2. Run bootstrap_checkout in it. It exits with no error and runs no command.
  3. 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 --frozen failure
  • Pins one pre-commit version, 4.7.0, for every checkout
  • Writes no uv.lock into 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.toml and no uv.lock
  • THEN the test in tests/roadmap/implement/test_roadmap_implement_hooks.py asserts that the command starts with uv tool run --from pre-commit==4.7.0 and holds no --frozen argument.

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.py asserts that the command starts with uv 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 sync nor uv 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.lock and no dev group
  • THEN the test asserts that the command uses uv tool run --from pre-commit==4.7.0 and holds no --group dev argument.

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 uses uv tool run --from pre-commit==4.7.0 when the checkout has no uv.lock, and keeps uv run --frozen pre-commit when 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.lock and a dev group. 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 run for a checkout with no lock. uv tool run creates an isolated environment and reads no project lock. It works with optional dependencies and writes no uv.lock.
    • Rejected: devops-cli runs uv sync to create a lock. This writes a lock file into the checkout. It still installs no pre-commit from optional dependencies.
  • 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_checkout need a uv sync for a checkout with no uv.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 sync in bootstrap_checkout. This writes a lock file and still installs no pre-commit from optional dependencies.
    • Chosen: Install pre-commit with uv tool run in the hooks step. This isolates pre-commit and needs no checkout environment.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    source/agent
    scope/roadmap
    status/new
    effort/medium
    value/high
    on Nov 30, 2026
  2. dan-petty commented on Nov 30, 2026

    @dan-petty
    OwnerAuthor
    • Priority: The implement job stops at the hooks step for any repository without a uv.lock.
    • Related: build(runner): bootstrap the dev env with uv in each Job #6517, which asks for a different change. Both concern the uv bootstrap of a checkout, but #6517 built the bootstrap and the candidate reports a gap where no lock file exists.
  3. added
    priority/p0-critical
    on Nov 30, 2026
  4. devops-cli-service commented on Nov 30, 2026

    @devops-cli-service
    Contributor

    Next step: the alternatives check records a verdict. See the section Proposed design of the body.

  5. devops-cli-service commented on Nov 30, 2026

    @devops-cli-service
    Contributor

    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:

    • prek pre-commit replacement rust single binary no python environment, results: 5
    • uv tool run pre-commit isolated environment no project lock file, results: 5
    • prek j178 pre-commit, results: 5
    • uv documentation tools uv tool run uvx, results: 5
    • astral-sh/uv tool run isolated environment pre-commit, results: 5

    Sources:

  6. added
    status/ready
    and removed
    status/new
    on Dec 1, 2026
  7. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  8. added
    owner/service
    on Dec 1, 2026
  9. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    Contributor

    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:

    1. Choose the pre-commit command by the lock file: 56040 tokens
    2. Give the scoped pre-push check the same command: 40080 tokens
    3. Update the step and phase tests for the unlocked command: 28756 tokens
    4. Update the job and metrics tests for the unlocked command: 26245 tokens

    A model review of the plan found these points. They stop no draft, and a person judges them:

    • major other at tasks (1): _pre_commit will choose the command from has_uv_lock(source). The shared test checkout (make_checkout) holds no uv.lock, so every existing test that expects uv run --frozen pre-commit for it gets the uv tool run command 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 are test_roadmap_implement_job_scoped.py, test_roadmap_implement_job_hooks.py, test_roadmap_implement_step_hooks.py, test_roadmap_implement_project_steps.py and test_roadmap_implement_phase_marks.py. Their checkouts must either get a uv.lock or the tests must expect the new command. Evidence: "STAGE = "uv run --frozen pre-commit run --hook-stage pre-commit""
  10. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    Contributor

    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):

    1. read_file({"path":"src/devops_cli/roadmap/implement/implement_hooks.py"})
    2. read_file({"path":"src/devops_cli/roadmap/implement/implement_hooks.py","start_line":158,"end_line":260})
    3. search_code({"text":"pre_commit_command"})
    4. read_file({"path":"src/devops_cli/roadmap/implement/implement_scoped_ci.py","start_line":120,"end_line":175})
    5. read_file({"path":"src/devops_cli/roadmap/runner_tools.py","start_line":380,"end_line":470})
    6. callers({"symbol":"scoped_checks"})
    7. search_code({"text":"scoped_checks(","path":"src"})
    8. search_code({"text":"pre_commit_command","path":"tests"})
    9. read_file({"path":"src/devops_cli/roadmap/implement/implement_run.py","start_line":1208,"end_line":1232})
    10. search_code({"text":"BIN_PRE_COMMIT","path":"src/devops_cli/config"})
    11. search_code({"text":"--frozen","path":"openspec/specs"})
    12. read_spec({"capability":"roadmap-implement-runner","requirement":"The Job starts each pre-commit command through uv run --frozen"})
    13. read_file({"path":"openspec/specs/roadmap-implement-runner/spec.md","start_line":326,"end_line":376})
    14. search_code({"text":"scoped_checks(","path":"tests"})
    15. search_code({"text":"CONST_PRE_COMMIT_COMMIT_STAGE","path":"src/devops_cli/config"})
    16. read_issue({"number":7924})
    17. search_code({"text":"pre_commit_command\\|install_hook_environments\\|def test_","path":"tests/roadmap/implement/test_roadmap_implement_hooks.py"})
    18. file_symbols({"path":"tests/roadmap/implement/test_roadmap_implement_hooks.py"})

    Run 2 (stage):

    1. search_code({"text":"BIN_PRE_COMMIT, *args","path":"src/devops_cli/roadmap/implement"})
    2. search_code({"text":"if (checkout / _UV_LOCK).is_file():","path":"src/devops_cli/roadmap/runner_tools.py"})

    Run 3 (stage):

    1. search_code({"text":"BIN_PRE_COMMIT, *args","path":"src/devops_cli/roadmap/implement"})
    2. search_code({"text":"(checkout / _UV_LOCK).is_file()","path":"src/devops_cli/roadmap/runner_tools.py"})
    3. callers({"symbol":"pre_commit_command"})

    Run 4 (stage):

    1. read_file({"path":"src/devops_cli/roadmap/implement/implement_hooks.py","start_line":75,"end_line":165})
    2. search_code({"text":"pre_commit_command(","path":"src"})
    3. read_file({"path":"src/devops_cli/roadmap/runner_tools.py","start_line":415,"end_line":435})
    4. read_file({"path":"src/devops_cli/roadmap/implement/implement_scoped_ci.py","start_line":105,"end_line":160})
    5. search_code({"text":"scoped_checks(","path":"src"})
    6. list_files({"directory":"tests/roadmap/implement"})
    7. read_spec({"capability":"roadmap-implement-runner","requirement":"The hook commands of a Job lock nothing"})
    8. search_code({"text":"CONST_PRE_COMMIT_PRE_PUSH_STAGE","path":"src"})

    Run 5 (stage):

    1. read_file({"path":"src/devops_cli/roadmap/implement/implement_hooks.py","start_line":120,"end_line":175})
    2. search_code({"text":"if (checkout / _UV_LOCK).is_file():","path":"src/devops_cli/roadmap/runner_tools.py"})

    Run 6 (stage_verify):

    1. read_file({"path":"src/devops_cli/roadmap/implement/implement_hooks.py","start_line":135,"end_line":300})
    2. search_code({"text":"def implement_checkout","path":"tests"})
    3. read_file({"path":"tests/support/implement_step.py","start_line":100,"end_line":150})
    4. search_code({"text":"uv.lock","path":"tests/support"})
    5. search_code({"text":"def make_checkout","path":"tests"})
    6. read_file({"path":"tests/support/implement_step.py","start_line":70,"end_line":100})
    7. search_code({"text":"--frozen","path":"tests"})
    8. search_code({"text":"The hook commands of a Job lock nothing","path":"openspec/specs"})
    9. callers({"symbol":"pre_commit_command"})
    10. read_file({"path":"tests/roadmap/implement/test_roadmap_implement_hooks.py","start_line":205,"end_line":245})
    11. search_code({"text":"uv.lock","path":"tests/roadmap/implement"})

    Run 7 (stage):

    1. search_code({"text":"run --frozen pre-commit","path":"tests"})
    2. read_file({"path":"src/devops_cli/roadmap/implement/implement_hooks.py","start_line":70,"end_line":200})
    3. search_code({"text":"def make_checkout"})
    4. read_file({"path":"tests/support/implement_step.py","start_line":70,"end_line":115})
    5. read_file({"path":"src/devops_cli/roadmap/runner_tools.py","start_line":405,"end_line":470})
    6. search_code({"text":"make_checkout","path":"tests/roadmap/implement"})
    7. search_code({"text":"uv.lock","path":"tests/roadmap/implement"})
    8. read_file({"path":"tests/roadmap/implement/test_roadmap_implement_hooks.py","start_line":1,"end_line":130})
    9. read_file({"path":"tests/support/implement_step.py","start_line":112,"end_line":160})
    10. search_code({"text":"make_checkout\\|implement_checkout\\|PRE_PUSH","path":"tests/telemetry/test_roadmap_intake_implement_metrics.py"})
    11. read_file({"path":"tests/roadmap/implement/test_roadmap_implement_job_scoped.py","start_line":175,"end_line":205})
    12. search_code({"text":"def job_world"})
    13. read_file({"path":"tests/support/roadmap_implement.py","start_line":640,"end_line":760})
    14. search_code({"text":"CONST_PRE_COMMIT_COMMIT_STAGE","path":"src"})
    15. read_file({"path":"tests/telemetry/test_roadmap_intake_implement_metrics.py","start_line":55,"end_line":110})
    16. search_code({"text":"def stage_repo","path":"tests"})
    17. search_code({"text":"--frozen","path":"tests"})
    18. search_code({"text":"PRE_PUSH","path":"tests/telemetry/test_roadmap_intake_implement_metrics.py"})
    19. search_code({"text":"scoped_checks(","path":"src"})
    20. search_code({"text":"devops ci test tests/","path":"docs/TESTING.md"})
    21. read_file({"path":"tests/roadmap/implement/test_roadmap_implement_job_scoped.py","start_line":536,"end_line":560})
    22. callers({"symbol":"pre_commit_command"})
    23. read_spec({"capability":"roadmap-implement-runner","requirement":"The hook commands of a Job lock nothing"})

    Run 8 (stage):

    1. file_symbols({"path":"tests/roadmap/implement/test_roadmap_implement_step_hooks.py"})
    2. search_code({"text":"run --frozen pre-commit","path":"tests"})
    3. search_code({"text":"STAGE_CMD","path":"tests/roadmap/implement/test_roadmap_implement_job_hooks.py"})
    4. search_code({"text":"def test_","path":"tests/roadmap/implement/test_roadmap_implement_step_repair.py"})
    5. search_code({"text":"def ","path":"tests/roadmap/implement/test_roadmap_implement_job_scoped.py"})
    6. search_code({"text":"HOOK_PRE_PUSH","path":"tests/roadmap/implement/test_roadmap_implement_project_steps.py"})
    7. read_file({"path":"tests/roadmap/implement/test_roadmap_implement_project_steps.py","start_line":100,"end_line":118})
    8. search_code({"text":"PRE_PUSH","path":"tests/roadmap/implement/test_roadmap_implement_phase_marks.py"})
    9. read_file({"path":"tests/roadmap/implement/test_roadmap_implement_phase_marks.py","start_line":208,"end_line":234})
    10. search_code({"text":"PRE_PUSH","path":"tests/telemetry/test_roadmap_intake_implement_metrics.py"})
    11. read_file({"path":"tests/telemetry/test_roadmap_intake_implement_metrics.py","start_line":366,"end_line":384})
    12. file_symbols({"path":"tests/roadmap/implement/test_roadmap_implement_job_hooks.py"})
    13. search_code({"text":"CONST_PRE_COMMIT_COMMIT_STAGE","path":"src"})

    Run 9 (stage_verify):

    1. search_code({"text":"scoped_checks(","path":"src"})
    2. search_code({"text":"run --frozen pre-commit","path":"tests"})
    3. search_code({"text":"pre_commit_command"})
    4. search_code({"text":"--frozen","path":"tests"})
    5. read_file({"path":"tests/support/roadmap_implement.py","start_line":470,"end_line":530})
    6. search_code({"text":"install-hooks","path":"tests"})
    7. read_file({"path":"tests/roadmap/steps/test_roadmap_step_fix_checks_repair.py","start_line":790,"end_line":870})
    8. search_code({"text":"locked_world","path":"tests"})
    9. search_code({"text":"\"pre-commit\"","path":"tests"})
    10. read_file({"path":"src/devops_cli/roadmap/implement/implement_hooks.py","start_line":145,"end_line":290})
    11. read_file({"path":"src/devops_cli/roadmap/implement/implement_run.py","start_line":1205,"end_line":1230})
    12. search_code({"text":"BIN_PRE_COMMIT"})
    13. search_code({"text":"hook-stage","path":"tests"})
    14. 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).

  11. removed
    owner/service
    on Dec 1, 2026
  12. added
    owner/agent
    on Dec 1, 2026
  13. added 2 commits that reference this issue on Dec 1, 2026
  14. removed
    status/ready
    owner/agent
    on Dec 1, 2026
  15. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    Contributor

    Live since 2026-12-01 03:18 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p0-criticalscope/roadmapsource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions