Skip to content

docs(cli): cut --help prose to usage and contract - #403

Merged
ractive merged 4 commits into
mainfrom
iter-help-prose-trim
Nov 27, 2026
Merged

ractive merged 4 commits into
mainfrom
iter-help-prose-trim

Conversation

@ractive

@ractive ractive commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Cause

Long --help hid the option list under prose (kb/backlog.md, agent feedback 2026-11-26). launch --help printed 155 lines before Usage:, eval --help 128. --stringify first came up around line 108 of eval --help. crates/ff-rdp-cli/src/cli/args.rs had 110 iter-NNN mentions and a lot of fixed-bug history ("from iter-93 to iter-164 … even though this help claimed otherwise", "BREAKING (iter-160)", "Note (iter-126): previously …").

Fix

This PR changes help text only. No flag, default or behaviour changes.

  • Each long_about now holds the usage and the current contract, written tersely: defaults, wait semantics, output fields, exit codes, flag interactions, and limits such as the ~500px window floor.
  • Facts an agent rarely needs first now sit in a per-command after_long_help, which clap prints after Options:. These are extra output shapes, edge cases and Examples. This applies to navigate, eval, network, screenshot, click, type, reload, launch, stop, install-skill, install-hook, profiles, profiles prune, run and index.
  • Iteration numbers, PR/issue numbers, dogfooding-session and DEC references, kb/ paths and "used to / before iter-N" history are gone from help strings, argument docs and the non-help comments in args.rs.
  • eval --help line 4 now says: "Objects and arrays come back as protocol grips (actor IDs, class names); pass --stringify for the value."
  • I fixed one wording error. The consent help said consent accept "exits 1 for the two non-accepting outcomes", but there are three (clicked_not_dismissed, detected_not_actioned, no_cmp_detected). It now says "exits 1 for every outcome but accepted", which matches the exit table in consent accept --help.
  • I left the console Output: line untouched, because a sibling PR owns it.

Proofs

Each number is the count of lines before Usage: in ff-rdp <cmd> --help. I measured every command and subcommand with the same script on the binaries built before and after the change.

command before after
launch 155 14 (Usage: on line 15)
eval 128 15 (Usage: on line 16; --stringify on line 4)
navigate 119 24
click 103 23
network 73 24
profiles prune 49 23
reload 47 21
screenshot 44 24
stop 38 25
console 12 12 (unchanged, sibling-owned)

The largest value for any command is now 25 (stop, addon reload). Before, 13 commands were over 25.

$ grep -c 'iter-[0-9]' crates/ff-rdp-cli/src/cli/args.rs
0          # was 110

Gates on the final tree:

  • cargo fmt and cargo clippy --workspace --all-targets -- -D warnings are clean.
  • FF_RDP_BLESS=1 cargo test -p ff-rdp-cli --test skill_drift passed, and SKILL.md did not change (its generated region does not come from long_about).
  • cargo test --workspace -q: 2485 passed, 0 failed.

The existing help-wording tests (unit_165_help_text_matches_behaviour, unit_160_type_help_states_synthetic_ceiling, stop_help_states_the_safety_rules, click_help_states_no_user_activation, and the screenshot/eval/responsive/launch/manifest --help assertions) pass unmodified.

I did not run Firefox: the change touches help text only.

Facts I dropped on purpose

  • History: these all described past behaviour, not the current contract.
    • eval: the regex, template-literal and class-body scanner bugs.
    • navigate: status being null before iter-166; results.network once being a bare array.
    • network: --jq once switching the detail mode.
    • a11y contrast: total once meaning the sample size.
    • click: the removed entered field.
    • geometry: hidden elements once included by default.
    • consent accept: the old exit-0-for-everything behaviour and the double-envelope bug.
    • launch: a removed auto_consent: true field.
    • profiles prune: "before this field existed".
  • Measurement rationale: launch's "Firefox bound the port at 7 s, the old 5 s bound failed 5/5"; the "tested on Firefox 153.0.3" note (removed from both screenshot's long_about and its --window-size flag doc); launch's "empirically confirmed on macOS". The resulting limits are kept.
  • Implementation detail without contract value: eval's "Firefox inlines ~1000 chars and ff-rdp fetches the rest" (the contract "strings come back in full" stays); type's Marionette/BiDi aside; the explanation of why type --submit has two budgets (the 600 ms and 3 s budgets stay); the comparis.ch example host.
  • Internal pointers: kb/research/viewport-emulation.md, kb/iterations/iteration-142-…, DEC-027 and dogfooding-session references.

Review (code-review, medium)

The review found no correctness bugs. I fixed all four wording findings in aa6aa6a:

  • eval: the "return the last statement" rule applies only to wrapped scripts, meaning those that declare, use await, or run with --stringify. Plain scripts are sent verbatim and keep their completion value. The help now says this.
  • launch: --window-size was described as "the only path with true viewport emulation". It is now described as the way to get a live session at a real window size, with a pointer to screenshot --viewport. Screenshot's "only true sub-500px raster" had the same problem and is reworded the same way.
  • stop: the help says again that a launch --profile DIR instance can be stopped too, because its owner markers live in a managed directory, not in the user's profile.
  • screenshot --window-size flag doc: the Firefox version note is gone.

CI

supply-chain failed on the first push because of RUSTSEC-2026-0592 (url 2.5.8). That advisory also failed main, so it was not caused by this PR. ff-rdp#404 bumped url to 2.5.9 and is merged. This branch now includes it through a merge of origin/main.

Skipped

  • Nothing from the backlog item was skipped.
  • The top-level ff-rdp --help after-text (AFTER_LONG_HELP) is still long. It follows the option list, and I only removed its history and iteration references.

Not confirmed

  • clap renders long_about unwrapped, so the long Output: lines count as one line each. Narrow terminals wrap them, so a reader there sees more than the counts above.

🤖 Generated with Claude Code

Every command's long_about now states usage and the current contract
only: no iteration numbers, no fixed-bug history, no kb/ paths. Detail
that an agent rarely needs first (extra output shapes, edge cases,
examples) moves to after_long_help, below the option list.

launch and eval show Usage: at line 15 (was 157 / 130); eval names
--stringify on line 4. No command has more than 25 lines of prose
before Usage:. args.rs has 0 `iter-NNN` mentions (was 110). No flag,
default or behaviour changes.

Ticks the kb/backlog.md "long --help buries the option list" line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ractive and others added 3 commits November 27, 2026 00:49
- eval: the return-last-statement rule applies to wrapped scripts only
  (declaring, await, --stringify); plain scripts are sent verbatim and
  keep their completion value.
- launch/screenshot: --window-size is the way to a live session at a real
  window size, not the only viewport emulation (screenshot --viewport).
- stop: restore that a launch --profile instance is stoppable too.
- screenshot --window-size arg: drop the Firefox version note.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	crates/ff-rdp-cli/src/cli/args.rs
#	kb/backlog.md
@ractive
ractive merged commit 74d81c6 into main Nov 27, 2026
13 checks passed
@ractive
ractive deleted the iter-help-prose-trim branch November 27, 2026 22:47
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.

1 participant