Skip to content

refactor(ios): integrate runner with snapshot engine - #2214

Merged
thymikee merged 13 commits into
mainfrom
codex/2191/runner-integration
Sep 1, 2026
Merged

refactor(ios): integrate runner with snapshot engine#2214
thymikee merged 13 commits into
mainfrom
codex/2191/runner-integration

Conversation

@thymikee

@thymikee thymikee commented Sep 1, 2026

Copy link
Copy Markdown
Member

Summary

Post-merge remediation for #2191, based directly on main after #2206, #2211, #2213, and #2216 merged.

  • Exact base: 544a80496545fc77c24dd8df0366fae73e18625a
  • Exact head: daf419a1c4a05a35c1a82f5d09423eeb4e2954a2
  • A/B/C are already in main; this PR keeps the surviving D slice and validated post-merge remediations on the existing refactor(ios): integrate runner with snapshot engine #2214 branch.
  • Adapts the current XCTest runner response into stage: 'presented' input for the iOS snapshot engine.
  • Carries the optional unscoped qualityPayload across the runner boundary for validation and classification while publishing only the primary payload.
  • Routes every nonfatal, nonempty iOS runner payload through the engine. A sparse payload without viewport evidence fails with typed missing-viewport and publishes no actionable nodes; there is no producer-specific bypass or fallback.
  • Preserves source acquisition indexes through regular/raw scope, depth, and reindex projections so published mappings retain acquisition lineage.
  • Makes the shared Apple presentation package a required, cache-fingerprinted, platform-parity-checked source boundary; keeps test-only validation APIs internal; preserves malformed-parent behavior; and keeps scope policy in UnitTests.
  • Keeps macOS app sessions on their existing XCTest tree path, preserves producer selection, fallback, timing, warnings, empty/fatal handling, and physical-device behavior.

The diff changes no public CLI/RPC surface, routing, or producer-selection behavior. This PR remains open; no merge was performed.

Validation

  • Exact-head GitHub checks for daf419a1c4a05a35c1a82f5d09423eeb4e2954a2: Bundle Size is green; Lint & Format, Ownership and context budgets, Compatibility & Provenance, Resolve native fingerprint, command-docs-gate, and deploy preview pass; the remaining release, smoke, coverage, integration, repo-guard, and typecheck/package jobs are still running.

  • pnpm typecheck, pnpm lint, pnpm format:check, pnpm build, the focused 28-test runner/engine set, and the related package/provider suites pass.

  • pnpm check:affected --run completed all checks before its capped related-test stage reported one host-sensitive failure: the unchanged hermetic signal guard rejected unrelated pkill cleanup. The owning session-open file passes in isolation 7/7; the provider iOS lifecycle suite also passed 3/3 in the affected run.

  • Exact-current-head iOS Simulator replay passed 1/1 in 8.49s on BC54AC11-CD86-4C10-8C4E-5101C773FFEB:

    node --experimental-strip-types src/bin.ts test test/integration/replays/ios/simulator/01-settings.ad --udid BC54AC11-CD86-4C10-8C4E-5101C773FFEB --retries 0 --artifacts-dir /private/tmp/agent-device-2191-ios-local/artifacts-direct-runner --report-junit /private/tmp/agent-device-2191-ios-local/replay-direct-runner.junit.xml
    

Size and smaller-design decision

The exact-head Size workflow is green. It now measures +9.1 kB JS raw, +3.3 kB JS gzip, +3.3 kB npm tarball, and +10.1 kB npm unpacked, versus the previous +18.6 kB raw / +5.8 kB gzip result. The principal deltas are:

  • dist/src/ios-snapshot-engine.js: +22.6 kB raw, offset by dist/src/snapshot-state.js -16.0 kB as ownership moves to the engine; the Apple adapter now imports the runner-only presenter, so the acquired-snapshot path is not pulled into this chunk;
  • dist/src/interactor.js: +2.0 kB raw / +613 B gzip for the runner boundary;
  • Apple runner source/project: +1.0 kB; shared Apple snapshot-presentation source: -142 B;
  • package metadata and cache/source boundary checks remain below the runtime surface.

