Skip to content

docs(commands): generate blocks for every public command and halve hand-written prose - #4919

Merged
thymikee merged 10 commits into
mainfrom
docs/commands-editorial
Nov 22, 2026
Merged

thymikee merged 10 commits into
mainfrom
docs/commands-editorial

Conversation

@thymikee

@thymikee thymikee commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Generated blocks own API facts, agent-device help owns exact semantics, and error reasons owns reason meanings. Hand-written notes keep purpose, workflows, behavior-changing gotchas, platform limits, and recovery.

  • perf cpu profile report reads --template, but its xctrace usage form omitted it; it now lists it.
  • audio, mcp, plugins, and proxy get generated blocks. A guard requires exactly one block per command in listCliCommandNames(), superseding the forward half of command-doc-coverage.test.ts.
  • Editorial pass: cut internal mechanisms, exact timings, help restatements, and per-reason narratives. Hand-written words: 27,152 → 12,739. Top sections: Navigation 5,585 → 1,996; Interactions 3,169 → 1,725; Media and logs 2,577 → 1,030; Wait and alerts 2,407 → 572; Settings helpers 1,493 → 578. Platform, backend, and precondition qualifiers stay. Headings, anchors, guarded phrases, and required reason tokens stay.

Before / after

agent-device help perf:

- agent-device perf cpu profile report --kind xctrace --out <report.json>
+ agent-device perf cpu profile report --kind xctrace [--template <name>] --out <report.json>

Validation

  • At 4301630c: check:command-docs, check:doc-prose, and check:doc-links (website build plus link check) pass. CI validates the head.
  • Earlier: check:affected --run passed at 0a8a7c7126.
  • Docs and help text only, so no device run applies.
  • Self-review: sentence-by-sentence sweep of the diff against 4075dd1 for dropped qualifiers, without an independent reviewer.

🤖 Generated with Claude Code

