Skip to content

sentrysearch stats should show all populated backends, not just the auto-detected one #67

@ssrajadh

Description

@ssrajadh

Problem

sentrysearch/cli.py:1224-1249 calls detect_index() once and reports a single backend/model. A user who has indexed footage under both (for example) gemini and local/qwen8b only sees one of them — there's no way to know from stats that the other index exists.

Suggested fix

Iterate over all backend/model combinations that have non-zero chunks and print one section per populated index.

sentrysearch/store.py already has the backend/model namespacing. If a "list all populated indexes" helper doesn't exist there, add one (e.g. list_populated_indexes() -> list[tuple[str, str | None]]). Then loop over it in stats:

Backend: gemini
  Total chunks:  812
  Source files:  20
  ...

Backend: local (qwen8b)
  Total chunks:  340
  Source files:  10
  ...

If --json lands first (see #62), this should return a list of objects instead of a single one.

Acceptance

  • With two backends populated, sentrysearch stats shows both with separate chunk/file counts.
  • With one backend populated, output is effectively unchanged (single section).
  • Empty-index case still prints "Index is empty."

Scope

sentrysearch/store.py (new helper) and sentrysearch/cli.py (stats command), plus a test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions