[19.0][FIX] base_tier_validation: don't promote later tiers out of sequence #53
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 246 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.330
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #53"
general
weight: 0.35
bofiltd
Problem
With
approve_sequence, a later-tier review could be promoted topendingbefore its predecessor is approved, which then:can_reviewis False while the lower tier still holds the minimum sequence), andnotify_on_pendingchatter message to the previous reviewer instead of the intended one.Root cause
tier.review._update_review_statusgates promotion onmin(self.mapped("sequence"))— the minimum over the recordset it happens to be called on, not the whole record.res.users.review_user_countcalls it asuser.review_ids._update_review_status(), i.e. on a single user's reviews. For a second-tier reviewer that subset contains only their own (higher-sequence) review, so it becomes the "minimum" and is promoted prematurely the moment they open their systray.The premature
pendingthen cascades:can_reviewevaluates False (the lower tier holds the min sequence) → hidden from the systray; thenotify_on_pendingmessage is posted in that reviewer's own transaction → they are excluded as its author and the alert lands on the previous reviewer; and when the first tier is finally approved the review is alreadypending, so it is skipped and no correct notification ever fires.Fix
Compute the gating sequence over the whole record's open reviews (per
res_id), not the passed recordset. No behaviour change for the normal full-recordset call (request_validation→_update_review_status).Test
Adds
test_19c_no_premature_promotion_on_subset, which runs_update_review_statuson only the later-tier reviewer's review (thereview_user_countpath) and asserts it stayswaitingand posts no message.test_19aonly exercised the full-recordset path, so the regression slipped through.<!-- Independent, pre-existing bug (the method is untouched by other open PRs). Complements the notify_on_pending routing work in #22. -->