Skip to content

[build-tools] Adopt prepared Simulator services - #4724

Draft
gwdp wants to merge 1 commit into
gwdp/prepared-simulator-adoption-20261022from
gwdp/prepared-simulator-build-tools
Draft

gwdp wants to merge 1 commit into
gwdp/prepared-simulator-adoption-20261022from
gwdp/prepared-simulator-build-tools

Conversation

@gwdp

@gwdp gwdp commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@gwdp

This comment has been minimized.

@gwdp
gwdp force-pushed the gwdp/prepared-simulator-build-tools branch from 61a1d77 to 3c643b1 Compare October 22, 2026 22:00
@gwdp
gwdp force-pushed the gwdp/prepared-simulator-build-tools branch from 3c643b1 to 13bdc62 Compare October 22, 2026 23:53
@gwdp

gwdp commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Codex renamed the internal helper to preparedIosSession, made the two engine preflights explicit, and replaced the mounted environment-file dependency with the worker's required current-boot effective-config record. Native identity/auth/version checks, artifact/event baselines, and cleanup before cold fallback remain in place.

Validation on the final stack: 112 focused build-tools tests and typecheck pass. CLI-only serve-sim owner handoff remains unchanged.

— Codex

@gwdp
gwdp force-pushed the gwdp/prepared-simulator-build-tools branch from 13bdc62 to b72f76e Compare October 22, 2026 23:59
@gwdp

gwdp commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Codex made the prepared-session test suite explicitly emulate Darwin and restore the original platform afterward. Linux CI was correctly skipping the production Darwin-only stop path, so the suite's stop assertions were testing the wrong platform. All 17 tests now pass with a Linux bootstrap; runtime behavior is unchanged.

— Codex

@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.88192% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.70%. Comparing base (0ea5643) to head (fffa6d9).

Files with missing lines Patch % Lines
.../build-tools/src/steps/utils/preparedIosSession.ts 89.59% 14 Missing and 1 partial ⚠️
...ools/src/steps/utils/IosSimulatorRecordingUtils.ts 93.48% 3 Missing ⚠️
...uild-tools/src/steps/utils/agentDeviceArtifacts.ts 85.72% 3 Missing ⚠️
...tools/src/steps/utils/preparedDeviceSessionHost.ts 97.57% 1 Missing ⚠️
Additional details and impacted files
@@                              Coverage Diff                              @@
##           gwdp/prepared-simulator-adoption-20261022    #4724      +/-   ##
=============================================================================
+ Coverage                                      75.63%   75.70%   +0.08%     
=============================================================================
  Files                                           1070     1072       +2     
  Lines                                          52967    53225     +258     
  Branches                                       11542    11613      +71     
=============================================================================
+ Hits                                           40054    40290     +236     
- Misses                                         11923    11944      +21     
- Partials                                         990      991       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gwdp
gwdp force-pushed the gwdp/prepared-simulator-build-tools branch 2 times, most recently from 4660651 to b951b79 Compare October 23, 2026 01:21
@gwdp
gwdp force-pushed the gwdp/prepared-simulator-build-tools branch from b951b79 to 7239ed8 Compare October 23, 2026 01:38
@gwdp
gwdp force-pushed the gwdp/prepared-simulator-build-tools branch from 7239ed8 to 3318b8c Compare October 23, 2026 02:28
@gwdp

gwdp commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Codex contribution: build-tools now passes the raw selector to the pinned worker adoption CLI and validates the returned device before native/auth/version/artifact/event preflight. CLI adoption/replacement or invalid-result failure awaits positive terminal cleanup and then propagates; it cannot resolve the requested device through a separate caller cold-start path. Unavailable initial candidates and post-result native preflight misses retain safe fallback. Failed stop propagates.

The existing preflight function block and private serve-sim CLI ownership handoff are unchanged. Local validation: 74 worker and 144 build-tools tests, both typechecks, bundle build, lint/format and isolated stubbed-native bundle smoke. This does not prove native replacement/cleanup or hosted behavior. The candidate is not all-service readiness; 420/425 seconds are provisional caller bounds, with active cleanup still potentially unbounded.

— Codex

@gwdp
gwdp force-pushed the gwdp/prepared-simulator-build-tools branch from 3318b8c to fc81018 Compare October 23, 2026 04:03
@gwdp
gwdp force-pushed the gwdp/prepared-simulator-build-tools branch from fc81018 to 5b142c6 Compare October 23, 2026 04:12
@gwdp
gwdp force-pushed the gwdp/prepared-simulator-build-tools branch from 5b142c6 to 594641f Compare October 23, 2026 04:41
@gwdp
gwdp force-pushed the gwdp/prepared-simulator-build-tools branch from 594641f to b92f43b Compare October 23, 2026 04:58
@gwdp
gwdp force-pushed the gwdp/prepared-simulator-build-tools branch from b92f43b to 2f345b4 Compare October 23, 2026 06:35
@gwdp

gwdp commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Share the host logging wrapper and launch environment. Remove the unused supported option, repeated Zod checks and duplicate adapter cleanup wrapper. Keep one memoized terminal stop; the function caller owns remaining startup failure cleanup, and screenshot finalization still waits for writer teardown.

Validate endpoint ancestry against the current-boot controller PID and native start time; missing/old identity has no pathname fallback. Keep separate native/auth/version/device and artifact/event baseline checks. Reuse layer3's shared early-stop helper. 241 focused build-tools tests, typecheck and lint/format pass, including existing cold-session functions. No new native or hosted acceptance.

— Codex

@gwdp
gwdp force-pushed the gwdp/prepared-simulator-build-tools branch from 2f345b4 to 613b96d Compare October 23, 2026 06:42
@gwdp
gwdp added this pull request to stack #4726 October 23, 2026 06:59
@gwdp
gwdp force-pushed the gwdp/prepared-simulator-build-tools branch from 613b96d to 2116f99 Compare October 23, 2026 07:23
@gwdp

gwdp commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Renamed endpoint validation, made environment fallback reasons specific, and separated serve-sim device-registration and URL warnings. Removed pre-adoption artifact IDs and event offsets under the fresh-VM-per-job assumption; native identity, version and authenticated preflight checks remain. Collection now uses the normal artifact/event path without a pre-adoption exclusion boundary.

193 focused tests, build-tools typecheck, lint and format pass. No native/hosted acceptance or performance run. Worker replacement and positive-stop-before-fallback behavior remain unchanged.

— Codex

@gwdp
gwdp force-pushed the gwdp/prepared-simulator-build-tools branch from 2116f99 to 06d2e55 Compare October 23, 2026 07:49
@gwdp

gwdp commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Integrated adoption-owned video recording with the agreed serve-sim CLI contract. When the job recording step is enabled, EAS supplies the output directory and recording ID and verifies the start acknowledgement before app actions. The poller reuses the job/device/server-token reservation instead of starting a second recorder. Shutdown finalizes that exact recording before worker cleanup; collection requires the owned finalization response and expected manifest.

197 focused tests, build-tools typecheck, lint and format pass. Checks use isolated filesystem and stubbed CLI/HTTP/native operations; no EAS native or hosted acceptance run. Existing v1 record-video process handling and fallback policy remain unchanged. Lower three heads and layer 5 logical diff preserved.

— Codex

@gwdp
gwdp force-pushed the gwdp/prepared-simulator-build-tools branch from 06d2e55 to ce28595 Compare October 23, 2026 07:58
@gwdp

gwdp commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Renamed the worker-facing helper to tryPrepareIosSessionAsync and its CLI command to prepare, with matching diagnostics and tests. Serve-sim --adopt, video recording and cleanup behavior are unchanged.

91 worker and 197 build-tools tests, types, build, lint, format and isolated offline runner smoke pass. Native/hosted acceptance was not rerun for this rename.

— Codex

@gwdp
gwdp force-pushed the gwdp/prepared-simulator-build-tools branch from ce28595 to 547d529 Compare October 23, 2026 08:13
@gwdp

gwdp commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Renamed the worker-facing helper to tryClaimPreparedIosSessionAsync and its CLI operation to claim, with matching diagnostics and tests. Serve-sim adoption and recording code are unchanged.

245 focused tests, both typechecks, worker build, lint, format and isolated offline bundle smoke pass. No native/hosted acceptance rerun for this rename.

— Codex

@gwdp
gwdp force-pushed the gwdp/prepared-simulator-build-tools branch from 547d529 to 06099f0 Compare October 23, 2026 08:32
@gwdp
gwdp force-pushed the gwdp/prepared-simulator-build-tools branch 2 times, most recently from 5d7bf48 to fc79bcb Compare October 23, 2026 17:34
@gwdp
gwdp force-pushed the gwdp/prepared-simulator-build-tools branch from fc79bcb to fffa6d9 Compare October 23, 2026 17:47
@gwdp

gwdp commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Capture stdout explicitly for the four native boot/process-identity preflight calls. turtle-spawn inherits stdout when options are omitted, which made a valid warm session fall back before claim. Global spawn defaults, identity checks and cleanup behavior are unchanged.

Validation: 106 focused tests with coverage, typecheck, lint and format passed. The regression uses the real turtle-spawn wrapper with disposable Node children and unchanged call options; it does not fabricate captured stdout or execute native Simulator commands. Fresh joined-chain native retest is pending.

— Codex

@gwdp
gwdp force-pushed the gwdp/prepared-simulator-build-tools branch from fffa6d9 to a972d92 Compare October 23, 2026 19:57
@github-actions

Copy link
Copy Markdown

✅ Thank you for adding a changeset!

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