enhance search API #3658
All Vouch review confidence checks passed
Residual risk 0.35 = Change Risk (0.59) × (1 − Review Confidence (0.41)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.59 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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.388
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #3658"
general
weight: 0.35
matthias314
This PR is based on #3575 ~~and therefore a draft at present~~. It has the following components:
RegexpGroupthat combines a regexp with its padded versions as used in #3575,DeltasinExecuteTextEventin reverse order. This makesreplacealleasier to implement,LocVoid()andLoc.IsVoid()to deal with unused submatches.The new types and functions are as follows (UPDATED):
The method
FindNextis kept.ReplaceRegexis removed in favor ofReplaceAll. The latter is easier to use in Lua scripts.Currently the simple search functions (
FindDownetc.) take aRegexpGroupas argument to avoid recompiling the regexps. In contrast,FindAll,ReplaceAlland friends take a string argument. Many other variants would be possible. Also, the new search functions ignore theignorecasesetting of the buffer and don't wrap around when they hit the end of the search region. I think they are more useful this way in Lua scripts.You will see that many new internal functions use callback functions. This avoids code duplication. (One has to somehow switch between
(regexp.Regexp).FindIndex()and(regexp.Regexp).FindSubmatchIndex()in the innermost function that searches each line of the buffer.)As said before, many details could be modified, but overall I think these functions are very useful for writing scripts. Please let me know what you think.