Conversation
…t lists The `SearchMatch` type previously returned groups of context lines (similar to `grep -C`), which was unbounded in size and leaked raw note content into every search response. Replace that model with a compact, size-bounded result: - `groups: Vec<MatchGroup>` is removed. In its place, `SearchMatch` now carries `line_hits` (1-indexed line numbers, capped at `max_line_hits`), `total_hits` (always the true count), and a `snippet` — a short excerpt centered on the first match, truncated with `…` at `snippet_chars` characters. - `SearchMatch` now also includes `tags` and `updated_at`, fetched in a single batch `fetch_metadata` query so callers no longer need a separate `note_get` round-trip just to identify a note. - `SearchParams` drops the `context` field and gains `snippet_chars` (default 200) and `max_line_hits` (default 20). - `make_snippet` is Unicode-safe: it counts chars, not bytes, and clamps the window to the actual match position. - The MCP tool description for `note_search` is updated to explain the new response shape and how to follow up with `note_get` when full content is needed. - `Snippet` is re-exported from the crate root. Signed-off-by: Jean Mertz <git@jeanmertz.com>
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.
The
SearchMatchtype previously returned groups of context lines (similar togrep -C), which was unbounded in size and leaked raw note content into every search response.Replace that model with a compact, size-bounded result:
groups: Vec<MatchGroup>is removed. In its place,SearchMatchnow carriesline_hits(1-indexed line numbers, capped atmax_line_hits),total_hits(always the true count), and asnippet— a short excerpt centered on the first match, truncated with…atsnippet_charscharacters.SearchMatchnow also includestagsandupdated_at, fetched in a single batchfetch_metadataquery so callers no longer need a separatenote_getround-trip just to identify a note.SearchParamsdrops thecontextfield and gainssnippet_chars(default 200) andmax_line_hits(default 20).make_snippetis Unicode-safe: it counts chars, not bytes, and clamps the window to the actual match position.note_searchis updated to explain the new response shape and how to follow up withnote_getwhen full content is needed.Snippetis re-exported from the crate root.