Repository navigation
feat(relevant): record min_score and its filtered-hit count on the span - #688
Conversation
GET /memories/relevant now stamps `lorekit.min_score` (always, 0 included) and `lorekit.min_score_filtered_count` (ranked candidates the threshold removed before diversification). Since 00112 graded relevance, a min_score tuned against the old 0.375 floor can drop hits it used to keep; the span showed that something was filtered but not the threshold or how much. Pinned by a source-scan spec in mcp-core, the rest-auth-tracing pattern, because the Deno edge tree has no test harness of its own. Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
✅ No issues foundRe-review of the two fix commits: the same-call test now checks membership without pinning key order (replayed: reorder passes, split still fails), and the comment names the Checked: 2 of 2 changed files read · 0 of 1 dependent file traced · 2 possible issues → 0 confirmed → 0 posted Progress: open review threads 2 → 0 across the last 2 reviews What this change reaches — 1 changed export · 1 dependent file · 0 checked · 1 not checkedflowchart LR
subgraph pr["Changed in this PR"]
s1["handleRelevant<br/>body changed"]:::changed
end
s1c1["supabase/functions/memories/index.ts<br/>? not checked"]:::unknown
s1 -.-> s1c1
classDef changed fill:#eef2ff,stroke:#6366f1,color:#1e1b4b
classDef ok fill:#e7f6ec,stroke:#16a34a,color:#14532d
classDef partial fill:#fef9c3,stroke:#ca8a04,color:#713f12
classDef unknown fill:#f3f4f6,stroke:#9ca3af,stroke-dasharray:4 3,color:#374151
classDef bad fill:#fde8e8,stroke:#dc2626,color:#7f1d1d
classDef warn fill:#fff4e5,stroke:#d97706,color:#78350f
classDef imports fill:#f8fafc,stroke:#64748b,stroke-dasharray:4 3,color:#1e293b
Review details
Found Quality — produced 2 → posted inline 0 · cleared 0 · carried forward 0 · deferred 0 · below-bar 0 Run incremental · 23 lines in delta · tier standard · depth checkout Nothing to report — optimality (skipped), severity, 0 files skipped.
|
…ithout pinning key order Addresses the pr-reviewer bot's comment: #688 (comment) Refs: #688 Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
…d of "the line above" Addresses the pr-reviewer bot's comment: #688 (comment) Refs: #688 Co-authored-by: dash0-dev[bot] <257284812+dash0-dev[bot]@users.noreply.github.com>
|
Darkplane auto-approval Darkplane could not finish evaluating this pull request. It will try again on the next request. |
Why
GET /memories/relevantdrops ranked hits scoring belowmin_score, and since 00112 graded relevance, a threshold tuned against the old0.375floor can drop hits it used to keep. The span showed that a response came back short (result_count < min(limit, candidate_count)), but not the threshold or how many hits it removed.What changed
lorekit.min_scoreon the handler span — always recorded,0included, bounded to[0,1]byRelevantQuerySchema.lorekit.min_score_filtered_count— ranked candidates the threshold removed before diversification. Read withcandidate_countandresult_count, it separates "nothing matched" from "min_scoredropped them" from "limitcut the list".relevant-min-score-tracing.spec.tspins both, as a source scan (therest-auth-tracing.spec.tspattern — the edge tree has no test harness).How to verify
pnpm nx test mcp-core— the new spec fails 3 of 4 againstmain's handler and passes on this branch.node scripts/ci/deno-check-functions.mjs --node-modules-dir=none—memoriesreports 0 errors.Notes for reviewers
No user-facing docs or
llms.txtchange: span attributes alter nothing a user can do, see or configure. Nothing watches the new count yet; an alert onmin_score_filtered_count > 0is a follow-up once/relevanthas a caller.