Repository navigation
Closed
Labels
priority/p1-highPriority P1: high-impact work for the next planned milestonescope/reviewMulti-persona code review engine, verification, and findingstype/featureType feature: a new function
Milestone
Description
Problem
- Every evaluation from S5 to S21 computed precision, recall and stability by hand.
score_recall.pyexists only inside docs/SELF_IMPROVEMENT.md:716-765.- The loop needed a separate matrix build (972 candidates in 295 clusters) and four analysis passes [measured].
- The recall scorer counts fixture echoes as hits: 9 raw hits in S14–S20 were echoes or a different defect [measured: loop §6].
- The baselines exist only as prose: S11 12/51, 11/51 and 4/30; loop 75/441 and 49/441; Jaccard 0.131 and κ 0.444; 38% of the 9 known defects per run.
- The labels can vanish.
- Only 111 of 295 clusters carry a machine-readable label (
s11_label,prior_label_s10). - The loop's 99 new labels and 75 manual partitions exist only as prose.
- The cluster files sit in another session's gitignored scratch directory,
.claude/scratch/loop1221/[.gitignore:71; measured: c-fidelity].
- Only 111 of 295 clusters carry a machine-readable label (
- The golden set is not a commit. Golden
real_defectsis 24 entries with embeddedfiles[code: tests/golden/review_findings.json], so it cannot be reviewed as it stands. - A deterministic pipeline gains no statistical power from repeated runs, only from more labelled inputs. Inputs used to tune rules cannot also judge them [inference].
Acceptance criteria
- First step, label rescue:
clusters.json,candidates.jsonlandclusters-method.mdare copied to.data/review-labels/.- The loop's prose labels and partitions are transcribed into
tests/fixtures/review_labels/. - A test checks that the label files cover all 441 loop rows and all 51 S11 rows.
-
devops review score SESSION... --labels FILE [--json]reports:- lenient, strict and per-distinct-defect precision, split by producer;
- VERIFIED and HIGH/CRITICAL precision;
- recall against a recall file and against the known-defect list;
- stability: Jaccard of reported identities and status agreement, across sessions with equal input digests.
- n is shown beside every ratio.
- Unlabelled rows are listed. A gate ratio reads "not computable" while one remains.
- Identity:
- From 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, fingerprint v2.
- For old sessions, the loop's cluster keys: kube-linter check + path + object; Bandit/Semgrep rule + path + line; persona path + origin page ± 5 lines.
- A location outside the reviewed tree never matches a label, and a hit whose source page is a fixture is not recall.
- Labels:
- Each entry holds identity, label (valid-strict, valid-lenient, opinion or false), defect id, expected severity, note, labeller and date.
- Each input is marked
tuningorheld-out.
- The golden set becomes reviewable.
devops review score --materialise-golden DIRwrites the goldenfilesinto a git repository with one fixed commit, for a path review.- Golden entries no tool can express (for example missing-containment and missing-depth-limit) are listed as accepted recall loss.
- Recorded slices of S11 and three loop sessions print exactly 12/51, 11/51 and 4/30, and the slices' Jaccard and κ.
-
devops ai runs checkgains tolerances for precision, stability, cost and reference coverage [code: commands/ai_runs.py:604-640]. - (person-run) Over
.data/reviewsfor S11 and S12–S21,scoregives 12/51, 75/441 and 49/441. The owner reviews the seed label file. - (person-run) After fix(security): a review's isolated Semgrep scan hands Semgrep only targets under its working directory, so it finishes instead of rediscovering each file across the checkout #1079 and fix(review): a branch review leaves the files it deletes out of persona pages and scanners, and a file a scanner cannot read does not mark the scanner failed #1140:
- three runs of
devops review branch --no-persona-review --no-verificationon the loop input are scored; - golden
real_defectsis scored once on the current pipeline; - the 16 BLE001 rows in the loop's diff hunks are labelled;
- one tools-only review on a loaded host (load1 above 20) completes Semgrep, with per-batch timings in the profile (the person-run check of the former D16 draft, which fix(security): a review's isolated Semgrep scan hands Semgrep only targets under its working directory, so it finishes instead of rediscovering each file across the checkout #1079 delivered).
- three runs of
- This is the redesign's first implementation PR, so it also lands the decision record and the vision text (no documentation-only PR):
docs/adr/0005-review-findings-come-from-tools-not-models.mdholds the ADR text recorded in feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137 ("Decision record"), byte for byte apart from issue links;docs/VISION.mditem 8 is replaced with the text recorded in feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137 ("Vision item 8"); item 16 changes later, with refactor(review): the model verifier, the hallucination catalog and the model-claim guards are deleted, and person-recorded verdicts become suppressions #1150;- the knowledge-base article's claim that reviews retrieve indexed chunks (
ai/knowledge_base/devops_cli/tasks/rag_context_indexing.md:5) is corrected, since reviews have not done so since 2026-09-30; - CONTEXT.md's code-review terms are not changed here; they land with feat(review): every reported finding is admitted with its producer's anchor and a location that exists in the reviewed commit, the review writes findings.sarif, and review.md shows findings and suppressions #871, when the code they describe exists.
- If another redesign item's PR merges before this one, these three documentation changes move into that PR instead.
- Producer-split precision replaces feat(review): every reported finding is admitted with its producer's anchor and a location that exists in the reviewed commit, the review writes findings.sarif, and review.md shows findings and suppressions #871's original
review stats --by producerand itsserved_by/model fields: this command reports precision per producer from the saved sessions. - Scanner paths are repo-relative before scoring: the rule + path + line key needs fix(review): location parsing keeps placeholder, prose-laden and truncated locations #788's scanner-path half (
security/semgrep.py:124,security/bandit.py:74passstr(p.resolve())today), which lands in P0 as its own item. - Tests run offline with fakes and recorded tool output: no network, no real scanner, no model; each test under 1 s.
-
changelog.d/<n>.mdrecords the change;CHANGELOG.mdanddocs/ROADMAP.mdare not edited. -
uv run devops cipasses.
Key questions
- Where do labels live? (proposed) In the repo next to the recall set. The raw cluster files stay under
.data/review-labels/. - How much labelling? (proposed) About 1 minute per distinct tool finding, which is 30–80 per new input, or 1–2 hours [estimate]. Tool findings are deterministic, so one label serves every later run.
- Which inputs are held out? (proposed) Golden
real_defectsand two merged ranges the owner picks (feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137 Q7). - Backend compute from Loki? (proposed) Not computed here. fix(ai): review calls through the gateway no longer stall for about 190 s on ollama, with the cause measured first #1069 records the query procedure, and P3's attempt records make it offline.
Strategic alignment
- Milestone: none; the roadmap tooling places it. P1. Urgent first step (Q0 in feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137): the seed labels in the gitignored scratch directory are copied before that session's scratch is pruned.
- Replaces: feat(review): count every candidate finding by verdict so the invalidated share can be charted #812 (the INVALIDATED-share count) and feat(review): verifier agreement with human verdicts as cohen's kappa #869 (verifier agreement with person verdicts as kappa). Both close as superseded when this item is filed; the INVALIDATED status goes away with the verifier (refactor(review): the model verifier, the hallucination catalog and the model-claim guards are deleted, and person-recorded verdicts become suppressions #1150).
- Depends on: fix(review): location parsing keeps placeholder, prose-laden and truncated locations #788's scanner-path half for the rule + path + line key (or lands it in the same release).
- Related: refactor(review): the synthetic corpus drops contradict-documented-default, which no tool can detect #541 (frozen; the synthetic-corpus generator in
ai/review/defects.pyandreview samplesis not deleted), fix(security): a review's isolated Semgrep scan hands Semgrep only targets under its working directory, so it finishes instead of rediscovering each file across the checkout #1079, feat(review): every reported finding is admitted with its producer's anchor and a location that exists in the reviewed commit, the review writes findings.sarif, and review.md shows findings and suppressions #871. - Parent: feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137 (phase P0).
- Evidence tags ([measured: …], [code: path:line], [sourced: …], [estimate], [inference]; "S11" is the single review run of 2026-10-03 and "the loop" the ten runs S12–S21; c-feasibility and c-fidelity are the two design critiques) are explained in feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137.
Update 2026-10-09: re-scope before building (v0.2.30)
An assessor and a challenger checked this item against release/v0.2.30 (edd2578) and the local .data/reviews and .data/review-labels. Most of it is buildable and the label data exists. The amendments below are applied before building; everything else in the body stands.
- Drop the reference-coverage tolerance from
ai runs check. Nothing records reference coverage today. Move the tolerance to feat(review): each finding group gets a model-written explanation and plan grounded in the rule's documentation at the installed tool version, kept apart from findings, with every quote, citation, version and code block checked #1147, the first item that records received ÷ needed per job, or to feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137's P2-2, whose scope already lists it. - Define "cost" as model calls (
llm_calls). Its tolerance is--max-calls-increase. The existing prompt-token and duration tolerances apply to score runs too. Do not usecost_usd: it is 0.0 in every recorded session, because the models are self-hosted, so a tolerance on it would always pass. - Identity. For new sessions, identity is the
fingerprint_v2partial fingerprint that admission records in findings.sarif (feat(review): every reported finding is admitted with its producer's anchor and a location that exists in the reviewed commit, the review writes findings.sarif, and review.md shows findings and suppressions #871), whatever algorithm 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 later puts behind it. For S11–S21, it is the loop's clusters, through a committed row map. Persona rows elsewhere match by path, origin page and ±5 lines. Nothing is parsed from titles. This removes the forward dependency 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 (v0.2.31). - fix(review): location parsing keeps placeholder, prose-laden and truncated locations #788 bullet. Reword it to "the scorer makes stored scanner paths repo-relative when it reads them" and drop fix(review): location parsing keeps placeholder, prose-laden and truncated locations #788 from Depends on. Stored sessions never change, and findings.sarif paths are already relative.
- Person-runs.
- Move the three tools-only runs to feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137's P0 exit, which already lists them, since they wait on fix(review): a branch review leaves the files it deletes out of persona pages and scanners, and a file a scanner cannot read does not mark the scanner failed #1140, which is unplaced.
- Move the 16 BLE001 labels to feat(review): ruff and mypy run as review evidence with the project's settings, advisory rules report only on changed lines, and changed functions show complexity before and after #873. No session holds those rows, or their fingerprint, until feat(review): ruff and mypy run as review evidence with the project's settings, advisory rules report only on changed lines, and changed functions show complexity before and after #873 admits ruff findings.
- Keep these person-runs here: the golden scoring once, the owner's seed-label review, and the loaded-host Semgrep review. fix(security): a review's isolated Semgrep scan hands Semgrep only targets under its working directory, so it finishes instead of rediscovering each file across the checkout #1079 delivered the batching, but this check was never run, and it does not need fix(review): a branch review leaves the files it deletes out of persona pages and scanners, and a file a scanner cannot read does not mark the scanner failed #1140.
- Documentation. Pin the ADR, VISION item 8 and the KB fix to feat(review): devops review score scores saved review sessions against a label file offline and reproduces the S11 and loop baselines #1138 whatever the merge order. feat(review): every reported finding is admitted with its producer's anchor and a location that exists in the reviewed commit, the review writes findings.sarif, and review.md shows findings and suppressions #871, fix(ai): review calls through the gateway no longer stall for about 190 s on ollama, with the cause measured first #1069 and fix(ai): a failing embedding model pauses rag lookups instead of ending rag for the run, and each embedding model gets its own prompts, cache keys, dimension and bounded chunks #1065 already merged without them. The ADR takes the next free number at merge time (docs(cli): docs/TESTING.md holds the test conventions, ADR 0005 records that tests double only process edges, and AGENTS.md and the contributor docs point to them #1308 also claims 0005).
- κ: decided by the owner, below.
Owner decision (2026-10-09): κ uses statsmodels' fleiss_kappa, imported lazily (adds statsmodels, scipy, pandas and patsy). It needs equal ratings per subject, so κ covers the identities every session in an equal-input group reported; the loop's 0.444 (126 clusters, 730 ratings) is not recomputed.
Metadata
Metadata
Assignees
Labels
priority/p1-highPriority P1: high-impact work for the next planned milestonescope/reviewMulti-persona code review engine, verification, and findingstype/featureType feature: a new function
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 8, 2026
Placed in v0.2.30 on 2026-10-08 at the owner's request ("Populate 10 security and ci issues into each v0.2.30, v0.2.31, and v0.2.32 milestone"). This is a person's placement. Release theme: P1 secret and sandbox-boundary fixes, the review tools lock and its scorer, kube-linter finding identity and a faster gate. Position 11 of 11 in the release's planned merge order. #1138 is the review scorer #1137 places ahead of its P1a items; the owner asked to place it next to #1142 and #1141. Its board Status is set to Ready, so the release-start fill keeps it.
feat(review): devops review score scores saved review sessions agains…
dan-petty-bot commentedon Oct 9, 2026
What changed
#1472, merged into
release/v0.2.30as 434c976.108 file(s) changed.
How it was verified
Check runs at bcbf7f7:
Acceptance Criteria of
docs/agent/tasks/task-1138-review-score.md:clusters.json,candidates.jsonlandclusters-method.mdare in.data/review-labels/(copied 2026-10-03); the prose labels and partitions are transcribed intotests/fixtures/review_labels/, andtest_the_label_file_maps_every_s11_and_loop_row_to_a_labelchecks all 441 loop rows and all 51 S11 rows.devops review score SESSION... --labels FILE [--json]reports lenient, strict and per-distinct-defect precision split by producer, VERIFIED and HIGH/CRITICAL precision, recall against the recall file and the known-defect list, and stability across sessions of equal input digests, with n beside every ratio:test_the_recorded_slices_reproduce_the_published_precision,test_precision_splits_by_producer,test_every_ratio_carries_its_n_in_the_table_and_the_jsonandtest_recall_counts_the_samples_whose_report_cites_each_finding. A SESSION without a readable findings.json is refused, and a session without an input digest gets no stability:test_a_session_without_a_readable_findings_json_is_refusedandtest_sessions_without_an_input_digest_are_compared_with_no_other.devops ai runs check:test_an_unlabelled_row_is_listed_and_every_label_ratio_reads_not_computable,test_a_score_whose_new_rows_are_unlabelled_fails_the_run_checkandtest_a_score_figure_the_current_run_could_not_compute_fails_the_check.fingerprint_v2from findings.sarif for new sessions, the loop's clusters through the committed row map for S11–S21, and persona rows by path, origin page and ±5 lines; two tool findings at one place leave the row unlabelled:test_new_sessions_match_labels_by_fingerprint_loop_key_and_persona_windowandtest_two_tool_findings_at_one_place_leave_its_rows_unlabelled.test_a_row_outside_the_reviewed_tree_counts_as_false_without_a_label,test_a_hit_echoed_from_a_fixture_page_is_not_recallandtest_echoed_known_defects_are_not_recall_in_the_slices.LabelFile,Label,LabelledInput). The loop evaluation recorded no expected severity per cluster, so 168 of the 169 seed labels leave it null, 19 of the 20 valid ones among them; see the pending seed-label review below.--materialise-golden DIRwrites the golden files into a repository with one fixed commit, and lists the accepted recall loss:test_the_golden_set_materialises_as_one_fixed_commit,test_commit_snapshot_makes_the_same_one_commit_of_the_same_filesandtest_the_committed_golden_input_lists_its_accepted_recall_loss; a DIR that is a file, or a golden file outside DIR or under its.git/, is refused before anything is written:test_materialising_into_a_directory_that_holds_files_or_a_file_is_refusedandtest_a_golden_set_that_cannot_be_written_is_refused.test_the_recorded_slices_reproduce_the_published_precisionandtest_the_loop_slices_pin_their_stability_and_pooled_precision.devops ai runs checkhas tolerances for precision, stability and cost (model calls):test_score_runs_check_precision_stability_and_calls_at_their_tolerances,test_a_score_figure_the_current_run_could_not_compute_fails_the_check,test_only_a_figure_neither_run_recorded_goes_without_a_verdictandtest_cli_runs_check_takes_the_score_tolerances..data/reviews,devops review scoregives S11 12/51 and the loop 75/441 lenient and 49/441 strict, run offline withDEVOPS_CLI_DATA_DIRset to a temporary directory and a config withoutruns.index_url, so the run stayed on the workstation.review stats --by producer.test_stored_scanner_paths_are_made_relative_to_the_input_root.test_the_loop_slices_pin_their_stability_and_pooled_precisionis the only test that computes κ, and it pays statsmodels' import (about 0.85 s alone, 1.1–1.2 s for the test under pytest), the cost of the owner's κ decision (2026-10-09); every other test scores sessions whose inputs have one session each, or none with an identity on every row, so no other test imports statsmodels.changelog.d/1138.mdrecords the change;CHANGELOG.mdanddocs/ROADMAP.mdare not edited.devops review branch --no-persona-review --no-verificationon the loop input: moved to feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137's P0 exit, since they wait on fix(review): a branch review leaves the files it deletes out of persona pages and scanners, and a file a scanner cannot read does not mark the scanner failed #1140.tests/fixtures/review_labels/labels.json, above all the 99 new reads of the loop evaluation and the golden input's accepted recall loss, and setexpected_severityon the valid-strict and valid-lenient labels (19 of the 20 are null; the loop evaluation recorded none).real_defectsonce on the current pipeline:uv run devops review score --labels tests/fixtures/review_labels/labels.json --materialise-golden /tmp/golden, thencd /tmp/golden && uv run --project <devops-cli checkout> devops review path . --no-cache, thenuv run devops review score <the new session directory> --labels tests/fixtures/review_labels/labels.json; add the session'ssubject.inputdigest to the golden input and label each listed unlabelled row with the golden defect id it is.uptime), runuv run devops review branch --no-persona-review --no-verification --no-cache; the session'sprofile.jsonshowsstatic_analyzers.Semgrepasranand itsstatic_analyzer_seconds.uv run devops cipasses: the PR's passing checks.feat(release): v0.2.30 (#1473)
fix(review): a review's scanners leave out the rules that never gave …