Skip to content

fix(review): the devsecops persona reports misconfiguration and error-handling defects again, scored against a fixed recall set #1015

Closed

Description

@dan-petty

Problem

#951 (38517a8) made the devsecops persona almost silent, and it stopped finding the real defects that earlier reviews of the same code found. Session 20261002-205520 (S5) was the first branch review with #951's prompts. It was cold, with 403 model calls and none from the cache, at 38517a8 (.data/review-evaluation-20261002-s5.md):

The prompt text is the likely cause. At 38517a8, src/devops_cli/ai/personas/devsecops/prompt.md says:

  • :4: "A vulnerability is a path you can quote: the untrusted source, the sink it reaches … and the missing check between them."
  • :6: "Return no finding when you cannot quote the source, the sink and the defective line. Most files have no security defect."
  • :16: "A choice the manifests or conventions document as deliberate is not a finding."

A NetworkPolicy open to the world, a broad except and a false claim in the docs have no source-to-sink path to quote. "Where to Look" (:8-18) has no class for network exposure or error handling. k8s/monitoring/networkpolicy.yaml:17 comments the rule as "(0.0.0.0/0 and kube-system/traefik)", and S5's reply on the otel policy says the changes "appear to align with the project's conventions". That fits :16.

S5 measured only half of #951. Branch reviews read .devops/review.md at the merge base (runner.py:2237, conventions_revision=base_revision.revision), so #951's threat model and project exemptions were not in effect. With them, recall may fall further. S6 (20261002-214641) replayed S5's empty replies from the cache, so it adds no sample.

Each file has one old-prompt sample against one new-prompt sample, so the cause per file cannot be told apart from sampling. The aggregate drop is systematic. The proposed rule changes below are inferences until the person-run measurement confirms them.

Acceptance criteria

  • devsecops/prompt.md defines a finding as either a quotable path (an untrusted source, the sink it reaches and the missing check) or a quotable misconfiguration: the setting or line, and what it exposes or permits that its job does not need. "Return no finding" applies when neither can be quoted. The sentence "Most files have no security defect" is gone.
  • "Where to Look" adds Network exposure: a NetworkPolicy, Ingress, Service, firewall or security group that admits 0.0.0.0/0, every namespace, or every pod to a port whose consumers are known. It also adds Error handling: a broad except that swallows an error on a path where failing closed matters (auth, verification, a security check, data integrity). These are reported at most MEDIUM and LOW unless a quotable consequence is worse.
  • :16 reads: a choice the manifests or conventions justify, by saying why it is safe, is not a finding. A comment that only restates the rule is not a justification.
  • The docs review prompt (src/devops_cli/ai/tasks/docs_review_prompt.md) keeps reporting a security claim that the code contradicts. Check whether feat(review): review prompts state a threat model and an evidence bar, and send nothing the pipeline does not use #951 changed this; if it did, restore it.
  • A recall set records the known real findings this issue names: file, revision, line range, class and the issue that tracks each. It goes in tests/fixtures/review_recall/ (or beside feat(review): review prompts state a threat model and an evidence bar, and send nothing the pipeline does not use #951's corpus in docs/SELF_IMPROVEMENT.md). An offline test checks that every class in the set is named in "Where to Look" or in the docs prompt, and that every listed file exists at its revision.
  • docs/SELF_IMPROVEMENT.md describes how to score recall on the set beside feat(review): review prompts state a threat model and an evidence bar, and send nothing the pipeline does not use #951's corpus A/B, with --no-cache and three samples per file.
  • Tests run offline, call no model, and each runs well under 1 s.
  • changelog.d/1015.md records the fix under ### Fixed. CHANGELOG.md is not edited.
  • uv run devops ci passes.
  • (person-run) On the homelab gateway, with --no-cache and three samples per file, the six files of the recall set are reviewed twice: once with 38517a8's prompts and once with this change. That is the four lost findings plus ai/spend/pricing.py:55 and :65, which S5 found. This change finds each Network Exposure entry of the set (monitoring fix(k8s): monitoring ingress admits 0.0.0.0/0, qdrant ignores its security context, and single-ollama leftovers remain #953, otel) in at least 2 of 3 samples; the Error Handling and Security Claims entries are counted and reported, not gated (revised 2026-10-03, below). A path review of S5's 24 reported files reports no more than 1.5 times S5's false findings. The numbers go in the PR.

Key questions

Depends on: none.
Order: lands before the v0.2.25 cut. It touches only prompt text, a fixture, a test and docs/SELF_IMPROVEMENT.md. #846 and #847, building now, change the verifier and the criteria, not the persona prompt.
Related: #951 (the change this fixes). #953, #913, #423 and #921 (the defects in the recall set). #948 (severity: S5's two broad excepts were reported HIGH). #950 (suppressing already-judged findings).

Scope revised 2026-10-03, after the first measurement (.data/measurements/recall/analysis.md): Network Exposure came back (6 of 6 samples against 3 of 6), but reported false findings on Python files rose from 1 to 6, every network finding was HIGH, and broad excepts and the VISION.md claim stayed at 0 of 9 and 0 of 3. A path review shows no diff to a broad except and no code to a docs page, and VISION.md item 6 is a stated theme. The persona prompt gains four edits: a code evidence bar ("A value that reaches no sink you can quote is not a vulnerability, and most code has none"), a network severity tied to a quoted publishing route, egress with metadata blocked is not exposure, and broad excepts reported as LOW instead of capped. The person-run bar is narrowed to the two Network Exposure entries; #423 carries broad excepts, #921 the VISION.md:12 text. The re-run pins both arms to one model, alternates them and runs without verification.

Activity

  1. added this to the v0.2.25 milestone on Oct 2, 2026
  2. added
    type/bug
    scope/ai
    scope/review
    priority/p1-high
    on Oct 2, 2026
  3. dan-petty commented on Oct 3, 2026

    @dan-petty
    OwnerAuthor

    Closed by #1054, merged into release/v0.2.25.

    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 3, 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/p1-highscope/aiscope/reviewtype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions