Add act_with_mode: trial and force action modes over the actionability gate#452
Merged
Conversation
…y gate act_when_ready only waits-then-acts. Real flows need two more modes Playwright codified: trial (run every actionability check but DON'T act - a side-effect-free dry run) and force (skip checks, act now). act_with_mode adds both alongside the default auto, over the same injectable seams as the gate, so each mode is testable without a screen. Reuses wait_actionable.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 23 |
| Duplication | 1 |
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.



Summary
Completes the ROUND-15 input-fidelity lane (7/7).
actionability.act_when_readyonly waits-then-acts. Real flows need two more modes Playwright codified.utils/act_modes/:act_with_mode(action, bbox_provider, *, mode, …)— trial (run every actionability check but DON'T act; report whether it would have — a side-effect-free dry run), force (skip the checks and act now — the escape hatch when the gate misjudges a control), and the default auto (gate then act). Returns{mode, acted, actionable, reason, point, result}. Reusesactionability.wait_actionable+_center; the gate's injectable probes/configare forwarded, so each mode is testable without a screen. Unknown mode raisesValueError.__all__;AC_act_with_modeexecutor command (gated/dry-run/force click at a point);ac_act_with_modeMCP tool (side-effect); Script Builder under Flow.v222_features_doc.rst+WHATS_NEW.md.Test
test/unit_test/headless/test_act_modes_batch.py— force acts ignoring a disabled probe / no-target no-op; trial reports actionable + not-actionable without ever acting; auto acts when actionable / no-op on gate timeout; unknown-mode raises; ACT_MODES constant; plus facade + executor/MCP/builder wiring. All 10 green;ruff+bandit+radonclean; no float==; package stays Qt-free.