Skip to content

feat(review): review tools install from a tools lock with exact versions, binary checksums and hashed Python requirements, and every review records them #1142

Closed

Description

@dan-petty

Problem

  • Tools are installed at whatever is latest. install-tools resolves the latest release (get_latest) [code: commands/install_tools.py:391-417], and reviews record no tool version.
  • The installed Semgrep 1.178.0 misreads PEP 758 silently; 1.179.0 fixes it [measured: c-feasibility; sourced: github.com/semgrep/semgrep/releases/tag/v1.179.0].
  • The tool supply chain has been attacked: Trivy v0.69.4 was poisoned (CVE-2026-33634), and LiteLLM 1.82.7/1.82.8 were backdoored [sourced: u-tools].
  • Pinning the top-level package is not enough. uv tool install name==version pins one package; Semgrep's environment holds 66 distributions, and uv tool install has no --require-hashes [measured: c-feasibility, uv 0.12.16].

Acceptance criteria

  • tools.lock (package data) holds name, exact version, source URL and, for binaries, sha256 per platform.
    • Pins: gitleaks 8.30.1, osv-scanner 2.6.0, Semgrep 1.179.0, kube-linter, Pluto, Trivy, Bandit and the P3-6 tools as they arrive.
  • Each Python tool has a hashed requirements file (uv pip compile --generate-hashes). It is installed with uv pip sync --require-hashes into its own virtual environment under the user data root.
  • devops install-tools installs only from the lock, verifies every checksum, and refuses a mismatch.
  • The tools-lock digest is recorded in profile.json as a review input.
  • The lock covers every install-tools registry entry, not only review tools: kubectl, kustomize, helm, argo, argocd, kubectl-argo-rollouts, trivy, kube-linter, popeye, pluto and k9s (install_tools.py:83-91). Removing get_latest otherwise leaves them with no version source.
  • The post-create uv tool install semgrep (devcontainer.py:713-718) is replaced by the lock's hashed install, so only one Semgrep is on PATH.
  • From fix(review): a review records its prompt digest when it starts, and a benchmark arm refuses runs whose prompts or code changed #1050: a review warns when devops-cli's own source tree changes (a commit or a dirty state) during the run.
  • (person-run) Install into an empty data root; devops install-tools --check reports every pin verified.
  • Tests run offline with fakes and recorded tool output: no network, no real scanner, no model; each test under 1 s.
  • changelog.d/<n>.md records the change; CHANGELOG.md and docs/ROADMAP.md are not edited.
  • uv run devops ci passes.

Key questions

  • The project locks its own ruff? (proposed) Use the project's locked ruff, so the review agrees with its CI. It is recorded either way.

  • gitleaks is "security patches only"? (proposed) Acceptable while it is patched. Switch to Betterleaks at v2 GA as one change.

  • Does the lock grow past review tools? (proposed) Yes, as above. If the owner does not want this item to grow, the non-review pins become a sibling item that uses the same lock format.

Strategic alignment

