feat(doris-repo-review): flag regressions per finding and floor them at Major - #12
Conversation
…at Major The 2026-09-13 review of apache/doris#67900 found that the refactor had dropped the per-attempt reset of the Flight result-location flag, wrote it up correctly, and rated it Minor because the trigger was narrow and the fix was one line. The verdict stayed APPROVE, a PASS receipt was posted with the regression as its first note, and the team's "fix only Blocker/Major" rule dropped it; the next reviewer sent it back as a must-fix. Make that classification impossible to repeat: - Every finding now carries a mandatory `Regression: yes | no` line (ZH `回归:是 | 否`) stating whether HEAD behaves differently from the base in a way the PR body does not declare as intended. `verify-review-docs.py` rejects a finding without it, rejects EN/ZH documents whose flags disagree, rejects a regression rated Minor or Nit, and reports `regressions` in its JSON result. - doc-templates.md defines the severity floors: a regression in a correctness, concurrency, lifecycle, compatibility, config or data category is at least Major; for a PR presented as behaviour-preserving every undeclared differing cell of the differential table is such a regression. Severity is the consequence when it triggers, never the probability or the size of the fix. - A downgrade below what a subagent proposed needs a written "Severity rationale" and one severity-challenge subagent (prompts.md section E) before it is final; the ledger skeletons carry the new fields. - post-pass-comment.sh additionally refuses to post when the verified result carries any regression finding, so a PASS receipt can never sit on top of a known behaviour change even if the two scripts ever disagree. - verify/repo-review covers the new rules (9 new contract tests). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
@morningman Could you confirm whether the following two cases need to be addressed in this PR? This is based on the current commit,
All 47 existing local tests passed. I also checked the category-validation and diverged-branch scenarios above. I would like to confirm the intended behavior before deciding whether changes are needed. |
…judge regressions against the merge base Review of apache#12 raised two gaps in the regression rule: 1. doc-templates.md scoped the Major floor to a list of categories while verify-review-docs.py floored every `Regression: yes` regardless, so a reviewer following the documented exception for an observability change produced a document the verifier rejected. 2. The regression evidence was `git show $BASE_SHA:<path>`, the target-branch tip. When the PR branch is behind that tip, a fix that landed on the target branch after the PR branched off is absent at HEAD without the PR having removed anything, and the rule would have turned it into a Major regression. Category-aware floor: - Every finding carries a mandatory `Category` / `类别` line from a closed vocabulary: functional-bug, functional-loss, data-error, resource-leak, performance, observability, test-coverage, wording, maintainability. The verifier rejects an unknown value (a typo must not escape the floor), accepts one parenthetical domain note after the class, resolves ZH aliases (功能性bug, 功能性缺失, 资源泄漏, 性能), and requires EN and ZH to agree. - A regression in the first five categories is at least Major. A regression in the other four may stay Minor/Nit only with a `Severity rationale` paragraph, which the verifier now checks for. - The JSON result adds `floored_regressions`. post-pass-comment.sh refuses on a floored regression (it can only appear if the two scripts disagree) and refuses to post when a non-floored regression would go undisclosed: the receipt needs at least one note, and SKILL.md / pr-comment-format.md say every such finding is named there first. Merge base: - Regression evidence is `git show $MERGE_BASE:<path>` in SKILL.md (premise checks, step 6), prompts.md (preamble, D1, E), the ledger skeletons and the templates; `{MERGE_BASE}` joins the prompt placeholders. `BASE_SHA` keeps its two jobs: the diff range and the commit the receipt binds to. - prepare-review-context.sh records `TARGET_AHEAD` (target-branch commits since the merge base) in meta.env and prints it when non-zero. - Two new common traps: filing a real behaviour change under a soft category, and comparing against the target-branch tip. Tests: verify/repo-review covers each floored category, the rationale requirement and acceptance for each non-floored category, the parenthetical note, spelling variants, missing / unknown / disagreeing categories, and the poster's disclosure gate. Suite: 63 PASS (was 47). Also replayed against the real apache/doris#67916 documents: they verify after relabelling with the closed vocabulary, a test-coverage regression is rejected without a rationale and accepted with one, and a functional-bug regression rated Minor is rejected; that review's own header already had BASE_SHA != MERGE_BASE (TARGET_AHEAD = 5). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H2in7A8yA4qQ3LwAghueTR
|
@shuke987 Thanks — both are real gaps, and both are addressed in 1. Category-aware floor (the documented rule wins; the verifier now enforces it). The intended rule is the documented one: only regressions in specified categories are floored at Major. The verifier now knows the categories instead of flooring every
2. Regression attribution uses You are right that For what it is worth, the real review of apache/doris#67916 already had this shape: its header shows Tests. Compatibility note: documents from the previous template now also need the |
Why
The 2026-09-13 local review of apache/doris#67900 (head
5181cba) found that the refactor had dropped the per-attempt reset of the Flight result-location flag, wrote it up correctly (F-02), and rated it Minor because the trigger was narrow ("Flight + replan + a failing retry") and the fix was one line. The verdict stayed APPROVE, a PASS receipt was posted with that regression as its first note, and the fix threshold downstream ("only Blocker/Major") dropped it. The next reviewer sent the same issue back on headd60a614as a must-fix.The finding was not missed — its severity was, and the pipeline had no rule that made the mis-classification impossible. This PR adds that rule and enforces it mechanically.
What changes
- **Regression**: yes | no(ZH- **回归**:是 | 否) right after its severity: does HEAD behave differently from the base in a way the PR body does not declare as intended?verify-review-docs.pyrejects a finding without the line, rejects EN/ZH documents whose flags disagree, and reportsregressionsin its JSON result.Major; the verifier rejects a regression ratedMinororNit. For a PR presented as behaviour-preserving ([refactor], "Behavior changed: No", …) every undeclared differing cell of the D1 differential table is such a regression. Severity is the consequence when it triggers, never its probability or the size of the fix (references/doc-templates.md, new "Regression flag and severity floors" section).references/prompts.mdsection E) before it is final (SKILL.mdstep 6). The ledger skeletons written byprepare-review-context.shcarry the new fields.post-pass-comment.shadditionally refuses to post when the verified result carries any regression finding, so a PASS receipt can never sit on top of a known behaviour change even if the two scripts ever disagree. Thedoris-repo-review/v1comment schema is unchanged.verify/repo-reviewcovers the new rules: 9 new contract tests (regression rated Minor/Nit rejected, count reported, parenthetical notes accepted, missing line rejected, EN/ZH disagreement rejected, unparseable value rejected, poster refusals). Full suite: 47 PASS.Also validated against real review documents (apache/doris#67916): docs with
Regression: noverify as before; flipping one Minor finding toRegression: yesis rejected withfinding F-01 is marked as a regression but rated Minor; a regression against the base is at least Major.Compatibility
Documents produced by the previous template fail verification until the
Regressionline is added to each finding — that is intended: the line is the judgment this change forces the reviewer to make explicitly.🤖 Generated with Claude Code