thymikee and others added 3 commits November 21, 2026 18:52
perf cpu profile report reads --template (falling back to the last
capture's template), but its usage form omitted the option.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tated prose

Add generated blocks for audio, mcp, plugins, and proxy. Delete
hand-written text that restates the adjacent generated block or
agent-device help, dedupe repeated paragraphs and examples, and move
the iOS runner refusal reasons under Retry after a failed command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The generated-block guard now checks the page against
listCliCommandNames(), which supersedes the forward half of the
command-doc coverage test and its canonical snapshot usage check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.49 MB 6.49 MB +20 B
Package (unpacked) 6.49 MB 6.49 MB +20 B
Package (download) 1.98 MB 1.98 MB +3 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 20.8 ms 20.6 ms -0.2 ms
CLI --help 44.4 ms 41.3 ms -3.0 ms

@apex-sentinel-staging

This comment has been minimized.

Generated blocks own API facts, `agent-device help` owns exact semantics,
and the error reasons page owns reason meanings. The notes now keep what a
command is for, how commands combine, gotchas that change the next step,
platform limits, and recovery advice. Internal mechanisms, exact timings,
and per-reason narratives are gone. Headings and guarded phrases stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee thymikee changed the title docs(commands): generate blocks for every public command and trim restated prose docs(commands): generate blocks for every public command and halve hand-written prose Nov 21, 2026
@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

At 43c1f63, one sentence in commands.md is now wrong for Android, so this needs a small fix before merge.

The old text said that on iOS the scroll refresh pull runs down the middle of the screen. The new text says "scroll refresh is one slow pull down the middle of the screen" and keeps only the list caveat under "On iOS" (commands.md#L1251). The scroll help says Android aims the pull inside the scroll container, and only iOS uses the middle of the screen (interaction/index.ts#L608). An agent on Android will read that the pull ignores the container, and may reason about the wrong gesture path. Please keep the platform qualifier of any sentence this PR rewrites, for example: "scroll refresh is one slow pull down. On Android it starts inside the scroll container; on iOS it runs down the middle of the screen, so a list only in the top or bottom part is not pulled." The same rule applies to "orientation auto ... on Android only" at commands.md#L366: other backends refuse it (orientation.ts#L12), so it should say "on ADB-backed Android".

Not blocking, and these can be taken or left: some facts lived only in the hand-written commands.md and no generated block or help text carries them now (published reasons such as shake-rest-acceleration-unreadable, simulator-log-stream-launch-timeout and runner_start_budget_exhausted; the targetActivation reason, priorState and otherActiveApplicationPid fields; the macOS native "no accessibility action" limit; where --no-post-gesture-stabilization is rejected), so each could keep one clause or move into a ReasonTable row and the comments that cite commands.md as owner could be updated; a few reworded bullets lost small qualifiers (--kind xctrace attach condition, Android hardware-button phone/tablet scope, Android TV and Fire TV detection notes, iOS runner cache retention); and the chore(gates) commit is followed by a docs commit, which is fine if the PR is squash-merged, with a pnpm format run if the double blank lines after some code fences remain.

The other 21 checks pass at this head. Body rules shows as cancelled, not failed: its workflow cancels older runs on the same ref, no gate script or workflow changed, and the PR body check run locally against the title and body passes. Not verified here: generator byte-equality, doc-prose and link results at 43c1f63, which rest on CI, and the exact command count behind "78 blocks", which rests on the guard test passing in CI. There are no conflicts. After the Android and orientation qualifiers are restored, this is ready to merge.

… and orientation auto

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee

Copy link
Copy Markdown
Member Author

Fixed at ce9b73d115: scroll refresh now says that on Android the pull starts inside the scroll container and on iOS it runs down the middle of the screen; orientation auto now says ADB-backed Android only. The optional items: the reasons that lost their prose (shake, simulator log stream, runner start budget, native audit, app-state activation) are being declared in ReasonTable rows by the running batch PRs (R2, R3, R6a), which also own the four comments that cite commands.md; changing those files here would conflict with them. pnpm format was run on the page.

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 1 new finding on ce9b73d. The verdict and the full list are in the summary comment.

Comment thread website/docs/docs/commands.md Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

The earlier finding on the shake error reasons is fixed at 6b22bb8: commands.md:369 names shake-rest-acceleration-unreadable again next to shake-console-refused, matching console-shake.ts:22-29. One docs problem remains.

The rewrite at commands.md:2274 now promises that the recorder captures the session app. The base text said the default app scope needs an active app session. On a local iOS simulator, record start without a scope still runs display-wide simctl io recordVideo: runtime.ts:100-123 passes only the device and output path, simctl-facade.ts:19-33 picks the lit display with no app filter, and completion.ts:92-101 exports without an app crop. A reader can expect an app-only video and share one that shows notifications, the home screen, or another app. Please restore the split between "app scope needs an active app session" and "the backend decides what is captured", and state that local iOS simulator recordings capture the display even with the default scope.

The inline thread on the shake reasons can be resolved: #4919 (comment).

All 21 checks pass, and this change only touches prose in website/docs. Not verified here: generator byte-equality, doc-prose and link checks were taken from CI and not run locally, and the non-delta diff was not re-read. There are no conflicts. Once the recording paragraph is corrected, nothing else blocks merge.

…tors capture the display

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee

Copy link
Copy Markdown
Member Author

Fixed at 7f7945f706: the record bullet says again that the default app scope needs an active app session and that the backend decides what is captured, and states that a local iOS simulator recording captures the whole display even at app scope (startAppleSimulatorRecording always records through simctl). --scope device|system keeps its "where the backend supports it" qualifier.

@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

The earlier finding about the removed gesture tap qualifier is still open at 7f7945f, and the one open inline thread on the Recording bullet is now fixed. CI is green: 21 checks pass, and the latest change only touches docs. There are no conflicts.

The rewrite drops the sentence that WebDriver providers must opt in to gesture tap. website/docs/docs/commands.md:1214 now describes multi-contact taps without that condition, and the generated gesture block links to a command-level support table that does not give the tap-specific rule. In a WebDriver session without tapGesture support, webdriver-interactor.ts:275 requires the separately mapped tapGesture capability before it sends W3C actions, and capabilities.ts:152 defaults it to unsupported. A reader who follows the gesture tap examples on a default WebDriver session gets UNSUPPORTED_OPERATION before any touch is sent. Please restore the sentence that WebDriver providers refuse gesture tap unless they declare tapGesture support in the handwritten gesture tap bullet.

The Recording bullet thread is fixed at this commit (#4919 (comment)), so the author can resolve it.

Not verified here: behavior on a simulator, since this was a docs-only review checked against the code path.

Once the gesture tap sentence is back, nothing else stands in the way of merge.

…out tapGesture support

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee

Copy link
Copy Markdown
Member Author

Fixed at 59daddc5fe: the gesture tap bullet says again that WebDriver providers refuse it unless they declare tapGesture support.

@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

One docs problem remains at 59daddc. The WebDriver gesture tap note from the earlier review is now restored at commands.md:1214, and it matches the capability guard in webdriver-interactor.ts.

The macOS focus note at commands.md:108 lost its best-effort qualifier. The base called focus handling best effort. The head says a windowed Android emulator always opens behind the focused app. That does not hold: when the frontmost-app lookup fails, the host still starts the emulator and skips focus restoration (src/platform-runtime-android-emulator-host.ts:73-86). When the watcher runs, it restores focus only if the emulator becomes frontmost within its startup budget. A user can rely on the new promise and still have the emulator take focus from the app they are using. Please restore the best-effort wording and say the emulator can take focus if the current app cannot be read or the window appears after the startup budget.

The same edit shows that the rewrite does not preserve every existing platform qualifier outside the gesture tap note. Please check the rest of the rewrite against the base for other dropped qualifiers, or explain why this one is safe to drop.

The generated-block guard in command-doc-generated-blocks.test.ts looks sound: it parses the published page and compares it to the production catalog, so it detects the original gap. All 21 checks pass at this head, and no conflicts are known. The recording bullet thread at commands.md:368 was fixed in 6b22bb8 and does not apply, so it can be resolved. Not verified here: a live WebDriver session. This was a docs-only review. After the focus note is corrected, nothing else stops the merge.

…rewrite dropped

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee

Copy link
Copy Markdown
Member Author

Qualifier sweep at 4301630c: I compared every removed or reworded sentence with the base text (4075dd1). Below is everything I restored and every omission I considered and kept, so the whole set can be checked at once.

Restored (section → qualifier, with the code it follows)

  • Device lifecycle → the macOS emulator window placement is best-effort: the emulator can still take focus if the focused app cannot be read, or if its window appears after the startup budget runs out (src/platform-runtime-android-emulator-host.ts:73-86,129).
  • Select a device → commands inside a session use the session's device (no AMBIGUOUS_MATCH).
  • Daemon → DEVICE_IN_USE exception: when the device rebooted after the claim was taken, open takes the claim and warns (src/commands/schema/cli-help.ts:317). "A command that needs the local daemon starts it" (device status never contacts one).
  • Open/close → "Metro-served" JS changes. The open settings --relaunch and close reasons are scoped to ADB-backed Android (packages/platform-android/src/app-lifecycle.ts).
  • Back → iOS presses the system back button only when it finds exactly one, and otherwise swipes. dismissControls lists only the buttons at the top of the app window (packages/command-surface/src/system/back.ts).
  • Orientation → the auto-rotate lock applies on ADB-backed Android (packages/platform-android/src/input-actions.ts:139).
  • hardware-button → iOS simulators refuse every key, not only volume (packages/command-surface/src/system/hardware-button.ts:19,56).
  • fold → iOS needs an Xcode with foldable HID support (fold help, Requirements).
  • capabilities → bounded-geometry covers ref and selector presses only. Coordinate presses skip the motion check.
  • HarmonyOS → settings supports only clear-app-state (packages/platform-harmonyos/src/runtime.ts:166).
  • watchOS → the list of commands that work is back, and every other command is refused (packages/platform-apple/src/os/watchos/facts.ts).
  • macOS → open can start a second instance while a copy is still registering, or when copies run from more than one path (launch-services-registration.ts:38-56). The Finder --count note is scoped to frontmost-app/menubar. The Chromium tree is turned on only by the native backend, so that bullet moved under it (SnapshotTraversal.swift:105-137). Native: click/press/fill need an element with an accessibility action inside an app window, not the menu bar, and scroll scrolls the area at the front window's center (BackgroundInteraction.swift:122-126,343, native-app-interactor.ts:152-170).
  • Alerts → the strict decline-only dismiss and the refusal of unknown buttons apply on iOS and Android. macOS falls back to the default/cancel button, then the first/last button (apple/macos-helper/.../main.swift:855-879).
  • Interactions → click @ref on the web also skips the motion check (element dispatch, packages/platform-web/src/interactor.ts:29).
  • Gestures → gesture tap works in Android and iOS/iPadOS app sessions only (packages/platform-apple/src/multitouch-support.ts). --hold-ms on gesture pan is single-pointer. synthesized_gesture_* is an iOS runner reason (packages/apple-runner/src/runner-contract.ts:360).
  • reinstall → the "unpack before uninstall" guarantee applies on iOS and Android.
  • Settings → settings bluetooth needs Android 8.1+ (svc bluetooth hint). permission applies to the session app on iOS and Android only, because macOS grants are host-level TCC.
  • perf → xctrace, simpleperf, and perfetto need the app running.
  • RN worktrees → Expo dev clients are handled only when the app registers a single exp+<slug> scheme (packages/platform-apple/src/core/app-resolution.ts:228-230).
  • Screenshots → the immediate capture and status-bar wait apply on ADB-backed Android.

Considered, cut kept

  • --launch-console, --text-stdin 64 KiB, --capture-backend runner refusals, and the gesture tap/swipe caps: the generated option tables state them.
  • The launch prompt language note stays unscoped. Help says "iOS simulator", and Limrun simulators also read it, so "local" would be wrong.
  • alert on iOS stays unscoped. Physical iOS devices support it (capabilities matrix). The base text "iOS simulator" was stale.
  • wait text "enabled" editable field: help says "an editable field never matches". The page matches help.
  • gesture drag on HarmonyOS: every drag is target-authored, so "gesture drag returns UNSUPPORTED" is exact.
  • Native macOS open --wait across daemons: the general open --wait bullet covers it. The install timeouts, record chunk recovery, runner cache trim, and status-bar timings are mechanisms or timings.
  • NO_TEXT_INPUT_AT_POINT "degraded XCTest channel", the web session workspace scoping, displayRotation displays, and --no-post-gesture-stabilization on MCP/.ad: no remaining sentence claims the broader case. Each entry describes what a returned value means, or is already hedged ("can report").
  • The install-from-source "any public host" wording is not a restriction (provision-kit/src/install-source.ts:235).

I also resolved the stale inline thread at commands.md:368 (fixed in 6b22bb8). No other unresolved threads remain.

@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

The earlier findings from 59daddc are now addressed, but one docs regression remains at 4301630. The code is otherwise as reviewed, and all 22 checks pass. Not verified here: every added qualifier sentence (alert macOS fallback, fold HID, Chromium accessibility, gesture tap scope, Expo scheme) was traced to code. The focus, bluetooth and hardware-button claims were sampled.

The home bullet in commands.md now says the watch face is unreachable. In a watchOS simulator session with an app in the foreground, agent-device home presses the Digital Crown and shows the watch face, and a second press from the face opens the app grid. The Swift dispatch still does this (RunnerTests+Interaction.swift), and the CLI help describes both transitions (home.ts). A reader planning watchOS navigation can now rule out home for a transition it supports. Please restore the two foreground-dependent home outcomes and limit the unreachable statement to interacting with watch-face overlays through session-app commands.

The PR text says the rewrite preserves the distinction between home taking the simulator to its watch face and app commands targeting the session app. That does not hold: the diff from 4075dd1 removes the explicit home-to-watch-face and face-to-app-grid transitions and adds the unqualified statement right after home. Please make the docs match that claim, or correct the claim.

…scope the overlay limit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee

Copy link
Copy Markdown
Member Author

At b3a547c784: the watchOS home bullet again says it acts on whatever is on screen (from an app it shows the watch face; from the watch face it opens the app grid, per system/home.ts), and the unreachable-overlay limit is scoped to the other commands, which act on the session app and bring it forward first (RunnerTests+Interaction.swift). That makes the earlier claim about keeping the home/session-app distinction true.

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of b3a547c

Since the review of 4301630: 0 new · 0 still open · 0 no longer raised

No open findings.

1 finding below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (d6767e0910fc).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready at b3a547c. The home bullet at commands.md:693 now states both transitions, which fixes the finding from the earlier review (#4919 (comment)), and nothing from that review remains. All 21 checks pass, and the change since the last review is a single docs line. There are no conflicts, and nothing else must happen before merge.

Not blocking: https://github.com/callstack/agent-device/blob/b3a547c/website/docs/docs/commands.md#L693 says other commands act on the session app and bring it to the foreground first, which also covers action-button, and the base text listed that one with home as acting on whatever is on screen. Saying "Other commands, except action-button" would fix it, and this can be taken or left.

The resolved thread at #4919 (comment) no longer applies, because the home bullet now matches home.ts:6, so the author can resolve it.

Not verified here: the docs build and checks were not run locally, and the foreground-first behavior of the non-home commands was not re-traced in Swift.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 21, 2026
@thymikee
thymikee merged commit b03e32b into main Nov 22, 2026
21 checks passed
@thymikee
thymikee deleted the docs/commands-editorial branch November 22, 2026 07:02
thymikee added a commit that referenced this pull request Nov 22, 2026
…-reasons

* origin/main:
  docs(commands): generate blocks for every public command and halve hand-written prose (#4919)
  fix(depgraph): budget the blast-radius query, not the whole-tree scan (#4920)
  refactor: remove dead exports and stale fallow exemptions (#4931)
  refactor(reasons): declare the R6a reasons in ReasonTable rows (#4938)

# Conflicts:
#	website/docs/docs/error-reasons.md
thymikee added a commit that referenced this pull request Nov 22, 2026
…n-client-reasons

* origin/main:
  docs(commands): generate blocks for every public command and halve hand-written prose (#4919)
  fix(depgraph): budget the blast-radius query, not the whole-tree scan (#4920)
  refactor: remove dead exports and stale fallow exemptions (#4931)
  refactor(reasons): declare the R6a reasons in ReasonTable rows (#4938)

# Conflicts:
#	website/docs/docs/error-reasons.md
thymikee added a commit that referenced this pull request Nov 22, 2026
…android-reasons

* origin/main:
  docs(commands): generate blocks for every public command and halve hand-written prose (#4919)
  fix(depgraph): budget the blast-radius query, not the whole-tree scan (#4920)
  refactor: remove dead exports and stale fallow exemptions (#4931)
  refactor(reasons): declare the R6a reasons in ReasonTable rows (#4938)

# Conflicts:
#	website/docs/docs/error-reasons.md
thymikee added a commit that referenced this pull request Nov 22, 2026
…er-errors

* origin/main:
  docs(commands): generate blocks for every public command and halve hand-written prose (#4919)
  fix(depgraph): budget the blast-radius query, not the whole-tree scan (#4920)
  refactor: remove dead exports and stale fallow exemptions (#4931)
  refactor(reasons): declare the R6a reasons in ReasonTable rows (#4938)

# Conflicts:
#	website/docs/docs/error-reasons.md
thymikee added a commit that referenced this pull request Nov 22, 2026
* origin/main:
  docs(commands): generate blocks for every public command and halve hand-written prose (#4919)
  fix(depgraph): budget the blast-radius query, not the whole-tree scan (#4920)
  refactor: remove dead exports and stale fallow exemptions (#4931)
  refactor(reasons): declare the R6a reasons in ReasonTable rows (#4938)

# Conflicts:
#	website/docs/docs/error-reasons.md
thymikee added a commit that referenced this pull request Nov 22, 2026
* origin/main:
  docs(commands): generate blocks for every public command and halve hand-written prose (#4919)
  fix(depgraph): budget the blast-radius query, not the whole-tree scan (#4920)
  refactor: remove dead exports and stale fallow exemptions (#4931)
  refactor(reasons): declare the R6a reasons in ReasonTable rows (#4938)

# Conflicts:
#	packages/platform-harmonyos/src/app-lifecycle.ts
#	website/docs/docs/error-reasons.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant