Repository navigation
Closed
Labels
Description
Outcome
When a query returns no hits, Polylogue should help the user understand which of several states they are in instead of flattening them into a single ambiguous miss.
Desired diagnosable outcomes include cases such as:
- not in archive
- source or raw artifact known but not parsed or not materialized
- index or read model not ready
- degraded fallback path used
- possible near match exists but did not satisfy the current query
Problem or opportunity
polylogue/cli/query.py currently reports "No conversations matched filters" and a generic broadening hint. That message does not tell the user whether the conversation is truly absent, not yet ingested, or simply not matched by the current search/index formulation.
The repository already has much of the diagnostic substrate:
- raw parse and validation state in
polylogue/storage/raw_ingest_artifacts.pyandpolylogue/storage/state_views.py - index and readiness state in
polylogue/health.py - action-read-model readiness and fallback behavior in
polylogue/lib/query_retrieval_candidates.pyandpolylogue/lib/query_retrieval_search.py
The missing piece is surfacing that state coherently at the user-facing retrieval boundary.
Expected scope
polylogue/cli/query.pypolylogue/mcp/server_tools.pypolylogue/mcp/payloads.pypolylogue/health.pypolylogue/lib/query_retrieval_candidates.pypolylogue/lib/query_retrieval_search.py- raw-ingest and derived-status read helpers as needed
- tests for no-result and degraded-path reporting
Constraints and invariants
- Only report states that Polylogue can actually observe. Do not claim global archive absence beyond available evidence.
- Distinguish archive absence from degraded retrieval or incomplete ingest; do not conflate them.
- Keep machine-readable diagnostics available for MCP and deterministic surfaces.
- Avoid overly chatty default output that obscures the main result when a query does succeed.
Acceptance criteria
- Query/no-result handling can distinguish between at least archive miss, degraded index/read-model state, and observed raw-ingest backlog when the evidence exists.
- MCP surfaces can return structured no-result diagnostics instead of only an empty list or generic not-found response.
- CLI exposes clearer guidance about why a query may have missed.
- Tests cover degraded FTS/action-readiness and raw-ingest-backed diagnostic cases.
Verification plan
- add unit coverage for
no_results/diagnostic rendering - add MCP contract tests for structured miss diagnostics
- add tests that simulate incomplete FTS or action-event readiness
- run
devtools verify
Context and evidence
Relevant files:
polylogue/cli/query.pypolylogue/health.pypolylogue/storage/raw_ingest_artifacts.pypolylogue/storage/state_views.pypolylogue/lib/query_retrieval_candidates.pypolylogue/lib/query_retrieval_search.py
Non-goals or explicitly deferred work
- General search relevance tuning.
- Full neighboring-conversation exploration UX.
- Reworking archive health/readiness naming across the entire repo.
Activity
Sinity commentedon Apr 22, 2026
Starting #217 on
feature/feat/query-miss-diagnostics.Tactic for this PR:
Sinity commentedon Apr 22, 2026
Progress update for #217:
detailsenvelope.results: []and diagnostics while preserving the existing root-list payload for successful results.Local checks so far:
Next: run the repository verification baseline, then commit/PR if it stays green.
feat: diagnose query misses (#358)
feat: diagnose query misses (#358)
feat: diagnose query misses (#358)
feat: diagnose query misses (#358)
feat: diagnose query misses (#358)