Skip to content

Add weighted candidate scoring (role + name + proximity)#367

Merged
JE-Chen merged 1 commit into
devfrom
feat/element-scoring-batch
Jun 23, 2026
Merged

Add weighted candidate scoring (role + name + proximity)#367
JE-Chen merged 1 commit into
devfrom
feat/element-scoring-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 23, 2026

Copy link
Copy Markdown
Member

anchor_locator is a single spatial relation + distance sort and ab_locator races whole strategies by elapsed time — neither is a weighted multi-signal scorer that ranks ambiguous candidates by role match + fuzzy name similarity + anchor proximity + enabled-state.

  • score_candidates (AC_score_candidates): returns ScoredCandidates (element / score / matched_on breakdown) best-first; each active signal contributes 0..1 and the score is their mean. Name similarity is injectable, defaulting to the project's fuzzy_ratio (reused — no new string-distance code).
  • best_candidate (AC_best_candidate): the top one (or None).
  • Pure-stdlib over element dicts; powers self-heal / grounding when several boxes could be the target. Fully headless-testable (exact-near-anchor ranks first, disabled+wrong-role last, injected similarity used). Wired through all 5 layers + headless test + EN/Zh docs + WHATS_NEW. Qt-free.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 31 complexity · 2 duplication

Metric Results
Complexity 31
Duplication 2

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit 50af1c3 into dev Jun 23, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/element-scoring-batch branch June 23, 2026 13:51
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant