Skip to content

feat(engine): extract buildIssueRagQuery to gittensory-engine - #4342

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
reyanthony062001-ops:feat/engine-issue-rag-query
Jul 9, 2026
Merged

feat(engine): extract buildIssueRagQuery to gittensory-engine#4342
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
reyanthony062001-ops:feat/engine-issue-rag-query

Conversation

@reyanthony062001-ops

Copy link
Copy Markdown
Contributor

What

buildIssueRagQuery is the pure, string-only query composer (#2320) the miner analyze phase needs before any PR diff exists, but it lived in src/review/issue-rag-wire.ts where the miner side cannot import it. This extracts it to packages/gittensory-engine/src/issue-rag-query.ts, with src/review/issue-rag-wire.ts becoming 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_CHARS into the engine module: it is the floor that both the query builder and rag.ts's retrieval guard check, so it is now defined once in the engine and re-exported from src/review/rag.ts — a single source of truth instead of two copies that could drift. The Vectorize/D1-bound retrieval backend (retrieveContext) intentionally stays in src, exactly as the issue scopes it (independent of the #4258 design decision).

Deliverables

Validation

  • 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 — every MIN_QUERY_CHARS consumer)
  • npm run test:engine-parity
  • git diff --check

Closes #4254

@superagent-security

Copy link
Copy Markdown
Contributor

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

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
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.95%. Comparing base (7ec1d53) to head (9966992).
✅ All tests successful. No failed tests found.

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           
Files with missing lines Coverage Δ
packages/gittensory-engine/src/issue-rag-query.ts 100.00% <100.00%> (ø)
src/review/rag.ts 100.00% <ø> (ø)
🚀 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:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 9, 2026
@loopover-orb

loopover-orb Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-09 04:47:55 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
AI review could not be completed for this PR head. Gittensory is holding this PR for manual review instead of relying on deterministic signals alone.

Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #4254
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: 9 registered-repo PR(s), 5 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor reyanthony062001-ops; Gittensor profile; 9 PR(s), 0 issue(s).
Gate result ✅ Passing No configured blocker found.
Linked issue satisfaction

Addressed
The PR extracts buildIssueRagQuery (and the MIN_QUERY_CHARS floor it depends on) into a new packages/gittensory-engine/src/issue-rag-query.ts module, exports it from the engine's public index.ts, and turns src/review/issue-rag-wire.ts into a thin re-export shim exactly as the issue's alternative option allowed, while leaving retrieveContext untouched in rag.ts per the issue's explicit scope note.

Review context
  • Author: reyanthony062001-ops
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 9 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
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.

🟩 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.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gittensory approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit c823f9c into JSONbored:main Jul 9, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(engine): extract buildIssueRagQuery to gittensory-engine

1 participant