Repository navigation
feat: diagnose query misses - #358
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 0 minutes and 58 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (11)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1dd2303245
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
## Summary - Adds a shared query-miss diagnostic model for empty query results. - Surfaces observed no-result causes in CLI plain/JSON output and MCP search/list responses. - Covers empty archive scopes, raw-ingest backlog, message FTS readiness, and action-event read-model readiness. Closes #217 ## Problem Query and MCP no-result paths previously collapsed several distinct operator states into a generic empty result. That made an absent match look the same as an empty archive, an unbuilt/degraded index, an action read-model gap, or raw ingested data that had not reached materialized conversations. ## Solution - Added `polylogue/lib/query_miss_diagnostics.py` as the shared diagnostic builder over observable archive stats, raw conversation counts, readiness checks, and action-event artifact state. - Threaded diagnostics through CLI no-result emitters and machine-error details without changing the existing successful output shape. - Added MCP empty-result payloads with `results: []` plus structured diagnostics while preserving the existing root-list payload for successful search/list calls. - Exposed `ArchiveSearchMixin.diagnose_query_miss()` so MCP and other archive operation surfaces can reuse the same semantics. - Added focused unit coverage for archive-empty, raw-backlog, degraded message FTS, degraded action readiness, CLI diagnostics, and MCP diagnostics. ## Verification ```bash ruff check polylogue/lib/query_miss_diagnostics.py polylogue/cli/query.py polylogue/cli/query_feedback.py polylogue/cli/machine_errors.py polylogue/cli/query_output.py polylogue/mcp/payloads.py polylogue/mcp/server_tools.py polylogue/operations/archive.py tests/unit/lib/test_query_miss_diagnostics.py tests/unit/cli/test_query_exec_laws.py tests/unit/mcp/test_tool_contracts.py mypy polylogue/lib/query_miss_diagnostics.py polylogue/cli/query.py polylogue/cli/query_feedback.py polylogue/cli/query_output.py polylogue/mcp/payloads.py polylogue/mcp/server_tools.py polylogue/operations/archive.py tests/unit/lib/test_query_miss_diagnostics.py tests/unit/cli/test_query_exec_laws.py tests/unit/mcp/test_tool_contracts.py pytest -q tests/unit/lib/test_query_miss_diagnostics.py tests/unit/cli/test_query_exec_laws.py tests/unit/mcp/test_tool_contracts.py devtools verify ``` Pre-push also ran `devtools verify --quick` through the repository hook.
## Summary - Adds a shared query-miss diagnostic model for empty query results. - Surfaces observed no-result causes in CLI plain/JSON output and MCP search/list responses. - Covers empty archive scopes, raw-ingest backlog, message FTS readiness, and action-event read-model readiness. Closes #217 ## Problem Query and MCP no-result paths previously collapsed several distinct operator states into a generic empty result. That made an absent match look the same as an empty archive, an unbuilt/degraded index, an action read-model gap, or raw ingested data that had not reached materialized conversations. ## Solution - Added `polylogue/lib/query_miss_diagnostics.py` as the shared diagnostic builder over observable archive stats, raw conversation counts, readiness checks, and action-event artifact state. - Threaded diagnostics through CLI no-result emitters and machine-error details without changing the existing successful output shape. - Added MCP empty-result payloads with `results: []` plus structured diagnostics while preserving the existing root-list payload for successful search/list calls. - Exposed `ArchiveSearchMixin.diagnose_query_miss()` so MCP and other archive operation surfaces can reuse the same semantics. - Added focused unit coverage for archive-empty, raw-backlog, degraded message FTS, degraded action readiness, CLI diagnostics, and MCP diagnostics. ## Verification ```bash ruff check polylogue/lib/query_miss_diagnostics.py polylogue/cli/query.py polylogue/cli/query_feedback.py polylogue/cli/machine_errors.py polylogue/cli/query_output.py polylogue/mcp/payloads.py polylogue/mcp/server_tools.py polylogue/operations/archive.py tests/unit/lib/test_query_miss_diagnostics.py tests/unit/cli/test_query_exec_laws.py tests/unit/mcp/test_tool_contracts.py mypy polylogue/lib/query_miss_diagnostics.py polylogue/cli/query.py polylogue/cli/query_feedback.py polylogue/cli/query_output.py polylogue/mcp/payloads.py polylogue/mcp/server_tools.py polylogue/operations/archive.py tests/unit/lib/test_query_miss_diagnostics.py tests/unit/cli/test_query_exec_laws.py tests/unit/mcp/test_tool_contracts.py pytest -q tests/unit/lib/test_query_miss_diagnostics.py tests/unit/cli/test_query_exec_laws.py tests/unit/mcp/test_tool_contracts.py devtools verify ``` Pre-push also ran `devtools verify --quick` through the repository hook.
Query and MCP no-result paths previously collapsed several distinct operator states into a generic empty result. An absent match looked the same as an empty archive, an unbuilt or degraded index, an action read-model gap, or raw ingested data that hadn't reached materialized conversations. Users saw "no results" and couldn't tell which. Adds a shared query-miss diagnostic model in `polylogue/lib/query_miss_diagnostics.py` built over observable archive stats, raw conversation counts, readiness checks, and action-event artifact state. The diagnostic surfaces the observed no-result cause: empty archive scope, raw-ingest backlog, message FTS readiness, or action-event read-model readiness. CLI plain/JSON output and MCP search/list responses now emit the diagnostic on empty results; the existing successful-result shape is unchanged so callers don't see breakage. Exposes `ArchiveSearchMixin.diagnose_query_miss()` so MCP and other archive operation surfaces can reuse the semantics. Unit coverage added for each diagnostic state and both CLI and MCP surfaces. Verification: ruff + mypy + pytest over query_miss_diagnostics / query-exec-laws / mcp-tool-contracts suites; devtools verify green. Closes #217
Query and MCP no-result paths previously collapsed several distinct operator states into a generic empty result. An absent match looked the same as an empty archive, an unbuilt or degraded index, an action read-model gap, or raw ingested data that hadn't reached materialized conversations. Users saw "no results" and couldn't tell which. Adds a shared query-miss diagnostic model in `polylogue/lib/query_miss_diagnostics.py` built over observable archive stats, raw conversation counts, readiness checks, and action-event artifact state. The diagnostic surfaces the observed no-result cause: empty archive scope, raw-ingest backlog, message FTS readiness, or action-event read-model readiness. CLI plain/JSON output and MCP search/list responses now emit the diagnostic on empty results; the existing successful-result shape is unchanged so callers don't see breakage. Exposes `ArchiveSearchMixin.diagnose_query_miss()` so MCP and other archive operation surfaces can reuse the semantics. Unit coverage added for each diagnostic state and both CLI and MCP surfaces. Verification: ruff + mypy + pytest over query_miss_diagnostics / query-exec-laws / mcp-tool-contracts suites; devtools verify green. Closes #217
Query and MCP no-result paths previously collapsed several distinct operator states into a generic empty result. An absent match looked the same as an empty archive, an unbuilt or degraded index, an action read-model gap, or raw ingested data that hadn't reached materialized conversations. Users saw "no results" and couldn't tell which. Adds a shared query-miss diagnostic model in `polylogue/lib/query_miss_diagnostics.py` built over observable archive stats, raw conversation counts, readiness checks, and action-event artifact state. The diagnostic surfaces the observed no-result cause: empty archive scope, raw-ingest backlog, message FTS readiness, or action-event read-model readiness. CLI plain/JSON output and MCP search/list responses now emit the diagnostic on empty results; the existing successful-result shape is unchanged so callers don't see breakage. Exposes `ArchiveSearchMixin.diagnose_query_miss()` so MCP and other archive operation surfaces can reuse the semantics. Unit coverage added for each diagnostic state and both CLI and MCP surfaces. Verification: ruff + mypy + pytest over query_miss_diagnostics / query-exec-laws / mcp-tool-contracts suites; devtools verify green. Closes #217
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Closes #217
Problem
Query and MCP no-result paths previously collapsed several distinct operator states into a generic empty result. That made an absent match look the same as an empty archive, an unbuilt/degraded index, an action read-model gap, or raw ingested data that had not reached materialized conversations.
Solution
polylogue/lib/query_miss_diagnostics.pyas the shared diagnostic builder over observable archive stats, raw conversation counts, readiness checks, and action-event artifact state.results: []plus structured diagnostics while preserving the existing root-list payload for successful search/list calls.ArchiveSearchMixin.diagnose_query_miss()so MCP and other archive operation surfaces can reuse the same semantics.Verification
Pre-push also ran
devtools verify --quickthrough the repository hook.