Skip to content

fix(review): the review learns only from a person's verdicts, and every reader of the feedback dataset is honest #950

Closed

Description

@dan-petty

Problem

docs/SELF_IMPROVEMENT.md describes a review that learns from its verdicts. In the code, nothing a verdict produces changes a later review, and the datasets built from verdicts are read by broken or circular tools. Found while analysing review session 20261001-224227 (2026-10-02).

  • The learned catalog is inert, and would be harmful if switched on.
    • All 35 entries in .data/common_hallucinations.json are general with HALLUCINATION-AUTO-* ids. _verify_general_ground_truth (common_hallucinations.py:677-694) dispatches on id substrings, so none can pass.
    • Their signatures pair common words such as exception+handling and insecure+configuration. Enabled, they would invalidate 240 of that session's 903 candidates, including 19 VERIFIED HIGH findings.
    • Deterministic checkers also call auto_record_invalidated_finding, so the catalog learns from the machine as well as from people.
    • The ledger's read-modify-write runs from parallel verification threads without a lock, and load failures are logged at debug level.
  • The negative exemplars never change. The persona prompt shows the top 8 builtin entries by a shipped count, and 51 of the 53 counts are 1. Recurrence data never reaches generation.
  • The benchmark suite sends empty prompts.
    • ai/benchmark/suite.py:38-39 loads benchmark_suite_system.md and benchmark_suite_user.md, which never existed, and load_task_prompt returns "" for a missing file.
    • It uses fix as the code under test (:103) and scores UNVERIFIED findings as non-vulnerable (:79).
  • prompt-eval is circular. It scores the deterministic layer against labels that layer wrote: in .data/feedback_dataset.jsonl, 28 of 51 labels are deterministic:*, and none is human.
  • The exporter loses data. export-feedback reads findings.json only, overwrites its output (mode "w"), and its default --status INVALIDATED sees almost nothing. The docs name three different dataset paths.

Acceptance criteria

  • The catalog learns only from people, and narrowly.
    • The auto-learned general entries are purged, both from .data on first load (with a one-time notice) and from the code path that made them.
    • Deterministic checkers no longer write to the catalog.
    • A person's INVALIDATED verdict records an exact suppression: same file, same normalized title, same hash of the cited line. Any signature needs at least one code-identifier token.
    • Writes are locked and loads warn on failure.
  • Exemplars come from verdicts. The ones shown to the persona come from human-verdict recurrence where any exists, and only the target project's own entries are labelled "reported against this codebase".
  • The suite is gone. ai benchmark --suite and ai/benchmark/suite.py are deleted (pre-1.0; feat(ai): model-in-the-loop prompt benchmarking #413's corpus arms replace them). A test asserts that every literal prompt filename passed to load_task_prompt in src/ exists.
  • prompt-eval is honest. It reports per labeller and excludes deterministic:* labels by default.
  • The exporter.
    • It appends, de-duplicated by finding fingerprint.
    • It reads verdicts from both findings.json and candidates.json.
    • Each record carries the subject, category, references and the cited excerpt.
    • It refuses to replace an existing file with zero records.
    • One dataset path is documented.
  • Tests:
    • With a copy of a ledger that holds the exception+handling entry, a real HIGH finding about a bare except stays UNVERIFIED.
    • After a human verdict, the same finding at the same line content is suppressed; with changed content it is not.
    • A threaded registration keeps every entry.
    • prompt-eval counts a deterministic:x label as excluded.
  • uv run devops ci passes.

Key questions

Scope added 2026-10-02 from review session 20261002-214641 (.data/review-evaluation-20261002-s6.md, section 7): 21 of S6's 24 reported entries replayed S5's wording, which shows what suppression would remove. Matching must ignore the producing tool: the exec finding at tests/test_review_prompt_consistency.py:439 changed from Semgrep's title to Bandit's at the same line.

  • A judged finding is matched across runs on location and a normalised claim, independent of the tool or persona that produced it. A test judges a Semgrep exec finding and asserts the Bandit B102 finding at the same line is suppressed.

Activity

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

    @dan-petty
    OwnerAuthor

    Closed by #1039, 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/reviewtype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions