Skip to content

refactor(daemon): separate open-target policy from mechanics - #2408

Closed
PLASMA-FR wants to merge 3 commits into
callstack:mainfrom
PLASMA-FR:refactor/open-target-planning-b-20260909T075320Z
Closed

refactor(daemon): separate open-target policy from mechanics#2408
PLASMA-FR wants to merge 3 commits into
callstack:mainfrom
PLASMA-FR:refactor/open-target-planning-b-20260909T075320Z

Conversation

@PLASMA-FR

@PLASMA-FR PLASMA-FR commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #2334.

Session identity planning and lifecycle opens share the application tools' resolveOpenTarget result. Android package lookup and foreground inference live in packages/platform-android; Apple observations stay behind Apple application tools. The daemon supplies no Android resolver, and surface/relaunch policy is preserved.

The requested correction restores the no-target/existing-identity fast return and keeps mechanics loading inside best-effort post-open inference. Five cases cover early returns, loader rejection, and successful inference.

21 files (+374/−246), including tests, ADR 0022, and the R76 inventory. This is an alternative to #2416, not an additional change to merge alongside it.

Validation

Head: 1f6edf6f525b71c33d19b3527150580549f46f2c (Linux arm64, Node 26.8.1, pnpm 11.17.0).

  • Four inference regressions passed on upstream e7d97f7dfe, failed on prior PR head 85e9fa2, and pass with the correction.
  • pnpm exec vitest run: 90 tests passed across application-tools, window-state, lifecycle, target-planning, and seven archive/provider suites.
  • pnpm check:affected --run: passed, including 2,246 tests across 329 files, 95 Node integration tests, lint/types, layering, Fallow, build/package validation, and compatibility. Nine native cases were skipped by the repository harness.

Initial local failures were missing zip/unzip and release tags; provisioning them resolved both. CI is pending on the updated head; full coverage and native/device lanes remain GitHub-authoritative.

@thymikee

thymikee commented Sep 9, 2026

Copy link
Copy Markdown
Member

Please preserve the no-target fast return in inferOpenedAppBundleId. It now loads Android mechanics before the helper can return for an absent target, so a loader failure can turn a fresh targetless Android open into an error instead of leaving the optional package identity unset. Keep loading inside the best-effort operation and add a targetless regression with the loader rejecting. This also overlaps #2416 on #2334; these are alternative implementations, not two changes to merge. Checks are green on 85e9fa2.

@thymikee

thymikee commented Sep 9, 2026

Copy link
Copy Markdown
Member

The inference correction looks good at 1f6edf6: early returns avoid loading Android mechanics, and loader failures remain best-effort. The iOS failure is likely unrelated—it is in an unchanged native alert-observation test. This and #2416 solve the same issue; choose one before marking it ready to merge.

@thymikee

thymikee commented Sep 9, 2026

Copy link
Copy Markdown
Member

This now conflicts with main at 1f6edf6 after the lifecycle changes landed. Resolve the conflict and rerun the affected checks once we choose between this and #2416.

thymikee commented Sep 9, 2026

Copy link
Copy Markdown
Member

Closing in favor of #2416 — both PRs implement #2334 independently; thymikee reviewed both and chose #2416 (see callstack/agent-device#2416 (comment)) to avoid merging two alternative implementations of the same issue.


Generated by Claude Code

thymikee commented Sep 9, 2026

Copy link
Copy Markdown
Member

Correction to my comment above: the specific comment anchor I linked doesn't exist. The decision is recorded in the thread on callstack/agent-device#2416 (thymikee's comments there choosing that implementation).


Generated by Claude Code

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.

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

2 participants