feat(harmonyos): verify foreground after open instead of trusting the launch line

ST
5d ago
+789-8

Summary

On HarmonyOS, open reported success off the start ability successfully stdout line alone — on a locked screen the report said Opened while the screen showed the lock face, and the session kept reasoning from a state the device never entered. openHarmonyApp now polls the app state (up to 5s, reusing the FOREGROUND parsing from apps state) after the launch line: when the launched bundle does not hold the foreground, the result carries an open_not_foreground warning telling the caller to unlock first; --foreground mode escalates that to a hard failure.

10 files changed (app-lifecycle polling, result plumbing, tests).

Validation

  • Head: 45a07a8e0 on a68693c72 (includes review-fix commit; help wording synced for both audiences per the flag-types rule).
  • pnpm run typecheck, pnpm run lint, app-lifecycle tests, integration-progress --check, fallow, freerange: pass locally.
  • Independent cold review: applied. CI runs the full gates on push.

šŸ¤– Generated with Claude Code


Autofix with [code]smith
Open in [code]smith Ā· Need help on this PR? Tag @codesmith-bot with what you need.