Add an interface for flag types that can provide default values #422
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.35 · 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.239
Real PR Conversation Timeline
2 items
Changes Requested
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.
jessevdk
peterebden
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