Repository navigation
Closed
Labels
priority/p1-highPriority P1: high-impact work for the next planned milestonescope/reviewMulti-persona code review engine, verification, and findingsscope/securitySecurity linters (trivy, bandit, gitleaks, kubeconform) and Vaulttype/featureType feature: a new function
Milestone
Description
Problem
- Every OSV batch hit is labelled HIGH, because the parser defaults to it [code: security/vulnerability_lookup.py:58-68].
- Results go missing: there is no pagination, and
zip(strict=False)drops results [code: :123]. - Only exact pins are queried [code: ai/review/pipeline.py:2238-2241].
- Regex extraction is slow and reads the wrong tree. It costs 47.3/100.6/123.3 s per loop run [measured: loop §7] and probes
Path.cwd(). - The inventory can describe devops-cli itself:
security/sbom.pyfalls back to the running interpreter's distributions [code: security/sbom.py:66-83]. - Hostnames leave the machine: Shodan and Radar send reviewed hostnames to third parties [code: pipeline.py:2210-2268].
Acceptance criteria
- osv-scanner 2.6.0 runs over the commit's lockfiles with an offline database fetched separately (24 h TTL). The snapshot digest is recorded as a review input.
- An
AdvisoryAnchorcarries purl@locked-version and the snapshot. Severity comes from the advisory, with no HIGH default. - The CycloneDX inventory is saved as environment facts. A missing lock is a coverage gap.
- Removed from the review: the OSV client and
extract_references. Shodan and Radar become opt-in, andsbom.py's runtime fallback is removed. - (person-run) On the S11 subject, results agree with
uv audit. - Tests run offline with fakes and recorded tool output: no network, no real scanner, no model; each test under 1 s.
-
changelog.d/<n>.mdrecords the change;CHANGELOG.mdanddocs/ROADMAP.mdare not edited. -
uv run devops cipasses.
Key questions
- Why osv-scanner? (proposed) It is lock-native, offline and Apache-2.0, and gives inventory and advisories in one tool. Trivy keeps images (feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137 Q4).
- The OSV client's other callers? (proposed) A separate fix (feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137 Q13).
Strategic alignment
- Milestone: none; the roadmap tooling places it. Depends on: feat(review): review tools run at the project's declared language and platform versions, and count only after their output on a canary matches the recorded expected output #1143.
- Parent: feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137 (phase P1a).
- Evidence tags ([measured: …], [code: path:line], [sourced: …], [estimate], [inference]; "S11" is the single review run of 2026-10-03 and "the loop" the ten runs S12–S21; c-feasibility and c-fidelity are the two design critiques) are explained in feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137.
Update 2026-10-08: refinement
The defects stand. sbom.py is not part of the review; #1439 deletes its runtime fallback, so drop that criterion here (#1137's R6 sbom.py part goes to #1439). Lines: ai/review/pipeline.py:2807-2839, security/vulnerability_lookup.py:66, :123. #1429 fixes the Radar lookup itself.
Proposed design
Problem statement
The current OSV advisory lookup process has multiple defects: it defaults to HIGH severity for all advisories, lacks pagination support leading to missing results, only queries exact package pins, uses slow regex extraction that probes the wrong tree, and includes devops-cli's own runtime distributions in the inventory. Additionally, Shodan and Radar lookups send hostnames to third parties.
Acceptance criteria
- Criterion 1: osv-scanner 2.6.0 runs over commit lockfiles with offline database fetched separately (24 h TTL) and records snapshot digest as review input
Verification: Run devops review with osv-scanner 2.6.0 against a commit's lockfiles, verify it uses offline database and records snapshot digest in review input - Criterion 2: AdvisoryAnchor carries purl
@locked-versionand snapshot with severity from advisory instead of defaulting to HIGH
Verification: Create an AdvisoryAnchor with different severity levels from advisories and verify the severity comes directly from the advisory, not defaulted to HIGH - Criterion 3: CycloneDX inventory is saved as environment facts with missing lock treated as coverage gap
Verification: Run review on repository with missing lockfiles and verify it records missing locks as coverage gaps in environment facts - Criterion 4: OSV client and extract_references are removed from review, Shodan and Radar become opt-in, and sbom.py's runtime fallback is removed
Verification: Verify that OSV client and extract_references are no longer called in review pipeline, and Shodan/Radar are disabled by default - Criterion 5: Tests run offline with fakes and recorded tool output: no network, no real scanner, no model; each test under 1 s
Verification: Run all related tests in offline mode with fake tools and verify they complete under 1 second each
Key questions
- The OSV client's other callers?: A separate fix (feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137 Q13). (proposed)
Open questions
- Why osv-scanner? (missing verified source)
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
Metadata
Metadata
Assignees
Labels
priority/p1-highPriority P1: high-impact work for the next planned milestonescope/reviewMulti-persona code review engine, verification, and findingsscope/securitySecurity linters (trivy, bandit, gitleaks, kubeconform) and Vaulttype/featureType feature: a new function
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 8, 2026
Linked: #1353 and #1302 fix the advisory admission path (
ai/review/pipeline.py:2881-2959) this item replaces; each fix survives the replacement, or this item carries it. Found by the 2026-10-08 backlog review.dan-petty commentedon Oct 14, 2026
Moved to the backlog: it was New, not Ready, when v0.2.36 started. (devops roadmap reprioritize)
dan-petty commentedon Oct 18, 2026
Amendment (2026-10-18): folded here by intake as a duplicate
devops roadmap intakejudged the candidate below a duplicate of this item and filed nothing, so its findings are recorded here for whoever plans or delivers this item. Candidate title: "fix(security): OSV lookups report each advisory's own severity and read every result page".Friction
OSVClientlabels every advisory HIGH, or CRITICAL when the advisory carries any CVSS v3 vector, whatever the score. A LOW advisory is reported as HIGH bydevopscommands that use the client outside the review: the dependency remediator and thescan_osvagent tool. The single-package query also reads only the first page of results. #1146 removes the client from the review, and #1137 Q13 decided that its other callers get a separate fix, which this item is.Evidence
src/devops_cli/security/vulnerability_lookup.py:58-63:is_critical = any("CVSS:3" in s.get("score", "") ...), thenseverity="CRITICAL" if is_critical else "HIGH". A CVSS vector string says nothing about the score.src/devops_cli/security/vulnerability_lookup.py:139-147: the/v1/queryreply is read asdata.get("vulns", []), and itsnext_page_tokenis never followed.src/devops_cli/security/dependency_remediator.py:212(scan_and_plan, which filters bymin_severity) andsrc/devops_cli/ai/tools/builtin_tools.py:437(scan_osv).Remedy
database_specific.severitywhen the source gives one (GitHub advisories give LOW, MODERATE, HIGH or CRITICAL), mapped through the existing severity normalisation, andUNKNOWNotherwise. Never infer it from a vector's presence.next_page_tokenon/v1/queryuntil the reply has none, within the existing request timeout.dependency_remediator'smin_severityfilter drops the LOW one. All tests run offline through a fake transport, under 1 s each.feat(review): dependency advisories and package inventory from osv-sc…
dan-petty commentedon Oct 20, 2026
What changed
#1747, merged into
release/v0.2.38as ea2ad78.20 file(s) changed.
How it was verified
Check runs at a958286:
Acceptance Criteria of
docs/agent/tasks/task-1146-osv-scanner-offline-advisories.md:No Acceptance Criteria section.
feat(release): v0.2.38 (#1799)
feat(release): v0.2.38 (#1798)
refactor(ai): three in-process caches use cachetools (#2611)