Skip to content

fix: include annotations, http route, package, and name in BM25 text - #97

Merged
GoodbyePlanet merged 1 commit into
mainfrom
fix/bm25-sparse-text-metadata
Jul 25, 2026
Merged

fix: include annotations, http route, package, and name in BM25 text#97
GoodbyePlanet merged 1 commit into
mainfrom
fix/bm25-sparse-text-metadata

Conversation

@GoodbyePlanet

Copy link
Copy Markdown
Owner

Summary

  • _build_bm25_text in server/indexer/pipeline.py only used signature + docstring + source, so the sparse index had no coverage for annotations (e.g. @RestController), HTTP routes, package/module, or the symbol name — even though those fields are present in the payload and in the dense embedding text.
  • Folded symbol name, package, @-normalized annotations, and HTTP method+route into the sparse text, mirroring how _build_embedding_text already reads those fields.
  • Updated docs/ingestion.md and docs/sparse-vectors.md, which documented the old gap explicitly.

Test plan

  • uv run pytest tests/test_pipeline.py -q — added test_bm25_text_includes_name_package_annotations_and_http_route and test_bm25_text_annotation_already_prefixed_not_double_prefixed
  • uv run pytest -q — 267 passed
  • ruff format / ruff check clean

Closes #77

🤖 Generated with Claude Code

chunk_tier's sparse (BM25) text only covered signature/docstring/source,
so keyword searches for annotation names or route strings had no sparse
matches even though those fields are indexed in the payload and dense
embedding text.

Closes #77

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@GoodbyePlanet
GoodbyePlanet merged commit 4cfaf0b into main Jul 25, 2026
2 checks passed
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.

BM25 sparse text omits high-signal metadata

1 participant