Skip to content

feat(review): mitigated findings re-verified when their perimeter changes #587

Closed

Description

@dan-petty

Context & Rationale

A MITIGATED finding (src/devops_cli/ai/review_schema.py:370-371), set by the verifier (ai/review/verification.py:1134-1149) or devops review verify --status MITIGATED (commands/review.py:896-908), is reportable=False and dropped from the merge recommendation (review_schema.py:793). Nothing records what mitigates it: the updates dict at verification.py:1171-1181 discards the verifier's reason, and no field names the mechanism or its file. The only file-keyed cross-session store (ai/review/common_hallucinations.py:966 auto_record_invalidated_finding) writes only on INVALIDATED. Neither devops review (ai/review/runner.py:1583-1645, :1646-1680) nor devops pr check-readiness (commands/pr.py:1304-1393) intersects the diff with mitigations. vibes patterns/kinetic-exploit-probes-and-invariant-leashing.md calls this mitigation perimeter decay; observations/systems/30-kinetic-falsification-and-the-ephemeral-exploit-harness.md §2.3: a gateway 10MB ceiling bypassed by a later streaming endpoint while the finding sat mitigated.

Scope & Deliverables

  • Context & Rationale*: A MITIGATED finding (src/devops_cli/ai/review_schema.py:370-371), set by the verifier (ai/review/verification.py:1134-1149) or devops review verify --status MITIGATED (commands/review.py:896-908), is reportable=False and dropped from the merge recommendation (review_schema.py:793). Nothing records what mitigates it: the updates dict at verification.py:1171-1181 discards the verifier's reason, and no field names the mechanism or its file. The only file-keyed cross-session store (ai/review/common_hallucinations.py:966 auto_record_invalidated_finding) writes only on INVALIDATED. Neither devops review (ai/review/runner.py:1583-1645, :1646-1680) nor devops pr check-readiness (commands/pr.py:1304-1393) intersects the diff with mitigations. vibes patterns/kinetic-exploit-probes-and-invariant-leashing.md calls this mitigation perimeter decay; observations/systems/30-kinetic-falsification-and-the-ephemeral-exploit-harness.md §2.3: a gateway 10MB ceiling bypassed by a later streaming endpoint while the finding sat mitigated.
  • Deliverable*: In order. First, record the mitigation: add mitigating_mechanism: str | None (vibes patterns/epistemic-seam-and-mitigated-defect-auditing.md) and perimeter_files: list[str] to Finding; make the verifier prompt (ai/tasks/verify_finding_system.md) name both for mitigated: true, else degrade to UNVERIFIED (also reportable=False, verification.py:1154-1155); stop setting mitigated=True on INVALIDATED (verification.py:1136-1138). Give devops review verify --status MITIGATED repeatable --perimeter <path>, a mitigation reason field replacing invalidation_reason, and optional --regression-test <path>, which core/coverage_index.py:187 and core/test_selection.py:112 (via commands/ci.py:665-667) already re-select on perimeter change. Human-accepted mitigations go to a tracked ledger like ai/review/common_hallucinations.json; model-only verdicts stay session-local. Second, measure before enforcing: devops review branch|pr and _evaluate_pr_blockers intersect the diff with ledger perimeter_files and warn 'N mitigated findings whose perimeter changed', naming each, no exit-code change; no InvariantLeashRegistry port. Executable leash probes (pytest per finding, pytest-timeout as new pinned dev dependency, untrusted-repo probes only inside docker/sandbox.py:135 WorkloadSandboxRunner) follow Executable Verification Criteria separately.
  • Constraint*: Locality: .gitignore:63 ignores .data/* and _get_reviews_base_dir (ai/review/review_environment.py) resolves sessions locally, so CI has nothing to intersect; the warning reads only the tracked ledger, separate from the hallucination catalog (glob-keyed, suppression polarity). Polarity: vibes tools/kinetic_probe.py maps exit 0 to 'confirmed' and non-zero to 'refuted', so an import failure reads as 'mitigation holds'; collection/import errors must re-open the finding, and an unresolvable perimeter path is reported, not dropped. Until the flag is repaired (verification.py:1138 True on INVALIDATED, commands/review.py:904 False), consumers key on status == MITIGATED. The 'Executable Verification Criteria' item's 'bounded subprocess sandbox (review_environment)' does not exist (no subprocess call there, no setrlimit in src/; only WorkloadSandboxRunner caps resources); correct that entry. A model-written probe is registered only after human acceptance via devops review verify -- the epistemic-seam rule verification.py:1142-1144 already breaks, writing the hallucination catalog from the model's invalidated_criteria_matched unguarded though the 'Model-in-the-Loop Prompt Benchmarking' item treats only human-verified records as trustworthy.
  • Measured*: grep -rIl -i for leash, InvariantLeashRegistry, perimeter_files and mitigating_mechanism across src, tests, .github, scripts and pyproject.toml: 0 files each. wc -l src/devops_cli/ai/review/review_environment.py: 51. grep -rn 'setrlimit\|RLIMIT' src/ | wc -l: 0. find .data/reviews -name findings.json | wc -l: 0 in this checkout (only sample-validations exists), so local MITIGATED incidence could not be measured; the second deliverable is what measures it.
  • Source*: vibes patterns/kinetic-exploit-probes-and-invariant-leashing.md, tools/kinetic_probe.py, observations/systems/30-kinetic-falsification-and-the-ephemeral-exploit-harness.md, patterns/epistemic-seam-and-mitigated-defect-auditing.md

Strategic Alignment

  • Milestone: v0.2.23 (devops ai Review Quality, LLM Routing & Multi-Language Validation)
  • Roadmap Reference: docs/ROADMAP.md

Activity

  1. added this to the v0.2.23 milestone on Sep 25, 2026
  2. added
    type/feature
    scope/review
    priority/p2-medium
    on Sep 25, 2026
  3. dan-petty commented on Sep 27, 2026

    @dan-petty
    OwnerAuthor

    Closed by #639, merged into release/v0.2.23.

    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.

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/p2-mediumscope/reviewtype/feature

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions