You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
require swipe distance and duration to be positive finite numbers
require repeat to be a non-negative finite integer
reject end and distance when supplied together
require direction for distance-based swipes
preserve the existing repeat=0 safety cap and clarify its description
add focused schema and runtime regression coverage
Problem
Invalid Swipe parameters could previously produce unexpected device actions:
negative distance reversed the requested swipe direction
negative repeat silently executed zero times
fractional repeat could execute more times than requested
invalid duration values reached platform adapters
distance was silently ignored when end was also present
The repeat=0 description also claimed infinite execution, while the implementation intentionally capped it at 10 iterations.
Changes
Validation is applied at two boundaries:
the action schema validates model-generated scalar parameters
normalizeMobileSwipeParam() validates runtime and direct SDK input
Cross-field constraints remain in the runtime normalization layer so the schema stays a ZodObject and existing locator-field extraction continues to work.
Validation
Swipe regression suite: 20 tests passed
device and related planning suite: 6 files, 73 tests passed
Note on the failing checks, in case it factors into review.
This PR's change is confined to packages/core (swipe-parameter validation) with unit coverage in swipe.test.ts and action-description.test.ts. The red checks are all the model-backed / device jobs (e2e-web, chrome-extension-*, android-emulator, ios-simulator, macos/windows-desktop) that need the repository secrets injected on the run — the same external-fork trust/configuration gate, not the changed logic. There is no core unit-test job among the failures.
I confirmed this class of change builds and passes locally on the sibling PR #3068 (packages/core unit file, 33/33). A maintainer can validate via a trusted branch or workflow_dispatch after reviewing the diff; happy to rebase if it helps.
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
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
Problem
Invalid Swipe parameters could previously produce unexpected device actions:
The repeat=0 description also claimed infinite execution, while the implementation intentionally capped it at 10 iterations.
Changes
Validation is applied at two boundaries:
normalizeMobileSwipeParam()validates runtime and direct SDK inputCross-field constraints remain in the runtime normalization layer so the schema stays a ZodObject and existing locator-field extraction continues to work.
Validation