Repository navigation
GH-36: refresh the index when store files change - #39
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the stale-index gap reported in #36:
query_knowledgewas served from an index built once at startup, so store edits made outsidewrite_knowledge/update_knowledge(hand edits,git checkout, migration scripts) were visible tolist_knowledgebut silently absent fromquery_knowledge.Changes
search.Indexrecords a store fingerprint (per-ref source file path, size, mtime) at build time.Queryre-checks it and, when files changed, builds a fresh in-memory index and swaps it in atomically, closing the old one after in-flight queries drain. Deleted entries disappear because the replacement index is built from scratch (bleve has no Delete path here).reindex_knowledgeMCP tool forces a full rebuild.*.mdunder.agents/knowledge/(sharedknowledge.OrgKnowledgeFiles) instead of thearchitecture.md/review.mdallowlist, in both the query index and the Grep/Glob augment hook.*.mdbehavior. Project store entries refreshed (sub-001, newdec-005).Verification
gofmt -l .cleango vet ./...cleango build ./...cleango test ./...9/9 packagesgo test ./search/ -race -count=10cleanmake eval-mock18/18 PASSCloses #36