Skip to content

refactor(daemon): separate open-target planning from platform mechanics #2334

Description

@thymikee

Purpose

Child of #2278 (audit area: open-target planning). src/platform-runtime-open-target.ts mixes a neutral open plan/result policy with platform mechanics:

  • neutral: resolveRequestedOpenSurface, validateOpenRelaunchTarget, resolveSessionAppBundleIdForTarget
  • Apple mechanics: resolveSoleForegroundIosApp (sole-booted-simulator/foreground-app probe)
  • Android mechanics: resolveAndroidPackageForOpen, inferAndroidPackageAfterOpen

Two classified daemon edges (R74 inventory) consume this file:

  • src/daemon/session-lifecycle/internal/session-open-prepare.tsresolveRequestedOpenSurface, validateOpenRelaunchTarget
  • src/daemon/handlers/session-selector-dispatch.tsresolveAndroidPackageForOpen, resolveSessionAppBundleIdForTarget

Required behavior

  • Separate the pure open plan/result from the platform implementation only when that creates a deeper interface and removes duplicated policy; preserve one construction path (one resolver producing the open plan — no second).
  • The daemon open prepare and selector-dispatch code imports only the neutral plan/policy surface.
  • Android package resolution moves behind the Android owning seam (package facts/runtime interface in packages/platform-android); the iOS probe is owned by refactor(daemon): own Apple runner session observation behind a semantic port #2332 (this issue depends on refactor(daemon): own Apple runner session observation behind a semantic port #2332 for the shared file src/platform-runtime-open-target.ts).
  • If the neutral surface stays a root module, its remaining daemon consumers are classified daemon-policy-essential in the R74 inventory with the plan-construction rationale; if it moves, the move is a pure seam change with no behavior change.

Observable completion conditions

  • The two R74 inventory edges above are reclassified or removed.
  • resolveAndroidPackageForOpen / inferAndroidPackageAfterOpen have no production importer outside their owning seam.
  • open prepare and selector dispatch behave identically (existing behavior tests).
  • Planted violation: a daemon import of the platform-mechanics symbols is red.
  • pnpm check:layering and pnpm check:affected --run pass.

Dependencies

Blocked by: #2332 (shared file src/platform-runtime-open-target.ts hosts the probe #2332 relocates).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions