Class LocatorRanker
java.lang.Object
com.shaft.capture.generate.LocatorRanker
Deterministically ranks captured locator evidence with explainable scoring.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRanked selection and fallback candidates.static final recordOne scored candidate. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Comparator<LocatorRanker.ScoredLocator> The one total, deterministic best-first ordering over scored candidates: lexicographic on (tier, score, strategy priority, strategy name, expression). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionselect(ElementSnapshot target, EventContext context, boolean interaction) Selects the strongest candidate for one captured target.
-
Field Details
-
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
CaptureGeneratoralso has to order selections -- when one logical element is seen on several events it keeps the better sighting -- and it previously did so by rawLocatorRanker.ScoredLocator.score()alone. That reintroduced issue #4239's F2 defect across event boundaries: aUSER_PROVIDEDsignal 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 evidencecontext- event contextinteraction- whether the event interacts with the target- Returns:
- ranked selection
-