Skip to content

feat(index): AST-based code indexing and semantic retrieval pipeline - #190

Merged
bug-ops merged 2 commits into
mainfrom
feat/zeph-index
Feb 12, 2026
Merged

feat(index): AST-based code indexing and semantic retrieval pipeline#190
bug-ops merged 2 commits into
mainfrom
feat/zeph-index

Conversation

@bug-ops

@bug-ops bug-ops commented Feb 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • New zeph-index crate: AST-based code indexing via tree-sitter, semantic retrieval via Qdrant, hybrid query routing, and lightweight repo map generation
  • 7 modules (~2,400 LOC): languages, chunker, context, store, indexer, retriever, repo_map
  • Feature-gated tree-sitter grammars (Rust, Python, JS/TS, Go, Bash, TOML/JSON/Markdown)
  • Dual-write storage (Qdrant vectors + SQLite metadata) with INT8 scalar quantization
  • Budget-aware retrieval with query classification (Semantic / Grep / Hybrid)
  • Integrated into agent loop via BudgetAllocation.code_context slot and inject_code_context()
  • Opt-in via [index] enabled = true config — disabled by default, zero impact on existing functionality
  • 54 unit tests, 1190 total workspace tests passing, zero clippy warnings

Architecture

User query
    |
    +-- Contains exact symbol (::, fn, CamelCase, snake_case)?
    |     -> Grep (agent uses bash rg)
    |
    +-- Conceptual query ("how does", "where is")?
          -> Semantic RAG -> Qdrant -> ranked chunks -> inject into context

Dependency graph

A (languages) ---> B (chunker) ---> C (context) ---> E (indexer)
D (storage) --------------------------------> E (indexer)
D (storage) ---> F (retriever)
A (languages) ---> G (repo_map)
E + F + G -----> H (integration)

Validation

Agent Verdict Findings
Testing Pass 54/54 tests, coverage 89-100% on pure-logic modules
Performance Pass (MVP) 3 post-merge optimizations identified (N+1 queries, JSON round-trip, non_ws_len)
Security Pass 0 critical/high/medium, 3 low (file size limit, XML escaping, path canonicalization)
Code Review Approved Zero blocking issues, 3 important + 5 minor suggestions for post-merge

Test plan

  • cargo nextest run -p zeph-index — 54 unit tests
  • cargo nextest run --workspace --lib --bins — 1190 tests
  • cargo clippy --workspace -- -D warnings — zero warnings
  • cargo +nightly fmt --check — clean
  • Existing tests unaffected by changes

Closes #179, Closes #180,Closes #181,Closes #182,Closes #183,Closes #184,Closes #185,Closes #186,Closes #187

@github-actions github-actions Bot added enhancement New feature or request size/XL Extra large PR (500+ lines) documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate dependencies Dependency updates and removed enhancement New feature or request size/XL Extra large PR (500+ lines) labels Feb 12, 2026
…179)

New crate zeph-index providing codebase understanding through tree-sitter
parsing, contextualized embeddings in Qdrant, hybrid retrieval (semantic +
grep routing), and lightweight repo map generation.

Modules: languages, chunker, context, store, indexer, retriever, repo_map.
Feature-gated tree-sitter grammars (Rust, Python, JS/TS, Go, Bash, config).
Dual-write storage (Qdrant + SQLite) with INT8 quantization.
Budget-aware retrieval with query classification (Semantic/Grep/Hybrid).
Integrated into agent loop via BudgetAllocation.code_context slot.
Opt-in via [index] config section, disabled by default.

Closes #179, closes #180, closes #181, closes #182, closes #183,
closes #184, closes #185, closes #186, closes #187
@codecov-commenter

codecov-commenter commented Feb 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.91575% with 397 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/zeph-index/src/store.rs 38.51% 166 Missing ⚠️
crates/zeph-index/src/indexer.rs 32.53% 85 Missing ⚠️
crates/zeph-index/src/retriever.rs 59.80% 82 Missing ⚠️
crates/zeph-index/src/repo_map.rs 89.94% 17 Missing ⚠️
crates/zeph-core/src/agent.rs 0.00% 16 Missing ⚠️
crates/zeph-index/src/chunker.rs 95.23% 16 Missing ⚠️
crates/zeph-index/src/languages.rs 89.72% 15 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #190      +/-   ##
==========================================
- Coverage   86.17%   85.16%   -1.02%     
==========================================
  Files          70       77       +7     
  Lines       19282    20644    +1362     
==========================================
+ Hits        16617    17582     +965     
- Misses       2665     3062     +397     
Files with missing lines Coverage Δ
crates/zeph-core/src/context.rs 99.47% <100.00%> (+0.01%) ⬆️
crates/zeph-index/src/context.rs 100.00% <100.00%> (ø)
crates/zeph-index/src/languages.rs 89.72% <89.72%> (ø)
crates/zeph-core/src/agent.rs 86.29% <0.00%> (-0.61%) ⬇️
crates/zeph-index/src/chunker.rs 95.23% <95.23%> (ø)
crates/zeph-index/src/repo_map.rs 89.94% <89.94%> (ø)
crates/zeph-index/src/retriever.rs 59.80% <59.80%> (ø)
crates/zeph-index/src/indexer.rs 32.53% <32.53%> (ø)
crates/zeph-index/src/store.rs 38.51% <38.51%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bug-ops
bug-ops merged commit 7ca4314 into main Feb 12, 2026
20 checks passed
@bug-ops
bug-ops deleted the feat/zeph-index branch February 12, 2026 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate dependencies Dependency updates documentation Improvements or additions to documentation enhancement New feature or request rust Rust code changes size/XL Extra large PR (500+ lines)

Projects

None yet

2 participants