Skip to content

ask: complementary evidence split across sibling symbols is not ranked at file level #204

Description

@Skyline-23

Problem

After #137, bounded output projects distinct-file leaders before sibling spans, but the file order still comes from the best individual symbol score.

When a relevant file expresses complementary query terms across multiple sibling symbols, no single symbol owns the full evidence. The file can therefore rank below a less complete single-symbol match even though its combined lexical evidence better covers the query.

Naive pooling is unsafe: independently taking the strongest lexical score and strongest PageRank score can create a score that no real candidate owns, repeated sibling terms can amplify a file without adding coverage, and graph-only or residual winners can be displaced.

Expected behavior

Rank complete file candidate groups before projecting spans, with a bounded complement that:

  • assigns any lexical gain to one real lexical anchor
  • rewards only complementary query-term coverage
  • cannot amplify duplicate terms or raw sibling magnitude
  • leaves graph-only, residual, singleton, and secondary candidates at baseline
  • preserves the existing test-file prior and comparable-scope score ownership
  • locks the exact baseline top hit
  • retains deterministic secondary span queues without a hard per-file quota

Retrieval effect

A 186-case fixed-base comparison across Django, Nest, PocketBase, and Spring Boot produced:

metric current bounded file evidence change
Natural R@10 53.6% 56.6% +3.0pp, 95% CI +1.0 to +5.6pp
Recall within 400 tokens 46.6% 54.3% +7.7pp
Median pack tokens 668 366 -45.3%
Stem-blind R@10 34.1% 34.9% +0.8pp

Additional guards:

  • R@10 improved in 7 cases and regressed in 0
  • the first result was exact in 186/186 cases
  • no repository-level R@10 regression
  • no stem-blind regression

This is a retrieval-quality and context-budget result, not a query-latency claim.

Related to #117 and the selection-only projection merged in #137 / #186.

I have a focused implementation and regression coverage ready.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions