Repository navigation
Description
Purpose
Decide "is a registered system-surface host presenting over this app" by presentation, not process liveness, so a host that lingers after dismissal stops routing every capture to the slow XCTest runner.
Status since this issue was written
The design was accepted (2026-10-09 Decision: comment, comment 6077564899) and the host-side probe was deleted: #4172 (8c416a75, released v0.21.37) removed packages/platform-apple/src/system-surface-presence.ts and moved the check guest-side — the route names host executables in the bridge request (packages/capture-kit/src/snapshot-router/router.ts:274) and the bridge reads the process table with sysctl (apple/snapshot-bridge/SnapshotBridgeSurfaceHosts.m), refusing system-surface-host-present.
The false positive this issue owns is still there. The shipped check is still a liveness check, just inside the bridge: the router still distinguishes system-surface-host-lingering for a host that outlives its dismissal (router.ts:58,567), processExecutable is still in contracts/fixtures/ios-system-surface-hosts.json:7,13, and no applicationAtCoordinate: hit test exists anywhere in apple/. The bonus also remains: createLaunchObservationProbe calls source.acquire directly and sends no host list (packages/platform-apple/src/snapshot-observability.ts:116), so launch observation still reports observable off an occluded tree.
Required behavior
Re-aimed at the shipped bridge path, verified against origin/main 3c68c19ed3:
- Replace the sysctl process-table check in
apple/snapshot-bridge/SnapshotBridgeSurfaceHosts.mwith a presentation test, keepingrespondsToSelector:guards and a typed failure when the private selector is absent, asapple/snapshot-bridge/SnapshotBridgeRuntime.malready does elsewhere. - Refuse with the existing
system-surface-presenteddisposition instead ofsystem-surface-host-presentwhen a registered host is presenting (packages/capture-kit/src/snapshot-router/refusal-policy.ts:109), and stop emittingsystem-surface-host-lingering(router.ts:58,567) once presentation, not liveness, decides the route. - Drop
processExecutablefromcontracts/fixtures/ios-system-surface-hosts.jsonand both parity consumers once nothing matches on it, keeping the bundle-id registry the Swift runner uses. - Have the launch-observation probe take the same answer by routing through the code path that sends
surfaceHostExecutables(packages/platform-apple/src/snapshot-observability.ts:116), so an occluded tree can no longer readobservable. - Verify absent, presented, and dismissed-but-lingering through the production bridge on a real sheet, not a unit seam, and keep both refusals out of the bridge circuit's disable path.
Per the accepted decision: one hit test at the centre detects a sheet but does not establish general foreground ownership (see #2696); do not present it as one.
Completion
The lingering-host false positive is gone; the routed refusals name presentation; processExecutable is deleted; live-validated through the production bridge on a real sheet, including the dismissed-but-lingering case.
Activity
thymikee commentedon Oct 9, 2026
Decision: accepted.
system-surface-presence.tschecks whether a process is running and caches positive results, so it can't tell a host process that's still around from a sheet that's actually presented. The issue's presented and dismissed controls show this.Scope:
thymikee commentedon Nov 23, 2026
Current state: body rewritten against origin/main 3c68c19 (2026-11-23 maintainer sweep, T105). The host-side pgrep/ps probe was deleted by #4172 (v0.21.37) and replaced by a sysctl liveness check inside the bridge guest, so the lingering-host false positive this issue owns survives; the contract is re-aimed at the shipped bridge path and the still-missing hit test, and the launch-observation gap is kept.
Previous body is preserved at the issue's edit history (the
Editedmarker in the header) and archived locally; no copy is republished here.apex-sentinel-staging commentedon Nov 23, 2026
Apex Sentinel · Issue review
Suggested label:
bugThe issue reports a concrete existing false-positive: a lingering iOS system-surface host is still detected via a sysctl process-table/liveness check and routed incorrectly/slowly, and it specifies the presentation-based hit-test fix with code references. It is actionable as written, despite containing detailed implementation notes and references that should be treated as data.
Required sections