← Back to Pull requests

feat(validation): warn when a read model slice merges divergent branches #374

Closed
unknown closed this pull request without merging on Nov 15, 2026 00:51 UTC
View on GitHub
unknown unknown commented on Nov 12, 2026 18:37 UTC
Author

Rule 2 says updates from divergent branches are separate slices, but the validator did not check it.

This adds the warning PROJECTION_MERGES_BRANCHES. It fires when one read model slice lists two or more events that are alternative successors in one lane transition. Example: lane review, review.submitted followed by review.approved or review.rejected. The message names both events. It says to split into one projection slice per branch, or to emit one event with an outcome field. The second option drops the fork from the lane transitions.

The event-to-lane and lane-to-transitions maps in the scenario check are now one helper that both rules use. The scenario check does not change.

The author-storyboard prompt names the rule and the outcome-field option. The evidence reference lists the new rule.

Closes #105

Refs #106 (documents the outcome-field alternative)

<!-- CURSOR_SUMMARY -->
---

[!NOTE]

Medium Risk

Introduces new storyboard validation on read-model slices using swimlane transition graphs; false positives/negatives could affect authoring workflows but severity is Warning only.

> Overview

Adds a Warning validation rule PROJECTION_MERGES_BRANCHES so storyboards enforce “divergent branches stay in separate read-model slices.” It flags read model slices whose source_events include two or more events that are alternative successors of the same swimlane transition (e.g. review.approved and review.rejected after review.submitted). Findings carry ROLE_CONSUMER evidence per merged event and suggest splitting projections per branch or using one event with an outcome field to remove the lane fork.

> Validation logic builds event→lane and lane→transitions maps via a shared lane_maps helper (refactored out of scenario lifecycle checks; behavior unchanged). Docs and the author-storyboard MCP prompt document the rule and remediation; finding-evidence.md lists its evidence roles.

> <sup>Reviewed by Cursor Bugbot for commit bc57f6405aeae1c977eccbef93278e0627b23166. Bugbot is set up for automated code reviews on this repo. Configure here.</sup>

<!-- /CURSOR_SUMMARY -->

Diff: 283 lines (+212 / -71) across 3 files Reviewer: yordis Review duration: 3254m
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 283 lines diff across 3 files
0.45
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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.338
Shallow Review Depth shallow_review_depth
0.289
Ai Authored ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #374"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 44.7% (MEDIUM) · Higher = larger blast radius
44.7%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 17.7% · Safe to merge
17.7%