Repository navigation
feat: refuse payment actions, signal security checks, add page_request - #31
Merged
Merged
Conversation
The driver refuses click, Enter, NumpadEnter, Space and type with submit on the final order-placement control or its form (cash on delivery included, English and Arabic), and typing into cc-* fields or payment-provider frames, before any input event (payment_refused). Captures and input checks report CAPTCHA and verification-code pages as security_check. page_request makes one packaged, credentialed, same-origin fetch inside the lease's origins: GET by default, writes only where the lease policy lists the exact origin, method and path, redirects refused, JSON capped at 32 KiB. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The protocol package compiles against ES2022 alone, so the global URL type is missing there. It takes the runtime's WHATWG URL from globalThis through a local type and returns only the fields callers read. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Cloudflare's Durable Object RPC types expand a recursive type alias without bound, so the backend typecheck hit TS2589 once Event carried the z.json() body. Named interfaces keep the same JSON shape and leave runtime validation by z.json() unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The driver hit-tests the click point, checks every clickable role the capture offers, matches more English and Arabic order and pay labels after normalising digits and invisible characters, refuses any key on a card field and modifier chords outside a navigation allowlist, and reports only visible challenges as security checks. A page_request write that may have reached the site ends unknown and unsafe to retry; write rules bind origin, path and query; credentialed GET needs act approval. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The capture stores names with bidi controls stripped, so the fixture seeds the same normalised name the live check compares against. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
Three additions the Smart Compliance Platform's browser agents need, usable by Understudy's own sessions too:
click, Enter, NumpadEnter, Space, andtypewithsubmit: trueon an order-placement control or its form (English and Arabic labels, cash on delivery included, with or without card fields), and anytypeinto acc-*autocomplete field or a recognised payment-provider frame. Each endsok: false, reason: "payment_refused"before any input event is dispatched. A target that changes after pointer movement or text insertion endstarget_changedbefore activation. The classifier (apps/extension/src/driver/payment-guard.ts) is reimplemented from Nanobrowser's design (Apache-2.0, credited in its header).security_check, so a caller stops instead of trying to solve them.page_request. A read command that makes one packaged, credentialed, same-originfetchinside the lease's allowed origins and returns JSON (capped at 32 KiB, redirects refused). GET by default; POST, PUT, PATCH and DELETE need prepare/grant and an exact origin, method and path listed in the lease policy (pageRequestWrites). The command carries data only; all executable logic is packaged in the extension.Protocol:
ActionFailureReasonSchemagainspayment_refusedandsecurity_check;CommandSchemagainspage_request; new capabilitypage-request-v1. Understudy's backend accepts the new reasons and capability. Changeset included.Release order
This changes the protocol, so the Smart Compliance Platform's vendored copy of
@understudy/protocolmust be re-forked and live before a store build carrying it ships: this PR merged todev→ SCP re-fork deployed →dev→master→ store submission (RUNBOOK.md).Test plan
ci.yml)page_request: cross-origin and off-policy refusal, redirect refusal, size cap🤖 Generated with Claude Code