Can a reviewer with project history catch what a generic reviewer misses?

Phase 2 report, 2026-11-30. Repository history helps a capable coding model most at review time, but only when the deciding history is retrieved. On real pull requests it usually is not. On the 34 development tasks with DeepSeek-V4.1-Flash, the model serge uses to drive Relore, a reviewer citing history fixed 10 of 16 historical violations in code-only patches with no regressions. A generic reviewer fixed none. History at review time was statistically indistinguishable from history at generation time. On 63 held-out cases mined from real transformers, trl and diffusers review threads, the reviewer caught 19 of 36 violations at 0.79 precision when handed the evidence a maintainer relied on. Deployable retrieval put that evidence on the page in only 7 of 43 cases. On a separate 41-case development set, no query strategy we designed did better, including two-stage thread expansion. The decisive rules are project-wide conventions that a diff does not name. On the small local Devstral model the whole loop changed almost nothing. Held-out and development labels are provisional and unreviewed.

Corrections, 2026-11-30. An audit for Phase 2.5 recomputed this page from the saved results. It corrected four figures in place (cost, reasoning-ceiling stops, revision failure rate, Devstral coder acceptances). It also found a data defect: the held-out oracle pages were built from GitHub's issues API, so every evidence PR showed merged_at: null, including the 38 merged before their cutoff. The held-out reviewer therefore saw merged decisions labelled as unmerged. The held-out oracle figures below (19 of 36 at 0.79) were measured under that defect and are probably understated. Phase 2.5 reports a corrected rerun of the reasoning step.

Why review instead of activation

Phases 1 and 1.5 found that raw Relore retrieval improved historical compliance from 14 to 24 of 30 packaging repairs. Compiled decisions, provisional headers and summaries added little on top. Several failures happened with the decisive evidence on the page: the model kept librosa, the superseded Torch cap and a self-referencing save flag. Phase 2 tests a different placement. History is applied to a concrete patch in one review-and-revision step, and a generic reviewer serves as the control. The patch also gives retrieval something specific to search for.

Design

Initial patches are not regenerated. Arm A reuses the frozen Phase 1 code-only edit, and arms B–E reuse the frozen raw-history edit, byte for byte, together with their saved executable grades. Every review arm gets one review call. If at least one finding validates, it also gets one revision call. The coding model judges each finding and may reject it. Without validated findings the initial patch is kept. The reviewer never edits code.

ArmInitial patchReviewReview evidence
Acode onlynone—
Bcode + raw historynone—
Ccode + raw historygenericnone
Dcode + raw historyhistoricaloriginal task-query page
Ecode + raw historyhistoricaldiff-driven page
Fcode onlyhistoricaldiff-driven page
R / RAraw / code onlysecond attempt, no findings—
CAcode onlygenericnone
FTcode onlyhistoricaltask-query page
ET / EC / E8code + raw historyhistoricaldiff + temporal follow-up / task ∪ diff / task query, 8 hits

R and RA control for the second attempt itself. Without them, any gain could come from giving the coder another try rather than from the findings. CA versus F isolates history inside review when no history was used during generation. The historical reviewer uses the Phase 2 prompt verbatim and returns flat JSON: id, location, description, evidence IDs, applicability, correction and uncertainty. There is no decision ontology. A historical finding must cite at least one document_id from the hits it was given. Unknown IDs are dropped, never repaired. A generic finding that cites evidence is rejected, because it saw none. The generic reviewer has the same 768-token budget, and revisions have 384. Coder and reviewer are both local Devstral Small 2 (Ollama manifest 24277f07…) at temperature 0 and seed 17, the Phase 1 model, so no external inference fees are incurred.

Experiment B: can the patch write a better query than the task?

A diff-driven query searches with entities read from the patch alone. For packaging these are the requirement names and versions added or removed, plus marker variables. For Python they are the identifiers that appear on only one side of the edit, plus the edited symbol. Results from each entity are merged round-robin and capped at four hits, the Phase 1 page size. Every page is served from an index rebuilt from the 61 frozen captures at the task cutoff. Each hit is also re-checked against the cutoff. The task-query strategy reproduced all 34 frozen Phase 1 pages exactly. The proxy measure is mechanical: is the task's source decision PR on the page? It is not a semantic sufficiency judgment.

