{
  "$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
  "title": "MetaMask Mobile Android lifecycle smoke",
  "description": "Isolated on-device proof for the standard app.lifecycle action on Android. The graph cold-relaunches the installed app without rebuilding, proves the React Native bridge is reachable, backgrounds and foregrounds the app, proves bridge recovery, and captures a screenshot.",
  "workflow": {
    "entry": "terminate-before",
    "nodes": {
      "background-app": {
        "action": "app.lifecycle",
        "platform": "android",
        "command": "background",
        "settle_ms": 1000,
        "intent": "Put the selected Android device on the launcher",
        "next": "foreground-app"
      },
      "foreground-app": {
        "action": "app.lifecycle",
        "platform": "android",
        "command": "foreground",
        "settle_ms": 15000,
        "intent": "Foreground the installed Android app through the Expo dev-client deep link",
        "next": "bridge-after"
      },
      "bridge-after": {
        "action": "cdp.target",
        "require_reachable": true,
        "intent": "Confirm the mobile React Native debug bridge recovered after foregrounding",
        "next": "screenshot-after"
      },
      "screenshot-after": {
        "action": "ui.screenshot",
        "path": "screenshots/app.lifecycle.android-smoke.png",
        "intent": "Record the foreground app state as evidence",
        "next": "end"
      },
      "end": {
        "action": "end",
        "status": "pass"
      },
      "start-state": {
        "action": "app.status",
        "intent": "Record the stable run start status after setup relaunch",
        "next": "background-app"
      },
      "bridge-before": {
        "action": "cdp.target",
        "require_reachable": true,
        "intent": "Confirm the mobile React Native debug bridge is reachable after setup relaunch",
        "next": "start-state"
      },
      "launch-before": {
        "action": "app.lifecycle",
        "platform": "android",
        "command": "launch",
        "settle_ms": 15000,
        "intent": "Launch the installed Android app through the Expo dev-client deep link from a cold process",
        "next": "bridge-before"
      },
      "terminate-before": {
        "action": "app.lifecycle",
        "platform": "android",
        "command": "terminate",
        "settle_ms": 3000,
        "intent": "Terminate the installed Android app before lifecycle smoke",
        "next": "launch-before"
      }
    }
  }
}
