Skip to content

feat: Self-Healing Observation Loop + Visual Verification 2.0 #16

Description

@Delqhi

Problem

When a click action fails silently (DOM unchanged, page looks the same), the script blindly continues and eventually crashes or produces wrong results. There is no feedback mechanism to detect "nothing happened".

Evidence

Solution (Implemented)

Self-Healing Loop (click_ref_checked)

  1. Take screenshot + DOM snapshot BEFORE click
  2. Execute click via CDP (with Human Entropy)
  3. Take screenshot + DOM snapshot AFTER click
  4. Compare DOM diff (addedCount, removedCount)
  5. Compare screenshots (Visual Verification 2.0 — Base64 length diff proxy)
  6. If BOTH are zero → trigger JS DispatchEvent fallback automatically
  7. Re-verify after fallback

Visual Verification 2.0

  • Compares Base64 encoded PNG data length before/after
  • A real UI change modifies compressed image size by >0.1%
  • If diff_ratio < 0.001 → "KEINE visuelle Änderung" → trigger self-healing

Files Changed

  • real_bridge_prolific.py — click_ref_checked(), visual_verification_2_0(), page_diff()

Acceptance Criteria

  • Silent click failures are detected within 2 seconds
  • JS fallback fires automatically without human intervention
  • Visual verification correctly distinguishes real UI changes from no-ops
  • Screenshots saved to /tmp/opensin-bridge-prolific/ for every action

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions