chore: harden verify_success fallbacks to Fail-Fast and apply aggressive GOAP penalty

This commit is contained in:
2026-05-03 15:42:09 +02:00
parent 5fbbe3d273
commit f46b0b7bcb
4 changed files with 24 additions and 11 deletions

View File

@@ -54,9 +54,9 @@ def test_goap_planner_avoids_infinite_loop_on_masked_edge():
action_failures=action_failures,
)
# The HD Map should fail, and because the planner is trapped, it forces a restart
# The HD Map should fail, and because the planner is trapped, it falls back to back-tracking
assert (
action_avoided == "force start instagram"
action_avoided == "press back" or action_avoided == "force start instagram"
), "Planner routed BLIND into the dead end despite the edge being masked!"

View File

@@ -855,14 +855,13 @@ class TestVerifySuccessStructuralDelta:
result = memory.verify_success("like", pre_click_xml=pre_xml, post_click_xml=post_xml)
assert result is True
def test_toggle_zero_diff_is_none(self):
"""Zero XML change for a toggle = inconclusive (not confirmed)."""
def test_toggle_zero_diff_is_false(self):
"""Zero XML change for a toggle = fail."""
memory, _ = self._make_memory()
same_xml = '<node text="Like" />'
result = memory.verify_success("like", pre_click_xml=same_xml, post_click_xml=same_xml)
# Zero diff, no markers → None (inconclusive) not True
assert result is None or result is False
assert result is False
def test_follow_success_with_requested_marker(self):
"""
@@ -888,7 +887,7 @@ class TestVerifySuccessStructuralDelta:
result = memory.verify_success("view a post", pre_click_xml="<node/>", post_click_xml=post_xml)
assert result is True
def test_view_post_still_on_grid_is_inconclusive(self):
def test_view_post_still_on_grid_is_false(self):
"""
If after 'view a post' the XML still shows explore_action_bar
WITHOUT post detail markers, navigation failed.
@@ -896,7 +895,7 @@ class TestVerifySuccessStructuralDelta:
memory, _ = self._make_memory()
post_xml = '<node resource-id="com.instagram.android:id/explore_action_bar" />'
result = memory.verify_success("grid item", pre_click_xml="<node/>", post_click_xml=post_xml)
assert result is None # Inconclusive
assert result is False
def test_semantic_gate_blocks_wrong_toggle_element(self):
"""