Skip to content

Add grounding_consensus: self-consistency over grounding proposals#385

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

Add grounding_consensus: self-consistency over grounding proposals#385
JE-Chen merged 1 commit into
devfrom
feat/grounding-consensus-batch

Conversation

@JE-Chen

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

Copy link
Copy Markdown
Member

摘要

新增 consensus_point / consensus_element / is_confident — 對單一目標的多個 grounding 提案做自我一致性融合。一個目標可同時以多種方式 grounding(set-of-marks / OCR / 樣板 / a11y / 模型 N 次抽樣)而未必一致。ab_locator / element_scoring 依歷史排序策略;action_grounding.snap_to_element 只貼單一座標——兩者都不融合同時的提案並給離散度。

本功能將候選點聚類(或對候選元素投票),回傳一致同意的目標 + agreement 比例 + spread,並以 is_confident 標記低一致度目標,讓呼叫端改為放大 / 詢問人工而非盲目點擊。純標準函式庫幾何;確定性、可無裝置測試。Qt-free。

五層

  • 核心:utils/grounding_consensus/ConsensusResultconsensus_pointconsensus_elementis_confident
  • Facade / Executor AC_consensus_point + AC_consensus_element / MCP ac_consensus_point + ac_consensus_element / Script Builder(Native UI)。
  • 文件:v172 EN + Zh + toctree。更新日誌:root EN + zh-TW + zh-CN。

測試

test_grounding_consensus_batch.py — 多數群勝出 + n_clusters、權重影響、is_confident 門檻、consensus_element 投票最近、空輸入、wiring + facade。7 passed。ruff / bandit / radon / float-scan / Qt-free 全乾淨(consensus_element 重構為具名 helper 避免迴圈內 lambda)。

A target can be grounded several ways at once (set-of-marks / OCR / template /
a11y / N model samples) and they don't always agree. ab_locator/element_scoring
rank strategies by history; snap_to_element snaps a single coordinate - neither
fuses simultaneous proposals. Cluster candidate points (or vote candidate
elements), return the agreed point + agreement fraction + spread, and flag
low-agreement targets so the agent zooms/asks instead of clicking blind.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 38 complexity · 0 duplication

Metric Results
Complexity 38
Duplication 0

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 363d8a5 into dev Jun 23, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/grounding-consensus-batch branch June 23, 2026 21:31
@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