Description
The search command in cli.py assigns a single backend variable
after deciding which code path ran, then prints that same label for
every result in the output:
try:
hits = index_db.search(store.kb_dir, query, limit=limit)
if not hits:
hits = store.search_substring(query, limit=limit)
backend = "substring"
else:
backend = "fts5"
except Exception:
hits = store.search_substring(query, limit=limit)
backend = "substring"
for kind, hid, snippet, score in hits:
click.echo(f"[{kind}] {hid} score={score:.3f} ({backend})")
This is the same structural problem that was fixed in server.py via
the embedding refactor (PRs #38–#44), but the CLI was never updated.
The backend label reflects control flow, not which backend produced
each individual hit.
Additionally, the command docstring still reads:
"""FTS5 search over claims, pages, and entities."""
This is stale — the search layer now supports embedding, FTS5,
substring, and hybrid backends. The docstring misleads users about
what the command actually does.
Steps to Reproduce
- Ensure
state.db exists but is empty so FTS5 returns no hits
- Run
vouch search <query> with a term that matches via substring
- Observe: all results are labelled
(fts5) instead of (substring)
Actual Behavior
All results share one backend label regardless of which backend
produced them. The command docstring advertises FTS5-only behaviour.
Expected Behavior
Each result line should carry the backend tag of the backend that
actually produced it. The docstring should reflect the current
multi-backend search surface.
Environment
- Python 3.11+
- vouch pre-1.0
Description
The
searchcommand incli.pyassigns a singlebackendvariableafter deciding which code path ran, then prints that same label for
every result in the output:
This is the same structural problem that was fixed in
server.pyviathe embedding refactor (PRs #38–#44), but the CLI was never updated.
The
backendlabel reflects control flow, not which backend producedeach individual hit.
Additionally, the command docstring still reads:
This is stale — the search layer now supports embedding, FTS5,
substring, and hybrid backends. The docstring misleads users about
what the command actually does.
Steps to Reproduce
state.dbexists but is empty so FTS5 returns no hitsvouch search <query>with a term that matches via substring(fts5)instead of(substring)Actual Behavior
All results share one backend label regardless of which backend
produced them. The command docstring advertises FTS5-only behaviour.
Expected Behavior
Each result line should carry the backend tag of the backend that
actually produced it. The docstring should reflect the current
multi-backend search surface.
Environment