From 8ef44415fca472337317b86d9f61e051763c9d3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Mon, 2 Nov 2026 10:57:42 +0100 Subject: [PATCH 1/3] docs(agents): stop local simulators and emulators on close Agents finish with plain close, which never stops the device, while open boots a stopped one. Tell them to finish with close --shutdown on local simulators and emulators, in close help, workflow/manual-qa/validate help, the skills, and the repo agent docs. Refs #4162 --- AGENTS.md | 2 +- docs/agents/device-verification.md | 4 ++++ packages/command-surface/src/management/app.ts | 2 +- scripts/__tests__/simulator-skills-contract.test.ts | 2 ++ skills/agent-device/SKILL.md | 2 +- skills/android-emulator/SKILL.md | 6 ++++++ skills/dogfood/SKILL.md | 2 +- skills/ios-simulator/SKILL.md | 6 ++++++ src/commands/schema/cli-help-workflows.ts | 4 ++-- src/commands/schema/cli-help.ts | 4 ++-- 10 files changed, 26 insertions(+), 8 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index ce4ea08e31..5ac6494334 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -48,7 +48,7 @@ The versioned CLI help owns command semantics. To drive an app, start with the s - In a new worktree, run `pnpm install --frozen-lockfile && pnpm build` before you test. - Do not change other worktrees, devices, sessions, dirty files, or experiments. Do not use `git stash`; all worktrees share it. - Do not copy `.env` into a worktree. For host credentials, source the main checkout's file by its absolute path. -- Give each parallel worker different files and a different device. `pnpm check:affected --run`, `pnpm check`, and heavy `pnpm gate` ids share one lock. +- Give each parallel worker different files and a different device. When a worker is done, it must stop its device with `close --shutdown`. `pnpm check:affected --run`, `pnpm check`, and heavy `pnpm gate` ids share one lock. - The layering scan reads only tracked files. Stage new modules before you trust its result. - When you rename a file, move its Fallow baseline entry. Do not regenerate unrelated baselines. diff --git a/docs/agents/device-verification.md b/docs/agents/device-verification.md index 2171c9ced4..66afa7a1fb 100644 --- a/docs/agents/device-verification.md +++ b/docs/agents/device-verification.md @@ -31,6 +31,10 @@ A failed command can look like a fast success. Before you record the time of a c Use one session for each purpose. For more isolation, use a separate `--state-dir` under `/private/tmp`. Close each session that you opened manually, including failed attempts, with its original session, platform, UDID, and state directory. +When you finish with a local simulator or emulator, close its session with `close --shutdown`. +`close` alone does not stop the device. `open` boots a stopped device and does not stop it later. +Use `close` without `--shutdown` only when the user tells you to keep the device running. +If you are a parallel worker, always stop the device that you used. For `DEVICE_IN_USE`: diff --git a/packages/command-surface/src/management/app.ts b/packages/command-surface/src/management/app.ts index efbb1acb08..a62b04cdd1 100644 --- a/packages/command-surface/src/management/app.ts +++ b/packages/command-surface/src/management/app.ts @@ -93,7 +93,7 @@ const openCommandMetadata = defineFieldCommandMetadata( const closeCommandMetadata = defineFieldCommandMetadata( 'close', - 'Close the named app, or close the active session app when app is omitted. Use shutdown only when the selected simulator or emulator should also stop. Android ADB close fails with android-app-close-timeout if the app stays foreground past 2s, a killed process does not exit within 10s, or a new process runs past 2s. It fails with android-process-probe-unavailable when adb pidof cannot list the app processes; if that happens before the force-stop, the app keeps running.', + 'Close the named app, or close the active session app when app is omitted. When you finish with a local simulator or emulator, add shutdown so the device does not keep running; omit it only when the device must stay up for more work. Android ADB close fails with android-app-close-timeout if the app stays foreground past 2s, a killed process does not exit within 10s, or a new process runs past 2s. It fails with android-process-probe-unavailable when adb pidof cannot list the app processes; if that happens before the force-stop, the app keeps running.', { app: stringField('Optional app to close.'), shutdown: booleanField('Shutdown the session/device where supported.'), diff --git a/scripts/__tests__/simulator-skills-contract.test.ts b/scripts/__tests__/simulator-skills-contract.test.ts index d55cc761a7..f57e6deaf4 100644 --- a/scripts/__tests__/simulator-skills-contract.test.ts +++ b/scripts/__tests__/simulator-skills-contract.test.ts @@ -37,6 +37,7 @@ const SKILLS = [ id: 'foreground platform open', requiredText: 'agent-device open --platform ios --foreground', }, + { id: 'device shutdown on finish', requiredText: 'agent-device close --shutdown' }, ] satisfies Contract[], prohibitions: [ { id: 'version startup probe', forbiddenText: 'agent-device --version' }, @@ -64,6 +65,7 @@ const SKILLS = [ id: 'foreground platform open', requiredText: 'agent-device open --platform android --foreground', }, + { id: 'device shutdown on finish', requiredText: 'agent-device close --shutdown' }, ] satisfies Contract[], prohibitions: [ { id: 'version startup probe', forbiddenText: 'agent-device --version' }, diff --git a/skills/agent-device/SKILL.md b/skills/agent-device/SKILL.md index 2dabf4798c..3cddfa5197 100644 --- a/skills/agent-device/SKILL.md +++ b/skills/agent-device/SKILL.md @@ -13,7 +13,7 @@ agent-device open --foreground That starts the session and returns the initial interactive snapshot with `@refs`. -Loop: act with `press|click|fill|longpress ... --settle`, `scroll --settle`, or `back --settle`; continue from the printed diff, verify the named expectation (`wait text "..."`, `is`, `get`, or `find`), then run `agent-device close`. +Loop: act with `press|click|fill|longpress ... --settle`, `scroll --settle`, or `back --settle`; continue from the printed diff, verify the named expectation (`wait text "..."`, `is`, `get`, or `find`), then run `agent-device close`. On a local simulator or emulator, run `agent-device close --shutdown` when you finish, unless the device must stay up for more work. Reaching an off-screen target is one command, not a scroll-and-check loop: `scroll down --until ` scrolls until that element is on screen, and `scroll bottom` runs to the end of the content. Repeated bare `scroll down` calls are the slow way to find something. diff --git a/skills/android-emulator/SKILL.md b/skills/android-emulator/SKILL.md index 51c65ba5d8..b9859d446f 100644 --- a/skills/android-emulator/SKILL.md +++ b/skills/android-emulator/SKILL.md @@ -21,6 +21,12 @@ agent-device open --platform android --foreground Follow the initial interactive snapshot and corrective error hints. If the shell reports that `agent-device` is unavailable, stop and ask the user to install it or expose their existing installation on `PATH`. +When you finish, end the session and stop the emulator so it does not keep running. Use plain `agent-device close` only when the emulator must stay up for more work: + +```bash +agent-device close --shutdown +``` + Only when the task is specialized or a command shape is unclear, read the relevant version-matched help topic: ```bash diff --git a/skills/dogfood/SKILL.md b/skills/dogfood/SKILL.md index 4e2b911770..2878308d22 100644 --- a/skills/dogfood/SKILL.md +++ b/skills/dogfood/SKILL.md @@ -22,6 +22,6 @@ Read current CLI guidance: agent-device help dogfood ``` -Loop: open app -> snapshot -i + screenshot -> explore flows -> capture evidence per issue -> close. +Loop: open app -> snapshot -i + screenshot -> explore flows -> capture evidence per issue -> close (`close --shutdown` on a local simulator or emulator). Target app is required; infer platform or ask. Findings must come from runtime behavior, not source reads. Let `help dogfood` provide exact report shape, evidence commands, and current workflow guidance. diff --git a/skills/ios-simulator/SKILL.md b/skills/ios-simulator/SKILL.md index a08d50e27a..03042a1ab5 100644 --- a/skills/ios-simulator/SKILL.md +++ b/skills/ios-simulator/SKILL.md @@ -21,6 +21,12 @@ agent-device open --platform ios --foreground Follow the initial interactive snapshot and corrective error hints. If the shell reports that `agent-device` is unavailable, stop and ask the user to install it or expose their existing installation on `PATH`. +When you finish, end the session and stop the simulator so it does not keep running. Use plain `agent-device close` only when the simulator must stay up for more work: + +```bash +agent-device close --shutdown +``` + Only when the task is specialized or a command shape is unclear, read the relevant version-matched help topic: ```bash diff --git a/src/commands/schema/cli-help-workflows.ts b/src/commands/schema/cli-help-workflows.ts index 7958f4b388..c695b0adfe 100644 --- a/src/commands/schema/cli-help-workflows.ts +++ b/src/commands/schema/cli-help-workflows.ts @@ -29,7 +29,7 @@ Loop: 4. Treat a settled:true diff as the next observation. Do not add wait stable or another snapshot when the diff already shows the next target or expected result. 5. If --settle prints not settled, follow its hint before the next ref-based action. 6. Verify named expectations with wait text/selector/absent, get, is, find, or the settled diff. A bare screenshot/snapshot is not verification for a named expectation. - 7. Close the session when the script ends. + 7. Close the session when the script ends. On a local simulator or emulator, use close --shutdown unless the device must stay up for more work. Command shapes: agent-device open com.example.app --relaunch @@ -278,7 +278,7 @@ Loop: 3. Use snapshot -i and press/fill/click/longpress --settle for UI-driving steps. 4. Use the settled diff as evidence when it shows the changed behavior; otherwise verify with wait/get/is/find, screenshot, logs, network, perf, or trace based on the claim. 5. Record timings, token/output size, screenshots/videos, logs, or perf artifacts only when they answer the validation question. - 6. Close sessions and release leases before finishing. + 6. Close sessions and release leases before finishing. Add --shutdown to close for each local simulator or emulator you no longer need, so it does not keep running. Evidence: CLI/runtime freshness: pnpm build, pnpm clean:daemon, then agent-device --version or the command under test. diff --git a/src/commands/schema/cli-help.ts b/src/commands/schema/cli-help.ts index ea9fb0a279..b65fd946dd 100644 --- a/src/commands/schema/cli-help.ts +++ b/src/commands/schema/cli-help.ts @@ -78,7 +78,7 @@ Command shape: Command lines only -- no prose, numbering, fences, pipes, or grep/head/tail/jq; raw output carries refs/hints for the next step. Order: subcommand, positionals, flags: agent-device open com.example.app --session checkout --platform android --relaunch Chain confident consecutive steps with &&: press 'label="Search"' --settle && fill 'label="Search"' "query" --settle. Fall back to one command at a time when a step is uncertain (ambiguous match, network-backed result, unseen screen). Refs look like @e12; use the exact ref from the latest snapshot -i, never a placeholder (@ref, @eN, @Label_Name). Pin with ~s (press @e12~s4); every platform rejects a stale pinned ref -- refresh with snapshot -i or use a selector. - close = agent-device close. App back is back; system back is back --system. Single taps are press/click; gesture tap touches 2 to 5 points at once. type never takes --settle: run type, then diff snapshot to verify. Known flow: batch --steps-file ./steps.json (help batch). + close = agent-device close; when you finish with a local simulator or emulator, run close --shutdown unless the device must stay up for more work. App back is back; system back is back --system. Single taps are press/click; gesture tap touches 2 to 5 points at once. type never takes --settle: run type, then diff snapshot to verify. Known flow: batch --steps-file ./steps.json (help batch). Gestures: scroll/swipe for lists/flicks; gesture pan|fling|pinch|rotate|transform|tap|drag for multi-touch. Shapes and platform quirks: help gestures. Bootstrap: @@ -126,7 +126,7 @@ Validation and evidence: React Native: help react-native for Metro/Re.Pack reload, DevTools, RN overlays. JS-only change: metro reload, find "Home"; open --relaunch for native reset. -Lifecycle facts (trust these instead of probing): open without --relaunch is idempotent-foreground except native macOS app opens (background); --relaunch restarts it. close keeps a healthy iOS runner warm by default; runners/daemons self-idle after 5 minutes; stale leases self-reclaim. open device claims reclaim other worktrees' warm runners; "already owned by another agent-device daemon" = owner outside claim arbitration. Env vars: help physical-device. +Lifecycle facts (trust these instead of probing): open without --relaunch is idempotent-foreground except native macOS app opens (background); --relaunch restarts it. close keeps a healthy iOS runner warm by default and never stops the device; close --shutdown also stops a local simulator or emulator; runners/daemons self-idle after 5 minutes; stale leases self-reclaim. open device claims reclaim other worktrees' warm runners; "already owned by another agent-device daemon" = owner outside claim arbitration. Env vars: help physical-device. Escalate: help manual-qa scripted manual QA From 893b2ca0732a3c301a3570de23c040ab613c91e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Mon, 2 Nov 2026 15:20:42 +0100 Subject: [PATCH 2/3] docs(agents): scope close --shutdown to a device the session booted Address review: one rule and one exception everywhere (the session booted the local simulator or emulator, unless the user asks to keep it running). Drop the AGENTS.md sentence; device-verification.md owns the rule. Remove two cleanup lines that duplicate CLI help and the line above them. --- AGENTS.md | 2 +- docs/agents/device-verification.md | 7 +------ packages/command-surface/src/management/app.ts | 2 +- skills/agent-device/SKILL.md | 2 +- skills/android-emulator/SKILL.md | 6 +----- skills/dogfood/SKILL.md | 2 +- skills/ios-simulator/SKILL.md | 6 +----- src/commands/schema/cli-help-workflows.ts | 4 ++-- src/commands/schema/cli-help.ts | 2 +- 9 files changed, 10 insertions(+), 23 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 5ac6494334..ce4ea08e31 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -48,7 +48,7 @@ The versioned CLI help owns command semantics. To drive an app, start with the s - In a new worktree, run `pnpm install --frozen-lockfile && pnpm build` before you test. - Do not change other worktrees, devices, sessions, dirty files, or experiments. Do not use `git stash`; all worktrees share it. - Do not copy `.env` into a worktree. For host credentials, source the main checkout's file by its absolute path. -- Give each parallel worker different files and a different device. When a worker is done, it must stop its device with `close --shutdown`. `pnpm check:affected --run`, `pnpm check`, and heavy `pnpm gate` ids share one lock. +- Give each parallel worker different files and a different device. `pnpm check:affected --run`, `pnpm check`, and heavy `pnpm gate` ids share one lock. - The layering scan reads only tracked files. Stage new modules before you trust its result. - When you rename a file, move its Fallow baseline entry. Do not regenerate unrelated baselines. diff --git a/docs/agents/device-verification.md b/docs/agents/device-verification.md index 66afa7a1fb..5bb55728a1 100644 --- a/docs/agents/device-verification.md +++ b/docs/agents/device-verification.md @@ -31,22 +31,17 @@ A failed command can look like a fast success. Before you record the time of a c Use one session for each purpose. For more isolation, use a separate `--state-dir` under `/private/tmp`. Close each session that you opened manually, including failed attempts, with its original session, platform, UDID, and state directory. -When you finish with a local simulator or emulator, close its session with `close --shutdown`. -`close` alone does not stop the device. `open` boots a stopped device and does not stop it later. -Use `close` without `--shutdown` only when the user tells you to keep the device running. -If you are a parallel worker, always stop the device that you used. +If your session booted a local simulator or emulator, add `--shutdown`, unless the user asks to keep it running. For `DEVICE_IN_USE`: - "already in use by session X": follow the `close --session` hint of this daemon. - "owned by session X in workspace Y": examine `device status`. Use `device release --stale` only for provably dead owners. A live or uncertain owner blocks `open`, unless the device rebooted after the claim. - With reboot evidence, `open` settles old resources, takes the claim, and reports the release in `warnings`. Do not search for PIDs. Do not steal the claim. If cleanup is stuck, run `agent-device device status --stale`. To stop the owning daemon, run `agent-device daemon stop --state-dir `. For retained runners, add `--clean`. -To release dead owners, run `agent-device device release --stale`. If you are blocked, report the session, state directory, and status output. Always report incomplete cleanup. The physical runner handoff checklist is in `docs/evidence/ios-physical-runner-handoff-2026-09-19.md`. diff --git a/packages/command-surface/src/management/app.ts b/packages/command-surface/src/management/app.ts index a62b04cdd1..b3c69886a2 100644 --- a/packages/command-surface/src/management/app.ts +++ b/packages/command-surface/src/management/app.ts @@ -93,7 +93,7 @@ const openCommandMetadata = defineFieldCommandMetadata( const closeCommandMetadata = defineFieldCommandMetadata( 'close', - 'Close the named app, or close the active session app when app is omitted. When you finish with a local simulator or emulator, add shutdown so the device does not keep running; omit it only when the device must stay up for more work. Android ADB close fails with android-app-close-timeout if the app stays foreground past 2s, a killed process does not exit within 10s, or a new process runs past 2s. It fails with android-process-probe-unavailable when adb pidof cannot list the app processes; if that happens before the force-stop, the app keeps running.', + 'Close the named app, or close the active session app when app is omitted. If the session booted a local simulator or emulator, add shutdown when you finish, unless the user asks to keep it running; close alone never stops the device. Android ADB close fails with android-app-close-timeout if the app stays foreground past 2s, a killed process does not exit within 10s, or a new process runs past 2s. It fails with android-process-probe-unavailable when adb pidof cannot list the app processes; if that happens before the force-stop, the app keeps running.', { app: stringField('Optional app to close.'), shutdown: booleanField('Shutdown the session/device where supported.'), diff --git a/skills/agent-device/SKILL.md b/skills/agent-device/SKILL.md index 3cddfa5197..c5416e824a 100644 --- a/skills/agent-device/SKILL.md +++ b/skills/agent-device/SKILL.md @@ -13,7 +13,7 @@ agent-device open --foreground That starts the session and returns the initial interactive snapshot with `@refs`. -Loop: act with `press|click|fill|longpress ... --settle`, `scroll --settle`, or `back --settle`; continue from the printed diff, verify the named expectation (`wait text "..."`, `is`, `get`, or `find`), then run `agent-device close`. On a local simulator or emulator, run `agent-device close --shutdown` when you finish, unless the device must stay up for more work. +Loop: act with `press|click|fill|longpress ... --settle`, `scroll --settle`, or `back --settle`; continue from the printed diff, verify the named expectation (`wait text "..."`, `is`, `get`, or `find`), then run `agent-device close`, or `agent-device close --shutdown` if your session booted a local simulator or emulator, unless the user asks to keep it running. Reaching an off-screen target is one command, not a scroll-and-check loop: `scroll down --until ` scrolls until that element is on screen, and `scroll bottom` runs to the end of the content. Repeated bare `scroll down` calls are the slow way to find something. diff --git a/skills/android-emulator/SKILL.md b/skills/android-emulator/SKILL.md index b9859d446f..433f57c9ee 100644 --- a/skills/android-emulator/SKILL.md +++ b/skills/android-emulator/SKILL.md @@ -21,11 +21,7 @@ agent-device open --platform android --foreground Follow the initial interactive snapshot and corrective error hints. If the shell reports that `agent-device` is unavailable, stop and ask the user to install it or expose their existing installation on `PATH`. -When you finish, end the session and stop the emulator so it does not keep running. Use plain `agent-device close` only when the emulator must stay up for more work: - -```bash -agent-device close --shutdown -``` +When you finish, if your session booted the emulator, run `agent-device close --shutdown`, unless the user asks to keep it running. Only when the task is specialized or a command shape is unclear, read the relevant version-matched help topic: diff --git a/skills/dogfood/SKILL.md b/skills/dogfood/SKILL.md index 2878308d22..972ac8874d 100644 --- a/skills/dogfood/SKILL.md +++ b/skills/dogfood/SKILL.md @@ -22,6 +22,6 @@ Read current CLI guidance: agent-device help dogfood ``` -Loop: open app -> snapshot -i + screenshot -> explore flows -> capture evidence per issue -> close (`close --shutdown` on a local simulator or emulator). +Loop: open app -> snapshot -i + screenshot -> explore flows -> capture evidence per issue -> close (`close --shutdown` if your session booted a local simulator or emulator, unless the user asks to keep it running). Target app is required; infer platform or ask. Findings must come from runtime behavior, not source reads. Let `help dogfood` provide exact report shape, evidence commands, and current workflow guidance. diff --git a/skills/ios-simulator/SKILL.md b/skills/ios-simulator/SKILL.md index 03042a1ab5..9560e21888 100644 --- a/skills/ios-simulator/SKILL.md +++ b/skills/ios-simulator/SKILL.md @@ -21,11 +21,7 @@ agent-device open --platform ios --foreground Follow the initial interactive snapshot and corrective error hints. If the shell reports that `agent-device` is unavailable, stop and ask the user to install it or expose their existing installation on `PATH`. -When you finish, end the session and stop the simulator so it does not keep running. Use plain `agent-device close` only when the simulator must stay up for more work: - -```bash -agent-device close --shutdown -``` +When you finish, if your session booted the simulator, run `agent-device close --shutdown`, unless the user asks to keep it running. Only when the task is specialized or a command shape is unclear, read the relevant version-matched help topic: diff --git a/src/commands/schema/cli-help-workflows.ts b/src/commands/schema/cli-help-workflows.ts index c695b0adfe..55d1ddd2b7 100644 --- a/src/commands/schema/cli-help-workflows.ts +++ b/src/commands/schema/cli-help-workflows.ts @@ -29,7 +29,7 @@ Loop: 4. Treat a settled:true diff as the next observation. Do not add wait stable or another snapshot when the diff already shows the next target or expected result. 5. If --settle prints not settled, follow its hint before the next ref-based action. 6. Verify named expectations with wait text/selector/absent, get, is, find, or the settled diff. A bare screenshot/snapshot is not verification for a named expectation. - 7. Close the session when the script ends. On a local simulator or emulator, use close --shutdown unless the device must stay up for more work. + 7. Close the session when the script ends. If your session booted a local simulator or emulator, use close --shutdown, unless the user asks to keep it running. Command shapes: agent-device open com.example.app --relaunch @@ -278,7 +278,7 @@ Loop: 3. Use snapshot -i and press/fill/click/longpress --settle for UI-driving steps. 4. Use the settled diff as evidence when it shows the changed behavior; otherwise verify with wait/get/is/find, screenshot, logs, network, perf, or trace based on the claim. 5. Record timings, token/output size, screenshots/videos, logs, or perf artifacts only when they answer the validation question. - 6. Close sessions and release leases before finishing. Add --shutdown to close for each local simulator or emulator you no longer need, so it does not keep running. + 6. Close sessions and release leases before finishing. If your session booted a local simulator or emulator, use close --shutdown, unless the user asks to keep it running. Evidence: CLI/runtime freshness: pnpm build, pnpm clean:daemon, then agent-device --version or the command under test. diff --git a/src/commands/schema/cli-help.ts b/src/commands/schema/cli-help.ts index b65fd946dd..25cfff8f6f 100644 --- a/src/commands/schema/cli-help.ts +++ b/src/commands/schema/cli-help.ts @@ -78,7 +78,7 @@ Command shape: Command lines only -- no prose, numbering, fences, pipes, or grep/head/tail/jq; raw output carries refs/hints for the next step. Order: subcommand, positionals, flags: agent-device open com.example.app --session checkout --platform android --relaunch Chain confident consecutive steps with &&: press 'label="Search"' --settle && fill 'label="Search"' "query" --settle. Fall back to one command at a time when a step is uncertain (ambiguous match, network-backed result, unseen screen). Refs look like @e12; use the exact ref from the latest snapshot -i, never a placeholder (@ref, @eN, @Label_Name). Pin with ~s (press @e12~s4); every platform rejects a stale pinned ref -- refresh with snapshot -i or use a selector. - close = agent-device close; when you finish with a local simulator or emulator, run close --shutdown unless the device must stay up for more work. App back is back; system back is back --system. Single taps are press/click; gesture tap touches 2 to 5 points at once. type never takes --settle: run type, then diff snapshot to verify. Known flow: batch --steps-file ./steps.json (help batch). + close = agent-device close; if your session booted a local simulator or emulator, use close --shutdown, unless the user asks to keep it running. App back is back; system back is back --system. Single taps are press/click; gesture tap touches 2 to 5 points at once. type never takes --settle: run type, then diff snapshot to verify. Known flow: batch --steps-file ./steps.json (help batch). Gestures: scroll/swipe for lists/flicks; gesture pan|fling|pinch|rotate|transform|tap|drag for multi-touch. Shapes and platform quirks: help gestures. Bootstrap: From 6fdb246a0e8ec35e2bd36923aec79b7533550b49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Mon, 2 Nov 2026 15:27:57 +0100 Subject: [PATCH 3/3] docs(help): keep the workflow card under its size budget The workflow card was 9092 of 9100 bytes on main. Leave it unchanged; the close command help and the manual-qa/validate topics carry the rule. --- src/commands/schema/cli-help.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/schema/cli-help.ts b/src/commands/schema/cli-help.ts index 25cfff8f6f..ea9fb0a279 100644 --- a/src/commands/schema/cli-help.ts +++ b/src/commands/schema/cli-help.ts @@ -78,7 +78,7 @@ Command shape: Command lines only -- no prose, numbering, fences, pipes, or grep/head/tail/jq; raw output carries refs/hints for the next step. Order: subcommand, positionals, flags: agent-device open com.example.app --session checkout --platform android --relaunch Chain confident consecutive steps with &&: press 'label="Search"' --settle && fill 'label="Search"' "query" --settle. Fall back to one command at a time when a step is uncertain (ambiguous match, network-backed result, unseen screen). Refs look like @e12; use the exact ref from the latest snapshot -i, never a placeholder (@ref, @eN, @Label_Name). Pin with ~s (press @e12~s4); every platform rejects a stale pinned ref -- refresh with snapshot -i or use a selector. - close = agent-device close; if your session booted a local simulator or emulator, use close --shutdown, unless the user asks to keep it running. App back is back; system back is back --system. Single taps are press/click; gesture tap touches 2 to 5 points at once. type never takes --settle: run type, then diff snapshot to verify. Known flow: batch --steps-file ./steps.json (help batch). + close = agent-device close. App back is back; system back is back --system. Single taps are press/click; gesture tap touches 2 to 5 points at once. type never takes --settle: run type, then diff snapshot to verify. Known flow: batch --steps-file ./steps.json (help batch). Gestures: scroll/swipe for lists/flicks; gesture pan|fling|pinch|rotate|transform|tap|drag for multi-touch. Shapes and platform quirks: help gestures. Bootstrap: @@ -126,7 +126,7 @@ Validation and evidence: React Native: help react-native for Metro/Re.Pack reload, DevTools, RN overlays. JS-only change: metro reload, find "Home"; open --relaunch for native reset. -Lifecycle facts (trust these instead of probing): open without --relaunch is idempotent-foreground except native macOS app opens (background); --relaunch restarts it. close keeps a healthy iOS runner warm by default and never stops the device; close --shutdown also stops a local simulator or emulator; runners/daemons self-idle after 5 minutes; stale leases self-reclaim. open device claims reclaim other worktrees' warm runners; "already owned by another agent-device daemon" = owner outside claim arbitration. Env vars: help physical-device. +Lifecycle facts (trust these instead of probing): open without --relaunch is idempotent-foreground except native macOS app opens (background); --relaunch restarts it. close keeps a healthy iOS runner warm by default; runners/daemons self-idle after 5 minutes; stale leases self-reclaim. open device claims reclaim other worktrees' warm runners; "already owned by another agent-device daemon" = owner outside claim arbitration. Env vars: help physical-device. Escalate: help manual-qa scripted manual QA