feat(core): identifier-affinity ranking + top-line candidate score (6F.7)#48
Merged
officialCodeWork merged 1 commit intoJul 15, 2026
Merged
Conversation
…F.7) Field feedback: matches were "ranked only by the query's own character rarity", and find_component's real score was nested where agents misread it. - matchComponents applies IDENTIFIER_AFFINITY (x1.5) to a matched term that also names the candidate component — its name, props, or file basename, camelCase-split, tokenized, fuzzy-tolerant. "calendar" matching CalendarPanel now outranks the same text rendered incidentally elsewhere; genuinely-tied generic terms stay tied (ambiguity honesty unchanged at 1.000). Evidence lines note "(also names the component)". - Candidate gains optional top-level `score` (raw ranking score; confidence stays the calibrated signal), set by matchComponents, printed by the CLI (score=… confidence=…), inherited by MCP through the envelope JSON. 2 new core tests (211 total). Eval 290 pass / 0 fail / 0 xfail, gate OK, metrics 1.000. Candidate isn't in the generated schemas (drift gate green). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Merged
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
Two scoring/UX polish items from the field feedback:
CalendarPaneloutranks the same text rendered incidentally elsewhere. Global character rarity alone couldn't tell those apart. Genuinely-tied generic terms stay tied — ambiguity honesty unchanged at 1.000.scoreon every candidate — the raw ranking score surfaces next toconfidenceinstead of being nested where agents misread it. Set inmatchComponents, printed by the CLI (score=… confidence=…), inherited by MCP through the envelope JSON.Verification
pnpm test: 211 tests green (2 new)pnpm eval: 290 pass · 0 fail · 0 xfail, gate OK, metrics 1.000 (no ranking regressions across fixtures)pnpm typecheck: clean; drift gate green (Candidate isn't in the generated schemas)🤖 Generated with Claude Code