-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Summary
Fix the existing update() method to actually work. Most infrastructure already exists.
What Already Works
- ✅ State management with file hashes (
indexer-state.json) - ✅
detectChangedFiles()using SHA-256 comparison - ✅
update()method orchestration - ✅ Doc IDs contain file path (e.g.,
src/auth.ts:func:10) - ✅ CLI
dev updatecommand
What's Broken
delete()throws error — We just never implemented it- New files not detected — Only iterates
state.files, misses new files - Deleted files leave orphans — Not cleaned up
Implementation
1. Implement delete by file path prefix (~1 hour)
// In store.ts
async deleteByFilePrefix(filePrefix: string): Promise<void> {
await this.table.delete(`id LIKE '${filePrefix}:%'`);
}2. Add new file detection (~30 min)
// In detectChangedFiles()
// Also scan for files NOT in state.files
const allFiles = await scanForFiles(repoPath);
const newFiles = allFiles.filter(f => !state.files[f]);3. Handle deleted files (~30 min)
// Files in state but not on disk
const deletedFiles = Object.keys(state.files)
.filter(f => !existsSync(f));
// Delete their docs from vector storeSuccess Criteria
-
dev updatedetects changed files -
dev updatedetects new files -
dev updateremoves docs for deleted files - Orphaned symbols cleaned up when removed from file
-
--forcestill triggers full reindex
Out of Scope
- Git commit SHA tracking (optimization, not required)
- Watch mode
Parent Epic
Part of #104 - Performance & Reliability Critical Path
Metadata
Metadata
Assignees
Labels
No labels