Retrieval baseline #
Recorded 2026-08-18 against the shared index at ~/.local/share/code-index/:
2448 files, 37,704 chunks, 12 repositories, model nomic-embed-text-v1.5.f16.gguf
(built 2026-08-18 16:28:39).
Query set: the local set at CODE_INDEX_EVAL_QUERIES, 25 queries across all 12
indexed repositories. Those are private repositories, so the rows below describe
each one by language and kind rather than by name; the committed
eval/queries.example.jsonl is a different, smaller set and does not reproduce
these numbers.
Hit rate #
| top-1 | top-5 | |
|---|---|---|
unscoped (uv run python eval/score.py) |
6/25 (24%) | 16/25 (64%) |
repo-scoped (uv run python eval/score.py --repo-scoped) |
13/25 (52%) | 19/25 (76%) |
Repo scoping roughly doubles top-1 hit rate (24% -> 52%) and lifts top-5 by 12 points (64% -> 76%). Most of the gap between scoped and unscoped is cross-repository ranking rather than retrieval failing outright: 6 of the 9 unscoped top-5 misses become hits once the search is scoped to the right repository, and the query's own repository directory almost always shows up somewhere in an unscoped result set even when it doesn't win.
Misses that survive repo scoping #
Six queries miss the top 5 even scoped to their own repository — these are retrieval failures, not cross-repository ranking noise:
- A small JavaScript chat bot — a message-scrubbing function, beaten by the repo's main entry point.
- A JavaScript identity service — a hashing helper that derives a record key, beaten by the main server file.
- A JavaScript reporting pipeline (x2) — a stalled-feature detector and the README's pipeline description, both beaten by a dashboard-generation script that apparently reads as topically closer to "pipeline" and "pass rate" language than the actual sources.
- A TypeScript monorepo — a name-validation function, beaten by a spec document.
- A TypeScript accounting library — a ledger-replay function, beaten by an unrelated finite-state-machine spec file.
What this baseline is for #
Every later ranking change — dropping the path prefix from embedded text, grouping results per repository, swapping the embedding model — is judged against these four numbers rather than against a handful of ad-hoc queries. Rerun both scorer invocations and diff the hit rates and the miss list.
Rejected: per-repository diversity in ranking #
Tried in Store.search()'s unscoped branch: over-fetching a pool of raw top
candidates, grouping them into per-repository buckets, and admitting in
round-robin order under a per-repository share of k before falling back to
plain score order for any slots left open.
Unscoped top-5 fell from 16/25 (64%) to 14/25 (56%); top-1 held at 6/25 (24%).
Repo-scoped was unchanged at 13/25 top-1 and 19/25 top-5, since a repo
filter bypasses this path entirely. Identical at a per-repository share of
both 0.4 and 0.6.
One miss became a hit (expected answer at raw rank 9). Three hits became
misses, each a case where one repository legitimately supplies more than one
true top-5 chunk: a metadata-parsing script at raw rank 2, behind two other
files from the same repository, plus a code-index query and one against a
TypeScript sync app.
The expected answers for the cross-repository misses this was meant to fix
sit at raw rank 83, 163, and 7742 — outside any candidate pool a ranking pass
over k=5 can reach. The gap is in the embedding, not in ranking.