← Back to Pull requests

Add an interface for flag types that can provide default values #422

Open
peterebden opened this pull request with 53 lines diff across 3 files
View on GitHub
peterebden peterebden commented on Jun 06, 2025 08:11 UTC
Author

A simple use case might be that you want a flag to have the value of os.UserCacheDir() and don't want to replicate its logic and/or deal with per-platform structs.

I suppose there's a chance that someone already has a type with this method signature which suddenly starts providing defaults. I think the chance is probably low, but there's no real way of avoiding that with Go's implicit interfaces.

Fixes #421

Diff: 53 lines (+53 / -0) across 3 files Reviewer: jessevdk Review duration: 717269m
All Vouch review confidence checks passed
Residual risk 0.13 = Change Risk (0.37) × (1 − Review Confidence (0.66)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 53 lines diff across 3 files
0.37
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.35 · 1 substantive comment(s)
0.35
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
65%
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.239
Real PR Conversation Timeline
2 items
jessevdk jessevdk requested changes on Oct 04, 2026 14:25 UTC
Changes Requested Reviewer

Sorry for not reviewing this earlier. I appreciate contributions, I'm just not really active on the repository anymore. I only check activity very irregularly.

Feature makes sense, but I agree that "Default()" is generic and a bit dangerous to add. What about calling it "DefaultFlagValue()" instead. I'd prefer if interfaces/extension methods have "Flag" in the name at least.

Reviewers
Assignees
peterebden peterebden
Labels
risk: low confidence: 65.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: 36.8% (MEDIUM) · Higher = larger blast radius
36.8%
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: 65.5% · Lower = rushed or shallow review
65.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: 12.7% · Safe to merge
12.7%