refactor(ios-runner): drop the runner's snapshot warning text; the verdict carries every disclosure

Merged
TH
2mo ago
+93-143

Summary

Stacked on https://github.com/callstack/agent-device/pull/2831.

The runner stops writing its own snapshot warning text. legacyQualityMessage and customActionCoverageWarnings are deleted, along with their Swift tests. The stamped payload now forwards the underlying payload.message unchanged; in practice that is nil. The daemon already renders every one of these disclosures from snapshotQuality, and it ignores message whenever a verdict is present. The tree backend pin, the capability declarations, and the conformance coverage are unchanged. The host fallback for verdict-less payloads (interactor.ts) stays, because the issue scopes injected-provider compatibility out.

Tests:

  • A new TS runtime test covers a healthy capture that has partial custom-action coverage and a collapsed leaf, with no backend message. The warnings array comes from the verdict alone.
  • The provider test checks that a runner capture with no message keeps the verdict facts and adds no warnings of its own.
  • The Swift test testStampedPayloadCarriesDisclosuresOnlyInTheVerdict replaces the deleted message test, including its slot in the ios.yml PR list (final chore(gates) commit).

Where the issue differs from the code: the helpers were also used by tests in RunnerTests+AXSnapshotFallback.swift and RunnerTests+SnapshotPresentationInvariantTests.swift. The fixture app has no collapsed container, so the live check used a local Safari page with an aria-label tab strip.

6 files, +93/−143. Closes #2802.

Validation

Rebased onto main at a913cb222. Signed macOS host lane: 240/240 at 5be256801. check:affected --run is green at the stack head 60e533284. The evidence below is from before the rebase.

Tested at 40e80cb54.

  • pnpm check:affected --run passed. It fails open to the full set because ios.yml changed; fallow was included.
  • pnpm check:xctest-selection passed.
  • The signed macOS runner built, and the host lane ran 238/238 tests with 0 failures, including the changed ones.
  • Live check on the iPhone 17 Pro simulator, with each runner freshly built from its own source. The legacy strings appear 2× in the before binary and 0× in the after binary. The snapshot --json warnings arrays are byte-identical (cmp) for all four scenarios; they are listed below.
  • The forced-backend conformance passed for both tree and private-ax, on the before runner and on the after runner. It ran as a standalone driver because the full smoke E2E stops earlier, at snapshotDepthFrontier: the host Simulator AX bridge is circuit-disabled here, which is unrelated to this change.
  • On main, the iOS lane is already red on testAbandonedTreeCapture… and testAlertCannotProve….
  • Review: the Agent tool was unavailable, so I ran the code-review skill (high). 8 of its 9 findings are in lower stack layers. The one in this layer, "remove the host message fallback", was rejected because the issue says not to widen into injected-provider compatibility.
Before/after warnings arrays
  • Healthy capture with collapsed tabs (Safari page): before = after = ["Simulator AX snapshot unavailable (circuit-disabled); used XCTest for this app generation.","@e14 [Button] merges many labels into a single accessibility element. The app likely marks a container as accessible, …"], verdict {"state":"healthy","backend":"tree","collapsedLeafIndexes":[13]}
  • Capture limited by custom actions (fixture Catalog, --actions): before = after = ["Custom actions were read for 12 of 117 merged elements, on-screen ones first; the remaining 105 were not read, …"]
  • Recovered capture (deep tree 200x0, --actions, recovered/requested-backend): before = after = null
  • Recovered capture (conformance private-ax, recovered/deferred): before = after = ["Detected an overly complex or slow accessibility tree. Fell back to the private-ax snapshot backend. …"]
  • Capped tree (deep tree 200x0): before = after = ["This capture was cut at a backend limit, …"]

🤖 Generated with Claude Code