Skip to content

refactor: one decision tree for recall on HTTP and MCP; MCP honours the HTTP parameters (#1439, part C2) - #1576

Merged
ajianaz merged 1 commit into
developfrom
refactor/unify-recall-1439-c2
Oct 29, 2026
Merged

ajianaz merged 1 commit into
developfrom
refactor/unify-recall-1439-c2

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

What

Second part of PR C of the unified-surfaces plan.

  • New uteke_core::recall_exec: Uteke::run_recall(&RecallRequest, RecallDefaults) -> RecallOutput. It is the decision tree the HTTP handler owned (explain guards, pack, unified recall, time travel, the memory-only path with its entity/category and before/after post-filters), moved verbatim. A guard failure is an Error::Validation with the exact text HTTP returned.
  • POST /recall now calls it and only renders the output (v1 flat or v2, the "No memories above similarity threshold" body). Its behaviour is unchanged.
  • MCP uteke_recall calls it too. It now accepts entity, category, strict, enrich, at, after and before (it ignored them), with the HTTP guards (pack and explain cannot be combined with the time filters; explain not with entity/category/enrich), and refuses an argument the tool does not declare, listing the supported ones (a typo such as limt was silently ignored). The list is built from the tool's own inputSchema, so the two cannot drift. The tool schema documents the new parameters.
  • The MCP default stays memories and documents: the shared execution treats an absent search_type as memory-only (HTTP's behaviour), so MCP names all explicitly unless explain is set.

Why

#1439 PR C (owner decisions of 2026-10-13: one behaviour per operation, towards HTTP; cloud contract uteke-cloud#173). Sharing the decision tree is what makes "honour entity/category/at/after/before on MCP too" a call instead of a second copy.

One thing for the reviewer: HTTP's default is memory-only while MCP's documented default is memories and documents, a disagreement the decisions did not list. I kept MCP's default (so this PR does not silently drop documents from MCP results); making MCP memory-only by default would be a one-line change if you want it.

Testing

  • Side by side, binaries from develop and from this branch, real servers with a mock embeddings endpoint, the same 4 memories (with entity/category metadata) and 20 POST /recall bodies (plain, limit, search types, entity, category, after/before/at, explain and its three guards, pack and its guard, min_score, unknown strategy and search_type, blank query, limit over the cap, tags: []): the normalised responses, including the error bodies, are identical.
  • New core tests for each branch of run_recall; MCP tests for the new parameters, the guards and the unknown-argument error; the existing server tests (explain, isolation, cross-surface) pass unchanged.
  • cargo test --workspace --locked, clippy -D warnings, fmt, docgen (no diff). The CLI local path is not touched, so no LongMemEval run is needed for this part. Cora MCP review before committing: no findings.

@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit eef7281 into develop Oct 29, 2026
14 checks passed
@ajianaz
ajianaz deleted the refactor/unify-recall-1439-c2 branch October 29, 2026 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant