SIGN IN SIGN UP

fix(search): rank implementations above tests for identifier queries

Board job cc269365, found by the golden ranking eval (job 15ad478a): every
identifier query ranked the matching tests/*.test.ts above the
implementation (mean MRR 0.371) because tests call a symbol more often than
the impl defines it, scoring rewarded raw match count, and the ripgrep leg
ordered files alphabetically.

- Definition boost: files with definition-shaped lines for a matched
  keyword (export function/class/const/interface/... <kw>, or
  method-shaped `<kw>(`) score +4 per keyword in the keyword leg, +5 in
  the ripgrep leg.
- Test demotion: when at least one non-test file matched, tests/ and
  *.test.*/*.spec.* scores are multiplied by 0.3. Pure-test queries keep
  their ranking.
- Ripgrep leg now orders files by relevance (hit count + definition boost
  + path match, ties alphabetical) instead of alphabetically.

Golden eval: mean MRR 0.371 → 0.889; every judged answer now ranks in the
top 3 (was rank 7 worst case). Floors in tests/local-search-eval.test.ts
to be raised in a follow-up (file locked by in-flight work).
V
Vir Sanghavi committed
bc86c7199f3989f8ffbbb5566c37b8609f4c58f7
Parent: 9efc0de