fix(queue): bound rag path coalesce keys - #1934
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1934 +/- ##
=======================================
Coverage 95.56% 95.56%
=======================================
Files 217 217
Lines 24139 24140 +1
Branches 8749 8749
=======================================
+ Hits 23068 23070 +2
Misses 438 438
+ Partials 633 632 -1
🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-01 00:30:32 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 4 non-blocking
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
rag-index-repocoalesce key embedded a JSON-serialized list of changed paths directly into the indexedjob_key, which can grow unbounded and cause PostgreSQL btree index tuple insertion failures for self-hosted Postgres deployments.Description
normalizedPathScope()and importcreateHashfromnode:cryptoso the coalesce key uses a boundedsha256:<hex>representation for path scopes.rag-index-repocoalescing semantics (usefullwhen no valid paths are present).test/unit/selfhost-queue-common.test.tsandtest/unit/selfhost-sqlite-queue.test.tsto assert hashed keys, distinguish comma-containing paths, verify long attacker-influenced path lists produce a bounded SHA key, and verify empty-path fallback behavior.Testing
npx vitest run test/unit/selfhost-queue-common.test.ts test/unit/selfhost-sqlite-queue.test.ts, which passed.npx vitest run test/unit/selfhost-pg-queue.test.tsandnpm run typecheck, both of which passed for the modified surfaces.npm run test:ciandnpm run test:coverage, but the full-suite run encountered unrelated infrastructure/timeouts (actionlint binary download/DNS, several long-running test timeouts); these failures are not caused by the bounded key change and the targeted queue tests passed.npm audit --audit-level=moderatecould not complete due to the registry audit endpoint returning403 Forbiddenin this environment.Codex Task