Skip to content

test(apple-runner): pin the close release truth table at the lifecycle seam - #2623

Merged
thymikee merged 1 commit into
t3code/reproduce-and-fix-issue-2552from
apex/2615-close-release-truth-table
Sep 15, 2026
Merged

thymikee merged 1 commit into
t3code/reproduce-and-fix-issue-2552from
apex/2615-close-release-truth-table

Conversation

@thymikee

Copy link
Copy Markdown
Member

Summary

Follow-up to #2605 for #2615. The seam the issue asks for already landed in this stack at 029c9e97: finalizeApplicationClose issues one awaited releaseRunnerOnClose(deviceId, { retain }), runner-session.ts decides with its own runnerMainThreadBusy, and the busy-only operation plus its forwarding exports are gone. The issue still owed the proof, so this PR adds it: one test file, plus four daemon mock entries for the removed scheduleIosRunnerIdleStop export.

runner-close-finalization.test.ts drives the real finalizeApplicationClose over the real runner module, composed as the root's lazy tools compose it, one case per truth-table row: idle-retain warm reuse (no relaunch), busy-retain disposal plus a fresh boot on reopen, non-retain stop with idle-stop cancellation, owned-lease release with no runner in memory, retain-with-no-runner starting and claiming nothing, daemon-shutdown deferral, disposal rejection before alert dismissal, and a drain that lands after close is issued (runner exit held open; no microtask counting). Occupancy is produced by a real RUNNER_BUSY refusal and cleared by a real stamped reply, never by a mocked method call.

Validation

Tested 455f9ec5c3. pnpm check:affected --run green: format, lint, typecheck, layering, di-seams, fallow, build, package, integration-node (95), macos-coverage (6), and vitest related (2920 tests, 421 files). Its first pass timed out 8 unrelated daemon-spawning cases at host load 60+ with sibling worktrees' gates running; re-run alone passed.

Mutation probes kill the exact case: busy check removed (3), release no longer awaited (6), lease cleanup removed, idle cancel removed. Temporary ready-based reuse condition: 2 files touched, no contract method, adapter or replay-fixture edit; removed.

No live run: no production line changed. The wedge scenario and device lanes belong to #2605.

@github-actions

github-actions Bot commented Sep 15, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
Installed (including dependencies) 4.53 MB 4.53 MB 0 B
Package (unpacked) 4.53 MB 4.53 MB 0 B
Package (download) 1.34 MB 1.34 MB +4 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 25.3 ms 25.9 ms +0.6 ms
CLI --help 70.5 ms 72.8 ms +2.3 ms

@thymikee

Copy link
Copy Markdown
Member Author

Reviewed at 455f9ec. This is test-only (no production lines), the cases drive the real close lifecycle, and each truth-table row would fail if its branch in the production decision were removed. Checks are green. It stays stacked on #2605.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Sep 15, 2026
@thymikee
thymikee added this pull request to stack #2628 September 15, 2026 09:45
@thymikee
thymikee force-pushed the apex/2615-close-release-truth-table branch from 455f9ec to 0217d96 Compare September 15, 2026 11:11
@thymikee
thymikee merged commit 465af75 into main Sep 15, 2026
16 of 17 checks passed
@thymikee
thymikee deleted the apex/2615-close-release-truth-table branch September 15, 2026 11:12
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-15 11:14 UTC

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant