Repository navigation
fix(mcp): rank symbol searches and report truncated pages - #75
Merged
knight22-21 merged 2 commits intoOct 13, 2026
Merged
knight22-21 merged 2 commits into
knight22-21 merged 2 commits into
Conversation
sundaysebasidian-byte
marked this pull request as ready for review
October 4, 2026 01:59
Owner
|
Thanks @sundaysebasidian-byte! PR #73 and PR #74 have just been merged into \main, which introduced a merge conflict (primarily in \docs/changelog.md). Could you please update your branch / rebase onto the latest \main\ to resolve the conflicts? Once updated and CI checks pass, we'll be ready to review and merge this. |
knight22-21
approved these changes
Oct 13, 2026
knight22-21
left a comment
Owner
There was a problem hiding this comment.
LGTM! Excellent implementation adding SQL ranking for symbol search, pagination limit parameter, and truncation metadata.
Owner
|
Merged, thank you @sundaysebasidian-byte! This adds ranking for symbol searches, pagination limits, and accurate truncation reporting. |
This was referenced Oct 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #38.
Substring symbol search currently applies an unordered 50-row cap before relevance or project filtering, so an exact
runsymbol can be omitted behind 60 partial matches. Rank exact names, then prefixes, then other matches in SQLite before limiting, with stable name/file/id ordering. Apply the existing kind and literal project-prefix filters before pagination, and return the complete filteredtotalplustruncatedthrough MCP.Append
limitto the MCP tool's arguments with default 50 and an accepted range of 1–500. Preserve the existing list-returning StorageManager/QueryEngine APIs. The SQL window count keeps the page and total in one SQLite snapshot. Update the tool description, README and changelog, and add 26 real-SQLite/temporary-index cases.Type of change
How was it tested?
On macOS with the existing Python 3.14.6 development environment, against main
6ee2ff6251af85f32dce90320b5ed956b98b1fa3and isolated XDG/test directories:ruff check codeprism/ tests/andruff format --check codeprism/ tests/: passed.--follow-imports=silent: the same 20 pre-existing diagnostics as main after removing line offsets; no new diagnostics, including in the new test file.search_symbolon the issue fixture. Default limit 50 was advertised;limit=1returnedcount=1,total=61,truncated=true, withrunfirst. Direct default/limit-100 calls returned the expected cut/complete pages.Cases cover empty/below/exact/above-limit pages, limits 1/50/500, invalid direct-API limits and unknown kinds, filters before counting/capping, relative/absolute paths including literal
%/_, and legacy serializer/semantic behavior.Checklist
ruff checkandruff format --checkpass.mypyerrors in the files changed.docs/changelog.mdupdated.Notes for reviewers
Completeness metadata and configurable limits apply to substring mode. Semantic search retains its existing top-20 neighbor cap, ordering, post-filtering and
count/matchesresponse shape; it ignores the new limit and omitstotal/truncatedbecause a complete semantic total is unavailable. This keeps the separate embedding issues in #36 outside this fix. Existing literalstartswithproject-prefix semantics are preserved.AI assistance: implementation, tests and documentation were prepared with Codex and independently reviewed by a separate Codex agent. No dependencies or software were added or installed. Local execution used macOS / Python 3.14.6 and existing FastMCP 4.0.10; other interpreter/platform/framework combinations were not run locally. Optional real embedding models/vector storage were not installed or exercised; semantic compatibility tests use lightweight components with actual indexed SQLite IDs. Mypy remains advisory and not fully green upstream.