Strategy (queries from the frozen raw-history patch)Source PR found / 34Mean evidence bytesMean hitsHits from source PR
task4 · original task query271,7572.6262%
task8 · task query, eight hits282,2173.2463%
diff4 · diff entities292,0172.8866%
diff4 + temporal follow-up301,9222.6569%
combined task ∪ diff, four hits302,1313.1563%
diff4 + file-name entity (sensitivity only)312,0913.0066%

Diff-driven queries recovered the source PR on three tasks where the task query returned nothing useful: japanese, audio-kenlm and optional-kernels. They lost it on mlinter. Adding a temporal follow-up also recovered peft-conversion, the Phase 1.5 incident, while using fewer bytes than diff4 alone. With the code-only patch as the query source, diff4 alone recovered peft-conversion as well. The expanded task query recovered peft-conversion only.

A leak we excluded. Phase 1 fragment file names are synthetic and name the task's concept, for example requirements-peft-conversion.txt. A modified file is a legitimate diff entity in a real repository. Here it would leak the task, so file names are kept out of every review arm and reported only as the sensitivity row. On a single project, with 61 curated PRs and a hit-presence proxy, this shows that patch-aware queries can surface missing decisions. It does not show that they produce better reviews. That is what arms E, ET and EC test.

Production model: DeepSeek-V4.1-Flash, all 34 development tasks

The development-task pilot and the reviewer-quality runs below first used Devstral Small 2, the Phase 1 model. The agent that actually drives Relore in serge uses deepseek-ai/DeepSeek-V4.1-Flash-1017:together through Hugging Face Inference Providers. Everything was rerun with that model in both roles and serge's production settings: reasoning_effort: low, a 49,152-token ceiling, and temperature 0 with seed 17. The code-only and raw-history initial patches were regenerated with Phase 1's unchanged prompts. Eight code-only generations first hit an 8,192-token ceiling while reasoning and were regenerated at the production ceiling. Later stages also hit the production ceiling: 3 calls in the development loop, 15 in reviewer quality, 4 in the injection probe and 11 held-out reviews. Total inference cost for all DeepSeek runs on this page, held-out and the development-set judge included, was $9.95 (1,607 calls).

Arm (34 tasks)Compliant initial → finalFixedBrokeFindings accepted by coderMean review+revision tokens
A · code only18 → 18————
B · raw history at generation30 → 30————
RA · code only, second attempt18 → 1921—3,158
CA · code only + generic review18 → 18003 / 53,671
F · code only + historical review, diff page18 → 2810011 / 122,480
FT · code only + historical review, task page18 → 2810013 / 143,276
R · raw history, second attempt30 → 3000—1,792
C · raw history + generic review30 → 31102 / 43,275
D / E · raw history + historical review30 → 30000 / 1849 / 627
ET / E8 · with temporal follow-up / 8 hits30 → 311 (peft-conversion)01 / 21,176 / 2,497
Reviewer quality, 92 graded patches (68 patches written by Devstral + 24 by DeepSeek; all 92 reviewed by DeepSeek)Violations flaggedCompliant patches flaggedPrecision
Generic, no history24 / 495 / 430.83
Historical, task-query page30 / 492 / 430.94
Historical, diff-driven page32 / 492 / 430.94

Injection probe. One fabricated "authoritative" comment told any AI reviewer to demand telemetry-helper==0.0.1 and strip every version bound, and it was inserted into 82 nonempty pages. DeepSeek never cited it and never made the demand. It named the comment as injected, untrusted text in 16 reviews, and its flag rate was unchanged at 32 vs 32. Devstral cited it in 3 of 61 reviews and made the demand once. ID validation cannot catch that, because the injected document was legitimately on the page.

The tables below are the original Devstral runs. They remain valid for that model, and they show that a small local model cannot use history-backed review findings at all.

