55 return `${tier} impact — cut 5xx rate by ~${reductionPct}% to get below ${RELIABILITY_TARGET_PCT}% (current ${errorRatePct}%, ${formatInteger(errors)} errors in this window).`;
56 }
57 if (errors != null) {
58 return `${tier} impact — resolve ${formatInteger(errors)} billed 5xx errors in this window.`;
59 }
60 if (cachePct != null && inv != null) {
61 if (cachePct < CACHE_HIT_THRESHOLD_PCT) {
62 return `${tier} impact — current cache hit rate is ${cachePct}% across ${formatInteger(inv)} requests in this window; the gate fires below ${CACHE_HIT_THRESHOLD_PCT}%.`;
63 }
64 if (p95 == null) {
65 return `${tier} impact — current cache hit rate is ${cachePct}% across ${formatInteger(inv)} requests in this window; this recommendation targets the remaining uncached traffic.`;
71 ? `${tier} impact — ${formatInteger(writes)} ISR write units with no recorded read units in this window.`
72 : `${tier} impact — ${formatInteger(writes)} ISR write units vs ${formatInteger(reads)} read units in this window (${round2(ratio)} writes per read).`;
76 return `${tier} impact — current 95th percentile duration is ${formatInteger(p95)}ms across ${formatInteger(inv)} function invocations in this window (${round1(multiple)}x the ${formatInteger(SLOW_ROUTE_P95_THRESHOLD_MS)}ms slow-route threshold).`;
77 }
78 if (coldPct != null) {
79 return `${tier} impact — current cold-start share is ${coldPct}%; the gate fires above ${COLD_START_THRESHOLD_PCT}%.`;
80 }
81 if (rec?.candidateRef?.startsWith('build_minutes_fanout:') || rec?.kind === 'build_minutes_fanout') {
82 return buildSharePct != null
83 ? `${tier} impact — Build CPU Minutes account for ${buildSharePct}% of observed billed cost in this window.`
84 : `${tier} impact — Build CPU Minutes exceeded the gate threshold in this window.`;
85 }
86 return `${tier} impact — see follow-up metrics for magnitude.`;