refactor(queue): extract data-retention pruning into its own module - #4962
Conversation
Part of #4013's module-split sequence (step 7, after transient-locks.ts, signal-snapshot.ts, duplicate-detection.ts, slop-detection.ts, review-evasion.ts, and ci-resolution.ts): runRetentionPrune moves to src/queue/retention.ts. Pure mechanical move, no behavior change -- a re-export shim keeps this file's own internal caller and the existing test/unit/retention.test.ts / test/unit/selfhost-pg-retention.test.ts imports working unchanged.
|
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 #4962 +/- ##
=======================================
Coverage 94.26% 94.26%
=======================================
Files 447 448 +1
Lines 38884 38884
Branches 14167 14167
=======================================
Hits 36653 36653
Misses 1574 1574
Partials 657 657
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-11 03:54:47 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.
|
Summary
src/queue/processors.ts. Step 7, aftertransient-locks.ts(refactor(queue): extract transient-lock primitives into their own module #4157),signal-snapshot.ts(refactor(queue): extract signal-snapshot generation into its own module #4820),duplicate-detection.ts(refactor(queue): extract duplicate-cluster adjudication into its own module #4823),slop-detection.ts(refactor(queue): extract AI-slop-advisory gating/orchestration into its own module #4946),review-evasion.ts(refactor(queue): extract review-evasion close-enforcement guards into their own module #4957), andci-resolution.ts(refactor(queue): extract live CI-aggregate/merge-state resolution into its own module #4960).runRetentionPruneintosrc/queue/retention.ts. Small, fully self-contained function (~30 lines) — its own dependencies (pruneExpiredRecords/dedupeSignalSnapshots) already lived in a dedicated../db/retentionmodule, so this move needed no dependency untangling.processJob) and the existingtest/unit/retention.test.ts/test/unit/selfhost-pg-retention.test.tsimports from../../src/queue/processorsworking unchanged.Part of #4013 (more extraction steps remain in the sequence — not closing the tracking issue).
Test plan
npx tsc --noEmit -p .— zero errorsnpx vitest run test/unit test/integration— 696/697 files passed (1 skipped, pre-existing)npm run test:coverage(unsharded) — 94.46% statements / 93.43% branches / 93.7% functions / 95.04% lines, no threshold failures;retention.tsitself is 100% line + branch + function coverednpm run docs:drift-check,npm run manifest:drift-check,npm run engine-parity:drift-check— all oknpm audit --audit-level=moderate— 0 vulnerabilities