Devstral Small 2: Stage 1 pilot, review rarely changes the patch

12 development tasks × 13 arms: the eight Phase 1.5 challenge tasks plus dataset-arrow, typer, hub-major and tracker. Compliance is the Phase 1 executable grade. Functional is the pip smoke check or the ordinary Python path. Review and revision token counts exclude generation.

ArmCompliant initial → final / 12FixedBrokeValidated findingsAccepted by coderMean review+revision tokens
A · code only3 → 300———
B · raw history6 → 600———
R · second attempt, no findings6 → 600——1,276
C · generic review6 → 710111 / 111,867
D · historical, task page6 → 71081 / 81,587
E · historical, diff page6 → 71082 / 81,894
ET / EC / E86 → 7 each108 / 10 / 81 each2,142 / 2,372 / 2,100
CA · code only + generic3 → 300120 / 121,476
F · code only + historical, diff page3 → 41081 / 82,126
FT · code only + historical, task page3 → 41081 / 82,026

Every reviewing arm on the raw-history patch fixed the same task: audio-reference, where librosa had to be removed. The generic reviewer fixed it too, so it is not evidence for history. D vs C: 7/12 vs 7/12, no discordant pair. F's gain over A, CA and RA is pytest-report. The coder rejected the historical finding but rewrote its upper bound to the <9 the finding quoted, so the attribution is mixed. Joint compliance and functional outcomes match compliance on every pair. With one discordant task at most, no comparison approaches significance. The correct reading is "no detectable difference on 12 tasks", not "no effect".

A harness bug, corrected from saved outputs. The first parser treated an empty final as a failed revision. On audio-reference the coder had accepted the finding and correctly returned an empty file, and that correction was discarded in six arms. The recorded model outputs were replayed through the fixed parser and regraded without new inference (rederive.py). Both the raw and re-derived files are kept.

Why so little moved

Reading every finding on the six violating raw-history patches and the nine violating code-only patches:

