You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(review): port reviewbot blockers[]/nits[] shape for extensive reviews (#1089)
The free Workers-AI pair produced shallow, hedging reviews under the open-ended
assessment/suggestions/risks/criticalDefect shape. reviewbot's gold-standard depth
comes from forcing the model to ENUMERATE findings via explicit blockers[] (concrete
must-fix defects) + nits[] (non-blocking) arrays with a severity rubric. Port it:
- REVIEW_SYSTEM_PROMPT: blockers[]/nits[]/suggestions arrays + severity discipline
(a blocker points to a real diff defect; nits/hypotheticals never block; CI status
is never a code finding), 'do not rubber-stamp', no hedging language.
- ModelReview / parseModelReview: parse blockers + nits (finding cap 6 -> 12).
- composeAdvisoryNotes: render **Blockers** + **Nits** (nits + suggestions merged).
- consensusDefectOf: a consensus defect = a concrete blocker in BOTH reviews
(severity-disciplined; a lone blocker is a split) -> replaces the numeric floor.
Internal to services/ai-review.ts; the external advisoryNotes string + consensusDefect
types are unchanged, so the gate + unified comment are unaffected. Diff patches were
verified present in storage -- the gap was purely the prompt structure.
"- assessment: a SUBSTANTIVE walkthrough (several sentences) — what the change does, whether it is correct, and the notable details. Specific to THIS diff; NEVER a generic one-liner and never hedging ('appears to', 'seems to').",
45
+
"- blockers: each ONE sentence naming a CONCRETE must-fix defect IN THIS DIFF — a correctness/logic bug, a security hole, data loss, a build/test breakage, a race condition, or an API/contract/backward-compat break. Reference the file (and function/line). Empty [] if there are genuinely none.",
46
+
"- nits: each ONE sentence — a NON-blocking point: style, naming, a 'consider…', a missing doc/comment, an unhandled edge case worth noting, or a minor improvement. File-reference where you can.",
"Do NOT rubber-stamp. If the diff is genuinely clean, the assessment must state SPECIFICALLY why it is safe (what you checked) and blockers must be []. Otherwise give real, specific findings — aim for depth, list every concern you actually see.",
49
+
"SEVERITY DISCIPLINE: a BLOCKER is a real defect you can point to in the diff; a NIT is style / preference / hypothetical / optional / docs. CI or check status ITSELF (failing, pending, unverified) is NOT a code defect — NEVER list it as a blocker or nit (the gate evaluates CI separately). Nits and hypotheticals are never blockers.",
if(!title)returnnull;// unsafe title → drop the block entirely (fail-safe)
379
-
return{ title,detail: detail??"Both AI reviewers independently flagged a high-confidence critical defect in this change.",confidence: Math.min(a.criticalDefect.confidence,b.criticalDefect.confidence)};
367
+
return{ title,detail: detail??"Both AI reviewers independently flagged a concrete must-fix defect in this change.",confidence: 1};
returnJSON.stringify({assessment: "Likely crash.",blockers: ["Null dereference of a possibly-null value in src/a.ts."],nits: ["Guard null."],suggestions: ["Guard null."]});
0 commit comments