Frontmatter
| id | 8420 |
| title | Fix Knowledge Base Indexing and Scoring for Source Code |
| state | Closed |
| labels | bugai |
| assignees | tobiu |
| createdAt | Jan 8, 2026, 1:02 PM |
| updatedAt | Jan 8, 2026, 1:05 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8420 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 8, 2026, 1:05 PM |
Fix Knowledge Base Indexing and Scoring for Source Code
tobiu assigned to @tobiu on Jan 8, 2026, 1:02 PM

tobiu
Jan 8, 2026, 1:04 PM
Input from Gemini 3 Pro:
✦ I have refactored
SourceParser,VectorService, andQueryServiceto correctly handle source code indexing.Changes:
SourceParser.mjs: Now extractsclassNameandextendsfrom the AST and injects them into every chunk generated for a class file.VectorService.mjs: Updated to build the inheritance map using themodule-contextchunks (which now contain the metadata) and applies the chain to all chunks with aclassName.QueryService.mjs: Removed the obsoletemetadata.type === 'class'check. It now correctly boosts scores based onmetadata.classNamematches, ensuringsrcfiles are properly ranked.This restores the "Inheritance Boosting" and class-name relevance scoring that was lost during the switch to source code parsing.
tobiu closed this issue on Jan 8, 2026, 1:05 PM
The recent switch to
SourceParser(Issue #8342) broke the inheritance chain resolution inVectorServiceand the scoring logic inQueryService.Issues:
SourceParserdoes not extract/emitclassNameorextendsmetadata in the chunks.VectorServicelooks forchunk.kind === 'class'to build the inheritance map, which no longer exists.QueryServiceboosts scores formetadata.type === 'class', but source files now havetype === 'src'.Tasks:
SourceParser.mjs:classNameandsuperClassfrom the AST.classNameandextendsmetadata in all generated chunks.VectorService.mjs:classNameandextendsfrom the new chunk structure to rebuild the inheritance map.QueryService.mjs:type: 'src'and boost based onclassNamematch (replacing the deadtype === 'class'check).Goal: Restore intelligent scoring and inheritance-based boosting for source code queries.