A smaller producer-specific sparse bypass or duplicate parser was rejected: it would recreate a second presentation owner, let an already-presented sparse tree evade engine validation, and lose the shared viewport/descendant invariant. The Apple runner now reuses the existing runner presenter directly, while the required semantic compaction and final-output validation remain in the shared engine.

Docs

ADR 0004 records the acquisition/presentation boundary, engine ownership, and primary-versus-quality payload vocabulary. Fixture provenance notes document intentional geometry normalization. No skills changed.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 2.55 MB 2.56 MB +9.1 kB
JS gzip 857.6 kB 860.9 kB +3.3 kB
npm tarball 979.6 kB 982.9 kB +3.3 kB
npm unpacked 3.39 MB 3.40 MB +10.1 kB

npm unpacked components

Component Base Current Diff
JS / dist source 2.71 MB 2.72 MB +9.1 kB
Apple runner source/project 543.4 kB 544.4 kB +1.0 kB
Apple snapshot presentation source 33.9 kB 33.8 kB -142 B
macOS helper source 54.8 kB 54.8 kB 0 B
Android helper artifacts 0 B 0 B 0 B
Other package files 45.9 kB 46.0 kB +123 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 31.0 ms 31.5 ms +0.5 ms
CLI --help 79.8 ms 80.5 ms +0.6 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/interactor.js +2.0 kB +613 B
dist/src/app-inventory-contract.js +30 B +6 B
dist/src/session2.js -7 B +3 B

Top changed packed files

Packed file Base Current Diff
dist/src/ios-snapshot-engine.js 0 B 22.6 kB +22.6 kB
dist/src/snapshot-state.js 21.5 kB 5.5 kB -16.0 kB
dist/src/interactor.js 29.9 kB 31.9 kB +2.0 kB
dist/src/rect-center.js 0 B 712 B +712 B
dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift 9.1 kB 9.8 kB +660 B
dist/src/android-input-ownership.js 5.2 kB 4.6 kB -621 B
dist/src/runner-cache-metadata.js 9.4 kB 9.9 kB +473 B
dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotCapturePlan.swift 31.1 kB 31.5 kB +430 B
package.json 19.5 kB 19.6 kB +123 B
dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotPresentation.swift 4.7 kB 4.6 kB -82 B
@thymikee
thymikee force-pushed the codex/2191/ts-conformance branch from 00d7978 to 623a136 Compare September 1, 2026 11:10
@thymikee

thymikee commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

BLOCKED at exact head 479edda97251a8968baea5f95d12b1daf7ded18e.

presentAppleRunnerSnapshot has a sparse/missing-viewport escape that returns raw runner nodes before publishIosSnapshot. Because the runner is then marked stage: 'presented', daemon assembly skips the old compactor, so a sparse payload can publish an unfolded actionable tree without engine validation. That violates #2191's one-engine boundary and typed missing-viewport requirement. Remove the producer-specific bypass: all nonfatal, nonempty iOS runner payloads must go through the engine and fail with its typed missing-viewport result when viewport evidence is unavailable. Add an adversarial sparse payload with no root rect plus a hittable child proving typed failure and no published nodes; do not add a fallback.

The adapter/quality-payload ownership otherwise looks sound. The +5.2 kB packed / +17.5 kB unpacked growth also needs itemized justification and a rejected-smaller-design rationale, and the PR still lacks recorded live iOS runner→engine Simulator evidence. Coverage is red and iOS Smoke is still in progress, so no readiness label.

@thymikee

thymikee commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

Branch blocker: the reviewed head 479edda97251a8968baea5f95d12b1daf7ded18e is unchanged, but its #2213 base moved to 623a13661b961d5417b8fac57c80faa37e94d391 after review and GitHub now reports the PR DIRTY. Restack/rebase this layer onto the new base, resolve the conflict, and rerun exact-head evidence before re-review. This does not supersede the existing sparse/missing-viewport code finding.

@thymikee
thymikee force-pushed the codex/2191/runner-integration branch from 479edda to 555e926 Compare September 1, 2026 12:13
@thymikee

thymikee commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

