Skip to content

search: query-time candidate-set resolver over raw edges #86

Description

@IceRhymers

Part of #82. Depends on #83 and #84.

Summary

Build the query-time resolver that turns raw edge target names into ranked candidate-set payloads, in the shared service layer.

Scope

  • Resolver module (e.g. app/search/references.py) joining edges.target_name against symbols.name: exact match primary, same-repo preferred with cross-repo fallback, ranking signals (kind match, same-file, same-repo). Use the two-query design from app/search/symbols.py — its docstring documents the SQLAlchemy auto-correlation hazard that a self-referencing join makes worse.
  • Payload builders in app/service.py (both MCP and webui consume these): candidate sets with (repo, path, line, edge_kind, enclosing_symbol, candidates[]), truncated/truncation_reason flags, deterministic ordering, keyset-friendly.
  • Branch scoping byte-identical to search_code: explicit branch:branches @> ARRAY[:v]; otherwise the implicit default-branch conjunct (coalesce(default_branch, 'HEAD')).
  • Quality measurement: record the unique/ambiguous/unresolved distribution on the indexed corpus against the deep-dive probe baseline (28.8% / 33.4% / 37.8% on the 4-repo sample).

Acceptance criteria

  • Resolver returns ranked candidate sets; ambiguity is represented, never silently collapsed to one target.
  • statement_timeout guard and truncation flags honored; ordering deterministic.
  • Branch/default-branch scoping proven by tests matching search_code behavior.
  • Resolution-quality distribution measured and recorded in the PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions