Skip to content

Commit 966ffdb

Browse files
committed
chore: use unified confidenceBand
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
1 parent 04a44fd commit 966ffdb

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

  • services/apps/packages_worker/src/security-contacts

services/apps/packages_worker/src/security-contacts/score.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { securityContactConfidenceBand } from '@crowd/data-access-layer/src/osspckgs/api'
2+
13
import { ConfidenceBand, ContactChannel, ProvenanceEntry, RawContact, SourceTier } from './types'
24

35
const WEIGHTS = { tier: 0.55, channel: 0.2, freshness: 0.15, corroboration: 0.1 }
@@ -85,10 +87,7 @@ function corroborationScore(provenance: ProvenanceEntry[]): number {
8587
}
8688

8789
export function confidenceBand(score: number): ConfidenceBand {
88-
if (score >= 0.8) return 'PRIMARY'
89-
if (score >= 0.55) return 'SECONDARY'
90-
if (score >= 0.3) return 'FALLBACK'
91-
return 'NONE'
90+
return securityContactConfidenceBand(score)
9291
}
9392

9493
export function scoreContact(

0 commit comments

Comments
 (0)