Class LocatorRanker

java.lang.Object
com.shaft.capture.generate.LocatorRanker

public final class LocatorRanker extends Object
Deterministically ranks captured locator evidence with explainable scoring.
  • Field Details

    • BEST_FIRST

      public static final Comparator<LocatorRanker.ScoredLocator> BEST_FIRST
      The one total, deterministic best-first ordering over scored candidates: lexicographic on (tier, score, strategy priority, strategy name, expression).

      Issue #4271 review finding 2: this is public and shared because CaptureGenerator also has to order selections -- when one logical element is seen on several events it keeps the better sighting -- and it previously did so by raw LocatorRanker.ScoredLocator.score() alone. That reintroduced issue #4239's F2 defect across event boundaries: a USER_PROVIDED signal worth +1000 let a tier-3 selection displace a tier-1 one. A second hand-maintained copy of an ordering rule is exactly the drift this redesign exists to remove, so there is now one comparator and both callers use it.

  • Constructor Details

    • LocatorRanker

      public LocatorRanker()
  • Method Details

    • select

      public LocatorRanker.LocatorSelection select(ElementSnapshot target, EventContext context, boolean interaction)
      Selects the strongest candidate for one captured target.
      Parameters:
      target - target evidence
      context - event context
      interaction - whether the event interacts with the target
      Returns:
      ranked selection