Skip to content

fix(review): the binary digest of a Python review tool names its package, not its launcher script #1984

Closed

Description

@dan-petty

Friction

  • The binary_sha256 of a Python review tool, such as Bandit or Semgrep, is the digest of its launcher script. The launcher does not change when the package changes, so the record does not show which code ran.

Evidence

Checked at main 4bb052c.

Existing tool considered

  • importlib.metadata reads the installed distribution of a tool. The RECORD file of an installed distribution lists a sha256 hash for each file of the package (the packaging specification for recorded installs).
  • The tools lock already names the version of each tool.

Proposed remedy

  • For a tool that is a Python distribution, take the digest from the installed distribution, for example a digest of its RECORD file through importlib.metadata. Do not hash the launcher script.
  • Keep the file digest for a tool that is one native binary.

Acceptance criteria

  • The binary_sha256 of a Python tool changes when a file of its package changes, and stays the same when only its launcher script changes. A test with a fake installed distribution in tmp_path asserts both.
  • The binary_sha256 of a native binary is still the digest of that file.
  • Tests run offline with fakes and recorded tool output: no network, no real scanner, no model. Each new test runs under 1 s.
  • uv run devops ci passes.

Source: #772

Activity

  1. added
    source/agent
    type/bug
    on Oct 23, 2026
  2. dan-petty commented on Oct 23, 2026

    @dan-petty
    OwnerAuthor

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

    • Type: type/bug. The candidate fixes an incorrect behavior in how binary digests are calculated for Python tools.
    • Priority: P2-Medium. The issue affects correctness of tool version tracking and should be fixed but is not critical.
    • Value: Medium. Fixing the digest calculation improves accuracy of review records for Python tools.
    • Effort: High. Requires changes to how Python tool digests are calculated using importlib.metadata and updating tests.
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

    source/agenttype/bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions