← Back to Pull requests

Fix ParentTypeName for nested unsafe query builder children #125

Merged
pquerna merged 1 files (117 lines) on Feb 01, 2026 20:30 UTC
View on GitHub
pquerna pquerna commented on Feb 01, 2026 20:29 UTC
Author

Summary


Fixes a bug where nested query builders for nested_only messages with oneofs would generate methods on undefined types when accessed through multiple layers of embedding.

Problem


When a non-nested_only message embeds another message containing a nested_only field with a oneof, the generated code produced methods like:
func (x *...ReasonQueryBuilder) UnsafeTicket() ...  // Type doesn't exist

Instead of:
func (x *...ReasonUnsafeQueryBuilder) UnsafeTicket() ...  // Correct type

Fix


Child query builders were being reused for both safe and unsafe parent contexts with the same ParentTypeName. Added copyChildrenWithParent() to create copies with the correct parent type when assigning to unsafe query builders.

Test


Added NestedOnlyWithOneof, NestedOnlyMiddle, NestedOnlyWrapper test messages and TestNestedOnlyWithOneofThroughMultipleLayers to verify the fix.

Diff: 117 lines (+87 / -30) across 1 files Reviewer: None requested Review duration: 0m
All Vouch review confidence checks passed
Residual risk 0.47 = Change Risk (0.54) × (1 − Review Confidence (0.11)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.54 · 117 lines diff across 1 files
0.54
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 28% · Reviewer familiarity: 10%
11%
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
Shallow Review Depth shallow_review_depth
0.344
Diff Size diff_size
0.285
No Reviewer Assigned no_reviewer_assigned
0.120
Rapid Merge rapid_merge
0.100
Real PR Conversation Timeline
1 comments
"Review active on #125"
general weight: 0.35
Reviewers
None requested
Assignees
pquerna pquerna
Labels
risk: medium confidence: 11.3% 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: 53.5% (MEDIUM) · Higher = larger blast radius
53.5%
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: 11.3% · Lower = rushed or shallow review
11.3%
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: 47.5% · Moderate risk
47.5%