refactor: consolidate Apple platform internals#968
Conversation
|
Size Report
Startup median (7 runs, lower is better):
Top changed chunks:
|
6e2e73e to
3162a65
Compare
Review — actionable itemsVerified the relocation is a clean byte-identical move (runner stack + ~46
|
3162a65 to
8ca1ca5
Compare
|
Addressed the review items after rebasing onto current
Request-count gate note: I did not arm
|
|
Re-reviewed the current clean #968 head ( The PR is now based on The runner request-count gate is still not armed, but the follow-up note explains why: latest successful main iOS workflow had Checks are green, including Typecheck, Unit Tests, Integration Tests, Smoke Tests, Fallow Code Quality, Lint & Format, Swift Runner Unit Compile, Web Platform Smoke, iOS Runner Swift Compatibility, and deploy-preview. I do not see an actionable blocker; ready for maintainer review. |
8ca1ca5 to
8510875
Compare
|
Follow-up on the request-count gate: removed it instead of trying to arm it with zero. The latest two successful
The runtime |
8510875 to
415672e
Compare
|
Dropped the request-count gate and the related runtime surface instead of carrying a half-working signal. What it was trying to catch: accidental runner behavior drift, mainly extra XCTest runner round trips per logical command, duplicate sends after fallback/retry changes, or a refactor accidentally bypassing the runner for an action that should use it. Why I removed it: the latest successful Replacement direction: rely on focused live e2e/smoke verification for the user-visible paths ( |
|
Head changed after the prior readiness review (now at 415672e), and the iOS smoke check is still in progress. I removed ready-for-human for now; please wait for checks to settle and re-review this head before restoring the label. |
|
Re-reviewed current clean head 415672e against plans/perfect-shape.md and ADR 0003. The only delta since my prior clean review is removal of the runner request-count gate and cost.runnerRoundTrips surface. That cleanup is consistent: request-router no longer computes the metric, the public ResponseCost type and cost tests no longer expose it, package/workflow hooks are removed, and checks are green. This also avoids preserving an inconclusive gate whose recent main baseline reported zero runner round trips. Residual risk remains as previously noted: the Apple core move still has compatibility shim imports through src/platforms/ios, and visionOS has build-cache groundwork without live Vision Pro simulator interaction evidence. I do not see an actionable blocker on this head; ready for maintainer review. |
415672e to
44c76dd
Compare
|
Re-checked current clean head 44c76dd. The delta from the previously reviewed 415672e head is docs/plans only: ADR 0009 now records the shipped/deferred Apple consolidation status, the obsolete standalone Apple plan was removed, and perfect-shape/phase3 progress links now point at ADR 0009 plus phase3-platform-plugin-progress.md. No code, routing, runner, command-surface, or platform backend behavior changed in this head. Checks remain green, and the existing ready-for-human label is still appropriate. |
44c76dd to
171f4d0
Compare
…) (#969) Post-#968 follow-up: the OS-agnostic Apple runner engine moved from src/platforms/ios/ to src/platforms/apple/core/, but several docs/config still pointed at the old locations, misleading agents that grep those paths. - AGENTS.md: repoint the runner-seam map, the Apple-family sync rule, the record/trace seam, the search-roots hint, and the platform-backends list at src/platforms/apple/core/...; rename "iOS Runner Seams" -> "Apple Runner Seams". - .fallowrc.json: drop the two stale ignoreExports entries for the removed src/platforms/ios/apps.ts and src/platforms/ios/index.ts (the live src/platforms/apple/core/apps.ts entry already covers those test-only exports). - ios-runner/{README,RUNNER_PROTOCOL}.md: point the TypeScript-client links at src/platforms/apple/core/runner/runner-client.ts. Docs/config only; no behavior change. fallow audit + build/lint stay green, and a live iOS simulator replay suite (6/6) confirms the consolidated runner works.
PR #968 (apple-platform-consolidation) accidentally dropped the runnerRoundTrips field from the agent-cost block during an over-broad conflict resolution. This restores the shipped Phase-4 feature: - src/kernel/contracts.ts: re-add ResponseCost.runnerRoundTrips: number - src/utils/diagnostics.ts: restore the countDiagnosticEventsByPhase() accessor over the flush-surviving phaseCounts tally (the tally itself survived #968; only the accessor was removed) - src/daemon/request-router.ts: repopulate runnerRoundTrips in the cost graft by counting the two real round-trip diagnostic phases (ios_runner_command_send + ios_runner_readiness_preflight). The RUNNER_ROUND_TRIP_PHASES constant is now defined locally (its former home, the dev-only runner-request-count.ts, was removed in #968 and is out of scope to restore) - request-router-cost.test.ts: restore the round-trip counting test and the runnerRoundTrips:0 assertion Byte-identical-default invariant preserved: with --cost OFF or on an error response the serialized payload is unchanged.
…n Phase 3 plan (#971) The Step (c) request-count bullet claimed both the dev-only CI gate AND the runtime `cost.runnerRoundTrips` surface were removed in #968. #970 restored the public agent-cost field, so the bullet is stale/misleading for the next Apple/agent-cost worker. Split the bullet: the dev-only request-count CI gate (the #966 --debug ndjson counter + smoke-ios assertion) stays removed (zero runner events on main runs); the runtime `cost.runnerRoundTrips` agent-cost field (ResponseCost / buildResponseCost over RUNNER_ROUND_TRIP_PHASES) is a separate pre-existing surface, restored in #970, and remains part of the agent-cost contract.
…s/apple/core (#980) (#983) After #968 moved the OS-agnostic Apple engine to src/platforms/apple/core/, its tests still lived in src/platforms/ios/__tests__/. Move the 19 that test Apple engine code into src/platforms/apple/core/__tests__/ so tests sit beside their source, re-relativizing every import / dynamic import / vi.mock / vi.importActual specifier to the new depth. Deferred (still in src/platforms/ios/__tests__/): recording-scripts.test.ts and runner-client.test.ts — both compute runtime fs paths (__dirname / fileURLToPath) to ios-runner artifacts, so they need path-string fixes, not just specifier re-relativization. Tracked under #980. Pure test relocation — no source or behavior change. tsc + oxlint + oxfmt green; the moved suites pass (384 tests across the apple + deferred dirs).
Summary
Move shared Apple-platform implementation into
src/platforms/apple/core, retarget internal callers directly to those Apple modules, and split macOS leaf code undersrc/platforms/apple/os/macos.Add visionOS runner profile/build-cache groundwork while keeping watchOS out of scope.
Remove the inert iOS runner request-count gate and its related runtime surface, including
cost.runnerRoundTrips, because recent successfulmainruns captured zero runner round trips and the signal was not proving runner behavior.Retire
plans/apple-platform-consolidation.md; ADR-0009 now owns the decision andplans/phase3-platform-plugin-progress.mdtracks the remaining follow-ups.Rebased onto current
mainafter #967 merged. Scope is 164 touched files across Apple platform internals, tests, runner build scripts, Fallow move metadata, CI cleanup, Xcode project metadata, request-count cleanup, and roadmap docs. Remaining Apple work is explicit follow-up: publicPlatformcollapse, tvOS leaf, plugin facets, per-AppleOS capability table, and the watchOS unsupported sentinel.Validation
pnpm formatpnpm check:toolingpnpm check:quickpnpm check:fallow --base origin/mainpnpm exec vitest run src/daemon/__tests__/request-router-cost.test.ts src/daemon/__tests__/request-router-response-level.test.tspnpm exec vitest run src/platforms/ios/__tests__/apple-runner-platform.test.ts src/platforms/ios/__tests__/runner-command-retry.test.ts src/platforms/ios/__tests__/runner-session.test.ts src/daemon/handlers/__tests__/session.test.tsgit diff --checkPreviously on this worktree before the rebase:
pnpm build,pnpm exec vitest run src/platforms/ios/__tests__, runner-focused Vitest suite,pnpm build:xcuitest,pnpm build:xcuitest:visionos, andgit diff --check. visionOS runtime was installed and the XCUITest build passed, but no Vision Pro simulator instance existed for live interaction verification.