Skip to content

v1.4.0 — World-Class Grep Engine

Choose a tag to compare

@bradleygauthier bradleygauthier released this 08 Apr 22:40
· 10 commits to main since this release

World-Class Grep Engine

Single-pass multi-keyword search with three-signal blended scoring.

What's New

  • Single-pass FTS5 OR query (SQLite) and ILIKE+trigram query (Postgres): one database round-trip regardless of keyword count, replacing N+1 per-keyword loops
  • Three-signal scoring: keyword coverage (Lucene coord factor), native text rank (FTS5 bm25 / pg_trgm), term proximity (cover density ranking)
  • Keyword highlighting: explain_metadata.snippet with configurable markers
  • Full scoring breakdown: explain_metadata includes matched_keywords, hit_density, text_rank, proximity, and snippet
  • StorageBackend.grep() protocol method for both SQLite and PostgreSQL
  • grep_utils.py: shared utilities for FTS5 query building, keyword sanitization, snippet generation, and proximity scoring
  • Configurable weights: VaultConfig.grep_rank_weight (default 0.7) and grep_proximity_weight (default 0.3)

Scoring Formula

base = rank_weight * text_rank + proximity_weight * proximity
blended = coverage * base
final = blended * trust_weight * adversarial * freshness

Coverage acts as a multiplier (Lucene coord factor): 3/3 keywords = full score, 1/3 = 33%.

Fixed

  • Encryption test skip guards for [encryption] extra across three test files

Stats

  • 22 files changed, 1,242 insertions
  • 62 new grep tests (31 unit, 31 integration)
  • 799 total tests passing, zero regressions

Install

pip install qp-vault==1.4.0

Full changelog: CHANGELOG.md