Re-reviewed exact head 555e92611e5589760c8f4bfb63a602a2715c51e7: the prior sparse/missing-viewport bypass is resolved. Every nonfatal, nonempty iOS runner payload now enters the engine; the adversarial sparse actionable-child regression proves typed missing-viewport failure with no published nodes, while macOS remains outside the iOS presenter. No new code finding. Still BLOCKED on readiness evidence: update the stale body from 479edda…, record live exact-head iOS Simulator runner→engine semantic-compaction commands/outcomes, and itemize the +5.5 kB tarball / +18.5 kB unpacked growth with why a materially smaller design was rejected. iOS Smoke is also still in progress.

@thymikee
thymikee force-pushed the codex/2191/runner-integration branch from 555e926 to c44b72c Compare September 1, 2026 12:40
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-01 16:36 UTC
@thymikee

thymikee commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

Re-reviewed exact head c44b72cf5c0ae66ff4d221d04f1e0b8d730f47e4: prior code and readiness-record findings are resolved. The sparse/viewport path remains correct; the body is current, itemizes growth and rejected smaller design, and records exact-head live Simulator replay. iOS/macOS Smoke, Release, Coverage, and all other checks are green. BLOCKED only by Android Smoke: the unrelated orientation scenario stalled with zero readable captures while waiting for landscape. This PR changes no Android route, so it looks like lane/device noise rather than a code regression, but rerun exact-head Android Smoke green before readiness.

An error occurred while trying to automatically change base from codex/2191/ts-conformance to codex/2191/ts-engine September 1, 2026 13:59
@thymikee
thymikee force-pushed the codex/2191/runner-integration branch from c44b72c to e554c11 Compare September 1, 2026 14:03
@thymikee
thymikee changed the base branch from codex/2191/ts-conformance to main September 1, 2026 14:03
@thymikee

thymikee commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

Re-reviewed restacked exact head e554c111de2a5760fcd79bf322e72ee3af2a7a2e on base a8ee397168163741093ce110413d68e4e754a3b0: all four D-layer commits are patch-identical to the previously reviewed c44b72… stack, so the sparse/viewport ownership fix and regressions remain clean. Still BLOCKED on exact-head readiness: the body still names base cbb3dae…, head c44b72…, and old validation/replay evidence, while GitHub currently reports no checks for e554c11…. Update the body to the current base/head, run exact-head CI (including size and device lanes), and record a current live Simulator runner→engine replay before readiness.

@thymikee

thymikee commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

Re-reviewed exact head 2542f67: no new code finding. The eight post-restack audit/remediation commits preserve the one-presenter boundary, source lineage, required/cache-fingerprinted shared source, and typed sparse/missing-viewport behavior without a shim or fallback. BLOCKED on current-head readiness: the body still names 009be5c and its replay/CI, while the actual head is 2542f67; the recorded Simulator runner→engine replay therefore predates the current cache/source-boundary changes, and the body’s +19.2 kB unpacked figure is stale versus the current Size report’s +19.6 kB. Update the body and record a current-head Simulator runner→engine outcome. Current static/coverage/integration checks are green, but iOS/Android Smoke and iOS Release remain in progress, so no readiness label.

@thymikee
thymikee force-pushed the codex/2191/runner-integration branch from 2542f67 to 153f97f Compare September 1, 2026 16:01
@thymikee

thymikee commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

Re-reviewed exact head daf419a1c4a05a35c1a82f5d09423eeb4e2954a2: READY for human review, no code finding. The prior stale-body/evidence blocker is resolved: the body names the current base/head and records a current-head Simulator runner→engine replay. The latest change routes the Apple adapter through presentIosRunnerSnapshot, reducing the acquired-path bundle pull while retaining the one-engine validation/compaction boundary, cursor-projected fold policy, and typed sparse/missing-viewport behavior; no fallback or bypass was reintroduced. Current Size evidence is itemized (+10.1 kB unpacked / +3.3 kB tarball) with a credible smaller-design decision. ready-for-human is appropriate. Exact-head native/coverage lanes remain in progress, so this is published/code-clean, not yet merge-ready.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Sep 1, 2026
@thymikee
thymikee merged commit 1826b2e into main Sep 1, 2026
21 of 22 checks passed
@thymikee
thymikee deleted the codex/2191/runner-integration branch September 1, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

1 participant