fix(db): limit signal snapshot dedupe to cache signals - #3971
Conversation
|
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 #3971 +/- ##
=======================================
Coverage 93.68% 93.68%
=======================================
Files 373 373
Lines 34895 34897 +2
Branches 12768 12768
=======================================
+ Hits 32692 32694 +2
Misses 1584 1584
Partials 619 619
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-07 08:21:51 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 4 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
🟩 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.
|
Motivation
signal_snapshotsrow per(signal_type, target_key), which deleted bounded historical series that callers rely on (e.g.contributor-decision-packandqueue-health).Description
LATEST_ONLY_SIGNAL_SNAPSHOT_TYPESallowlist containing latest-only cache signal types (repo-culture-profile,repo-doc-refresh-attempt) and document the rationale in the function comment.dedupeSignalSnapshotsto only consider signal types present in the allowlist by selectingDISTINCT signal_type WHERE signal_type IN (...)and processing those types only.test/unit/retention.test.tsto use the canonical latest-only signal names, add a regression test that verifies historical-series signal types (e.g.contributor-decision-pack,queue-health) are preserved, and adjust test mocks accordingly.Testing
npx vitest run test/unit/retention.test.tsand all tests in that file passed.npm run typecheckwhich completed successfully.npm run test:coveragescoped to the retention tests; the tests executed successfully but V8 coverage remapping failed withTypeError: jsTokens is not a functionbefore producing a coverage report (test assertions themselves passed).Codex Task