Add action_effect: classify did-my-click-do-anything with attribution#379
Merged
Conversation
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.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 35 |
| Duplication | 2 |
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.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



摘要
新增
classify_effect/effect_near_point/is_no_op— 在第一步就分類「我的點擊有沒有效果」並做目標局部歸因。screen_state.diff_snapshots與element_diff回報變了什麼卻從不把變化歸因回動作;loop_guard只在相同摘要重複 N 次後才標記 no-op(代理會先空轉 2–8 次);actionability純粹是動作前閘門。本功能補上這個迴圈:比對前後觀測,並依動作目標點分類結果為
no_op(無變化)/changed_near_target(變化在動作之處)/changed_elsewhere(別處彈出意外對話框)/changed(有變化但動作無座標可歸因)。回傳含變化中心與原因的EffectVerdict。純標準函式庫,作用於元素字典 + 動作記錄;重用element_diff.match_elements與observation_delta的欄位變更檢查。完全確定性、可無裝置測試。Qt-free。五層
utils/action_effect/—EffectVerdict、classify_effect、effect_near_point、is_no_op。je_auto_control匯出 +__all__。AC_classify_effect(verdict dict)/AC_effect_near_point({near})。ac_classify_effect/ac_effect_near_point(read-only)。測試
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 全乾淨。