feat(engine): extract buildIssueRagQuery to gittensory-engine - #4342
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
ed879b0 to
0c707b6
Compare
0c707b6 to
5419950
Compare
buildIssueRagQuery is pure, string-only query composition (JSONbored#2320) that the miner analyze phase needs before any PR diff exists, but it lived in src/review/issue-rag-wire.ts where the miner cannot import it. This moves it to packages/gittensory-engine/src/issue-rag-query.ts and turns issue-rag-wire.ts into a thin re-export shim, following the same layout as the JSONbored#2278 duplicate-winner and JSONbored#2282 scoring extractions. MIN_QUERY_CHARS moves with it: the constant is the floor both the query builder and rag.ts's retrieval guard check, so it is defined once in the engine module and re-exported from src/review/rag.ts — keeping a single source of truth instead of two drifting copies. The Vectorize/D1-bound retrieval backend (retrieveContext) intentionally stays in src, exactly as the issue scopes it. Exported from the package entrypoint, covered by an engine-side barrel test mirroring the duplicate-winner extraction's, and the existing test/unit/issue-rag-wire.test.ts passes unmodified through the shim. Closes JSONbored#4254
5419950 to
9966992
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4342 +/- ##
=======================================
Coverage 93.95% 93.95%
=======================================
Files 399 399
Lines 36786 36786
Branches 13440 13440
=======================================
Hits 34561 34561
Misses 1569 1569
Partials 656 656
🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-09 04:47:55 UTC
✅ Suggested Action - Approve/Merge
Review summary
Linked issue satisfactionAddressed 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.
|
What
buildIssueRagQueryis the pure, string-only query composer (#2320) the miner analyze phase needs before any PR diff exists, but it lived insrc/review/issue-rag-wire.tswhere the miner side cannot import it. This extracts it topackages/gittensory-engine/src/issue-rag-query.ts, withsrc/review/issue-rag-wire.tsbecoming a thin re-export shim — the same layout as the #2278 duplicate-winner and #2282 scoring extractions.The circular-import question the issue raises is resolved by moving
MIN_QUERY_CHARSinto the engine module: it is the floor that both the query builder andrag.ts's retrieval guard check, so it is now defined once in the engine and re-exported fromsrc/review/rag.ts— a single source of truth instead of two copies that could drift. The Vectorize/D1-bound retrieval backend (retrieveContext) intentionally stays insrc, exactly as the issue scopes it (independent of the #4258 design decision).Deliverables
buildIssueRagQueryextracted topackages/gittensory-engine/src/issue-rag-query.ts(new small module, mirroringduplicate-winner.ts)src/review/issue-rag-wire.tsis a thin re-export shim (relative source path, matching the feat(miner-foundation): extract duplicate-winner adjudication into gittensory-engine #2278/feat(miner-foundation): extract scoring preview/model modules into gittensory-engine #2282 shims), avoiding any circular import withrag.tsindex.ts)test/unit/issue-rag-wire.test.tsuntouched and green through the shim; plus a new engine-side barrel test mirroringtest/duplicate-winner.test.tsValidation
npm run test --workspace @jsonbored/gittensory-engine(build + 273 tests, 0 fail)npm run typecheck(0 errors)npx vitest run test/unit/issue-rag-wire.test.ts test/unit/rag.test.ts test/unit/impact-map.test.ts(96 tests — everyMIN_QUERY_CHARSconsumer)npm run test:engine-paritygit diff --checkCloses #4254