Skip to content

test: harden AX content-group path + dedup perform_action probe (1.0.0b13) - #170

Closed
mauricecarrier7 wants to merge 1 commit into
mainfrom
chore/ax-169-fast-follow
Closed

test: harden AX content-group path + dedup perform_action probe (1.0.0b13)#170
mauricecarrier7 wants to merge 1 commit into
mainfrom
chore/ax-169-fast-follow

Conversation

@mauricecarrier7

Copy link
Copy Markdown
Contributor

Fast-follow to #169 (merged as 1b149a5, 1.0.0b12). Addresses the three non-blocking nits raised by #169's architect + QA reviews — nothing else. No behavior change: test hardening + a perform_action probe dedup.

Reviewer findings addressed

  1. QA (concern): _frame had zero test coverage. It's monkeypatched away in every content-group test, so neither its CGRect-struct path nor its documented fallback ran. Added direct unit tests against a stubbed ApplicationServices: CGRect-struct → {x,y,width,height}, the (x,y,w,h) tuple fallback, and the None paths (attribute-read failure, value-unwrap failure, malformed rect). ax.py:99 / tests/test_ax_module.py.

  2. QA (warning): stop-at-AXGroup up-walk semantics not pinned. The probe fixture's container had no parent, so dropping AXGroup from the stop-set survived (mutation gap). Gave the container a window parent so the up-walk must stop at the nearest AXGroup; if AXGroup is dropped the walk over-climbs to the window and the test fails. Verified: temporarily removed AXGroup from the stop-set → test_position_probe_hits_window_centre failed → restored. ax.py:376 / tests/test_ax_module.py.

  3. Architect (perf/warning): redundant _resolve_content_group on the perform_action not-found path. It was resolved twice (carrier search + WKWebView hint), each re-firing a position-probe + full DFS. Now resolved once and reused. Purely removes the duplicate probe — same return values. ax.py:514.

Behavior unchanged

Probe dedup is observably identical: the existing hint tests still pass — test_perform_action_adds_wkwebview_hint_when_zero_actions and test_perform_action_no_hint_when_other_actions_exist, plus test_perform_action_finds_carrier_via_content_group_probe.

Tests

cd simdrive && PYTHONPATH=src python3 -m pytest -q --ignore=tests/test_e2e_testkit.py1704 passed, 4 skipped (the e2e suite needs a booted sim and is ignored per convention).

Version

1.0.0b12 → 1.0.0b13 + CHANGELOG entry (Changed: probe dedup, no behavior change + test hardening).

⚠️ ax.py critical-path — architect+QA forge review required before merge; no behavior change (test hardening + probe dedup).

🤖 Generated with Claude Code

…0b13)

Fast-follow to #169 addressing the three non-blocking reviewer nits
(architect + QA) — test hardening + a probe dedup, no behavior change.

**Scope:**
- ax.py `perform_action`: resolve `_resolve_content_group(window)` ONCE on the
  not-found path and reuse it for both the carrier search and the WKWebView
  hint, removing the duplicate position-probe + DFS (architect perf nit).
- test_ax_module.py: add direct `_frame` coverage (CGRect-struct path,
  4-tuple fallback, and the malformed/missing None paths) — previously
  monkeypatched away in every content-group test (QA concern).
- test_ax_module.py: give the position-probe fixture's container a window
  parent so `test_position_probe_hits_window_centre` now FAILS if `AXGroup`
  is dropped from the up-walk stop-set (pins stop-at-nearest-group; QA mutation
  gap). Verified the mutation makes the test fail, then restored.
- Bump 1.0.0b12 -> 1.0.0b13 + CHANGELOG entry.

No observable behavior change; perform_action hint tests still pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mauricecarrier7

Copy link
Copy Markdown
Contributor Author

Closing — superseded by a history-rewrite sanitization pass on main. The fast-follow (_frame test + perform_action probe dedup) will be re-applied on the rewritten main.

@mauricecarrier7
mauricecarrier7 deleted the chore/ax-169-fast-follow branch June 24, 2026 13:23
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