Skip to content

feat(review): the toolrun of osv-scanner and ruff records the digest of its advisory database and its configuration #2130

Closed

Description

@dan-petty

Friction

Part of the tracker #772 (Part D: "The ruleset digest of osv-scanner and the Ruff config digest are settled here"; criterion 5: each ToolRun records its config and ruleset digests). The ToolRun of an osv-scanner run records no digest of its advisory database, and the ToolRun of a Ruff run records no digest of the Ruff configuration that it read. On 2026-10-24 the PyPI database of osv-scanner was 36 MB, above the file-size cap of the record's digest step, so the digest is not a plain file hash.

What should happen

The ToolRun of osv-scanner records a digest that names the database it used (for example, the database's own modified time and the digest of its index, or a streamed hash of the files), and the ToolRun of Ruff records the digest of the configuration that Ruff resolved for the target.

Evidence

Acceptance criteria

  • The ToolRun of an osv-scanner run changes when its database changes, and stays the same when it does not.
  • The ToolRun of a Ruff run changes when the Ruff configuration of the target changes.

Source: #772

Proposed design

Problem statement

The ToolRun record of an osv-scanner run does not capture a digest of the advisory database it used. The ToolRun record of a Ruff run does not capture a digest of the Ruff configuration it resolved. Without these digests, a user cannot verify which database version or configuration produced a given scan result. The osv-scanner PyPI database is 36 MB, above the file-size cap of the record's digest step, so a plain file hash is not possible.

Acceptance criteria

  • Criterion 1: The ToolRun of an osv-scanner run records a digest that changes when the database changes and stays the same when it does not.
    Verification: Run osv-scanner twice with the same database and confirm the ToolRun digest is identical. Update the database and run again, then confirm the digest differs.
  • Criterion 2: The ToolRun of a Ruff run records a digest of the configuration that Ruff resolved for the target.
    Verification: Run Ruff twice with the same configuration and confirm the ToolRun digest is identical. Modify the Ruff configuration and run again, then confirm the digest differs.

Key questions

  • What digest method should the osv-scanner ToolRun use for its database, given that the 36 MB PyPI database exceeds the file-size cap for a plain file hash?: Use a streamed hash of the database files, or the database's modified time combined with a digest of its index. The exact method is a design choice for the implementer. (proposed)
  • What does 'the configuration that Ruff resolved for the target' mean for the digest?: It is the final Ruff configuration after Ruff merges its defaults with the project's ruff.toml or pyproject.toml section. The digest covers the resolved configuration, not the raw file. (proposed)

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/feature
    on Oct 24, 2026
  2. dan-petty commented on Oct 24, 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/feature. The candidate adds new functionality to record digests in ToolRuns.
    • Priority: P2-Medium. This change improves traceability and reproducibility of scan results. The failed run 2096 does not set P0: the author has no write access, and no caller attached it as evidence. A person can set P0 on the board.
    • Value: High. Users can verify which version of a tool's database or config was used in a scan.
    • Effort: Medium. Requires modifying ToolRun to capture and store digest information for osv-scanner and Ruff.
    • Related: feat(review): the SARIF export of a review carries the ToolRun of each scan under its SARIF 2.1.0 names #1983, which asks for a different change. Both items are about ToolRun records in SARIF exports, but the candidate adds digest recording while #1983 introduced the SARIF export of ToolRuns.
  3. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Status set to Ready at bb46660 (see proposed design in issue body).

  4. added
    priority/p2-medium
    status/ready
    effort/medium
    value/high
    scope/review
    on Oct 28, 2026
  5. devops-cli-service commented on Nov 1, 2026

    @devops-cli-service
    Contributor

    Staged: branch feat/2130-the-toolrun-of-osv-scanner-and, draft pull request #2978. The pull request plans the item and closes no issue.

    The task groups, with the tokens of the inputs of each step, for a budget of 40000 tokens:

    1. Add osv-scanner database digest to the ToolRun: 3003 tokens
    2. Add Ruff configuration digest to the ToolRun: 2982 tokens

    These paths of the plan are no file on the default branch, and no group creates them: src/devops_cli/review/scanners/osv_scanner.py, tests/test_review_tool_runs.py, src/devops_cli/review/scanners/ruff.py. A person checks that the plan names them right.

  6. added a commit that references this issue on Nov 1, 2026
  7. added
    status/planned
    and removed
    status/ready
    on Nov 1, 2026
  8. added
    owner/agent
    on Nov 1, 2026
  9. added a commit that references this issue on Nov 1, 2026
  10. removed
    owner/agent
    on Nov 1, 2026
  11. removed
    status/planned
    on Nov 1, 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

    effort/mediumpriority/p2-mediumscope/reviewsource/agenttype/featurevalue/high

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions