Skip to content

feat: add user-approved workflow locator healing - #2700

Merged
esokullu merged 1 commit into
webbrain-one:mainfrom
alectimison-maker:feat/user-approved-locator-healing
Aug 8, 2026
Merged

feat: add user-approved workflow locator healing#2700
esokullu merged 1 commit into
webbrain-one:mainfrom
alectimison-maker:feat/user-approved-locator-healing

Conversation

@alectimison-maker

@alectimison-maker alectimison-maker commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • offer user-reviewable replacement targets when strict saved-workflow matching fails
  • re-resolve the selected semantic target immediately before dispatch
  • persist approved repairs only after the saved postcondition succeeds conclusively
  • apply repairs atomically without storing live element references
  • add localized healing approval UI for Chrome and Firefox

Design

When deterministic replay cannot strictly match a saved target, WebBrain may
present up to five independently replayable semantic candidates.

The model never selects or persists a replacement. The user must explicitly
choose a candidate from a structured confirmation card. Timeout and unattended
auto-selection responses cannot authorize healing.

After approval, replay checks the page scope again and reads a fresh
accessibility tree. The selected semantic descriptor must still resolve to
exactly one current target before the action can run. This prevents an old
ref_id from being reused after the page changes while the user is deciding.

The existing permission, submit-confirmation, execution, and postcondition
validation paths remain authoritative. A repair is returned for persistence
only when the action succeeds without inconclusive, stale, ambiguous,
wrong-target, or no-progress evidence.

The background applies all verified repairs atomically against the workflow's
previous updatedAt value. Concurrent workflow edits win and are never
overwritten.

Safety boundaries

  • no model-selected or automatic healing
  • no timeout/Instant clarification approval
  • no persistence before successful postcondition verification
  • candidates must be independently strong enough for future replay
  • duplicate semantic descriptors are excluded
  • role-incompatible and cross-origin link replacements are rejected
  • the selected target is re-resolved after user approval
  • live ref_id values and selectors are never persisted
  • sensitive field repairs can upgrade parameter protection but never downgrade it
  • existing Agent fallback remains unchanged when safe healing is unavailable

Testing

  • node test/run.js: 1527 passed, 1 existing upstream failure
    • existing failure: package version 26.2.2 is newer than the latest
      changelog entry 26.2.0
  • security injection corpus: 60/60 passed
  • rich-text toolbar guard: 33 passed
  • CI unit scenarios: 14 passed
  • cloud capture test passed
  • Chrome/Firefox syntax, locale coverage, and workflow-module parity passed
  • regression coverage includes:
    • candidate strength and duplicate rejection
    • cross-origin link rejection
    • explicit approval requirement
    • post-approval DOM revalidation
    • inconclusive-result rejection
    • atomic concurrent-update protection
    • live-ref non-retention
    • sensitive-parameter upgrades

Follow-up to #442

@vercel

vercel Bot commented Aug 8, 2026

Copy link
Copy Markdown

@alectimison-maker is attempting to deploy a commit to the esokullu's projects Team on Vercel.

A member of the Team first needs to authorize it.

@webbrain-one

Copy link
Copy Markdown
Owner

Review finding: no code-level merge blocker found; merge-worthy after rebasing onto current main.

The important safety properties are present:

  • candidates are bounded, independently replayable, and duplicate semantic descriptors are excluded;
  • timeout/Instant auto-responses cannot approve healing;
  • an approved target is re-resolved from a fresh accessibility tree after a fresh scope check;
  • persistence requires a successful, non-inconclusive result;
  • live refs/selectors are not stored;
  • sensitive-field repairs can upgrade parameter protection but cannot downgrade it; and
  • expectedUpdatedAt prevents a repair from overwriting a concurrent workflow edit.

Validation: local test/run.js reached 1527/1528; the sole failure is the existing package.json 26.2.2 vs CHANGELOG.md 26.2.0 mismatch on main. The security corpus passed 60/60, CI passed 14 scenarios, cloud-capture passed, and GitHub's WebMCP smoke check passed. The red Vercel status is an authorization failure, not a test failure.

#2698 has now merged and overlaps this PR in the Chrome and Firefox saved-workflow modules. Please rebase/resolve those conflicts while retaining both rename and healTargets, then rerun the combined workflow tests before merging.

@webbrain-one
webbrain-one force-pushed the feat/user-approved-locator-healing branch from 70c6286 to ded3fed Compare August 8, 2026 12:10
@webbrain-one

Copy link
Copy Markdown
Owner

Rebase completed onto current main (b289b56c). The two expected conflicts in the Chrome and Firefox saved-workflow modules were resolved by retaining both #2698's rename operation and this PR's healTargets operation; the resulting browser modules remain byte-identical.

Post-rebase validation:

  • test/run.js: 1529/1530; the sole failure is already present on main because version 27.0.0 expects dist/*-27.0.0.zip while only 26.2.2 archives are tracked.
  • rich-text toolbar guard: 33 passed
  • security corpus: 60/60
  • CI scenarios: 14 passed
  • cloud-capture: passed
  • GitHub WebMCP smoke: passed

The PR is now conflict-free and GitHub reports it as mergeable. The remaining red Vercel status is still the deployment-authorization issue, not a code failure.

@esokullu
esokullu merged commit 8148f98 into webbrain-one:main Aug 8, 2026
1 of 2 checks passed
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.

3 participants