Skip to content

fix: drop copied tool versions from generated files #6412

Closed

Description

@dan-petty

Problem

Generated files hold copies of tool versions that drift:

  • osv_scanner.py writes the CycloneDX metadata.tools[].version (:213) and seeds the digest of the empty database with a version (:103).
  • devcontainer.json.j2:10-37 adds a features block to the devops devcontainer init --image path. It has drifted (node:1 against node:2), and its python else-branch is never reached.
  • The knowledge base holds 27 name==version pins in devops_cli/python_packages.md (3 already differ from uv.lock) and one pin each in libraries/bandit_actionlint.md, httpx2.md, pydantic_ai_harness.md and ruff_mypy_pytest.md.

Change

  • osv_scanner.py: omit the optional CycloneDX metadata.tools[].version (:213), seed the empty-database digest with a fixed string with no version (:103), and fix the docstring (:3).
  • devcontainer.json.j2:10-37: delete the features block of the init --image path and the unreachable python else-branch. The published image owns the tools. Change test_devcontainer.py:758-780.
  • Knowledge base: remove the 27 pins of devops_cli/python_packages.md and the one pin in each of the four library articles. Say that pyproject.toml and uv.lock own them. If refactor(ai): drop the knowledge base copies of project docs #3917 deletes python_packages.md first, only the library articles remain.

Renovate. None.

Risk. Low. The osv cache digest changes once. devops devcontainer init --image <other> no longer adds tool features.

Proof

  • Scoped pytest of the security, devcontainer and knowledge base tests passes.
  • git grep -nE '2\.6\.0' origin/main -- src/devops_cli/security/osv_scanner.py and git grep -nE '[a-z0-9-]+==[0-9]' origin/main -- src/devops_cli/ai/knowledge_base return nothing.

Depends on: none

Proposed design

Problem statement

Remove the copied tool versions from the OSV scanner, the devcontainer template and the knowledge base. These copies go out of date with the real sources. pyproject.toml and uv.lock stay the owners of the package versions.

Acceptance criteria

Requirement: CycloneDX tool metadata has no version

The CycloneDX writer SHALL omit the optional metadata.tools[].version field.

Scenario: Tool entry has no version key

  • WHEN A test calls the CycloneDX writer with a fixed scanner name.
  • THEN The output has a metadata.tools entry with name and no version key.

Requirement: Empty OSV database seed is fixed

The OSV scanner MUST seed the empty-database digest with a fixed string that holds no tool version.

Scenario: Empty database seed has no version

  • WHEN A test calls the empty-database seed with no database file.
  • THEN The seed equals the fixed string and holds no version number.

Requirement: OSV scanner holds no copied version

The OSV scanner SHALL hold no copied 2.6.0 version string.

Scenario: No copied version in scanner

  • WHEN The proof command runs git grep -nE '2\.6\.0' -- src/devops_cli/security/osv_scanner.py.
  • THEN The command returns no match.

Requirement: Image init has no features block

The devcontainer template SHALL render the init --image path with no features block.

Scenario: Image path renders no features

  • WHEN tests/test_devcontainer.py renders devcontainer.json.j2 with init --image and a sample image.
  • THEN The test passes and the rendered JSON holds no features key and no unreachable Python else-branch content.

Requirement: Image init test checks the image tools

The devcontainer test MUST assert that the init --image path adds no tool features.

Scenario: Updated devcontainer test

  • WHEN tests/test_devcontainer.py runs the init --image case.
  • THEN The test passes and asserts that the published image owns the tools.

Requirement: Knowledge-base package pins are gone

The knowledge-base files SHALL NOT hold name==version pins for packages that pyproject.toml and uv.lock own.

Scenario: No package pin remains

  • WHEN The proof command runs git grep -nE '[a-z0-9-]+==[0-9]' -- src/devops_cli/ai/knowledge_base.
  • THEN The command returns no match.

Requirement: Knowledge base names the version owners

The edited knowledge-base articles SHALL state that pyproject.toml and uv.lock own the package versions.

Scenario: Version owners are named

  • WHEN The proof command runs git grep -nE 'pyproject[.]toml|uv[.]lock' -- src/devops_cli/ai/knowledge_base.
  • THEN The command returns at least one match for each owner.

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers this cleanup: the change removes copied version strings and a template block. It builds no code, so the build cost is zero tokens and zero elapsed time. The edit touches the scanner, the template, the knowledge-base files and their tests.

Key questions

  • Which files own the package versions after the copied pins go?: pyproject.toml and uv.lock own the package versions. The knowledge-base articles SHALL point to them and SHALL NOT repeat a name==version pin. [sources: pyproject.toml, uv.lock]
  • Should the knowledge-base articles keep name==version pins?: No. The articles SHALL remove the pins and SHALL state that pyproject.toml and uv.lock own the versions. (best practice) [sources: pyproject.toml, uv.lock]
    • Chosen: Remove the pins and point to the lock files. One source owns each version, so the articles cannot drift.
    • Rejected: Keep the pins and update them by hand. The body reports that three pins already differ from uv.lock.
    • Rejected: Keep the pins and add a drift check. A check adds work and still keeps two sources.
  • Should the devcontainer init --image path keep a features block?: No. The published image owns the tools, so the template SHALL delete the features block and the unreachable Python else-branch. (best practice) [sources: src/devops_cli/templates/devcontainer.json.j2:10-37]
    • Chosen: Delete the features block. The published image owns the tools, and the block already drifts from the image.
    • Rejected: Update the features block. It copies tool versions again and will drift.
    • Rejected: Keep the Python branch only. The body says the Python else-branch is never reached.
  • Should the CycloneDX writer keep metadata.tools[].version?: No. The writer SHALL omit the optional version field. (best practice) [sources: src/devops_cli/security/osv_scanner.py:213]
    • Chosen: Omit the optional version field. The field is optional and copies a tool version that drifts.
    • Rejected: Keep the version and update it with the lock. It adds a second source for the same version.
  • What seed does the empty OSV database use?: A fixed string with no tool version. (best practice) [sources: src/devops_cli/security/osv_scanner.py:103]
    • Chosen: Fixed string with no version. The digest identifies the empty database, not the scanner version.
    • Rejected: Scanner version string. It copies a version and changes the digest at each scanner release.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    on Nov 19, 2026
  2. dan-petty commented on Nov 19, 2026

    @dan-petty
    OwnerAuthor
  3. added
    source/agent
    status/new
    value/medium
    effort/medium
    priority/p2-medium
    on Nov 19, 2026
  4. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

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

  5. dan-petty commented on Nov 19, 2026

    @dan-petty
    OwnerAuthor

    Scope note from #6414 (PR #6472), owner rules of 2026-11-19 ("podman should replace docker"; no Docker CLI in the devops-cli container): the template src/devops_cli/templates/devcontainer.json.j2 must follow the devops-cli devcontainer once PR #6472 merges.

    • The features block of the init --image path goes (this item already plans it), and with it docker-in-docker:2.
    • The published path uses ghcr.io/dan-petty/devops-cli/devcontainer, which then holds podman-in-podman with dockerCompat and no Docker CLI. Give that path the same remoteEnv value as .devcontainer/devcontainer.json: "DOCKER_HOST": "unix:///var/run/docker.sock". The reason is in feat(podman-in-podman): add the podman-in-podman Feature 1.0.0 devcontainer-features#5 (the podman-docker profile script points a bash login shell at a socket where no service runs).
    • DOCKER_CLI_HINTS in containerEnv has no effect without the Docker CLI: remove it.
    • Keep the extension list the same as .devcontainer/devcontainer.json after fix(devcontainer): build the devcontainer image FROM devtools #6414.
  6. added
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 20, 2026
  7. added a commit that references this issue on Nov 20, 2026
  8. added
    status/in-review
    and removed
    status/in-progress
    on Nov 20, 2026
  9. removed
    status/in-review
    owner/agent
    on Nov 20, 2026
  10. devops-cli-service commented on Nov 20, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-20 02:10 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-mediumsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions