File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,10 +26,15 @@ const LARGE_SCOPE_PATTERNS = [
2626 / \b b r e a k i n g c h a n g e \b / i,
2727] ;
2828
29+ /** Clamp a numeric score to the 0–100 integer range. */
2930function clampScore ( value : number ) : number {
3031 return Math . max ( 0 , Math . min ( 100 , Math . round ( value ) ) ) ;
3132}
3233
34+ /**
35+ * Compute a freshness score based on how recently the issue was updated.
36+ * Issues updated within 24 h score 100; older issues decay toward 42.
37+ */
3338function computeFreshnessScore ( updatedAt : string ) : number {
3439 const hours = ( Date . now ( ) - new Date ( updatedAt ) . getTime ( ) ) / ( 1000 * 60 * 60 ) ;
3540
@@ -41,6 +46,10 @@ function computeFreshnessScore(updatedAt: string): number {
4146 return 42 ;
4247}
4348
49+ /**
50+ * Rate onboarding clarity based on labels, body length, and reproduction signals.
51+ * Well-labeled issues with descriptive bodies score higher.
52+ */
4453function computeOnboardingClarity ( issue : MatchedIssue ) : number {
4554 const labels = issue . labels . map ( normalizeLabel ) ;
4655 const body = issue . body . trim ( ) ;
You can’t perform that action at this time.
0 commit comments