Skip to content

Commit af032f6

Browse files
committed
fix(api): drop redundant avgNearMissDelta guard in loosen-threshold branch
bugbot LOW: nearMisses is filtered to s.score <= threshold + 0.03 so avgNearMissDelta is constrained to (0, 0.03] by construction. The extra '< 0.03' guard never excluded anything useful but did suppress the loosen recommendation in the boundary case where every near miss sits at exactly threshold + 0.03 (delta avg == 0.03), falling through to 'optimal' despite a high near-miss rate.
1 parent df4049b commit af032f6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/api/src/cache-proposals/cache-readonly.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ export class CacheReadonlyService {
222222
recommendation = THRESHOLD_RECOMMENDATIONS.TIGHTEN;
223223
recommendedThreshold = Math.max(0, threshold - config.uncertainty_band * 1.5);
224224
reasoning = THRESHOLD_REASONINGS.tighten(uncertainHitRate);
225-
} else if (nearMissRate > 0.3 && avgNearMissDelta < 0.03) {
225+
} else if (nearMissRate > 0.3) {
226+
// avgNearMissDelta is constrained to (0, 0.03] by the nearMisses filter.
226227
recommendation = THRESHOLD_RECOMMENDATIONS.LOOSEN;
227228
recommendedThreshold = threshold + avgNearMissDelta;
228229
reasoning = THRESHOLD_REASONINGS.loosen(nearMissRate);

0 commit comments

Comments
 (0)