Activity

  1. added
    type/feature
    scope/security
    scope/review
    priority/p1-high
    on Oct 3, 2026
  2. added this to the v0.2.30 milestone on Oct 8, 2026
  3. dan-petty commented on Oct 8, 2026

    @dan-petty
    OwnerAuthor

    Placed in v0.2.30 on 2026-10-08 at the owner's request ("Populate 10 security and ci issues into each v0.2.30, v0.2.31, and v0.2.32 milestone"). This is a person's placement. Release theme: P1 secret and sandbox-boundary fixes, the review tools lock, kube-linter finding identity and a faster gate. Position 10 of 10 in the release's planned merge order. Its board Status is set to Ready, so the release-start fill keeps it.

  4. dan-petty-bot commented on Oct 9, 2026

    @dan-petty-bot
    Collaborator

    What changed

    #1467, merged into release/v0.2.30 as 7a357d2.

    Summary

    Before this change, devops install-tools installed whatever release was latest. Some tools had only a checksum file fetched beside them, trivy, popeye, pluto and k9s installed with just a warning when that file could not be fetched, and kube-linter installed with no check at all. Post-create added its own uv tool install semgrep.

    Now every tool comes from tools.lock (src/devops_cli/tools_lock/), which gives each tool an exact version and source:

    • Binary tools: kubectl, kustomize, helm, argo, argocd, kubectl-argo-rollouts, trivy, kube-linter, popeye, pluto, k9s, gitleaks 8.30.1 and osv-scanner 2.6.0. Each has a SHA-256 for every build (linux and darwin, amd64 and arm64).
    • Python tools: Semgrep 1.179.0 and Bandit 1.9.4. Each has a requirements file in which every distribution is hashed.

    What devops install-tools does now:

    • A binary build is downloaded from the lock's URL only. It is refused unless its SHA-256 matches the lock, then unpacked into a staging directory and moved into ~/.local/share/devops-cli/tools/<name>/<version>/ with one rename.
    • A Python tool installs with uv --no-config pip sync --require-hashes into a relocatable virtual environment of its own. Because of --no-config, a uv.toml or [tool.uv] in the current directory cannot change the install. UV_MALWARE_CHECK, UV_CACHE_DIR and UV_LINK_MODE are kept from the environment.
    • Each tool's commands in the target directory link into its version directory. Once they…

    32 file(s) changed.

    How it was verified

    Check runs at fb403f4:

    • Prune PR DevContainer Images: pass
    • CodeQL: pass
    • Static Analysis: pass
    • Analyze (actions): pass
    • Analyze (python): pass
    • Tests & Coverage: pass
    • DevContainer Image: skipping
    • Service Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-1142-review-tools-install-from-a-tools-lock.md:

    • tools.lock holds each tool's name, exact version and source URL and, for binaries, a SHA-256 per platform, with gitleaks 8.30.1, osv-scanner 2.6.0, Semgrep 1.179.0, kube-linter 0.8.3, pluto, trivy and Bandit pinned: test_the_packaged_lock_holds_every_tool_install_tools_installs and test_every_binary_build_is_an_https_url_with_a_sha256.
    • Each Python tool has a hashed requirements file that pins it, installed with uv pip sync --require-hashes into its own virtual environment under the user data root: test_every_python_tool_pins_itself_in_its_hashed_requirements, test_a_python_tool_installs_its_hashed_requirements_into_a_relocatable_venv (with --no-config) and test_a_failed_python_install_leaves_no_stage_and_no_link; a pin bump removes the earlier version (test_an_install_removes_the_tools_other_versions); the locked Bandit is the project's dev pin (test_the_locked_bandit_is_the_projects_own_dev_bandit).
    • devops install-tools installs only from the lock, verifies every checksum and refuses a mismatch: test_a_verified_binary_is_pinned_and_linked_from_its_url_alone (the lock's URL is the only request), test_a_build_whose_bytes_differ_from_the_lock_is_refused, test_install_tools_exits_1_when_it_refuses_a_build, test_each_archive_format_unpacks_to_the_tool, test_a_platform_the_lock_has_no_build_for_is_named and test_version_is_no_longer_an_option.
    • The tools-lock digest is recorded in profile.json as a review input, read at the review's start: test_a_profile_records_the_tools_lock_it_started_with; one more byte in the lock or a requirements file changes it (test_the_digest_covers_the_lock_and_its_requirements_files).
    • The lock covers every former install-tools registry entry: kubectl, kustomize, helm, argo, argocd, kubectl-argo-rollouts, trivy, kube-linter, popeye, pluto and k9s.
    • Post-create's uv tool install semgrep is gone, and its managed-tools install puts the locked Semgrep on PATH: test_post_create_leaves_semgrep_to_the_tools_lock; the links replace an existing semgrep, and the lock links pysemgrep too (test_semgrep_links_the_pysemgrep_it_runs).
    • From fix(review): a review records its prompt digest when it starts, and a benchmark arm refuses runs whose prompts or code changed #1050: a review warns when devops-cli's own source tree gets a commit or an edit during the run: test_own_source_state_changes_with_each_edit_and_commit, test_an_installed_copy_has_no_source_state and test_a_review_warns_when_its_own_source_changes_during_the_run.
    • --only-missing, --check and status read the pin from the target directory's links, offline: test_only_missing_skips_a_tool_at_its_pin_and_reinstalls_one_linked_elsewhere, test_check_passes_only_when_every_tool_is_at_its_pin and test_status_shows_each_pin_and_what_is_installed_without_a_request.
    • Tests run offline with fakes: no network, no real scanner, no model, each under 1 s.
    • changelog.d/1142.md records the change; CHANGELOG.md and docs/ROADMAP.md are not edited.
    • Docs: README.md's Checksum Verification item, docs/DEVCONTAINER_USAGE.md's security tools line, docs/SELF_IMPROVEMENT.md's Review Profiles & Benchmarks section and the generated command reference.
    • uv run devops ci passes.
    • Pending a person: (export HOME="$(mktemp -d)"; uv run devops install-tools --target-dir "$HOME/.local/bin" && uv run devops install-tools --check --target-dir "$HOME/.local/bin") installs every tool into an empty data root, and the check prints that every tool is linked at its locked version and exits 0.
  5. added a commit that references this issue on Oct 9, 2026
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

    priority/p1-highscope/reviewscope/securitytype/feature

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions