Skip to content

fix(queue): widen rag-index fan-out to match the regate-sweep candidate set - #5686

Merged
JSONbored merged 1 commit into
mainfrom
fix/rag-index-fanout-isinstalled-5024
Jul 14, 2026
Merged

fix(queue): widen rag-index fan-out to match the regate-sweep candidate set#5686
JSONbored merged 1 commit into
mainfrom
fix/rag-index-fanout-isinstalled-5024

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • fanOutRagIndexJobs (the RAG-index cron fan-out) built its candidate pool from isRegistered repos UNION the LOOPOVER_REVIEW_REPOS allowlist, unlike fanOutAgentRegateSweepJobs (the regate sweep) which unions ALL listRepositories(). An installed-but-never-registered, non-allowlisted repo (the brokered self-host case: is_registered=0) was never even a fan-out candidate, so a per-repo features.rag manifest override could never resurface it — the repo still got reviewed via the regate sweep, just without codebase-context retrieval.
  • Drop the isRegistered filter so the candidate set matches fanOutAgentRegateSweepJobs exactly: ALL known repos UNION the allowlist. The existing convergedFeatureActive(env, repo, "rag") filter is untouched, so this widens ELIGIBILITY only, not indexing spend.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. (N/A — no auth/session surface touched.)
  • API/OpenAPI/MCP behavior is updated and tested where needed. (N/A — no public API/schema change.)
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. (N/A — no UI change.)
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. (N/A — backend-only change, no visible UI surface.)
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs. (N/A — no doc-visible behavior change.)

UI Evidence

N/A — backend-only change to the RAG-index cron fan-out candidate resolution; no UI surface.

Notes

  • Regression test added in test/unit/rag-index.test.ts: an installed (installationId set), non-registered, non-allowlisted repo with a features.rag: true manifest override is now included in the cron fan-out, matching fanOutAgentRegateSweepJobs's coverage. Verified the new test fails on the pre-fix code and passes after.

Closes #5024

…te set

fanOutRagIndexJobs still filtered candidates to isRegistered repos unioned
with the LOOPOVER_REVIEW_REPOS allowlist, unlike fanOutAgentRegateSweepJobs
which unions ALL listRepositories(). An installed-but-never-registered,
non-allowlisted repo (the brokered self-host case) was never a fan-out
candidate, so a per-repo features.rag override could never resurface it —
the repo was still reviewed via the regate sweep, just without codebase-
context retrieval. Drop the isRegistered filter so the candidate set
matches the regate sweep exactly; convergedFeatureActive still gates the
actual indexing spend, so this only widens eligibility.

Closes #5024
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.04%. Comparing base (66e927e) to head (1dd351b).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5686      +/-   ##
==========================================
- Coverage   95.04%   95.04%   -0.01%     
==========================================
  Files         576      576              
  Lines       45977    45976       -1     
  Branches    14724    14724              
==========================================
- Hits        43699    43698       -1     
  Misses       1525     1525              
  Partials      753      753              
Flag Coverage Δ
shard-1 43.57% <100.00%> (-0.43%) ⬇️
shard-2 35.86% <0.00%> (+0.13%) ⬆️
shard-3 32.40% <0.00%> (-0.06%) ⬇️
shard-4 32.94% <0.00%> (-0.12%) ⬇️
shard-5 31.51% <0.00%> (-0.26%) ⬇️
shard-6 44.61% <0.00%> (+0.20%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/queue/processors.ts 95.67% <100.00%> (-0.01%) ⬇️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 14, 2026
@loopover-orb

loopover-orb Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ LoopOver review result - manual review recommended

Review updated: 2026-07-14 04:05:24 UTC

2 files · 1 AI reviewer · no blockers · readiness 100/100 · CI green · clean

⏸️ Suggested Action - Manual Review

  • Touches a guarded path — held for manual review: This PR changes guardrail-protected path(s): src/queue/processors.ts (matched src/queue/**).

Review summary
This narrows the discrepancy between fanOutRagIndexJobs and fanOutAgentRegateSweepJobs by dropping the isRegistered filter, so the candidate pool becomes ALL known repos union the allowlist, matching the sweep's own selection. The convergedFeatureActive(env, repo, "rag") gate is untouched, so this only widens eligibility for indexing consideration, not actual indexing spend. A new test exercises the exact scenario described (installed, non-registered, non-allowlisted repo with a features.rag override), and the mirrored watchedRepos helper in sweep-watchdog.ts confirms this pattern (ALL listRepositories() union allowlist) is the established convention elsewhere in the codebase.

Nits — 5 non-blocking
  • The comment block above fanOutRagIndexJobs (src/queue/processors.ts:1162-1169) is fairly verbose for a one-line behavioral change (dropping .filter(r => r.isRegistered)); consider trimming to the essential rationale.
  • The new test's inline comment block (test/unit/rag-index.test.ts:912-919) duplicates most of the production-code comment nearly verbatim — could shorten to just the scenario setup rationale.
  • Consider extracting the repeated 'ALL known repos UNION allowlist, deduped case-insensitively' candidate-building logic (now duplicated between fanOutRagIndexJobs, fanOutAgentRegateSweepJobs, and watchedRepos in sweep-watchdog.ts) into a shared helper to prevent future drift between these three call sites.
  • PR author also opened the linked issue — Link an issue that was opened by a different contributor, or provide a rationale for why this self-authored issue represents genuine discovery work.
  • Touches a guarded path — held for manual review — A maintainer must review and merge this change.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #5024
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 45 registered-repo PR(s), 37 merged, 330 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 45 PR(s), 330 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Improvement ✅ Minor risk: clean · value: minor — Code changes are accompanied by test evidence.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, TypeScript, Ruby, Go, JavaScript, MDX, Shell, Solidity
  • Official Gittensor activity: 45 PR(s), 330 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
[BETA] Chat with Gittensory

Ask Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @gittensory ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 14, 2026
@JSONbored
JSONbored merged commit ad22e6d into main Jul 14, 2026
17 checks passed
@JSONbored
JSONbored deleted the fix/rag-index-fanout-isinstalled-5024 branch July 14, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Finish the RAG-index fan-out fix to match the regate-sweep isInstalled pattern

1 participant