Skip to content

feat(cli): scanner outcome status unavailable, failed or unqueried is not clean #708

Closed

Description

@dan-petty

Context & Rationale

Scanners and advisory lookups record work that never ran as clean. A missing binary, a non-zero exit with non-JSON output or an exception reaches fallback_scan (security/base.py:93-97,111-117,132-134), which returns [] unless overridden (base.py:58-60); scan report and scan_all store a raised error as [] (commands/scan.py:831-834, security/registry.py:83-85); tools_run names every attempted scanner (security/pipeline.py:130); SARIF runs come from surviving findings alone (commands/scan.py:839, security/sarif.py:138-144). #516 predicts review states with check_binary (ai/review/pipeline.py:860-872), so a crashing binary shows as "ran". OSV lookups return [] on any exception, and query_package caches it (security/vulnerability_lookup.py:232-239,290-295); DependencySpec.severity defaults to CLEAN (models/vulnerability.py:14), so _check_scanned_clean_dependency invalidates a correct CVE finding. A Dive efficiency score gates as a MEDIUM security result (security/dive.py:146); Popeye audits the kube context's cluster whatever the target (security/popeye.py:66-73). vibes sarif_report.py emits zero-result runs, none for a failed adapter.

Scope & Deliverables

  • Context & Rationale*: Scanners and advisory lookups record work that never ran as clean. A missing binary, a non-zero exit with non-JSON output or an exception reaches fallback_scan (security/base.py:93-97,111-117,132-134), which returns [] unless overridden (base.py:58-60); scan report and scan_all store a raised error as [] (commands/scan.py:831-834, security/registry.py:83-85); tools_run names every attempted scanner (security/pipeline.py:130); SARIF runs come from surviving findings alone (commands/scan.py:839, security/sarif.py:138-144). fix(review): the static scan reports a clean result when its scanners are not installed #516 predicts review states with check_binary (ai/review/pipeline.py:860-872), so a crashing binary shows as "ran". OSV lookups return [] on any exception, and query_package caches it (security/vulnerability_lookup.py:232-239,290-295); DependencySpec.severity defaults to CLEAN (models/vulnerability.py:14), so _check_scanned_clean_dependency invalidates a correct CVE finding. A Dive efficiency score gates as a MEDIUM security result (security/dive.py:146); Popeye audits the kube context's cluster whatever the target (security/popeye.py:66-73). vibes sarif_report.py emits zero-result runs, none for a failed adapter.
  • Deliverable*: Three PRs, in order. (1) DependencySpec.severity defaults to UNCHECKED; failed lookups are not cached, query_batch returns a status per key, and only a successful lookup yields CLEAN or lets the verifier invalidate. (2) BaseSecurityScanner.scan returns ScanOutcome(status, findings, reason): ran, built-in patterns, not_applicable, unavailable, failed or dry-run, deciding applicability (Dive without an image, Popeye without a context) before check_binary. ScanReport.outcomes replaces tools_run; single-scanner commands say "not run", never "passed"; each run_*_scan wraps its registry scanner; observed outcomes replace fix(review): the static scan reports a clean result when its scanners are not installed #516's _static_analyzer_states. --fail-on exits non-zero on failed or when a --scanner-named tool did not run; otherwise a missing scanner warns. gating: ClassVar[bool] is False for Dive alone, and exceeds counts gating findings. (3) Before Publish Scanner Findings to Code Scanning uploads: ran emits a run, zero results included, with invocations[].executionSuccessful and start/end times; other outcomes emit no run, only a toolExecutionNotifications entry on the devops-cli invocation; non-gating results get level: note, problem.severity: recommendation and no security-severity. Tests validate against the vendored OASIS schema via jsonschema.validators.validator_for; jsonschema, locked only via mcp, joins the dev group.
  • Constraint*: Not-applicable must differ from unavailable, or scan report goes red on every workstation without a cluster or image. No unavailable or failed scanner becomes an empty run, and checkov, gitleaks, kubeconform or tflint fallback findings never carry the real tool's driver name: once empty runs are uploaded, either closes the tool's open alerts. Code scanning's handling of executionSuccessful: false is unverified. Class is not severity: Dive is not demoted to LOW, and unregistered scanners and from_sarif input stay gating.
  • Measured*: With only bandit of the 11 registered binaries on PATH (command -v), devops scan report <empty-dir> --json --fail-on LOW --sarif out.sarif exits 0, lists all 11 under tools, and writes 1 SARIF run, devops-cli, holding only tool and results. devops scan sast <empty-dir> without semgrep exits 0 with "No static AST pattern flaws detected". uv run --no-sync python probe/osv_fail_clean.py: on ConnectError, query_batch returns [] and a HIGH CVE finding comes back INVALIDATED, not reportable.
  • Source*: vibes observations/systems/17-a-fuzzers-first-report-is-about-the-fuzzer.md, tools/sarif_report.py, examples/code-smell-quantifier/smell_quantifier.py, examples/go-leak-sentinel/go_leak_sentinel.py, examples/go-leak-sentinel/test_go_leak_sentinel.py, tools/metric_reference.py, observations/systems/09-multi-agent-epistemic-loss-and-delegation-boundary-distortion.md, artifacts/schemas/sarif-schema-2.1.0.json, tools/fuzz_harness.py, tools/resource_iteration_workbench.py, examples/code-smell-quantifier/README.md, examples/code-smell-quantifier/test_smell_quantifier.py, tools/reliability_slo.py, observations/systems/13-verify-the-finding-before-you-fix-it.md

Strategic Alignment

  • Milestone: v0.2.24 (Reactive Workstation Command Center, Interactive TUI & Unified Operations Hub)
  • Roadmap Reference: docs/ROADMAP.md

Activity

  1. added this to the v0.2.24 milestone on Sep 28, 2026
  2. added
    type/feature
    scope/cli
    priority/p0-critical
    on Sep 28, 2026
  3. dan-petty commented on Oct 1, 2026

    @dan-petty
    OwnerAuthor

    Closed by #785, merged into release/v0.2.24.

    GitHub only acts on closing keywords when a pull request merges into the default branch, so this was closed by devops gh issues close-merged.

  4. added a commit that references this issue on Oct 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

    priority/p0-criticalscope/clitype/feature

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions