Repository navigation
Description
Context & Rationale
export_invalidated_feedback writes one record for every finding in every session directory (src/devops_cli/ai/review/exporter.py:145-153). A re-review, or devops review benchmark (3 sessions by default, src/devops_cli/config/defaults.py:391), writes the same finding once per session. findings.json stores no session id, so FeedbackRecord.session_id falls back to the directory name (exporter.py:82).
Human verdicts are the only labels in the export that a person wrote. They are written by devops review verify (by = "human", src/devops_cli/commands/review.py:1062). #607 records each session's subject and adds one session reader that counts one session per subject: the one with the most human verdicts, then the newest. Exporting only that session would still lose human verdicts recorded on a different session of the same subject.
Scope & Deliverables
Deliverable: export_invalidated_feedback reads sessions through the #607 reader.
- For each subject, export the counted session's findings.json findings.
- Then take each human-verdict finding from that subject's other sessions:
- If
_are_findings_duplicate(src/devops_cli/ai/review_schema.py:887) matches it to an exported record, that record takes the human verdict. - Otherwise it is exported as its own record.
- If
- Target-only and unkeyed sessions export all their findings, as today.
FeedbackRecordgainssubject_key: str | None.
Acceptance criteria: all are tmp_path tests with structural tuple assertions.
- Three sessions with one subject and the same two findings export 2 records.
- Two sessions of one subject each hold a human verdict on a different finding. The export has 2 records, and both carry the human verdict.
- Two sessions of one subject hold different human verdicts on the same finding. The export has 1 record, with the newer
verified_atverdict. - A target-only session and an unkeyed session each export all their findings.
devops review export-feedback(CliRunner) prints the deduplicated count.- Each new test runs in under 1 s (
uv run pytest tests/test_review_exporter.py --durations=0), anduv run devops cipasses.
Key questions:
- Merge findings that a machine raised only in the subject's other sessions? (proposed) No. They are repeats of the same subject with model noise, and merging them deterministically needs feat(review): order-independent review finding consolidation with a permutation test #608.
- Which matcher? (proposed)
_are_findings_duplicate, the predicate that consolidation already uses._is_matching_finding(src/devops_cli/ai/review/verification.py:2090) matches on title substrings only, which is loose across sessions. No new rule. - Should the export read candidates.json? (proposed) Not here. The default INVALIDATED export sees few machine invalidations, because the pipeline keeps them out of findings.json (
src/devops_cli/ai/review/pipeline.py:2840-2846). Which file holds every finding with every verdict belongs to refactor(review): review session store that owns layout, fingerprints and verdicts #771. - When two human verdicts conflict, which wins? (proposed) The newer
verified_at.
Constraint:
- No new match rule.
- A machine verdict never replaces a human verdict.
- Tests use no network or model.
Strategic Alignment
- Milestone: Backlog
- Depends on: feat(review): subject-keyed review history with a leave-one-out baseline #607
- Related: refactor(review): review session store that owns layout, fingerprints and verdicts #771, feat(review): order-independent review finding consolidation with a permutation test #608, feat(review): track false-positive rate across runs #434
Split off #607 during the v0.2.25/v0.2.26 readiness review (2026-10-01): The original #607 body planned three PRs. The export merge is a separate concern with its own merge rules, and it depends on the subject and reader that #607 adds. Keeping it out lets #607 fit one PR.
Update 2026-10-08: refinement
#950 made the exporter read candidates.json and carry subject, but its fingerprint includes the session id (ai/review/exporter.py:68-84), so a subject reviewed three times exports three records. Records group by subject_key (ai/review/history.py:64), and findings match by fingerprint v2 (#1141), not _are_findings_duplicate.
- A person's valid verdict sets CONFIRMED (
review/state.py:25-31). Depends on fix(security): each finding keeps its own fingerprint across unrelated edits, and deduplication and correlation give one result in every input order, in devops scan and in reviews #1141.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsReady
- StatusShow more project fieldsReady
Activity
dan-petty commentedon Oct 3, 2026
Review redesign (#1137, 2026-10-03): this item is a phase P2 child (P2-10): human verdicts and the feedback export are keyed by fingerprint v2, and a valid verdict sets CONFIRMED. It is blocked by #1141, because its dedup key becomes fingerprint v2. A person sets the native blocked-by link.
dan-petty commentedon Oct 17, 2026
Moved to v0.2.37: v0.2.37 started with fewer than its 16 items and was topped up to 16 from Ready items, critical fixes and P0 features first. (devops roadmap reprioritize)
feat(review): the feedback export counts each review subject once and…