refactor(queue): extract gate-check policy/publish/audit functions into their own module - #4965
Conversation
| \nSuperagent 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 #4965 +/- ##
=======================================
Coverage 94.26% 94.26%
=======================================
Files 448 449 +1
Lines 38900 38900
Branches 14172 14172
=======================================
Hits 36669 36669
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 05:31:25 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.
|
…to their own module Part of #4013's module-split sequence (step 8, after transient-locks.ts, signal-snapshot.ts, duplicate-detection.ts, slop-detection.ts, review-evasion.ts, ci-resolution.ts, and retention.ts): gateCheckPolicy, recordPublishedGateCheckSummary, and auditGateCheckPermissionMissing move to src/queue/gate-checks.ts. Pure mechanical move, no behavior change. These three were never physically adjacent in the original file (interspersed with unrelated linked-issue/pre-merge-check/public- surface helpers that stay behind), but share no state and have no caller besides processors.ts's own many disposition/publish call sites, so they group cleanly by concern here. A re-export shim keeps this file's own internal callers and the existing test/unit/gate-check-policy.test.ts / test/unit/repository-settings-enforcement.test.ts imports working unchanged.
89c5612 to
fe888de
Compare
Summary
src/queue/processors.ts. Step 8, 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),ci-resolution.ts(refactor(queue): extract live CI-aggregate/merge-state resolution into its own module #4960), andretention.ts(refactor(queue): extract data-retention pruning into its own module #4962).gateCheckPolicy,recordPublishedGateCheckSummary, andauditGateCheckPermissionMissingintosrc/queue/gate-checks.ts. Pure mechanical move, no behavior change. Unlike most prior steps, these three functions were never physically adjacent in the original file — they were interspersed with unrelated linked-issue-evidence/pre-merge-check/public-surface-eligibility helpers that stay inprocessors.ts— but they share no state with each other or with anything staying, and each has real external callers only inprocessors.ts's own many disposition/publish call sites, so they group cleanly by concern in the new file (mirrors howshouldCollectSlopEvidence/shouldRunSlopAiAdvisorywere similarly scattered before the slop-detection.ts extraction).test/unit/gate-check-policy.test.ts/test/unit/repository-settings-enforcement.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;gate-checks.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