Skip to content

fix: time search and excerpt bilingual notes in the question script - #71

Merged
hmbanan666 merged 1 commit into
mainfrom
search-timing-excerpt-lang
Nov 18, 2026
Merged

hmbanan666 merged 1 commit into
mainfrom
search-timing-excerpt-lang

Conversation

@hmbanan666

Copy link
Copy Markdown
Owner

Summary

  • MCP search (evidence and pack) now includes integer tookMs, the server wall time for that call. Each search logs one stderr line, {"event":"search","tookMs":n,"embedMs":n,"retrievalMs":n,"groundingMs":n}, with no query text. embedMs is query embedding, retrievalMs is vector plus lexical lookup, and groundingMs is passage scoring. listProjects does not search and omits tookMs. There is no separate HTTP search route; this field is the /mcp tool result.
  • When a note contains both Cyrillic and Latin and the question is predominantly one of those scripts, the source excerpt is taken from a paragraph, line, or sentence in that script. A one-script note keeps the match anchor. Word and sentence trimming is unchanged. Grounding still scores the same passages.

Tests

pnpm run check (lint, tsc --noEmit, full test suite): 55 files, 291 tests passed.

Friction

  1. Nothing stalled for minutes. The slow part was finding the excerpt anchor (excerpt() in src/context-package.ts, offsets from src/search-lexical.ts) inside docs/search.md and a single-line MCP tool description. About ten minutes of reading. pnpm run check itself was about 30 seconds. The first check failed immediately on formatting and vp check --fix cleared it.
  2. None. The formatter is the repo's own vp check --fix.
  3. src/mcp-surface.ts keeps the whole search tool description on one line, so a one-sentence field note is easy to miss. docs/search.md describes response fields in running prose, with no field list, so tookMs had no obvious place to land. vp check says to run vp check --fix and also warns that the npm script name is vpr check.
  4. A short pointer at the top of docs/search.md — response assembly in src/mcp-surface.ts (packageResult / pack), excerpt window in excerpt() — plus a response-field list (grounding, sources[].excerpt, tookMs) would cut the reading in half. Splitting the MCP description string would make the field addition a normal edit.
Open in Web Open in Cursor 

Report server tookMs on MCP search and log embed, retrieval, and grounding
milliseconds without the query. When a note contains both Cyrillic and Latin,
take the source excerpt from the question's script.

Co-authored-by: Nick Kosarev <nick@kosarev.space>
@hmbanan666
hmbanan666 merged commit be46b59 into main Nov 18, 2026
2 checks passed
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.

2 participants