Repository navigation
refactor: contract CLI, MCP, and UI surfaces over renewed substrate - #264
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 13 minutes and 55 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 (20)
✨ 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 |
…264) Ref #245 ## Summary Tighten the remaining CLI, MCP, and UI surface contracts so those entrypoints consume the renewed substrate through explicit typed request/result boundaries instead of weak parameter bags and ad hoc prompt or payload glue. ## Problem The first half of this tranche tightened check-command and UI prompt surfaces, but query and MCP paths still carried a lot of broad `dict[str, object]` plumbing, dynamic registration glue, and prompt-side ad hoc payload shaping. That left the public surfaces technically type-clean in places while still underspecifying meaning and forcing compatibility workarounds deeper in the stack. ## Solution - introduced typed CLI surface aliases and callback protocols in `polylogue/cli/query.py`, `polylogue/cli/query_output.py`, `polylogue/cli/query_verbs.py`, and `polylogue/cli/root_request.py` - tightened semantic stats and action-read-model readiness compatibility in `polylogue/lib/query_retrieval_candidates.py` - rebuilt MCP dynamic tool registration and prompt payload shaping in `polylogue/mcp/server_product_tools.py`, `polylogue/mcp/server_prompts.py`, `polylogue/mcp/server_support.py`, `polylogue/mcp/payloads.py`, and `polylogue/mcp/__init__.py` - kept the machine-facing metadata payload raw while avoiding recursive Pydantic root-model traps - the earlier branch commit also tightened the check-command/UI prompt surface with explicit result models and typed prompt stubs ## Verification - `ruff check polylogue/cli/query.py polylogue/cli/query_output.py polylogue/cli/query_verbs.py polylogue/cli/root_request.py polylogue/mcp/__init__.py polylogue/mcp/payloads.py polylogue/mcp/server_product_tools.py polylogue/mcp/server_prompts.py polylogue/mcp/server_support.py polylogue/ui/facade_console.py` - `mypy polylogue/cli/query.py polylogue/cli/query_output.py polylogue/cli/query_verbs.py polylogue/cli/root_request.py polylogue/mcp/payloads.py polylogue/mcp/server_support.py polylogue/mcp/server_prompts.py polylogue/mcp/server_product_tools.py polylogue/mcp/__init__.py polylogue/ui/facade_console.py` - `pytest -q tests/unit/ui/test_ui.py tests/unit/cli/test_check.py` - `pytest -q tests/unit/mcp/test_tool_contracts.py::TestMutationTools::test_get_metadata_success tests/unit/mcp/test_server_surfaces.py::TestClampLimit::test_clamp_limit_contract\[10-10_0\] tests/unit/cli/test_click_app.py::TestMcpServerImport::test_serve_stdio_can_be_imported` - `pytest -q tests/unit/cli/test_query_exec_laws.py::test_async_execute_query_semantic_stats_by_falls_back_without_summaries_contract` - `devtools verify`
…264) The first half of this tranche tightened check-command and UI prompt surfaces, but query and MCP paths still carried broad `dict[str, object]` plumbing, dynamic registration glue, and prompt-side ad hoc payload shaping. The public surfaces were technically type-clean in places while still underspecifying meaning and forcing compatibility workarounds deeper in the stack. Introduces typed CLI surface aliases and callback protocols in `cli/query.py`, `cli/query_output.py`, `cli/query_verbs.py`, and `cli/root_request.py`. Tightens semantic stats and action-read-model readiness compatibility in `lib/query_retrieval_candidates.py`. Rebuilds MCP dynamic tool registration and prompt payload shaping in `mcp/server_product_tools.py`, `mcp/server_prompts.py`, `mcp/server_support.py`, `mcp/payloads.py`, and `mcp/__init__.py`. Keeps the machine-facing metadata payload raw while avoiding recursive Pydantic root-model traps. Verification: ruff + mypy over touched CLI/MCP modules; pytest over UI, check, and focused MCP/CLI tests; devtools verify green. Ref #245
…264) The first half of this tranche tightened check-command and UI prompt surfaces, but query and MCP paths still carried broad `dict[str, object]` plumbing, dynamic registration glue, and prompt-side ad hoc payload shaping. The public surfaces were technically type-clean in places while still underspecifying meaning and forcing compatibility workarounds deeper in the stack. Introduces typed CLI surface aliases and callback protocols in `cli/query.py`, `cli/query_output.py`, `cli/query_verbs.py`, and `cli/root_request.py`. Tightens semantic stats and action-read-model readiness compatibility in `lib/query_retrieval_candidates.py`. Rebuilds MCP dynamic tool registration and prompt payload shaping in `mcp/server_product_tools.py`, `mcp/server_prompts.py`, `mcp/server_support.py`, `mcp/payloads.py`, and `mcp/__init__.py`. Keeps the machine-facing metadata payload raw while avoiding recursive Pydantic root-model traps. Verification: ruff + mypy over touched CLI/MCP modules; pytest over UI, check, and focused MCP/CLI tests; devtools verify green. Ref #245
…264) The first half of this tranche tightened check-command and UI prompt surfaces, but query and MCP paths still carried broad `dict[str, object]` plumbing, dynamic registration glue, and prompt-side ad hoc payload shaping. The public surfaces were technically type-clean in places while still underspecifying meaning and forcing compatibility workarounds deeper in the stack. Introduces typed CLI surface aliases and callback protocols in `cli/query.py`, `cli/query_output.py`, `cli/query_verbs.py`, and `cli/root_request.py`. Tightens semantic stats and action-read-model readiness compatibility in `lib/query_retrieval_candidates.py`. Rebuilds MCP dynamic tool registration and prompt payload shaping in `mcp/server_product_tools.py`, `mcp/server_prompts.py`, `mcp/server_support.py`, `mcp/payloads.py`, and `mcp/__init__.py`. Keeps the machine-facing metadata payload raw while avoiding recursive Pydantic root-model traps. Verification: ruff + mypy over touched CLI/MCP modules; pytest over UI, check, and focused MCP/CLI tests; devtools verify green. Ref #245
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 01502be725
ℹ️ 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".
|
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. |
Ref #245
Summary
Tighten the remaining CLI, MCP, and UI surface contracts so those entrypoints consume the renewed substrate through explicit typed request/result boundaries instead of weak parameter bags and ad hoc prompt or payload glue.
Problem
The first half of this tranche tightened check-command and UI prompt surfaces, but query and MCP paths still carried a lot of broad
dict[str, object]plumbing, dynamic registration glue, and prompt-side ad hoc payload shaping. That left the public surfaces technically type-clean in places while still underspecifying meaning and forcing compatibility workarounds deeper in the stack.Solution
polylogue/cli/query.py,polylogue/cli/query_output.py,polylogue/cli/query_verbs.py, andpolylogue/cli/root_request.pypolylogue/lib/query_retrieval_candidates.pypolylogue/mcp/server_product_tools.py,polylogue/mcp/server_prompts.py,polylogue/mcp/server_support.py,polylogue/mcp/payloads.py, andpolylogue/mcp/__init__.pyVerification
ruff check polylogue/cli/query.py polylogue/cli/query_output.py polylogue/cli/query_verbs.py polylogue/cli/root_request.py polylogue/mcp/__init__.py polylogue/mcp/payloads.py polylogue/mcp/server_product_tools.py polylogue/mcp/server_prompts.py polylogue/mcp/server_support.py polylogue/ui/facade_console.pymypy polylogue/cli/query.py polylogue/cli/query_output.py polylogue/cli/query_verbs.py polylogue/cli/root_request.py polylogue/mcp/payloads.py polylogue/mcp/server_support.py polylogue/mcp/server_prompts.py polylogue/mcp/server_product_tools.py polylogue/mcp/__init__.py polylogue/ui/facade_console.pypytest -q tests/unit/ui/test_ui.py tests/unit/cli/test_check.pypytest -q tests/unit/mcp/test_tool_contracts.py::TestMutationTools::test_get_metadata_success tests/unit/mcp/test_server_surfaces.py::TestClampLimit::test_clamp_limit_contract\[10-10_0\] tests/unit/cli/test_click_app.py::TestMcpServerImport::test_serve_stdio_can_be_importedpytest -q tests/unit/cli/test_query_exec_laws.py::test_async_execute_query_semantic_stats_by_falls_back_without_summaries_contractdevtools verify