Skip to content

GH-34: serve queries from a per-process in-memory index - #35

Merged
blainemotsinger merged 6 commits into
mainfrom
GH-34
Oct 7, 2026
Merged

blainemotsinger merged 6 commits into
mainfrom
GH-34

Conversation

@blainemotsinger

Copy link
Copy Markdown
Member

Fixes #34.

Replaces the on-disk bleve/bbolt search index with a per-process in-memory index (bleve.NewMemOnly), eliminating the cross-instance index flock that permanently hard-failed query_knowledge with ErrIndexLocked when a second knowledge-mcp instance was alive.

Changes

  • search.Index is now a thin in-memory wrapper (search.NewIndex()); queries block on a ready channel until the background IndexAll completes (same cold-start semantics)
  • Deleted all disk-index machinery: search.Location, lazy open, lock waits, staleness metadata, corruption recovery; removed search/location.go, search/location_test.go, search/race_test.go
  • --index and --no-index-on-startup are accepted warning-logged no-ops so existing configs keep working; --store/--global/--root/--project unchanged
  • knowledge-mcp debug (doctor) drops the disk-index diagnostics (location/locked/stale) and keeps resolution/kick/watchdog self-query/doc-count/install-record
  • README updated; this repo's own knowledge-store entries refreshed for the new behavior (and their YAML parse issues fixed)

Verification

  • gofmt -l ., go vet ./..., go build ./... clean
  • go test ./... -count=1 9/9 packages PASS
  • make eval-mock 18/18 PASS
  • prove evals/t/ 175/175 PASS
  • Doctor smoke on the repo itself: exit 0, 10 docs indexed, zero load warnings

Search semantics (query escaping, category/project filters, result merge, scoring) are unchanged; store files remain the single source of truth; cross-process store-file write locking remains out of scope.

@blainemotsinger
blainemotsinger merged commit 6486a78 into main Oct 7, 2026
2 checks passed
@blainemotsinger
blainemotsinger deleted the GH-34 branch October 7, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix index lock

1 participant