Skip to content

Add action_effect: classify did-my-click-do-anything with attribution#379

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

Add action_effect: classify did-my-click-do-anything with attribution#379
JE-Chen merged 1 commit into
devfrom
feat/action-effect-batch

Conversation

@JE-Chen

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

Copy link
Copy Markdown
Member

摘要

新增 classify_effect / effect_near_point / is_no_op — 在第一步就分類「我的點擊有沒有效果」並做目標局部歸因。screen_state.diff_snapshotselement_diff 回報變了什麼卻從不把變化歸因回動作;loop_guard 只在相同摘要重複 N 次後才標記 no-op(代理會先空轉 2–8 次);actionability 純粹是動作前閘門。

本功能補上這個迴圈:比對前後觀測,並依動作目標點分類結果為 no_op(無變化)/ changed_near_target(變化在動作之處)/ changed_elsewhere(別處彈出意外對話框)/ changed(有變化但動作無座標可歸因)。回傳含變化中心與原因的 EffectVerdict。純標準函式庫,作用於元素字典 + 動作記錄;重用 element_diff.match_elementsobservation_delta 的欄位變更檢查。完全確定性、可無裝置測試。Qt-free。

五層

  • 核心:utils/action_effect/EffectVerdictclassify_effecteffect_near_pointis_no_op
  • Facade:由 je_auto_control 匯出 + __all__
  • Executor:AC_classify_effect(verdict dict)/ AC_effect_near_point({near})。
  • MCP:ac_classify_effect / ac_effect_near_point(read-only)。
  • Script Builder:Classify Action Effect / Effect Near Point?(Native UI)。
  • 文件:v167 EN + Zh + toctree。更新日誌:root EN + zh-TW + zh-CN。

測試

test/unit_test/headless/test_action_effect_batch.py — 無變化→no_op、目標附近變化→changed_near_target、遠處變化→changed_elsewhere、無座標→changed、effect_near_point 輔助、改名算變化、wiring + facade。8 passed。ruff / bandit / radon / float-scan / Qt-free 全乾淨。

screen_state/element_diff report what changed but never tie it to the action;
loop_guard only flags a no-op after the same digest repeats N times. Diff the
before/after observation and, given the action's target point, classify the
result on the first step as no_op / changed_near_target / changed_elsewhere /
changed, returning the changed centres and a reason. Reuses
element_diff.match_elements and observation_delta's field-change check.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 35 complexity · 2 duplication

Metric Results
Complexity 35
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 e8b5088 into dev Jun 23, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/action-effect-batch branch June 23, 2026 20:10
@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