← Back to Pull requests

fix(cli): state each option default once in help output #7334

Open
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Oct 26, 2026 23:54 UTC
Author

Summary

Six CLI commands printed an option default twice in --help output: once as prose inside the option description and once as the automatic (default: …) annotation the help renderer appends when the option has a schema default. This removes the redundant prose from the CLI-layer option descriptions so each default is stated exactly once, and adds a boundary test covering all six commands.

Fixes #7306

Problem and expected behavior

Smallest trigger: node scripts/rea.mjs inspect-byte-entropy --help prints --block-size <number> Power-of-two block size from 256 to 65536 bytes (default 4096) (default: 4096). The violated invariant is that an option's help presents its default once. Both annotations carried the same value in the same units, so the defect was purely presentational redundancy across 11 entries in six commands: inspect-byte-entropy (--block-size, --offset), inspect-devicetree (four --max-* options), decode-signal-recording (--line_offset), inspect-packet-capture (--match_offset), inspect-packet-fields (--kind, --offset), and inspect-signal-decoders (--offset).

Change and scope

The redundant text lived in two layers:

  • src/cli/binaryDiagnosticsCommands.ts — the CLI-layer .describe() overrides themselves appended (default N); those clauses are dropped.

  • src/cli/captureCommands.ts and src/cli/signalCommands.ts — the commands spread shared domain-schema shapes, whose descriptions say "default 0" / "defaults to protocols". Following the existing pattern in those files (the CLI-layer limit overrides), the affected fields are re-described at the CLI wiring layer with the default mention removed.
  • The domain schemas and the MCP tool contracts are intentionally unchanged, so machine-readable schema defaults and advertised tool descriptions are untouched. No help content beyond the duplicated default wording is altered.

    Contribution scope: not applicable; ordinary presentation fix within the existing CLI surface.

    Contract and boundary impact

  • Semantic owner and earliest changed stage: CLI help presentation (transport/projection layer); consumers are human CLI readers only.

  • Contribution scope fit and linked maintainer decision: not applicable.

  • CLI and MCP/tool-catalog contract: CLI help text only; MCP tool descriptions, input schemas and defaults unchanged. Generated catalogs are unaffected (verified: no artifact/catalog files changed).

  • Provider, bridge, target-format, or platform compatibility: none.

  • Evidence, artifact, provenance, or reconstruction contract: not applicable.

  • Target selection, authority, upstream behavior, and cleanup details: not applicable.

  • Generated metadata: none; no build outputs committed.
  • Expected effects: documentation or usability only; no target interaction.

  • Documentation or usability only; no target interaction.
  • Evidence and regression coverage

  • Tests added or updated: tests/boundary/cli/helpDefaultAnnotation.test.ts runs --help for the six affected commands and asserts that no help line restates the automatic (default: …) annotation's value in its description (matching (default X), default X, or defaults to X prose before the automatic annotation).

  • Base reproduction or other evidence: on base revision 077de9259 the new test fails with exactly the reported lines, e.g. --block-size <number> Power-of-two block size from 256 to 65536 bytes (default 4096) (default: 4096) and --offset <number> Window start as a decimal file byte offset (default 0) (default: 0); after the fix it passes.

  • User-visible CLI/MCP output: inspect-byte-entropy --help now shows --block-size <number> Power-of-two block size from 256 to 65536 bytes (default: 4096); the same single-annotation presentation applies to the other ten entries.

  • Remaining proof gaps: the test enumerates the six commands from the issue, not a complete catalog audit; other commands could carry similar wording but none were reported.
  • Boundary regressions: not applicable (no boundary or lifecycle behavior changed).

    Validation performed

  • npx vitest run tests/boundary/cli/helpDefaultAnnotation.test.ts — red on base (failed with the two byte-entropy duplicate lines and the equivalent duplicates in the other five commands), green after the fix.

  • npx vitest run tests/boundary/cli/ — 1198 passed; 33 failures in 11 files are pre-existing environment issues on this machine (local Node is 24.21.0 while supported_runtime requires ^24.22.1, and IDA/Hopper/provider probes are absent); none touch the six affected commands or help rendering.

  • node scripts/rea.mjs <command> --help for the six commands against a local build — all exit 0 with each default shown once.
  • Compatibility, safety, and release

  • Breaking changes or migration steps: none; help text only.

  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.

  • Package or release metadata impact: none.

  • Security, privacy, process, or containment review: not applicable; no target interaction.
  • Author readiness

    Human owner: @akushonkamen

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.

  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.

  • I declare this PR ready for initial maintainer review.
  • Before merge

  • This PR addresses a concrete problem or an agreed enhancement.

  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.

  • The PR has one focused outcome and the title follows type(scope): outcome.

  • Related issue is linked, or the reason for not linking one is stated above.

  • Tests cover changed observable behavior and meaningful failure paths.

  • Owning docs, contracts, and generated metadata are updated where needed.

  • User-visible CLI/MCP changes include representative output.

  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: greptile-apps[bot] Review duration: 8m
    All Vouch review confidence checks passed
    Residual risk 0.38 = Change Risk (0.52) × (1 − Review Confidence (0.27)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 52% · Reviewer familiarity: 35%
    26%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #7334"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 26.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 26.5% · Lower = rushed or shallow review
    26.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 38.2% · Moderate risk
    38.2%
    Repository