Repository navigation
feat(mcp): close three read-capability gaps left by the six-tool cutover - #3132
Conversation
Problem: the six-tool MCP read algebra (PR #3095) shipped with three documented capability gaps versus the retired ~97-tool surface: no way to list personal-state records back (marks/annotations/saved-views/recall-packs/ workspaces/corrections/blackboard notes -- write() could create them but nothing could list them), no postmortem/pathology reports, and status(scope="sources"/"embeddings") silently falling through to the same archive-stats payload as scope="archive". All three were "trivial": the underlying Polylogue facade calls stayed live and independently tested through the cutover; only MCP dispatch wiring was missing. What changed (polylogue/mcp/server_cutover.py): - query(projection=...) gains 7 personal-state projections (marks, annotations, saved_views, recall_packs, workspaces, corrections, blackboard), each a thin dispatch onto the existing list_* facade call + page_items + existing typed payload class. - query(projection=...) gains postmortem/pathologies (reusing build_session_query_request's filter scaffolding, dropping the MCP default page limit before handing the spec to the 200-session analysis cap, mirroring the retired get_postmortem_bundle/get_pathologies tools' own replace(spec, limit=None) trick) plus abandoned_sessions/ stuck_sessions (no overlap found with postmortem/pathologies, so kept as separate thin projections per the plan's fallback). - status(scope="sources") wires the existing named-source-freshness handler through the already-unused ref parameter; status(scope="embeddings") wires embedding_status_payload via a small _EmbeddingStatusEnv config adapter. Verification: - devtools test tests/unit/mcp/ -- 182 passed (16 new, in test_query_gap_projections.py). - devtools verify --quick -- green (format/lint/mypy --strict/render-all). - Live read-only smoke pass (POLYLOGUE_ARCHIVE_ROOT=~/.local/share/polylogue via sinnix-scope background) against the real 18k-session archive: all 12 new projections/scopes returned valid payloads with no errors -- postmortem/pathologies matched 153 sessions over 7d, abandoned_sessions found 74, status(scope=embeddings) reported real catch-up state. Ref polylogue-t46.8.2
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 11 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ 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 |
Summary
Closes the three documented "Known gaps" from PR #3095's six-tool MCP read algebra: no way to list personal-state records back, no postmortem/pathology reports, and
status(scope="sources"/"embeddings")silently falling through to archive stats.Problem
PR #3095 replaced the ~97-tool MCP surface with six read transactions (
query/read/get/explain/context/status) plus four privileged transactions. It shipped with a documented "Known gaps" section admitting three read capabilities lost no equivalent dispatch in the new surface:write()could create these records but nothing could list them back.get_postmortem_bundle/get_pathologiestools had no successor.status(scope="sources"/"embeddings")— declared in thestatus()signature but both silently fell through to the samescope="archive"payload.All three were confirmed "trivial": the underlying
Polyloguefacade calls stayed live and independently tested through the cutover (unchanged by it); only the MCP dispatch wiring was missing.Solution
All changes are in
polylogue/mcp/server_cutover.py:query(projection=...)gains 7 personal-state projections (marks,annotations,saved_views,recall_packs,workspaces,corrections,blackboard), each a thin dispatch onto the existinglist_*facade call +page_items+ the existing typed payload class (MCPUserMarkListPayloadetc., which survived the cleanup PR unused). Offset pagination is not yet exposed (mirrors the existingprojection="sessions"precedent, which also fixes offset at 0).query(projection=...)gainspostmortem/pathologies, reusingbuild_session_query_request's filter scaffolding and dropping the MCP default page limit (replace(spec, limit=None)) before handing the spec to the 200-session analysis cap — the same trick the retiredget_postmortem_bundle/get_pathologiestools used, otherwise the shared page-size default of 10 silently caps the matched scope and defeats the facade's own analysis cap. Also addsabandoned_sessions/stuck_sessionsas two more thin projections (no semantic overlap found with postmortem/pathologies, so kept separate per the plan's documented fallback).status(scope="sources")wires the existingnamed_source_freshnesshandler through the already-unusedrefparameter (single-source by design, matching the retired tool's own scope).status(scope="embeddings")wiresembedding_status_payloadvia a small_EmbeddingStatusEnvconfig adapter (mirrors the retiredembedding_statustool), withinclude=("detail",)/include=("bands",)mapping to itsinclude_detail/include_retrieval_bandsparams.Rebased onto master after #3128 landed a fifth
status()scope (coordination) concurrently — merged cleanly since it's a disjointif scope == ...branch in the same function; also updatedstatus()'s docstring to describe all four now-wired non-archive scopes.No new MCP declaration rows needed:
query/statusalready exist inTARGET_DEFAULT_READ_ALGEBRAwith result-semantics broad enough to cover the new projections/scopes (documented in each function's docstring, matching thecontext(intent="resume")precedent).Verification
devtools test tests/unit/mcp/— 184 passed (16 new, intests/unit/mcp/test_query_gap_projections.py).devtools verify --quick— green (format/lint/mypy --strict/render-all-check).POLYLOGUE_ARCHIVE_ROOT=~/.local/share/polylogueviasinnix-scope background, same pattern as fix(mcp): harden six-tool cutover — session correlation, status(operation), SessionStart preamble #3095) against the real ~18k-session archive: all 12 new projections/scopes returned valid payloads with no errors —postmortem/pathologiesmatched 153 sessions over the last 7 days,abandoned_sessionsfound 74,status(scope=embeddings)reported real catch-up state (total_sessions=2498),status(scope=sources)returned a real freshness projection.Ref polylogue-t46.8.2
🤖 Generated with Claude Code