feat(scoring): warn when the served scoring snapshot is stale (#810) - #984
Conversation
…red#810) getOrCreateScoringModelSnapshot served the last-good (or DEFAULT) scoring snapshot with no staleness signal, so a failed or long-stale upstream refresh silently kept previews on old constants — Pipeline B (upstream/ruleset.ts) has UPSTREAM_STALE_MS but the scoring side had none. Add SCORING_SNAPSHOT_STALE_MS (mirrors Pipeline B's 2h window) and a pure scoringSnapshotStalenessWarning(snapshot, now) helper; getOrCreateScoringModelSnapshot now appends that warning when the served snapshot is older than the window, so previews surface it. Pure helper + serve-path covered by tests (fresh/stale boundary, served-old, freshly-refreshed). Completes JSONbored#810 (the parser-robustness deliverable landed in JSONbored#969). Closes JSONbored#810.
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 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. |
|
🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 🛠️ Maintainer review — Held for maintainer reviewReviewed 2 changed file(s) — two independent AI reviewers, synthesized. ✅ Safe to merge — both reviewers found no blocking issues.
Merge readiness: ✅ Mergeable · all CI checks green/neutral/skipped. Summary The changes introduce a staleness detection for scoring model snapshots, correctly compute the warning based on a configurable freshness window, and propagate the warning through 💡 Nits — non-blocking, optional
|
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #984 +/- ##
=======================================
Coverage 96.60% 96.60%
=======================================
Files 110 110
Lines 15066 15072 +6
Branches 5444 5446 +2
=======================================
+ Hits 14555 14561 +6
Misses 107 107
Partials 404 404 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ghost
left a comment
There was a problem hiding this comment.
Held for maintainer (guardrail_area) — correct + CI green
Summary
Completes #810 (staleness-gate deliverable; the parser-robustness deliverable landed in #969).
getOrCreateScoringModelSnapshotserved the last-good (or DEFAULT) scoring snapshot with no staleness signal, so a failed or long-stale upstream refresh silently kept previews on old constants — Pipeline B (upstream/ruleset.ts) hasUPSTREAM_STALE_MS, but the scoring side had none.Fix
SCORING_SNAPSHOT_STALE_MS(mirrors Pipeline B's 2h window) and a purescoringSnapshotStalenessWarning(snapshot, now)helper.getOrCreateScoringModelSnapshotappends that warning when the served snapshot is older than the window, so previews surface it (no behavior change when fresh).Tests (full patch coverage)
Pure helper fresh/stale boundary; serve-path served-old → warning; freshly-refreshed → no warning.
npx vitest run test/unit/scoring.test.ts→ 42 passed ·npx tsc --noEmit→ clean ·git diff --check→ clean.Closes #810.