Repository navigation
fix(ios): match alert labels through the OS prompt strings of the preferred languages - #4006
Conversation
…ferred languages On a non-English iOS simulator, `alert accept`/`dismiss` refused system permission prompts such as Japanese 「許可しない」 with ALERT_BUTTON_NOT_FOUND, because the runner only recognized English labels since callstack#3715. The runner now reads the OS's own notification, privacy (including App Tracking Transparency), and location prompt strings once, pairs each English value with the same key in every preferred language, and matches a localized label through the English labels it translates. Matching stays exact: a source must be a whole button label, a translation that reads as an English label keeps its English meaning, and one claimed by both actions stays unknown (callstack#3627). Unreadable tables leave the English vocabulary in place. Limrun iOS stays English-only because its tree capture cannot read the device's string tables.
|
@kazutoyo is attempting to deploy a commit to the Callstack Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
1 issue found across 8 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/UnitTests/RunnerTests+AlertLabelVocabularyTests.swift">
<violation number="1" location="apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/UnitTests/RunnerTests+AlertLabelVocabularyTests.swift:53">
P3: No test covers the unreadable-table fallback. Add a case that makes `fromSystemStrings` see a missing table and asserts English-only matching. The all-tables-or-none rule also needs coverage.</violation>
</file>
Reply to a comment to ask cubic a question or push back. It learns from your replies.
View guided diff | Re-trigger cubic
| } | ||
| #endif | ||
|
|
||
| #if AGENT_DEVICE_RUNNER_UNIT_TESTS && os(iOS) && targetEnvironment(simulator) |
There was a problem hiding this comment.
P3: No test covers the unreadable-table fallback. Add a case that makes fromSystemStrings see a missing table and asserts English-only matching. The all-tables-or-none rule also needs coverage.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/UnitTests/RunnerTests+AlertLabelVocabularyTests.swift, line 53:
<comment>No test covers the unreadable-table fallback. Add a case that makes `fromSystemStrings` see a missing table and asserts English-only matching. The all-tables-or-none rule also needs coverage.</comment>
<file context>
@@ -0,0 +1,83 @@
+}
+#endif
+
+#if AGENT_DEVICE_RUNNER_UNIT_TESTS && os(iOS) && targetEnvironment(simulator)
+extension RunnerTests {
+ /// The OS's own strings supply the translations: a Japanese device words the notification,
</file context>
|
The code looks good at f6cfbb2, and I found no blocking problems. Not blocking, and fine to take or leave: the alert vocabulary reads three private-framework The open inline thread on the missing fallback test still applies as a low-priority note: #4006 (comment) The only check that did not pass is Vercel. Its bot comment says a Callstack team member must authorize the deployment for a fork, so this looks unrelated to the change. No runner, daemon, or unit CI ran on this fork PR. There are no conflicts. Before merge, a maintainer needs to approve the fork workflow run so the runner and unit jobs run, and authorize or ignore the Vercel preview. |
* origin/main: (76 commits) fix(open): refuse --launch-console on a provider-owned device before the relaunch close (#3938) fix(test-app): keep the inert surface control above the settings fold (#3993) fix(fill): redact the read-back of a sensitive fill (#4014) fix(apple): read the runner cache toolchain key from Xcode's own files (#3995) docs: point stable test suites to e2e (#4010) docs(mutation): state the file-name rule that marks test support code (#4011) refactor(kernel): read the Action Button leaf from isHandheldAppleDevice (#3988) fix(ios): match alert labels through the OS prompt strings of the preferred languages (#4006) fix(mutation): measure each kernel against the tests that import it (#3994) fix(webdriver): avoid unused pre-tap focus geometry reads (#3997) refactor(apple): share coordinate drag execution (#4003) fix(apple): type a text-entry-trait element as a text input in the simulator AX tree (#4008) refactor(contracts): own the unsupported-interactor stub both platforms duplicated (#4002) refactor: reuse canonical device identity projections (#3996) refactor(apple): share simulator status-bar diagnostics (#3998) refactor(runtime): share host command runner construction (#3999) refactor(android): centralize session error encoding (#4000) chore: mark 0.21.33 as released chore(gates): detect new native duplication with jscpd (#3980) fix(android): publish the Compose role on its clickable parent instead of a fake child (#3983) ...
* base-3865: (76 commits) fix(open): refuse --launch-console on a provider-owned device before the relaunch close (callstack#3938) fix(test-app): keep the inert surface control above the settings fold (callstack#3993) fix(fill): redact the read-back of a sensitive fill (callstack#4014) fix(apple): read the runner cache toolchain key from Xcode's own files (callstack#3995) docs: point stable test suites to e2e (callstack#4010) docs(mutation): state the file-name rule that marks test support code (callstack#4011) refactor(kernel): read the Action Button leaf from isHandheldAppleDevice (callstack#3988) fix(ios): match alert labels through the OS prompt strings of the preferred languages (callstack#4006) fix(mutation): measure each kernel against the tests that import it (callstack#3994) fix(webdriver): avoid unused pre-tap focus geometry reads (callstack#3997) refactor(apple): share coordinate drag execution (callstack#4003) fix(apple): type a text-entry-trait element as a text input in the simulator AX tree (callstack#4008) refactor(contracts): own the unsupported-interactor stub both platforms duplicated (callstack#4002) refactor: reuse canonical device identity projections (callstack#3996) refactor(apple): share simulator status-bar diagnostics (callstack#3998) refactor(runtime): share host command runner construction (callstack#3999) refactor(android): centralize session error encoding (callstack#4000) chore: mark 0.21.33 as released chore(gates): detect new native duplication with jscpd (callstack#3980) fix(android): publish the Compose role on its clickable parent instead of a fake child (callstack#3983) ...
… device On a physical iOS device, `alert accept`/`dismiss` refused a Chinese permission prompt with ALERT_BUTTON_NOT_FOUND, because the label vocabulary is only the OS prompt strings of a simulated OS (callstack#4006): a device's runtime keeps its framework string files from the runner process, so the non-simulator build compiled `system` as the English vocabulary. The device build now carries a built-in table of the system prompts' Simplified Chinese wording instead: the notification, App Tracking Transparency, and location prompts' buttons, the general-purpose 好/取消 pair, and the launch confirmation's 打开. Each entry pairs an English button label with its localized wording, so the localized label ranks exactly like the English original — 仅在使用期间允许 outranks 仅本次允许. The callstack#3627 guards hold unchanged: a source must be a whole button label, and a translation both actions claim stays unknown. English resolution is untouched, and the simulator keeps reading the OS strings for every preferred language. The table grows only with wording a device really shows, so it starts at Simplified Chinese and other languages stay unknown until device evidence names them. Co-Authored-By: Claude Code <noreply@anthropic.com>
… device (#4859) * fix(ios): recognize the system prompts' Chinese wording on a physical device On a physical iOS device, `alert accept`/`dismiss` refused a Chinese permission prompt with ALERT_BUTTON_NOT_FOUND, because the label vocabulary is only the OS prompt strings of a simulated OS (#4006): a device's runtime keeps its framework string files from the runner process, so the non-simulator build compiled `system` as the English vocabulary. The device build now carries a built-in table of the system prompts' Simplified Chinese wording instead: the notification, App Tracking Transparency, and location prompts' buttons, the general-purpose 好/取消 pair, and the launch confirmation's 打开. Each entry pairs an English button label with its localized wording, so the localized label ranks exactly like the English original — 仅在使用期间允许 outranks 仅本次允许. The #3627 guards hold unchanged: a source must be a whole button label, and a translation both actions claim stays unknown. English resolution is untouched, and the simulator keeps reading the OS strings for every preferred language. The table grows only with wording a device really shows, so it starts at Simplified Chinese and other languages stay unknown until device evidence names them. Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(ios): shed the alert search keyword the description now carries The device-coverage sentence puts the word "system" in the alert description, so the "dialog system" search hint no longer adds a word the text lacks; `command-tools-loading-meta`'s hint contract fails on the repeat. "system" stays searchable through the description itself, so the hint keeps "dialog" only. Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(ios): pin the device table's zh_CN rows to the pairs iOS ships The three hand-typed rows drifted from Apple's zh_CN wording (使用App时允许, 允许一次, 要求App不追踪): on a zh-Hans device the location accept and the ATT dismiss matched no row and answered ALERT_BUTTON_NOT_FOUND. The rows now equal the OS strings, and a simulator-lane test pins every deviceTranslations row to a pair in fromSystemStrings(["zh-Hans"]) so the table cannot drift from the OS wording again; the vocabulary keeps the handed-in rows for it. * fix(ios): carry both zh_CN wordings of the ATT decline the shipped iOS versions show A zh-Hans iPhone 12 Pro Max on iOS 18.1 words the ATT decline 要求App不跟踪; the iOS 26.5-27.x zh_CN string tables the earlier simulator check pinned ship 要求App不追踪. The table carried only the newer wording, so alert dismiss on the device answered ALERT_BUTTON_NOT_FOUND having tapped nothing. The table now carries both rows, the zh-Hans pairs test keeps asserting every row equals a pair this lane's OS ships except the cross-version wording it pins by presence, and the device evidence doc records the three prompts' verbatim alert get labels with the accept/dismiss outcomes and authorization read-backs. A probe read on the device also answers the review's question: the OS string tables are present on device but their localizations are not readable, so widening the OS-string read to os(iOS) cannot replace the table. --------- Co-authored-by: Claude Code <noreply@anthropic.com> Co-authored-by: strzhao <strzhao@users.noreply.github.com>








Summary
Since #3715, the iOS XCUITest runner taps only listed English labels. On a Japanese simulator,
alert dismisson the notification prompt許可しない/許可fails withALERT_BUTTON_NOT_FOUND.The runner now reads the OS's own notification, privacy (including ATT), and location prompt strings once at startup. It pairs each English value with the same key in every preferred language. A localized label then matches through the English labels it translates. These are Apple's own translations, not guesses (#3627):
#3922's localized launch confirmation (
Ouvrir) stays uncovered: its strings are not read.8 files. Scope: iOS simulators; physical iOS, tvOS, and visionOS keep English labels. Limrun iOS stays English-only: tree capture cannot read device string tables.
Validation
Head
f6cfbb215(baseb396bd009), tree-identical to checkedd28809ed8.check:affected --run --head d28809ed8(run-N8cSYR,exactCommit=true): all pass excepthelp-conformance-sample-outputs(4, identical on base) and 4 host-load timeouts (7/7 on rerun).authorizedWhenInUse;auth_value=0;dispatched: no.Risks: the string-table locations are undocumented and may move. If any table fails to read, matching degrades to English-only refusal and logs
AGENT_DEVICE_RUNNER_ALERT_VOCABULARY_UNAVAILABLE.