Skip to content

Commit bbc93e3

Browse files
committed
docs+test(ios): pin the template-retaining mask as the completion rule's known limit (#2634 review)
The docs and help claimed a normalizing field is always typed once; a mask that keeps its template through the clear ("$0.00" before "$10.00") shares characters with the value it formats, so its fill still takes the echo reading with its repair — text cannot tell surviving template from failed-clear residual, which is the same relation the residual fix relies on. Pin the exact triple at the completion-table and evidence levels, state the boundary in the docs/help and the predicate doc, and drop the orphaned one-character-request comment left above the span bounds when the count guard moved into the opening guard.
1 parent 3b98c12 commit bbc93e3

4 files changed

Lines changed: 20 additions & 4 deletions

File tree

‎apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryConfirmation.swift‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ extension RunnerTests {
7373
/// burst typed, so end-only insertions (`"old123456"` for `"123456"`) stay echoes. A doubled
7474
/// entry (`"66"` for `"6"`) leaves its surplus at the ends; a mask inserting a request
7575
/// character (`.` for a decimal value) falls back to the echo reading; a one-character request
76-
/// has no between.
76+
/// has no between. Known limit: a mask that keeps its template through the clear shares
77+
/// characters with the value it formats (`"$0.00"` for `"$10.00"`), so its fill keeps the echo
78+
/// reading — text cannot tell surviving template from failed-clear residual.
7779
static func textValueCompletesRequest(observed: String, request: String, baseline: String) -> Bool {
7880
guard !request.isEmpty, request != observed, request.count > 1 else {
7981
return false
@@ -88,7 +90,6 @@ extension RunnerTests {
8890
consumedOffsets.insert(observed.distance(from: observed.startIndex, to: match))
8991
cursor = observed.index(after: match)
9092
}
91-
// A one-character request has no between for an insertion to sit in.
9293
let first = consumedOffsets.first!
9394
let last = consumedOffsets.last!
9495
var sawInteriorInsertion = false

‎apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/UnitTests/RunnerTests+TextEntryConfirmationTests.swift‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ extension RunnerTests {
5757
// Its closest positive: residual fully absorbed by the embedding, where every extra is
5858
// punctuation the baseline cannot explain — the value is request + formatting after all.
5959
XCTAssertTrue(Self.textValueCompletesRequest(observed: "(555) 123-4567", request: "5551234567", baseline: "12"))
60+
// Known limit, the empty-baseline "$10.00" positive's twin: a mask that keeps its template
61+
// through the clear shares characters with the value it formats, and text cannot tell
62+
// surviving template from failed-clear residual, so the echo reading (repair, then the same
63+
// mismatch as main) stands.
64+
XCTAssertFalse(Self.textValueCompletesRequest(observed: "$10.00", request: "1000", baseline: "$0.00"))
6065
}
6166

6267
func testDigitCountSummaryThatMovedOffItsBaselineIsUnconfirmed() {
@@ -189,6 +194,16 @@ extension RunnerTests {
189194
)
190195
)
191196

197+
// The known limit at the wire decision: a template-retaining mask ("$0.00" survives the
198+
// clear) keeps the echo reading, so this fill fails with a repair as it does on main.
199+
XCTAssertNil(
200+
Self.unconfirmedTextEntryEvidence(
201+
requested: "1000",
202+
baseline: Self.otpObservation("$0.00"),
203+
observed: Self.otpObservation("$10.00")
204+
)
205+
)
206+
192207
// The refusals, each the completion positives' closest negative. Note the shape they share:
193208
// every one of them is still an echo — a value that could be a degraded copy — which is the
194209
// only refusal this path now makes. Values that match no echo clause at all (a digit lost

‎src/commands/schema/cli-help-workflows.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ Stabilizers:
183183
Text-entry quirks:
184184
iOS Allow Paste cannot be exercised under XCUITest; prefill with clipboard write "some text" instead and test the system prompt manually.
185185
Android Gboard handwriting/stylus UI can capture text in an IME-owned input instead of the app field. If fill reports that input was captured by the keyboard/IME, use the diagnostic targetInput/actualInput details, inspect keyboard status/get if needed, and switch or disable handwriting outside the command plan before retrying. Do not keep retrying fill/type against the same field while the IME owns focus. If the exact target changes but app-owned formatting prevents raw equality, fill succeeds with verification: "unconfirmed" plus target-bound requested/before/after evidence; inspect that evidence instead of retrying the same mutation.
186-
iOS accessibility-driven fill into a field whose accessibility value does not echo the typed text succeeds with the same verification: "unconfirmed" evidence when that field's value moved off its post-clear baseline: an OTP input announcing "6 of 6 digits", or a normalizing field whose value is the request with formatting inserted ("00 062 91 77" for "000629177"). A normalizing field is typed once, never cleared and retyped. A value that could still be a degraded copy of the text as sent fails instead: characters dropped from it ("12456" for "123456"), or old text a failed clear left around it ("old123456"). The coordinate-driven fill route still requires an exact match. Confirm the value through the screen, for example the OTP slots or the next screen; do not retry the fill or switch to per-character typing.
186+
iOS accessibility-driven fill into a field whose accessibility value does not echo the typed text succeeds with the same verification: "unconfirmed" evidence when that field's value moved off its post-clear baseline: an OTP input announcing "6 of 6 digits", or a normalizing field whose value is the request with formatting inserted ("00 062 91 77" for "000629177"). A normalizing field is typed once, never cleared and retyped; the limit is a field that shows a template even while empty ("$0.00"), whose surviving template is indistinguishable from old text a failed clear left behind, so those fills keep failing with a repair. A value that could still be a degraded copy of the text as sent fails instead: characters dropped from it ("12456" for "123456"), or old text a failed clear left around it ("old123456"). The coordinate-driven fill route still requires an exact match. Confirm the value through the screen, for example the OTP slots or the next screen; do not retry the fill or switch to per-character typing.
187187
188188
React Native internals:
189189
If the question is about React Native performance, profiling, props, state, hooks, render causes, slow components, or rerenders, use help react-devtools instead of inferring from screenshots or logs.`,

‎website/docs/docs/commands.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ On iOS, if `fill` reports `TEXT_INPUT_SYNTHESIS_BUDGET_EXCEEDED`, the text is lo
474474
Use plain `fill` or `type` first for ordinary login and form fields. Use `--delay-ms` on `type` or `fill` only when a debounced search field or search-as-you-type input actually misses characters, or when the app must receive incremental updates.
475475
Delayed typing intentionally prefers paced character entry over clipboard-style fallbacks so the target field receives each incremental update.
476476
On Android, `fill` also verifies text and treats IME-owned capture as a terminal failure instead of retrying against the wrong field.
477-
When the filled field changed but its value cannot confirm the text, `fill` succeeds with `verification: "unconfirmed"` plus target-bound `requested`/`before`/`after` evidence instead of failing. On Android that is app-owned formatting. On iOS's accessibility-driven `fill` route it is a field whose value moved off its post-clear baseline to one that raw equality cannot reach: an OTP input announcing `6 of 6 digits`, or a field that normalizes what it holds so the shown value is the typed text with formatting inserted (filling `000629177` into a `## ### ## ##` grouping reports `after: "00 062 91 77"`). A normalizing field is typed once, never cleared and retyped. A value that could still be a degraded copy of the text as sent fails instead: characters dropped from it (`12456` for `123456`), or old text a failed clear left around it (`old123456`). The coordinate-driven route still requires an exact match. Verify the result through the screen, for example the OTP slots or the next screen, instead of retrying the same fill.
477+
When the filled field changed but its value cannot confirm the text, `fill` succeeds with `verification: "unconfirmed"` plus target-bound `requested`/`before`/`after` evidence instead of failing. On Android that is app-owned formatting. On iOS's accessibility-driven `fill` route it is a field whose value moved off its post-clear baseline to one that raw equality cannot reach: an OTP input announcing `6 of 6 digits`, or a field that normalizes what it holds so the shown value is the typed text with formatting inserted (filling `000629177` into a `## ### ## ##` grouping reports `after: "00 062 91 77"`). A normalizing field is typed once, never cleared and retyped. A field that shows a template even while empty (`$0.00`) is the limit: its surviving template is textually indistinguishable from old text a failed clear left behind, so those fills keep failing with a repair. A value that could still be a degraded copy of the text as sent fails instead: characters dropped from it (`12456` for `123456`), or old text a failed clear left around it (`old123456`). The coordinate-driven route still requires an exact match. Verify the result through the screen, for example the OTP slots or the next screen, instead of retrying the same fill.
478478
Android text entry is owned by `agent-device`: provider-native injection when available, then chunk-safe ASCII shell input. Do not switch to raw `adb`, clipboard, or paste as an agent fallback. If non-ASCII is unsupported in the current backend, report the tool/device gap.
479479
`click --button secondary` is the desktop context-menu flow on macOS.
480480
`click --button middle` returns an unsupported-operation error on macOS.

0 commit comments

Comments
 (0)