Skip to content

Clarify CLI help and render accurate command usage - #145

Merged
zhongwencool merged 3 commits into
mainfrom
zw/clarify-cli-help
Oct 7, 2026
Merged

zhongwencool merged 3 commits into
mainfrom
zw/clarify-cli-help

Conversation

@zhongwencool

Copy link
Copy Markdown
Owner

Summary

  • Reorganize root help into clear sections, move command discovery into its own section, and remove the notes block.
  • Give all subcommands grouped options, complete usage, meaningful placeholders, accurate dynamic timeout rules, and relevant defaults and bounds.
  • Wrap help within 80 columns and add useful, shell-quoted examples with safe continuation lines.

Compatibility and scope

  • Keep command names, runtime behavior, validation rules, authorization requirements, and public schema unchanged.
  • Preserve JSON examples as argument arrays; only descriptive text, examples, and explanatory default rules change in command descriptors.
  • Keep the default report at 24 lines; root help now has a 40-line budget. Subcommand help is width-bounded without hiding required safety information.
  • No release, deployment, or user runtime-node operations are included.

Validation

  • rebar3 eunit: 945 tests, 0 failures.
  • sh scripts/escript-smoke.sh: passed, including all 25 help pages, 47 shell example round-trips, help aliases, preflight checks, and isolated TUI EOF handling.
  • python3 scripts/generate-cli-schema.py --check: passed.
  • rebar3 as ci compile: passed.
  • rebar3 fmt -c on every changed Erlang file: passed.
  • git diff --check and staged diff checks: passed.
  • Compared all 23 command descriptors to confirm non-descriptive contracts remain unchanged.
  • Manually inspected built help; root help is 40 lines / 78 columns, and all subcommand pages are at most 80 columns. Shell examples use a stub, not live tracing.

Changes:
- Organize root help into task-oriented sections and remove the notes block.
- Group subcommand options, expose required arguments, and show accurate timeout rules and parameter bounds.
- Wrap help at 80 columns and provide shell-quoted, executable examples while preserving JSON argument arrays.
- Preserve command names, validation, authorization, and runtime behavior; retain a 24-line default report budget and allow 40-line root help.
- Add regression coverage for all 25 command help pages and 47 shell examples.

Validation:
- rebar3 eunit: 945 tests passed, 0 failures.
- sh scripts/escript-smoke.sh: passed, including help aliases, 25 page layouts, 47 shell argument round-trips, and isolated TUI EOF handling.
- python3 scripts/generate-cli-schema.py --check: passed.
- rebar3 as ci compile: passed.
- rebar3 fmt -c on all changed Erlang files: passed.
- git diff --check and git diff --cached --check: passed.
- Compared all 23 command descriptors: contracts unchanged except descriptions, examples, and explanatory default rules.
- Inspected built help output; no user runtime nodes or real tracing were used for example validation.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-10-07T03:09:12.132646Z 1f2ac90 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.73418% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.13%. Comparing base (3fcd50b) to head (f954823).

Files with missing lines Patch % Lines
src/observer_cli_catalog.erl 97.05% 1 Missing ⚠️
src/observer_cli_command_help.erl 99.19% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #145      +/-   ##
==========================================
+ Coverage   95.02%   95.13%   +0.11%     
==========================================
  Files          34       35       +1     
  Lines        9451     9586     +135     
==========================================
+ Hits         8981     9120     +139     
+ Misses        470      466       -4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Changes:
- Gate JSON discovery and the JSON-backed help audit on the tested CLI controller's OTP major version.
- Assert the documented exit code and error for both JSON flag forms on OTP 26 instead of requiring unsupported output.
- Exercise text and Erlang-term discovery on every supported controller while preserving help, preflight, and TUI smoke checks.
- Document the help-audit script's OTP 27+ prerequisite without changing application behavior or weakening runtime validation.

Validation:
- sh scripts/escript-smoke.sh on real OTP 26.2.5.2 in an isolated source/build directory: passed, including both JSON rejection checks and TUI EOF handling.
- sh scripts/escript-smoke.sh on OTP 29.1.1: passed, including all 25 help pages and 47 shell example round-trips.
- OTP 26 rebar3 eunit --module=observer_cli_command_help_test,observer_cli_input_test: 41 tests passed, 0 failures.
- sh -n scripts/escript-smoke.sh: passed.
- git diff --check: passed.
- The full CI matrix will rerun after pushing this fix; no application source changed.
Changes:
- Replace eight separate spawn-and-monitor pairs for immediately exiting fixtures with atomic spawn_monitor calls.
- Preserve assertions that expect a normal DOWN message instead of allowing a late monitor to report noproc and hang the test.
- Keep production tracing, timeout budgets, and cleanup assertions unchanged.

Validation:
- Reproduced delayed monitor attachment on OTP 29: all 100 separate-monitor trials reported noproc, while all 100 atomic-monitor trials reported normal.
- rebar3 eunit --module=observer_cli_trace_test: 72 tests passed, 0 failures.
- rebar3 fmt -c test/observer_cli_trace_test.erl: passed.
- git diff --check: passed.
- GitHub CI confirmed the prior OTP 26 smoke fix; this change addresses the newly exposed OTP 29 trace fixture timeout.
@zhongwencool
zhongwencool merged commit eca44f5 into main Oct 7, 2026
8 checks passed
@zhongwencool
zhongwencool deleted the zw/clarify-cli-help branch October 7, 2026 08:34
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