feat(desktop): add read-only action target verification (Phase 2F-A)#8
Merged
gu87 merged 1 commit intoJun 7, 2026
Merged
Conversation
- Add hermes:browser:verify-action-target IPC handler in main.cjs. - IPC performs a fixed-script, read-only DOM target lookup. - targetRef must match /^@e\d+$/. No agent-provided JS execution. - Script uses querySelector + getBoundingClientRect only. - No click, focus, type, dispatchEvent, or value mutation. - Preload exposes only verifyActionTarget — no arbitrary execution. - desktop-visible-provider adds verifyDesktopActionTarget() with: targetRef validation, URL/fingerprint/visibility/disabled checks. - click/type remain non-executable — executor returns failed but attaches PreActionVerification for user inspection. - eval/press_key/scroll remain permanently denied. - snapshot/vision now produce real data via getDesktopSnapshot()/ getScreenshot() instead of fake executed results. - get_images/console report unavailable on Desktop. - 154 browser-runtime tests pass. 79 platform tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Adds a read-only pre-action target verification IPC that checks whether a DOM element referenced by an agent action (
click,type) still exists on the current page — without performing any execution.What Changed
hermes:browser:verify-action-targetinmain.cjsquerySelector+getBoundingClientRecttargetRefmust match/^@e\d+$/— no agent-provided JS execution{ found, visible, disabled, readOnly, elementFingerprint, value, ... }dispatchEvent, or value mutationverifyActionTargetonly — no arbitrary executiondesktop-visible-provider: addsverifyDesktopActionTarget()with checks for:action-gateway-ui: click/type executor now runs pre-action verification and attachesPreActionVerificationto the action log entry for user inspectiongetDesktopSnapshot()/getScreenshot()) instead of fakeexecutedresultsget_images/console: explicitly report unavailable on DesktopSafety Boundary
navigateclick,typeeval,press_key,scrollsnapshot,visionget_images,consoleclick/type remain non-executable — the executor still returns
failed. Pre-action verification is diagnostic only.Validation
npm run type-check: PASSnpx eslint(scoped): 0 errors, 0 warningsnpx vitest run --environment jsdom src/app/browser-runtime/*.test.ts: 154/154 PASSnpm run test:desktop:platforms: 79/79 PASSScope
🤖 Generated with Claude Code