Skip to content

feat(k8s): toolchain presets and runner tools for each language #4648

Done

Description

@dan-petty

Update 2026-11-26 (infra move): The runner programs now come from dan-petty/devtools.

tools.lock is gone. The runner already has npm, shellcheck and kube-linter. Here: the presets, RUNNER_TOOLS rows and tests. The shell allowlist is gone since #7031. New programs (Rust tools, ansible-lint) go in the devtools image (follow-up).

Follow-up: dan-petty/devtools#97.


Problem or Motivation

Owner decision 5 (2026-11-11): implement runs in all 7 repositories. The repositories use these languages:

Repository Language and tools Preset today
devops-cli Python, uv, ruff, mypy, pytest devops-cli
vibes Python (pip, pytest), with Rust and JS none
danielpetty.com Python and Docker, uv, pytest, ruff none
dreamscaper Rust (about 45 KB), cargo none
homelab Makefile, Ansible, Kubernetes manifests none
dotfiles Shell none
devcontainer-features Shell none

The runner image has no cargo or ansible-lint (src/devops_cli/roadmap/runner_tools.py, NOT_IN_RUNNER). dreamscaper had 3 refused_tool stops on 2026-11-03 and 2026-11-04. dan-petty/dotfiles#3 stopped at the static check on 2026-11-04. With only the neutral preset (#4635), implement in these repositories cannot run their tests or linters, and the pull request CI finds each defect late.

Proposed Solution & Architectural Design

  • Add one toolchain preset for each language that the repositories use: python (pytest and ruff, for vibes and danielpetty.com), rust-cargo (cargo build, cargo test, cargo clippy and cargo fmt --check), shell (shellcheck, for dotfiles and devcontainer-features) and ansible (ansible-lint, with kube-linter for the manifests of homelab).
  • Add the programs of each preset to the runner image, with a pin and a proof command in RUNNER_TOOLS, and remove them from NOT_IN_RUNNER.
  • Each preset gets a security review of the shell allowlist in its pull request. For example, cargo build runs build.rs code of the target and of its crates, and cargo fetches crates over the network. The review decides the egress and the sandbox for each program.
  • Each repository declares its preset in .devops/roadmap.toml through the onboarding kit (feat(roadmap): onboard writes the labels file and the status workflow #3753).
  • The test selection stays per preset: python-imports for Python, and the full test command of the language for the others.

Target Subsystem

Kubernetes & Minikube Automation (the runner image and src/devops_cli/roadmap/toolchains.py).

Existing Tool Considered

The official distributions: rustup (minimal profile) or the Debian cargo package, the shellcheck release binary, and ansible-lint, each from the dan-petty/devtools image. #3108 plans shellcheck as a catalog row, and #3562 plans kubectl and kube-linter. One image for each language was considered: it adds CI image build time, so one runner image with the pinned programs is better. Cost: about 300 lines with the presets and the image rows, about 600,000 tokens and 6 hours to build, about 20,000 tokens a month to keep the pins current.

Acceptance Criteria

  • A test: each preset names only programs that RUNNER_TOOLS holds.
  • The image build runs python -m devops_cli.roadmap.runner_tools and proves each new program and its pin.
  • A live implement run on one item of dreamscaper, dotfiles and homelab ends without a refused_tool or static stop for a missing program.
  • Each preset pull request has a security section for the shell allowlist.
  • The image scan of the runner image passes with no lowered threshold.

Dependencies

#4635, #4645 and #4550 (the image layers change first). Related: #3108 and #3562.

Source: #4627

Alternatives check of 2026-11-26: partly.
Tool: jdx/mise (https://github.com/jdx/mise), MIT, last activity 2026-11-26, maintained.
Reason: Searches found mise, one CLI that installs and pins 1,000+ dev tools, including Python, Rust, shellcheck and ansible-lint, so it covers the runner image installs but not the preset registry, the proof rows or the allowlist.

Covers:

  • Installs pinned Python, Rust, shellcheck and ansible tools from one config
  • Reads per-project tool versions and keeps a lock of them
  • Runs each command with the pinned tools on PATH
  • Installs from GitHub, aqua, Cargo, npm and PyPI backends

Lacks:

  • No preset registry for the project's toolchains.py
  • No RUNNER_TOOLS proof rows or NOT_IN_RUNNER bookkeeping
  • No shell allowlist, test selection or image scan pass
  • Adds a second installer beside the Dockerfile pins

Proposed design

Problem statement

The toolchain registry holds only devops-cli and neutral. An implement run in a Python or shell repository cannot run its linter or tests. This change adds the python and shell presets and a test that keeps each preset program in RUNNER_TOOLS. The Rust and Ansible presets are already deferred to #7341 and #7342.

Acceptance criteria

Requirement: Python preset exists

The toolchain registry SHALL hold a python preset that names ruff for its static check and pytest for its test command.

Scenario: The Python preset resolves

  • WHEN A test in tests/roadmap/test_roadmap_toolchains.py asks PRESETS for python.
  • THEN It gets a preset whose name is python, whose static_check names ruff, and whose test_command names pytest with the {tests} placeholder.

Requirement: Python test selection

The python preset SHALL set test_selection true.

Scenario: The Python preset selects tests

  • WHEN A test in tests/roadmap/test_roadmap_toolchains.py reads test_selection of PRESETS['python'].
  • THEN It is true.

Requirement: Shell preset exists

The toolchain registry SHALL hold a shell preset that names shellcheck for its static check and has no test command.

Scenario: The shell preset resolves

  • WHEN A test in tests/roadmap/test_roadmap_toolchains.py asks PRESETS for shell.
  • THEN It gets a preset whose name is shell, whose static_check names shellcheck, and whose test_command is None.

Requirement: Shell test selection

The shell preset SHALL set test_selection false.

Scenario: The shell preset selects no tests

  • WHEN A test in tests/roadmap/test_roadmap_toolchains.py reads test_selection of PRESETS['shell'].
  • THEN It is false.

Requirement: Preset programs are runner tools

Each program that a preset names SHALL be in RUNNER_TOOLS and SHALL NOT be in NOT_IN_RUNNER.

Scenario: A preset names a program

  • WHEN A test in tests/roadmap/test_roadmap_toolchains.py reads the program of each preset command, after a leading uv run when present.
  • THEN Every program is in RUNNER_TOOLS, and no program is in NOT_IN_RUNNER.

Requirement: Pending a person after the merge

A live implement run on one item of dotfiles SHALL end without a refused_tool or static stop for a missing program.

Scenario: A live implement run uses the shell preset

  • WHEN A person starts an implement run on one item of dotfiles after the runner image is released.
  • THEN The run ends with no refused_tool or static stop for a missing program.

Existing Tool Considered

jdx/mise (https://github.com/jdx/mise), MIT, is open and maintained. The alternatives check of 2026-11-26 records the verdict partly in the issue body, and the block there states what the tool covers and lacks. The proposal keeps the Dockerfile pins and adds the preset registry and the RUNNER_TOOLS bookkeeping test that the block lists as lacking, so it adds no second installer. The issue body gives the cost of the full preset work: about 300 lines, about 600,000 tokens and 6 hours to build, and about 20,000 tokens a month to keep the pins current. This proposal covers the smaller python and shell part.

Key questions

  • Which programs do the python and shell presets need, and are they in RUNNER_TOOLS?: python needs pytest and ruff; shell needs shellcheck. pytest and ruff are checkout rows, and shellcheck is a devtools row. All three are in RUNNER_TOOLS, and none is in NOT_IN_RUNNER. [sources: src/devops_cli/roadmap/runner_tools.py, src/devops_cli/roadmap/toolchains.py]
  • Does the change add new RUNNER_TOOLS rows?: No. The table already holds pytest and ruff as checkout rows and shellcheck as a devtools row. The change adds presets and a test. [sources: src/devops_cli/roadmap/runner_tools.py]
  • What commands does the python preset run?: It runs ruff check . as its static check and pytest {tests} as its test command, with test_selection true. (best practice) [sources: src/devops_cli/roadmap/runner_tools.py, src/devops_cli/roadmap/toolchains.py, docs/adr/0004-ci-is-the-authoritative-gate.md]
    • Chosen: Direct ruff and pytest from the checkout venv. bootstrap_checkout installs the dev group, and checkout_environment puts .venv/bin first on PATH.
    • Rejected: uv run ruff and uv run pytest. The preset program test would read only uv and would miss ruff and pytest.
    • Rejected: pytest only. It leaves the ruff defects to the pull request CI.
    • Rejected: No test command. The Python repositories then run no test in an implement run.
  • What commands does the shell preset run?: It names shellcheck as its static check and has no test command, with test_selection false. (best practice) [sources: src/devops_cli/roadmap/runner_tools.py, src/devops_cli/roadmap/toolchains.py]
    • Chosen: shellcheck only. shellcheck is already in the runner image, and the shell repositories need a linter.
    • Rejected: No static check. The shell repositories then run no linter in an implement run.
    • Rejected: Add shfmt. shfmt is not in RUNNER_TOOLS, and the issue asks for shellcheck.
  • How does a test keep each preset program in RUNNER_TOOLS?: One test in tests/roadmap/test_roadmap_toolchains.py reads the program of each preset command, after a leading uv run, and checks it in RUNNER_TOOLS and not in NOT_IN_RUNNER. (best practice) [sources: tests/roadmap/test_roadmap_runner_tools.py, src/devops_cli/roadmap/runner_tools.py]
    • Chosen: One test over all presets. It covers each preset and names the preset and the program in its message.
    • Rejected: No test. A preset can name a missing program and stop an implement run.
    • Rejected: A test for each preset. It repeats the same check and misses a new preset.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Moved to new items

#7341, #7342

Activity

  1. added
    source/agent
    on Nov 11, 2026
  2. added
    type/feature
    scope/k8s
    status/new
    value/high
    effort/medium
    on Nov 11, 2026
  3. dan-petty commented on Nov 11, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/k8s. The (k8s) scope of the title gives the scope.
    • Priority: P2-Medium. It unblocks implement runs in seven repositories but is a planned feature, not a live outage or security fix.
    • Value: High. Without it, implement runs in six of seven repositories stop at refused_tool or static checks.
    • Effort: Medium. The body estimates about 300 lines, six hours to build, and ongoing pin maintenance.
    • Related: feat(runner): add actionlint, shellcheck, Trivy when scan passes #3108, which asks for a different change. Both add shellcheck to the runner image, but the candidate builds a per-language preset system while #3108 targets specific tools with scan-blocking CVEs.
  4. added
    priority/p2-medium
    on Nov 11, 2026
  5. devops-cli-service commented on Nov 13, 2026

    @devops-cli-service
    Contributor

    Alternatives check: partly

    Reason: Searches on per-language runner presets returned mostly generic docs, but the fact reads show mise is an open, actively maintained dev tool version manager that installs many pinned language toolchains (Python/uv, Rust, Node, shellcheck, ansible-lint and similar CLI tools) into one image from a per-project config file, so it covers the "pinned programs in one runner image" half of the issue. It does not provide the preset definitions, the RUNNER_TOOLS proof commands, the shell allowlist security review, or the per-preset test selection, which stay project code.

    Tool: jdx/mise (https://github.com/jdx/mise)

    • License: MIT
    • Last activity: 2026-11-13
    • Maintained: yes

    Covers:

    • One tool installs and pins the toolchains of many languages (Python, Rust/cargo, Node, shell and Ansible linters) into a single runner image
    • A per-project config file declares which tool versions a repository uses, comparable to declaring a preset in .devops/roadmap.toml
    • A task runner runs per-project commands (build, test, lint) through the same config
    • Version pins are lockable, which replaces hand-maintained pins for each program

    Lacks:

    • The preset model itself: which programs a language preset names and how a test checks that RUNNER_TOOLS holds them
    • Proof commands per program in the image build and the removal of programs from NOT_IN_RUNNER
    • Per-preset test selection (python-imports for Python versus the full test command for other languages)
    • The security review of the shell allowlist, egress and sandbox for each program
    • kube-linter for Kubernetes manifests and the image scan threshold criteria

    Tools considered:

    Searches run:

    • mise tool version manager lockfile install python rust shellcheck ansible-lint pinned, results: 5
    • aqua declarative CLI version manager registry checksum install tools per project, results: 5
    • asdf version manager plugins pinned tool versions, results: 5
    • mise-en-place dev tool version manager, results: 5
    • ansible-lint kube-linter linters Kubernetes manifests, results: 5
    • shellcheck static analysis tool for shell scripts, results: 5
    • jdx/mise github repository, results: 5
    • aquaproj/aqua github CLI version manager, results: 5
    • one container image with pytest cargo shellcheck ansible-lint preinstalled, results: 5
    • mise lockfile pin tool versions CI Docker image install python rust node, results: 5

    Sources:

    Checked on 2026-11-13. A person decides what this means for the item. The check changes no label and closes no issue.

  6. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at 0410772 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.

    • Does the security review accept the shell allowlist entries, the egress and the sandbox of the new programs? (a person decides)
  7. devops-cli-service commented on Nov 20, 2026

    @devops-cli-service
    Contributor

    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.

  8. added
    status/ready
    and removed
    status/new
    on Nov 26, 2026
  9. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.

  10. dan-petty commented on Nov 27, 2026

    @dan-petty
    OwnerAuthor

    Owner decision of 2026-11-27: the devtools image gets no Rust toolchain. dan-petty/devtools#97 now adds ansible-lint only.

    Reason: the minimal Rust toolchain with gcc and libc6-dev adds about 0.96 GB. The runner image v0.224.2 is 6,296,100,499 bytes, and ci.yml:687 and release-image.yml:187 refuse an image over 7,000,000,000 bytes.

    The Ansible preset of this item can use ansible-lint of the next devtools release. The Rust preset needs another source than the devtools image.

  11. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.

  12. added a commit that references this issue on Nov 27, 2026
  13. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 28, 2026
  14. removed
    status/in-review
    owner/agent
    on Nov 28, 2026
  15. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-28 17:56 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/p2-mediumscope/k8ssource/agenttype/featurevalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions