Skip to content

Commit 94ac89e

Browse files
authored
Merge branch 'main' into chore/scorecard-coverage-in-1251
2 parents 7cb9a5e + 0982ee1 commit 94ac89e

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

services/libs/tinybird/datasources/health_score_v2_repo_copy_ds.datasource

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ DESCRIPTION >
1212
dependency health (checked against the repo's own published packages' dependencies, not an average
1313
across unrelated packages), supply chain integrity (hardcoded 0 — provenance/2FA data not yet piped).
1414
- `developmentActivityScoreV2` (0-25) — release cadence, commit activity, issue resolution, PR merge health.
15-
- `healthScoreV2` (0-100) is the sum of the three categories above, clamped to 100.
15+
- `healthScoreV2` (0-100) — weighted rescale of available categories: SUM(available subtotals) * (100 / SUM(available weights)), clamped to 100. NULL when fewer than 2 of the 3 categories are available. Does not equal the arithmetic sum of the three subtotals.
1616
- `lifecycleLabelV2` — per-repo lifecycle state (active/stable/declining/inert/abandoned/archived),
1717
computed via the spec's decision tree (archived flag > abandoned > inert > declining > stable >
1818
active, first match wins), or NULL when the repo has zero commits and zero issues/PRs in every window
@@ -23,8 +23,9 @@ DESCRIPTION >
2323
- Graceful degradation (spec Layer 1+2): per-category pipes emit NULL when covered sub-signal weight
2424
is <40% of that category's max pts (Layer 1); the aggregate health_score_v2 applies Layer 2 rescaling
2525
(`SUM(available categories) * (100 / SUM(available category weights))`) so only actually-available
26-
scores are summed. If all three categories are unavailable, healthScoreV2 itself is NULL (see
27-
health_score_v2.pipe DESCRIPTION for the full spec).
26+
scores are summed. healthScoreV2 is NULL when fewer than 2 of the 3 categories are available —
27+
a single-category rescale would extrapolate ≤40 pts of evidence into a full 0-100 range (IN-1248).
28+
See health_score_v2.pipe DESCRIPTION for the full spec.
2829
- Known temporary gap: security-practices score's spec-stated max is 8 points (includes +1 for
2930
`security_contact_email IS NOT NULL` flag), but no `security_contact_email` column exists yet in
3031
the GitHub enrichment datasource, so the current maximum achievable is 7 points. This gap is

services/libs/tinybird/pipes/health_score_v2.pipe

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ DESCRIPTION >
1313
- Applies spec Layer 2 graceful degradation across categories: healthScoreV2 = SUM(available
1414
category subtotals) * (100 / SUM(available category max weights)) — each category datasource
1515
already carries NULL when its own coverage fell below 40% (Layer 1, done per-category pipe).
16-
If all three categories are unavailable, healthScoreV2 itself becomes NULL, per spec, rather
17-
than a fabricated 0. Impact stays NULL (not defaulted to 0) when the repo has no packages.
16+
If fewer than 2 of the 3 categories are available, healthScoreV2 becomes NULL rather than
17+
rescaling a single-category score into a misleading full 0-100 range (IN-1248). Impact stays
18+
NULL (not defaulted to 0) when the repo has no packages.
1819
- lifecycleLabelV2 passes through health_score_v2_lifecycle_ds unmodified (2026-07-24,
1920
IN-1196) — previously wrapped in `coalesce(l.lifecycleLabelV2, 'active')`, which silently
2021
converted the upstream pipe's genuine "no usable signal" NULL back into a fabricated 'active'
@@ -31,7 +32,7 @@ SQL >
3132
securitySupplyChainScoreV2,
3233
developmentActivityScoreV2,
3334
if(
34-
coveredCategoryWeight = 0,
35+
coveredCategoryCount < 2,
3536
NULL,
3637
toNullable(
3738
toUInt8(round(least(100.0, availableCategorySum * (100.0 / coveredCategoryWeight))))
@@ -59,6 +60,11 @@ SQL >
5960
+ if(s.securitySupplyChainScoreV2 IS NOT NULL, 35, 0)
6061
+ if(d.developmentActivityScoreV2 IS NOT NULL, 25, 0)
6162
) AS coveredCategoryWeight,
63+
(
64+
if(m.maintainerHealthScoreV2 IS NOT NULL, 1, 0)
65+
+ if(s.securitySupplyChainScoreV2 IS NOT NULL, 1, 0)
66+
+ if(d.developmentActivityScoreV2 IS NOT NULL, 1, 0)
67+
) AS coveredCategoryCount,
6268
l.lifecycleLabelV2 AS lifecycleLabelV2,
6369
i.impactScoreRaw AS impactScoreRaw
6470
FROM

0 commit comments

Comments
 (0)