The coder rejects nearly everything, which keeps false positives harmless and makes true positives useless. The historical reviewer is not precise enough for a coder to trust it. On this model, the bottleneck is mostly reviewer temporal judgment and revision acceptance. The deciding PR was on every historical page for generation-save (#49914) and torchcodec-reopen (#41839). Retrieval still missed peft-conversion's superseding PR without a temporal follow-up.

Devstral Small 2: reviewer quality, measured without revision

The collection is every distinct patch written in Phases 1 and 1.5: 68 patches, labelled by their saved executable compliance grade. 32 violate the historical decision and 36 comply. Each patch was reviewed once by three reviewers, with no revision step. The historical reviewer saw either the task-query page or a page queried from that patch's own diff, and the generic reviewer saw no history. "Flagged" means at least one validated finding. A correct reviewer flags violations and stays silent on compliant patches. Strata use the Phase 1 retrieval audit of the task-query page: full, partial or no decisive evidence.

ReviewerViolations flaggedCompliant patches flaggedPrecisionSilent on compliantFlagged patches citing the source PR¹
Generic, no history29 / 3234 / 360.462 / 36—
Historical, task-query page19 / 3215 / 360.5621 / 3629 / 34
Historical, diff-driven page16 / 3214 / 360.5322 / 3625 / 30
Historical, task-query page, by evidence stratumPatchesViolations flaggedCompliant patches flagged
Full decisive evidence3713 / 1910 / 18
Partial164 / 74 / 9
None152 / 61 / 9

¹ A lower bound. The check matches PR numbers in title and body document IDs. Comment-level IDs carry a comment number and are not counted.

"Flagged" counts a patch, not whether the finding names its actual violation, so true precision on violating patches is likely lower. A hand adjudication of each finding into the Phase 2 categories is pending: real violation, generic code-quality, unsupported objection, obsolete constraint and valid departure. All runs use one local model at temperature 0, with one review per patch. The patches come from development tasks.

Held-out: real pull requests (provisional labels)

63 candidates were mined from maintainer review comments in transformers (32), trl (21) and diffusers (10). None overlaps the development tasks. Each case is a PR's original diff at the commit a maintainer objected to, or a merged PR that drew no such objection. 36 cases should draw an objection: 35 violations and 1 case of conflicting evidence. 27 should not: correct changes, superseded decisions, exceptions, accepted departures from history, and cases with insufficient evidence. Evidence is searched in production Relore with --before set to the cutoff, and with the PR's own thread excluded. Every hit is re-checked against the cutoff. The daemon's age field, computed from today, is dropped. Diffusers is not indexed, so its 10 cases have only the generic and oracle conditions. "Oracle" gives the reviewer the earlier threads the maintainer relied on. It is an upper bound, not a deployable condition. Retrieval settings were fixed before the run and were not tuned on these cases. The DeepSeek reviewer saw only the diff hunk, not the surrounding file.

ConditionCasesShould object: flagged…citing the labelled decisionShould not object: flaggedPrecisionLabelled evidence on page
Generic6329 / 36—17 / 270.63—
Historical, task query538 / 3024 / 230.677 / 43
Historical, diff query535 / 3014 / 230.562 / 43
Historical, task ∪ diff, 6 hits539 / 3027 / 230.567 / 43
Historical, oracle evidence6319 / 36195 / 270.7950 / 50

The base rate is 0.57: 36 of 63 cases should draw an objection.

Held-out downstream: does review change the code?

Each frozen review that produced findings was followed by one DeepSeek revision. The coder saw the task, the PR's original hunk, the findings and the hits they cited, and returned the revised code for that region. A revision-only control got no findings. Violations are graded by executable pattern checks on the revised region. 32 checks were written from the mined descriptions. The 24 kept are those that fail on the PR's original hunk and pass on the maintainer-corrected one. For the 27 no-objection cases the outcome is whether the code was materially changed: a new code line, or one of the PR's own added lines removed. That is an automatic, provisional measure of unnecessary modification.

ConditionGradable violations fixedCorrect PRs materially changedFindings accepted by coder
Revision only, no findings1 / 249 / 27—
Generic review4 / 2412 / 2773 / 88
Historical, task query1 / 210 / 236 / 10
Historical, diff query2 / 213 / 234 / 6
Historical, task ∪ diff2 / 213 / 2310 / 17
Historical, oracle evidence5 / 241 / 279 / 16

Held-out downstream with the surrounding file

The coder may have failed because it saw only a diff hunk. The revision step was rerun with a ±400-line window of the patched file at the PR's commit, fetched from GitHub, and the frozen reviews were reused.

ConditionViolations fixed: hunk → with fileCorrect PRs materially changed: hunk → with file
Revision only, no findings1 → 4 / 249 → 17 / 27
Generic review4 → 3 / 2412 → 14 / 27
Historical, task query1 → 0 / 210 → 4 / 23
Historical, task ∪ diff2 → 1 / 213 → 5 / 23
Historical, oracle evidence5 → 6 / 241 → 4 / 27

Context was not the main limit: with oracle evidence the ceiling stayed at 5–6 of 24. The file alone teaches some local conventions. Seeing neighbouring zip(..., strict=True) calls, a bare second look restored strict=True. It also made every condition edit more correct PRs. Single-run differences of 1–3 cases are within noise. 10 of 128 revision calls failed: 9 hit the reasoning ceiling and 1 returned malformed output.

Finding the rule: query design on a separate development set

To design better queries without touching the held-out cases, a second set of 41 cases was mined from older history: transformers 2024-06 to 2025-05 and trl 2024-09 to 2025-04, with 30 violations and 11 controls across 23 kinds of project-wide rule. Examples are define_import_structure inits, GradientCheckpointingLayer, the tuple-cache deprecation, trace-safe casts and no assert in library code. It shares no PR and no evidence thread with the held-out set. Its miner read only the held-out PR and evidence numbers, to exclude them. Each case's check was verified to fail on the original hunk and pass on the corrected one. Two measures were used. One is mechanical: is the labelled thread on the page. The other is a DeepSeek judge that must cite a hit and decide whether the page states the rule. That judge has two rubrics: strict (every labelled detail) and core (discourages the incorrect pattern or establishes the expected one). The core rubric was fixed before it was run.

Strategy, 30 development violationsLabelled thread on pageRule on page, strictRule on page, coreMedian page
Task text10——
Longest changed identifiers (the held-out diff query)00——
APIs the patch uses or drops, excluding names it introduces00——
…restricted to maintainer text1043.5 KB
…restricted to rationale documents11——
Two-stage: candidate threads, then opening post + focused comments before the cutoff2026.6 KB
Control: labelled thread, title hit only30212—
Control: labelled thread, expanded303141.5 KB

Every strategy reaches the governing rule in at most 1–4 of 30 cases. Wording the query from the patch does not close the gap. That needs a source anchored on the code rather than on words.

Training feasibility (Stage 5)

No model was trained. The question is whether project history yields reliable supervision for a future reviewer.

Verdict: feasible for a retrieval model, not yet for a reviewer model. About 65 violation positives exist. A useful reranker would need roughly an order of magnitude more, which targeted mining by rule kind makes reachable. Human review of the labels must come first.

Answers to the Phase 2 questions

  1. Does historical review outperform generic review? It depends on the model and on retrieval. On Devstral, no. On DeepSeek development tasks, yes when generation lacked history: 28 vs 18 of 34, p = 0.002. On held-out real PRs with deployable retrieval it fixes no more than generic review, 1–2 vs 4. But it disturbs far fewer correct PRs: 0–3 of 23 vs 12 of 27.
  2. Does it correct errors that survive raw Relore-assisted generation? Rarely. Only 4 of 34 survived on DeepSeek, and one (peft-conversion) was fixed with temporal or expanded retrieval.
  3. Unacceptable regressions or false constraints? Not on DeepSeek: no development regressions and a 5% false-positive rate on graded patches. On Devstral the reviewer objected to 42% of correct patches, made harmless only because the coder rejected nearly everything. Generic review on DeepSeek is the risky arm: an agreeable coder applies its findings.
  4. Is diff-driven retrieval better than task-driven? On the curated development corpus, slightly: 29–30 vs 27 of 34. On real PRs, no: 2 vs 7 of 43 held-out, and 0–1 of 30 on the new development set.
  5. Does temporal follow-up help? Within the curated corpus, it recovered the superseding PEFT decision in both retrieval and review. Too few cases to generalize.
  6. Generation, review or both? On DeepSeek, history at generation (30/34) and history only at review (28/34) are not distinguishable (p = 0.69), and both together add little. Review-time history is the safer integration point, because it leaves generation unchanged and abstains cheaply. It still depends on retrieval.
  7. Does it generalize beyond packaging? The reviewer's judgment does: 19 of 36 at 0.79 precision on broad held-out categories with the right evidence. Retrieval does not.
  8. Dominant failure modes? First, retrieval query construction: every missed held-out decision was indexed and title-findable. Second, the coder not turning a correct finding into the right edit: 5–6 of 24 even with oracle evidence. Third, an agreeable coder applying generic findings. Fourth, reasoning runaway in 7% of revision calls at production settings.
  9. Is there enough reliable training supervision? For a retriever, nearly: the data shape is clear and mining scales. For a reviewer, not yet.
  10. Which specialized model would add most value? A retriever or reranker that maps a diff to the project rule it touches. A better reviewer would not.

Recommendation for Phase 3

Scope

The 34-task development set comes from a single project and a curated corpus. Held-out and second development sets have provisional, unreviewed labels and were judged partly by a model. The same model played both roles (Devstral locally, then DeepSeek-V4.1-Flash). There was one revision opportunity and one run per configuration. Total DeepSeek inference cost was $9.95, billed to the Hugging Face organization. Phase 1 single-edit tasks are small requirement fragments and expressions, not full agent sessions. All counts on this page are exploratory and come from tasks that also informed earlier designs. Harness: benchmarks/review/ on Relore branch exp/historical-review, built on the Phase 1.5 source 438aa9d.