[19.0][FIX] base_tier_validation: reviewer systray counter drifting (negative) #52
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 196 lines diff across 2 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.316
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #52"
general
weight: 0.35
bofiltd
Problem
The reviewer systray counter (
tierReviewCounter) can show a wrong— even negative — value
Root cause
The counter is mutated by real-time bus deltas (
review_created→++,review_deleted→--intier_review_service.esm.js). ButTierValidation._update_countersends those deltas toself.env.user.partner_id— the acting user — rather than the reviewers whose pending count actually changes:So whenever someone acts on a tier-validated record without being one of its reviewers (creating it, editing it, force-validating), the wrong user's counter is moved. An active approver accumulates a drift that eventually goes negative. The systray's own absolute count (
res.users.review_user_count→pending_count = len(records)) can never be negative — only the blind delta can.Fix
tier_review_service.esm.js): on the bus event, re-fetch the authoritative absolute count (review_user_count) instead of++/--. This is drift-proof and can never go below zero, regardless of which user receives the event. (ormadded to the service deps.)_update_counter): notify the reviewers' partners (the users whose pending count changes), falling back to the acting user only when the reviews are already gone (deletions), so reviewers get a prompt, correct live update.Also nticed this behaviour on V18
<!-- minor patch fix; happy to add a regression test if maintainers prefer -->