gitnexus 1.6.13-rc.77 → 1.6.13-rc.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -108,7 +108,7 @@ export async function augment(pattern, cwd) {
108
108
  await initLbug(repoId, repo.lbugPath);
109
109
  }
110
110
  // Step 1: BM25 search (fast, no embeddings)
111
- const { results: bm25Results, ftsAvailable } = await searchFTSFromLbug(pattern, 10, repoId);
111
+ const { results: bm25Results } = await searchFTSFromLbug(pattern, 10, repoId);
112
112
  // Step 2: Map BM25 file results to symbols
113
113
  const symbolMatches = [];
114
114
  for (const result of bm25Results.slice(0, 5)) {
@@ -135,14 +135,16 @@ export async function augment(pattern, cwd) {
135
135
  /* skip */
136
136
  }
137
137
  }
138
- // When FTS indexes are unavailable (read-only DB, first run before indexes are built),
139
- // fall back to a direct name CONTAINS query so enrichment still works.
140
- if (symbolMatches.length === 0 && !ftsAvailable) {
138
+ // FTS ranks files by mentions, so a widely referenced symbol's definition
139
+ // may not be present in the top file results. Fall back to graph names
140
+ // whenever those files produce no symbol match, regardless of FTS health.
141
+ if (symbolMatches.length === 0) {
141
142
  const fallbackRows = await executeQuery(repoId, `
142
143
  MATCH (n)
143
144
  WHERE n.name CONTAINS '${patternFirstWord}'
144
- RETURN n.id AS id, n.name AS name, labels(n)[0] AS type, n.filePath AS filePath
145
- ORDER BY id
145
+ RETURN n.id AS id, n.name AS name, labels(n)[0] AS type, n.filePath AS filePath,
146
+ CASE WHEN n.name = '${patternFirstWord}' THEN 0 ELSE 1 END AS exactRank
147
+ ORDER BY exactRank, id
146
148
  LIMIT 5
147
149
  `).catch(() => []);
148
150
  for (const sym of fallbackRows) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitnexus",
3
- "version": "1.6.13-rc.77",
3
+ "version": "1.6.13-rc.78",
4
4
  "description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.",
5
5
  "author": "Abhigyan Patwari",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",