Skip to content

refactor: move Apple platform family into package - #2118

Merged
thymikee merged 3 commits into
mainfrom
refactor/platform-apple-wave
Aug 28, 2026
Merged

refactor: move Apple platform family into package#2118
thymikee merged 3 commits into
mainfrom
refactor/platform-apple-wave

Conversation

@thymikee

@thymikee thymikee commented Aug 28, 2026

Copy link
Copy Markdown
Member

Summary

Move the complete Apple family, including core and colocated tests, behind @agent-device/platform-apple's exports map for W4 of #2082.

  • Rebased onto current main after W5 (refactor: move Android family behind package exports #2117) and W6 (refactor: move W6 platform families behind package facades #2116), preserving W6's injected snapshot-loader seam and focused host-file port.
  • Deleted the old src/platforms/apple production tree with no compatibility shim or fallback, and routed production consumers through named Apple facades.
  • Removed duplicate host-kit environment/filesystem authority and the stale Apple internal app barrel/install path; deployment runtime remains the owning install route.
  • Preserved synchronous helper contracts, kept the package root lazy, and pinned measured eager closures.
  • Consolidated the platform-family policy into the shared data-driven declaration.
  • Completed an adversarial review of routes, exports/package closure, layering/cold-start policy, superseded paths, hidden behavior, test validity, and scope.

Refs #2082

Validation

  • pnpm install --frozen-lockfile
  • pnpm format and format check
  • pnpm check:quick
  • Focused Apple/runtime tests: 23 files / 143 tests, plus 15 affected-route files / 145 tests
  • Eager-closure gate: 395/395 passed after observing the missing/zero-facade-budget shape red
  • pnpm check:layering: 161 tests passed; the named-facade violation was observed red against the planted root-import shape, then green after restoration
  • Changed-since production export audit: no issues in changed scope; full-repository output retains unrelated baseline findings
  • pnpm check:fallow --base origin/main: passed changed scope
  • pnpm check:affected --run: 56 checks selected; all runnable checks passed, including 562 Vitest files / 4,535 tests, package, typecheck, layering, integration-node, macOS coverage, replay/wire compatibility, dependency, fixture, documentation, and mutation-model checks

Local proof covers TypeScript/unit/integration, packaging shape, layering, exports closure, and structural gates. GitHub remains authoritative for exact-head native/device/provider/full-coverage lanes; those lanes are not substituted by local proof. The local environment uses pnpm 11.21.0 while the repository pins 11.17.0.

Adversarial review residual risk: native/device/provider/full-coverage evidence depends on current-head GitHub checks and cannot be replaced by this host's local tests.

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 2.51 MB 2.51 MB +1.9 kB
JS gzip 837.2 kB 839.3 kB +2.2 kB
npm tarball 964.1 kB 966.7 kB +2.6 kB
npm unpacked 3.34 MB 3.35 MB +1.9 kB

npm unpacked components

Component Base Current Diff
JS / dist source 2.66 MB 2.66 MB +1.9 kB
Apple runner source/project 581.1 kB 581.1 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 45.6 kB 45.6 kB 0 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 31.0 ms 30.7 ms -0.3 ms
CLI --help 85.5 ms 82.4 ms -3.1 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/runner-disposal.js +45.7 kB +14.7 kB
dist/src/src7.js +47.5 kB +14.1 kB
dist/src/runner-client.js -44.6 kB -13.0 kB
dist/src/interactor.js +29.9 kB +9.7 kB
dist/src/platform-runtime-operation-host.js -14 B -13 B

Top changed packed files

Packed file Base Current Diff
dist/src/src6.js 47.5 kB 1.6 kB -45.9 kB
dist/src/runner-disposal.js 0 B 45.7 kB +45.7 kB
dist/src/runner-client.js 86.3 kB 41.7 kB -44.6 kB
dist/src/perf-facade.js 0 B 27.3 kB +27.3 kB
dist/src/interactor.js 2.7 kB 29.9 kB +27.2 kB
dist/src/src9.js 0 B 23.2 kB +23.2 kB
dist/src/apps.js 22.8 kB 0 B -22.8 kB
dist/src/src7.js 25.4 kB 47.5 kB +22.1 kB
dist/src/perf2.js 20.9 kB 0 B -20.9 kB
dist/src/debug-symbols-facade.js 0 B 14.3 kB +14.3 kB

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-28 13:25 UTC

@thymikee

Copy link
Copy Markdown
Member Author

Reviewed 3ce855d as W4 within the #2082 W4-W6 family. CI, including Apple smokes, is green, but the head is not ready:

Family landing order: #2116 first, #2117 second, #2118 rebased last against both; then validate the combined tip.

@thymikee

Copy link
Copy Markdown
Member Author

Current head 3ce855d is unchanged, but main has advanced and GitHub now reports CONFLICTING with broad Apple modify/delete conflicts. Prior findings remain: preserve #2116's injected desktop snapshot seam, replace raw host-kit fs authority with the focused host-file port, preserve sync contracts through smaller domain/mechanics facades, and consolidate the Apple-specific policy exceptions. Rebase only after #2116 then #2117, resolve the broad move/delete cells deliberately, and rerun combined-tip gates. Not ready.

@thymikee
thymikee force-pushed the refactor/platform-apple-wave branch from 02d7e1a to 8179540 Compare August 28, 2026 10:35
@thymikee

Copy link
Copy Markdown
Member Author

Addressed in 81795400ba:

  • Restored synchronous helper contracts by removing async root wrappers and adding named app-resolution, interactions, install-artifact, perf, physical-device, runner-owner, simctl, simulator, and tool-provider facades.
  • Repointed production consumers and mocks, and added package-export assertions for concrete synchronous behavior.
  • Measured and pinned the new eager closures after observing the missing-row/zero-budget gate red.
  • Kept Fallow's dynamic-import suppressions exact and removed the stale root export.

I also rebased onto current main to resolve the reported conflict. The snapshot loader injection and focused host-file findings remain intentionally pending family sequencing: #2116 owns those seams, #2117 follows it, and #2118 must rebase again after both land. The generalized Apple consumer-policy consolidation is likewise pending its owning policy wave. I did not duplicate sibling work or claim merge-ready.

The final local pnpm check:affected --run passed all runnable checks (381 Vitest files, 3,066 tests). Native/device/full-coverage evidence remains GitHub-authoritative and is still running on the new head.

@thymikee

Copy link
Copy Markdown
Member Author

Re-reviewed exact head 8179540. The facade contract finding is fixed: synchronous subpath facades preserve sync behavior, representative tests execute them, root wrapper growth is reduced, and this head's CI is fully green. Still not ready: the branch predates merged W6/W5 and conflicts broadly with current main. Its snapshot dispatch still restores direct Apple/Linux imports instead of main's injected loaders; host-kit still exports raw fs.promises instead of main's focused host-file port; and Apple-specific retired/consumer policy exceptions duplicate main's generalized policy. Rebase onto c7f42cce, preserve those merged seams, resolve the 141 conflict cells deliberately, quantify the remaining +14.4 kB unpacked growth after rebase, then rerun combined-tip gates.

@thymikee
thymikee force-pushed the refactor/platform-apple-wave branch from 8179540 to a3c9d57 Compare August 28, 2026 12:52
@thymikee

Copy link
Copy Markdown
Member Author

Rebased and published at a3c9d57f24 after W5 (#2117) and W6 (#2116) landed. The four prior findings are addressed:

  • preserved W6's injected desktop snapshot loaders;
  • reused the focused W6 host-file port and removed duplicate host-kit environment/filesystem authority;
  • preserved synchronous Apple contracts with smaller named facades;
  • consolidated Apple-family policy into the shared data-driven declaration.

The stale Apple production tree is deleted with no compatibility shim or fallback. Local pnpm check:affected --run passed all runnable checks (562 Vitest files / 4,535 tests), with the planted eager-closure and layering violations observed red before their fixes. The PR is now mergeable while exact-head GitHub checks run; native/device/provider/full-coverage lanes remain the authoritative proof for those environments. No merge performed.

@thymikee

Copy link
Copy Markdown
Member Author

Reviewed exact head a3c9d57f24 after W5/W6 landed. The prior implementation findings are resolved and exact-head CI is fully green.

P2 — update ADR 0019 before merging. ADR 0019 still states that Apple exposes only the root façade plus ./runner, ./runner/client, and ./runner/test-host. This PR adds and structurally enforces fourteen additional Apple domain subpaths. Because ADR 0019 owns this platform-package seam, the implementation currently contradicts the recorded decision. Update the ADR to name the new domain-facet/consumer rule and why these subpaths replace the previous root-only posture.

Otherwise the W6 loader injection, focused host ports, sync contracts, generalized family policy, lazy production route, size result, mergeability, and all exact-head checks look good.

@thymikee
thymikee merged commit 9abcd7f into main Aug 28, 2026
21 of 22 checks passed
@thymikee
thymikee deleted the refactor/platform-apple-wave branch August 28, 2026 13:25
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