Skip to content

refactor: colocate native platform sources under android/, apple/, linux/#1273

Merged
thymikee merged 1 commit into
mainfrom
refactor/colocate-native-platform-folders
Jul 15, 2026
Merged

refactor: colocate native platform sources under android/, apple/, linux/#1273
thymikee merged 1 commit into
mainfrom
refactor/colocate-native-platform-folders

Conversation

@thymikee

@thymikee thymikee commented Jul 15, 2026

Copy link
Copy Markdown
Member

What

Groups the scattered native helper/runner projects into per-platform top-level folders and drops the now-redundant platform prefix from each sub-folder:

Before (repo root) After
android-ime-helper/ android/ime-helper/
android-multitouch-helper/ android/multitouch-helper/
android-snapshot-helper/ android/snapshot-helper/
apple-runner/ apple/runner/
macos-helper/ apple/macos-helper/ (keeps its qualifier — distinct from the runner)
src/platforms/linux/atspi-dump.py linux/atspi-dump.py

Cache safety (no user cache invalidation on upgrade)

Only repo source paths move; the identity surfaces that feed cache keys stay frozen, so upgrading users don't pay a rebuild:

  • The Apple runner derived-cache key hashes each source file's path relative to AgentDeviceRunner and excludes packageVersion (runner-cache-metadata.ts) — invariant to any parent-folder rename. The macOS helper fingerprint is likewise relative to its package root.
  • Frozen: the ~/.agent-device/apple-runner and ~/.agent-device/macos-helper cache/lease namespaces, the agent-device-android-*-helper APK/manifest names + android-*-helper-v1 wire protocols, the AgentDeviceRunner Xcode project, the apple-runner-platform/apple-runner-options TS modules + 'macos-helper' snapshot-backend enum, and the prepare ios-runner CLI subcommand.

The packaged Apple runner source now lands at dist/apple/runner/… to mirror the source tree.

References updated

Build/package scripts, CI (ci.yml swift-lint, linux.yml atspi-dump, setup-apple-replay cache hashFiles), package.json (files + scripts), .gitignore/.worktreeinclude/.gitattributes/.fallowrc.json, runtime path resolvers (apple runner source, macOS helper package root, android helper dist, atspi-dump.py), check-affected ownership, and all test fixtures.

Verification

  • pnpm typecheck + oxlint clean; 262 unit tests + 31 check-affected tests pass
  • package-apple-runner-source.mjs run end-to-end → emits dist/apple/runner/… from the new source
  • ✅ Comprehensive sweep: no stale paths remain; every frozen identity surface confirmed intact
  • Adversarial code review (high effort) run on the branch — found 3 real defects from the added nesting level (a gated XCUITest fixture path + two moved-doc relative links walking to the repo root); all fixed in commit 3 and verified against real targets

Note

The stray ios-runner/ directory at the repo root is untracked leftover from the earlier ios-runner → apple-runner rename (#996) and is not part of this PR. Safe to delete locally: rm -rf ios-runner.

@thymikee thymikee force-pushed the refactor/colocate-native-platform-folders branch from eac1370 to b2e1cdf Compare July 15, 2026 18:11
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 1.7 MB 1.7 MB -70 B
JS gzip 557.5 kB 557.5 kB +6 B
npm tarball 673.0 kB 673.0 kB +14 B
npm unpacked 2.4 MB 2.4 MB -66 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 27.8 ms 27.5 ms -0.3 ms
CLI --help 59.4 ms 58.9 ms -0.4 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/internal/daemon.js +4 B +9 B
dist/src/runner-client.js +4 B +6 B
dist/src/record-trace-recording.js 0 B +3 B
dist/src/agent-device-client.js 0 B +2 B

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-15 19:48 UTC

@thymikee

Copy link
Copy Markdown
Member Author

CI blocker at head b2e1cdf7fa58cfc6fa7990a61e93000eaabaac91: Lint & Format fails because src/platforms/apple/core/runner/runner-source.ts is not formatted. oxlint itself is clean; run the repository formatter and push the resulting file before readiness review.

thymikee added a commit that referenced this pull request Jul 15, 2026
…t double-ship

`dist` is shipped wholesale and the packaged runner output moved from
dist/apple-runner to dist/apple/runner. package-apple-runner-source.mjs cleaned
only the new path, so a stale tree from an older build/checkout — or the
bundle-size job, which packages the base then the PR into one shared dist —
leaves both trees in the tarball (the ~421 KB unpacked regression on #1273).

Clean the legacy locations on every packaging run and add a regression test that
seeds a stale dist/apple-runner and asserts only dist/apple/runner survives.
…nux/

Move the scattered root-level native projects into per-platform folders and drop
the now-redundant platform prefix:

- android-ime-helper/        -> android/ime-helper/
- android-multitouch-helper/ -> android/multitouch-helper/
- android-snapshot-helper/   -> android/snapshot-helper/
- apple-runner/              -> apple/runner/
- macos-helper/              -> apple/macos-helper/
- src/platforms/linux/atspi-dump.py -> linux/atspi-dump.py

Only repo source paths move. Identity surfaces stay frozen so no user's runner
cache is invalidated on upgrade: the derived-cache key hashes source paths
relative to AgentDeviceRunner and excludes packageVersion, and the
~/.agent-device/{apple-runner,macos-helper} namespaces, the
agent-device-android-*-helper artifact/manifest/protocol names, the
AgentDeviceRunner Xcode project, and the `prepare ios-runner` CLI command are
unchanged. Updates build/package scripts, CI, package.json files+scripts,
ignore/attr/fallow configs, runtime path resolvers, and test fixtures.

Also: re-base repo-root-relative refs inside the moved apple/runner for the
added nesting level (gated XCUITest fixture walk + two doc links), and clean the
legacy dist/apple-runner packaged output so the relocated runner can't
double-ship into the wholesale-included dist (with a regression test).
@thymikee thymikee force-pushed the refactor/colocate-native-platform-folders branch from 10f080e to 638037a Compare July 15, 2026 19:32
@thymikee thymikee merged commit e58cbcd into main Jul 15, 2026
23 checks passed
@thymikee thymikee deleted the refactor/colocate-native-platform-folders branch July 15, 2026 19:47
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