Repository navigation
Description
Problem
The runner image of the stage, implement and fix-checks Jobs installs the whole dev dependency group of uv.lock into /app/.venv, and /app/.venv/bin is first on PATH. So the checks of a Job (ruff, mypy, pytest, pre-commit) can run from the image venv and not from the checkout the agent changes. The checkout gets its own environment only by accident: the first uv run of the Job (uv run pre-commit install-hooks) builds it. src/devops_cli/roadmap/runner_tools.py lists the dev tools (_dev(...), for example ruff and mypy) as tools of the image, and the runner smoke test checks them on PATH.
Owner direction (2026-11-20): "actually I don't think the dev dependencies should be in the image, there should be a uv command to bootstrap the coder environment". The plan/implement image is the devtools image plus the devops-cli runtime only (#4361, PR #6513).
Change
- The runner image installs only the runtime dependencies of devops-cli (and the
reviewextra) into/app/.venv: no dev group. - Each Job bootstraps the coder environment in its checkout with one explicit command before the agent starts:
uv sync --lockedwith the dev group, as the devcontainer post-create does (docs/DEVCONTAINER_USAGE.md). - Every check a Job runs (ruff, mypy, pytest, pre-commit,
devops ci) uses the checkout environment, never/app/.venv. runner_tools.pymoves the dev tools from "in the image" to "in the checkout environment after the bootstrap"; the runner smoke test proves the image and the bootstrap together.
Proof
- A test (written first) shows that the Job runs the bootstrap command in the checkout before the first agent step, and that a check runs the checkout's tools.
- The runner smoke step runs the bootstrap on a checkout inside the image and then
uv run ruff --version,uv run pytest --versionanduv run mypy --versionfrom it. docker run --rm <runner> sh -c 'ls /app/.venv/bin'shows no ruff, mypy or pytest.
Proposed design
Problem statement
The runner image installs the full dev dependency group, so Job checks can run from /app/.venv instead of the checkout. Each stage, implement and fix-checks Job must bootstrap its checkout with uv sync --locked and run every check from that environment.
Acceptance criteria
Requirement: Runner image has no dev tools
The runner image SHALL install only the runtime dependencies of devops-cli and the review extra into /app/.venv.
Scenario: The image venv has no dev tool
- WHEN the runner image is built and
docker run --rm "$RUNNER_IMAGE" sh -c 'ls /app/.venv/bin'runs - THEN the output lists no
ruff,mypy,pytestorpre-commitexecutable
Requirement: Checkout bootstrap command
Each stage, implement and fix-checks Job MUST run uv sync --locked in its checkout before the first agent step.
Scenario: A job bootstraps before the agent
- WHEN a job test records the setup commands of the stage, implement or fix-checks Job
- THEN the setup runs
uv sync --lockedin the checkout before the first agent step
Requirement: Shared bootstrap function
The runner code SHALL expose one bootstrap function in src/devops_cli/roadmap/runner_tools.py that the stage, implement and fix-checks Jobs call.
Scenario: All jobs call the shared bootstrap
- WHEN a test inspects the setup of the stage, implement and fix-checks Jobs
- THEN each job calls the same bootstrap function and passes its checkout path
Requirement: Checks use the checkout environment
Every check that a Job runs MUST resolve ruff, mypy, pytest, pre-commit and devops from the checkout environment.
Scenario: A check uses the checkout tools
- WHEN a job test runs a check after the bootstrap
- THEN the check resolves each tool under
<checkout>/.venv/binand not under/app/.venv/bin
Requirement: Dev tools move to the checkout inventory
runner_tools.py SHALL report ruff, mypy, pytest and pre-commit as tools of the checkout environment after bootstrap, not tools of the image.
Scenario: The tool inventory names the checkout
- WHEN a test reads the tool inventory from
src/devops_cli/roadmap/runner_tools.py - THEN each dev tool has the checkout source and no dev tool has the image source
Requirement: Runner smoke proves the bootstrap
The runner smoke step MUST run the checkout bootstrap inside the image and then run the dev tools from that checkout.
Scenario: The smoke step prints dev tool versions
- WHEN the runner smoke step runs
uv run ruff --version,uv run pytest --versionanduv run mypy --versionin a checkout inside the image - THEN each command exits 0 and prints the version from the checkout environment
Existing Tool Considered
No alternatives check has run. uv (https://docs.astral.sh/uv/) is the open, maintained tool that covers the need: uv sync --locked builds the checkout environment from uv.lock, including the default dev group. The change writes no new tool code.
Key questions
- Which command bootstraps the checkout environment in each Job?: Use
uv sync --lockedin the checkout. The command installs the defaultdevgroup, as the devcontainer post-create does. (best practice) [sources: docs/DEVCONTAINER_USAGE.md, uv.lock]- Chosen: uv sync --locked. It uses the existing lock and the documented devcontainer command.
- Rejected: uv sync --locked --no-dev. It leaves out the dev tools that the checks need.
- Rejected: pip install -e .[dev]. It adds a second resolver and does not use
uv.lock.
- Which dependencies stay in the runner image?: Install the runtime dependencies of devops-cli and the
reviewextra only. Install nodevgroup. The owner direction in the issue removes the dev group from the image. (best practice) [sources: pyproject.toml, uv.lock]- Chosen: runtime and review extra. The runner needs devops-cli and the review extra at runtime.
- Rejected: full dev group. The owner direction removes the dev group from the image.
- Rejected: runtime only. The runner needs the review extra.
- Where does the shared checkout bootstrap live?: Put one bootstrap function in
src/devops_cli/roadmap/runner_tools.pyand call it from the stage, implement and fix-checks Job setup before the agent step. (best practice) [sources: src/devops_cli/roadmap/runner_tools.py]- Chosen: shared function in runner_tools.py. The module already holds the runner tool inventory, so one place owns the bootstrap and the tool list.
- Rejected: copy the command into each Job. Three copies can drift.
- Rejected: bootstrap in the image entrypoint. The checkout does not exist when the image starts.
- How do the checks select the checkout environment?: Prepend
<checkout>/.venv/binto PATH after the bootstrap and run checks withuv runfrom the checkout. Never resolve a check from/app/.venv. (best practice) [sources: src/devops_cli/roadmap/runner_tools.py, docs/DEVCONTAINER_USAGE.md]- Chosen: prepend checkout venv and use uv run. The checkout venv is the environment that the bootstrap fills.
- Rejected: remove
/app/.venvfrom PATH only. The checks then have no dev tools. - Rejected: call tools by absolute path. The paths differ from the documented
uv runworkflow.
- What does the runner smoke step prove?: Run
uv sync --lockedin a checkout inside the image, then runuv run ruff --version,uv run pytest --versionanduv run mypy --versionfrom that checkout. (best practice) [sources: docs/DEVCONTAINER_USAGE.md, uv.lock]- Chosen: bootstrap then uv run versions. It proves the image and the bootstrap together.
- Rejected: check tools on PATH only. It can pass on the old image venv and prove nothing about the checkout.
- Rejected: check the image venv only. It cannot show that the checkout has the dev tools.
- Which tools are dev tools in
runner_tools.pynow?:ruff,mypy,pytestandpre-commitare dev tools. [sources: src/devops_cli/roadmap/runner_tools.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
Alternatives check of 2026-11-20: in-use.
The repository already uses this tool.
Tool: astral-sh/uv (https://github.com/astral-sh/uv), Apache-2.0, last activity 2026-11-20, maintained.
Reason: Searches and the uv docs show uv sync --locked fills a checkout .venv from uv.lock with the dev group, and uv run resolves ruff, mypy and pytest from it, so uv covers the bootstrap whole.
Covers:
- One
uv sync --lockedfills the checkout.venvfromuv.lock uv runresolves ruff, mypy, pytest and pre-commit from that checkout venv- Runs offline from a copied uv seed cache, as the reply asks
Lacks:
- No Job orchestration: the runner must run the bootstrap before the first agent step
- No PATH or venv selection; the runner must prepend
<checkout>/.venv/bin - No image change: dropping the dev group from
/app/.venvstays with this item - The reply's
--group devand offline form is not in the body's command
Activity
dan-petty commentedon Nov 20, 2026
runner, and .github/labels.yml declares no scope/runner label. Add the label to the file to give the scope to this item.Both change the runner image, but #4361 restructures the Dockerfile build (FROM devtools, no tool-install RUN steps) while the candidate changes the venv content and adds a per-Job bootstrap command.devops-cli-service commentedon Nov 20, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
dan-petty commentedon Nov 20, 2026
The bootstrap of this item uses the uv-seed image volume when it is present (decision on #4814, 2026-11-20): copy
/opt/uv-seed/cacheinto the home emptyDir, then oneuv sync --locked --group dev --offlinewhenseed.jsonmatches the clone, else the onlineuv sync --locked --group devwithUV_HTTP_RETRIES=5. Also setUV_COMPILE_BYTECODE=0in the runner final stage (the image ENV sets 1 today, and #4814 measured 71 s of 110 s of the Job bootstrap as bytecode compile). Build after #6513 merges.devops-cli-service commentedon Nov 20, 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 (4)
Tools considered:
Searches run:
Sources:
refactor(docker): keep OpenSpec out of the devtools image updates
refactor(docker): build the runner image FROM devtools with no tool i…
test(roadmap): give the seed tests synthetic uv versions (#6517)
dan-petty commentedon Nov 20, 2026
The stage part of this item waits for the move of the stage Job to the runner image (#6417, #6528). PR #6537 bootstraps only the implement Job and the model fix of the fix-checks Job.
Evidence:
k8s/devops/cronjob-stage.yamlruns the stage Job inghcr.io/dan-petty/devops-cli/service; onlyk8s/devops/cronjob-runner.yamlusesghcr.io/dan-petty/devops-cli/runner.ci.ymlfails whencommand -v uvfinds uv, and the image holds no npm.So
uv syncin the stage Job would exit 127 on each repository withuv.lock, the Job would end asci_infra, and it would run again each hour with the same result. The pull request adds no check whether uv is present. When the stage Job runs in the runner image, it can callbootstrap_checkouton its clone beforeplan_stage.build(roadmap): bootstrap the dev env with uv in each Job (#6517)
test(roadmap): give the seed tests synthetic uv versions (#6517)
fix(roadmap): bootstrap only the runner Jobs, after tier 1 (#6517)
chore(main): release 0.185.0 (#6556)
devops-cli-service commentedon Nov 20, 2026
Released in v0.185.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.185.0
devops-cli-service commentedon Nov 20, 2026
Live since 2026-11-20 20:21 UTC
fix(roadmap): a Job leaves a stale lock for the agent (#6558)
fix(roadmap): the base replay of a step runs the checkout Python (#6692)
perf(k8s): seed the uv cache of a runner pod from the image (#7156)