File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ function computeImpactScore(issue: MatchedIssue): number {
110110 return clampScore ( 20 + Math . log10 ( issue . repoStars + 10 ) * 28 ) ;
111111}
112112
113+ /** Build a one-line human summary highlighting the strongest and weakest signals. */
113114function summarizeOpportunity ( opportunity : OpportunityAnalysis ) : string {
114115 const strongest = Object . entries ( opportunity . breakdown ) . sort (
115116 ( left , right ) => right [ 1 ] - left [ 1 ] ,
@@ -126,10 +127,12 @@ function summarizeOpportunity(opportunity: OpportunityAnalysis): string {
126127 return `Strongest signal: ${ strongest [ 0 ] } (${ strongest [ 1 ] } ). Main risk: ${ weakest [ 0 ] } (${ weakest [ 1 ] } ).` ;
127128}
128129
130+ /** Normalize a GitHub label to lowercase with single spaces. */
129131function normalizeLabel ( label : string ) : string {
130132 return label . toLowerCase ( ) . replace ( / [ - _ ] + / g, ' ' ) . replace ( / \s + / g, ' ' ) . trim ( ) ;
131133}
132134
135+ /** Check whether the issue carries any labels that signal low actionability. */
133136function hasRiskLabel ( issue : MatchedIssue ) : boolean {
134137 return issue . labels
135138 . map ( normalizeLabel )
@@ -152,6 +155,10 @@ function mentionsReproductionSignal(content: string): boolean {
152155 ) ;
153156}
154157
158+ /**
159+ * Compute a composite risk penalty from problem labels, thin descriptions,
160+ * large-scope language, and blocking dependencies. Capped at 45.
161+ */
155162function computeRiskPenalty ( issue : MatchedIssue ) : number {
156163 let penalty = 0 ;
157164 const content = `${ issue . title } \n${ issue . body } ` ;
You can’t perform that action at this time.
0 commit comments