feat(signals): validate label-multiplier ranges in config quality - #1655
Conversation
`buildConfigQuality` grades registry config but never checks that each configured label multiplier is a usable value. A non-positive, non-finite, or non-numeric multiplier (0, negative, NaN, Infinity, or a malformed raw-config value) silently misweights scoring, yet the config-quality score stays clean. Add an `invalid_label_multipliers` dimension: any multiplier that is not a positive finite number is surfaced as a warning finding and deducts from the score (10 each, capped at 30), mirroring the existing per-label penalties. A penalty multiplier below 1 is still positive and remains valid, so legitimate sub-1 multipliers are untouched. Distinct from `configured_labels_not_observed`, which checks whether a label is used, not whether its multiplier is valid.
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review — safe to merge
✅ Approved — safe to merge Review summary
Nits — 6 non-blocking
Review context
Contributor next steps
Signal definitions
Review detailsGenerated from public PR metadata and the diff. Advisory only; deterministic signals remain authoritative. This change adds a focused validation pass inside buildConfigQuality for configured label multipliers and reports non-positive, non-finite, or non-numeric values as a warning finding with a capped deduction. The production predicate is correct for positive sub-1 penalty multipliers and rejects the bad numeric cases the description calls out. The tests cover the main behavior and the nullish labelMultipliers path; the notable gap is mostly presentation/test clarity, not correctness. Nits (5)
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1655 +/- ##
=======================================
Coverage 95.58% 95.58%
=======================================
Files 204 204
Lines 22295 22301 +6
Branches 8053 8055 +2
=======================================
+ Hits 21310 21316 +6
Misses 408 408
Partials 577 577
🚀 New features to boost your workflow:
|
`buildConfigQuality` grades registry config but never checks that each configured label multiplier is a usable value. A non-positive, non-finite, or non-numeric multiplier (0, negative, NaN, Infinity, or a malformed raw-config value) silently misweights scoring, yet the config-quality score stays clean. Add an `invalid_label_multipliers` dimension: any multiplier that is not a positive finite number is surfaced as a warning finding (named inline as `label=value`) and deducts from the score (10 each, capped at 30), mirroring the existing per-label penalties. A penalty multiplier below 1 is still positive and remains valid, so legitimate sub-1 multipliers are untouched. Distinct from `configured_labels_not_observed`, which checks whether a label is used, not whether its multiplier is valid. Validated with the full local gate: npm run test:ci green, codecov/patch 100% on changed lines, branch coverage on every added line, OpenAPI unchanged.
What
buildConfigQualitygrades a repo's registry config but never checks that each configured label multiplier is a usable value. A non-positive, non-finite, or non-numeric multiplier (0, negative, NaN, Infinity, or a malformed raw-config value) silently misweights scoring, yet the config-quality score stays clean.Why no linked issue
No issue is linked because this is a self-evident, self-contained enhancement to an existing internal scorer (
buildConfigQuality): it adds one validation dimension alongside the existing per-label penalties, with no behavior change to any public surface, no API/schema change, and no migration. This is exactly the small, low-risk, self-explanatory change the repo'spreferred(not required) linked-issue policy allows as a direct PR.How
Adds an
invalid_label_multipliersdimension: any multiplier that is not a positive, finite number is surfaced as a warning finding (named inline aslabel=valueso a maintainer sees the offending value) and deducts from the score (10 each, capped at 30) — the same shape as the existing per-label penalties. A penalty multiplier below 1 is still positive and remains valid, so legitimate sub-1 multipliers are untouched. Distinct fromconfigured_labels_not_observed(which checks whether a label is used, not whether its multiplier is valid). Findings-only: theConfigQualitytype is unchanged, so OpenAPI is unaffected.How it was validated
Validated with the full local gate:
npm run test:ciis green, codecov/patch is 100% on every changed line, with branch coverage of all four invalid cases (negative, zero, NaN, non-numeric) plus the valid/penalty pass-through and the null-safe no-multipliers path. Regression-checked everybuildConfigQualitycaller (123 tests) — normal repos with valid multipliers are unaffected. OpenAPI verified unchanged vianpm run ui:openapi:check.