Skip to content

feat(core): identifier-affinity ranking + top-line candidate score (6F.7)#48

Merged
officialCodeWork merged 1 commit into
developmentfrom
build/phase-6f/step-6f.7-scoring-polish
Jul 15, 2026
Merged

feat(core): identifier-affinity ranking + top-line candidate score (6F.7)#48
officialCodeWork merged 1 commit into
developmentfrom
build/phase-6f/step-6f.7-scoring-polish

Conversation

@officialCodeWork

Copy link
Copy Markdown
Owner

Summary

Two scoring/UX polish items from the field feedback:

  • Identifier-affinity weighting — a matched term that also names the candidate (component name, props, or file basename; camelCase-split, fuzzy-tolerant) gets a ×1.5 multiplier, so "calendar" matching CalendarPanel outranks 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.
  • Top-line score on every candidate — the raw ranking score surfaces next to confidence instead of being nested where agents misread it. Set in matchComponents, 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

…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>
@officialCodeWork
officialCodeWork merged commit ccfd234 into development Jul 15, 2026
1 check 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