Skip to content

refactor(ios): converge Limrun snapshots through engine - #2222

Open
thymikee wants to merge 4 commits into
mainfrom
codex/limrun-2195
Open

refactor(ios): converge Limrun snapshots through engine#2222
thymikee wants to merge 4 commits into
mainfrom
codex/limrun-2195

Conversation

@thymikee

@thymikee thymikee commented Sep 1, 2026

Copy link
Copy Markdown
Member

Summary

Converges Limrun iOS snapshots on the shared iOS snapshot engine from #2191. The Limrun adapter now acquires the full vendor tree once, derives current viewport evidence from the tree root with a deviceInfo fallback, preserves Limrun provenance, and lets the engine own raw, regular, depth, scope, and interactive projection. Provider options are no longer silently ignored or applied after the wire boundary.

Regular Limrun snapshots disclose that hittability evidence is unavailable and never infer actionability from enabled rectangles. Truncation is also disclosed as an unavailable vendor fact instead of being reported as false. A missing or invalid viewport fails presentation with the engine reason and a --raw remediation hint.

The engine-presented result carries an internal, non-serialized marker through the provider-to-daemon boundary, so the daemon does not present Limrun results a second time. Limrun raw traversal is declared incomplete because the SDK tree call has no depth contract; the shared engine owns that projection. Appium/WebDriver remain separate provider adapters and are untouched.

Refs #2195

Validation

  • Fresh worktree setup completed with pnpm install --frozen-lockfile && pnpm build.
  • Final static affected checks passed: format, lint, typecheck, layering, fallow, and build.
  • pnpm check:affected --run selected 711 related test files. Its default four-worker run reached 5,446/5,447 tests before the existing hermetic process-signal guard rejected a cross-project pkill; the same selection passed with one worker: 711 files / 5,447 tests.
  • Limrun adapter coverage includes shared-engine raw/regular/depth/scope projection, tree-derived viewport precedence, typed missing-viewport remediation, unavailable truncation/hittability disclosure, and no false actionability from enabled rectangles.
  • CI substantive lanes are green: native runner, coverage, package, integration, Linux, Android, macOS, CodeQL, compatibility, analysis, bundle size, and lint/format. Repo Guards is red on the current main baseline because scripts/layering/model.ts still classifies the removed utils zone after refactor: move utilities to owning modules #2225; the current main workflow fails the same guard independently. The iOS smoke job reached its fixture-backed simulator E2E step but has remained in progress for about two hours, versus about three minutes on the latest successful run, with no live GitHub log available.

Tradeoffs and residual risk

The size workflow reported +12.4 kB npm-unpacked and +3.7 kB gzip, primarily from the shared iOS engine chunk. This growth is required to route Limrun through the same engine contract; duplicating engine policy in the provider would violate the owning-interface design. The engine is loaded lazily so the Limrun package import stays within its 29-module eager-closure budget.

No Appium, WebDriver, or native implementation files changed. Live Limrun device verification was not available in this workspace; required evidence is pnpm ad snapshot -i --session <configured Limrun iOS session> against a live Limrun iOS instance. The required local adversarial audit was attempted against the exact final head but produced no verdict after roughly seven minutes and was stopped as stalled; it is not represented as a clean review. This PR is published and ready for review, but not merge-ready while the base guard, stalled iOS job, audit, and live-provider evidence remain unresolved. This task will not merge it.

Touched files: 15.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 2.56 MB 2.57 MB +12.1 kB
JS gzip 860.9 kB 864.6 kB +3.7 kB
npm tarball 982.9 kB 986.2 kB +3.3 kB
npm unpacked 3.40 MB 3.41 MB +12.4 kB

npm unpacked components

Component Base Current Diff
JS / dist source 2.72 MB 2.73 MB +12.4 kB
Apple runner source/project 544.4 kB 544.4 kB 0 B
Apple snapshot presentation source 33.8 kB 33.8 kB 0 B
macOS helper source 54.8 kB 54.8 kB 0 B
Android helper artifacts 0 B 0 B 0 B
Other package files 46.0 kB 46.0 kB 0 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 21.0 ms 25.9 ms +4.9 ms
CLI --help 53.5 ms 61.6 ms +8.1 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/ios-snapshot-engine.js +31.8 kB +9.4 kB
dist/src/session2.js 0 B -40 B
dist/src/internal/daemon.js 0 B -29 B
dist/src/device-claim-conflict.js 0 B -28 B
dist/src/runner-disposal.js 0 B -17 B

Top changed packed files

Packed file Base Current Diff
dist/src/ios-snapshot-engine.js 22.6 kB 31.8 kB +9.2 kB
dist/src/snapshot4.js 0 B 6.3 kB +6.3 kB
dist/src/ios-snapshot-adapter.js 0 B 2.7 kB +2.7 kB
dist/src/snapshot2.js 5.0 kB 2.6 kB -2.5 kB
dist/src/snapshot.js 2.6 kB 1.2 kB -1.4 kB
dist/src/snapshot3.js 6.3 kB 5.0 kB -1.3 kB
dist/src/device-session.js 10.8 kB 9.7 kB -1.1 kB
dist/src/sdk-contracts.d.ts 18.3 kB 18.5 kB +182 B
dist/src/sdk-contracts.js 11.7 kB 11.8 kB +71 B
dist/src/sdk-selectors.d.ts 33.0 kB 33.1 kB +68 B

@thymikee

thymikee commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

Reviewed exact head b5c457b99b0c00098bdb6915c9f47c1227bf2850: BLOCKED.

  1. The Limrun adapter already presents through the shared iOS engine, but daemon buildSnapshotState classifies limrun-ios-tree as acquired and applies presentIosInteractiveSnapshot again for interactive snapshots. Current fixtures happen to be idempotent; the production owner is still duplicated. Carry an internal, non-serialized engine-presented result marker through the shared result/daemon boundary, strip it from public output, and add a provider-runtime → daemon regression. Do not add a Limrun-specific skip branch.

  2. limrun-ios-tree declares raw traversal narrowing complete, yet elementTree() is always called without depth and the locked SDK exposes no depth parameter. Mark this capability incomplete so the engine owns raw-depth projection; replace the test that currently pins the false narrowing plan.

Residual: truncated: false is asserted without a vendor completeness signal. Attach vendor evidence that the returned tree is uncapped or disclose a typed limitation; absence of an SDK field is not proof of completeness. Focused tests pass, but live Limrun evidence is unavailable and iOS Smoke was still pending.

@thymikee

thymikee commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

Re-reviewed exact head 73d84bf0a1d6b33c3f8529bd0d18f73a74cc3c0d: still BLOCKED. The new delta improves viewport extraction and missing-viewport disclosure only. It does not stop the daemon’s second interactive presentation after Limrun already published through the engine; it does not change Limrun’s false rawTraversal: complete claim despite elementTree() accepting no depth; and it still hard-codes truncated: false without vendor completeness evidence or typed limitation disclosure. The prior required shared engine-presented carrier + provider-runtime/daemon regression, truthful incomplete narrowing capability, and truncation evidence/disclosure all remain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant