Repository navigation
fix(cli): stop restating schema defaults in help descriptions - #9278
Merged
Merged
Conversation
The help renderer appends "(default: X)" whenever the option field declares a
schema default, so descriptions that also spell the default out print it twice:
--block-size <value> Power-of-two block size from 256 to 65536 bytes
(default 4096) (default: 4096)
Remove the hand-written default from the eleven options that own a schema
default across inspect-byte-entropy, inspect-devicetree,
inspect-packet-capture, inspect-packet-fields, inspect-signal-decoders and
decode-signal-recording, matching the rule in cliDecimalField's contract that
the domain field owns bounds, defaults and help.
Options without a schema default keep their prose: --match_limit, --line_limit,
--limit and --packet_limit are nullable or optional, so the renderer emits no
annotation and the description is the only place the effective value appears.
Add a boundary test asserting each such option states its default exactly once,
so a restated default cannot come back unnoticed.
Shelden-Hao
marked this pull request as ready for review
November 7, 2026 14:27
Contributor
[Low impact] The PR appears safe to merge; no blocking issue was found. SummaryRemoves repeated default values from eleven option descriptions across six commands.
Reviews (2) · Last reviewed commit: "fix(cli): stop restating schema defaults..." · Reviewed by Greptile |
This was referenced Nov 7, 2026
Owner
|
Glad to welcome you to REA, @Shelden-Hao! Thanks for cleaning up the repeated defaults in CLI help and covering the affected options; it makes those command descriptions easier to read. |
This was referenced Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #7306.
rea <command> --helpprinted the same default twice for eleven options, forexample
(default 4096) (default: 4096). The help renderer already appends(default: X)when the option field declares a schema default, so a descriptionthat also spells the default out duplicated it.
Problem and expected behavior
Smallest trigger:
rea inspect-byte-entropy --helponmain(c5301e6) printsViolated invariant:
cliDecimalField's documented contract insrc/cli/options.tsstates the domain field owns bounds, defaults, nullabilityand help. The CLI description restated a fact the schema already owns, so the
rendered help carried it twice. Expected: each option states its default once.
Change and scope
I removed the hand-written default from the eleven options whose field declares
a schema default, across six commands:
inspect-byte-entropy(--block-size,--offset),inspect-devicetree(--max-file-bytes,--max-nodes,--max-properties,--max-depth),inspect-packet-capture(--match_offset),inspect-packet-fields(--kind,--offset),inspect-signal-decoders(
--offset) anddecode-signal-recording(--line_offset).I deliberately left the options untouched where the description is the only place
the effective value appears:
--match_limitand--line_limitarenullable().default(50); the rendereremits no annotation for them, so their prose keeps
default 50.--limit,--packet_limitand the--all*flags declare no schema default.Maintainer scope decision: not applicable — help text within existing boundaries,
no new provider or capability, no target interaction.
Contract and boundary impact
src/domain/captures/andsrc/domain/signals/, plus the CLI optiondescriptions in
src/cli/binaryDiagnosticsCommands.ts. Defaults stay owned bythe schemas; only the duplicated prose is removed. No superseded path remains:
the renderer is now the single producer of the annotation.
existing contract; scope decision not applicable.
bounds, defaults and JSON Schemas are unchanged; descriptions are identical
apart from the removed restatement. MCP clients keep the
defaultkeyword inthe schema and the nullable-field prose.
skills/output is committed.Expected effects:
Evidence and regression coverage
tests/boundary/cli/cliHelpDefaultAnnotations.test.tsopens thereal CLI via
createCli({}), renders--helpfor the six commands and failswhen an option line carries zero or more than one
defaultstatement. It alsofails when an expected option line is missing, so a renamed flag cannot silently
skip the assertion.
--helponmain(c5301e6) produced(default 4096) (default: 4096); the new test fails on that revision with twodefaultstatements per line.dist):incurdependency and is not covered by this repository's tests; this change asserts
the rendered output instead of that implementation detail.
Boundary regressions: the applicable case is the CLI help surface in
docs/testing.md; lifecycle regressions are not affected because no resourceownership or process supervision changes.
Validation performed
npm run test:focused -- tests/boundary/cli/cliHelpDefaultAnnotations.test.ts— could not run in my checkout:node_modules/.package-lock.jsonwas missing after an interruptednpm ci. I ran the same test file directly withnode node_modules/vitest/vitest.mjs run tests/boundary/cli/cliHelpDefaultAnnotations.test.ts— 1 passednode scripts/run-typescript.mjs --noEmit— no diagnosticsnode scripts/ci/static-check-report.mjs lint— 6626 files, 0 errors (3332 pre-existing warnings)node scripts/rea.mjs <six commands> --help— each option states its default exactly once, output quoted aboveCompatibility, safety, and release
type, bound, default or schema changes.
process interaction.
Author readiness
Human owner: @Shelden-Hao
I completed these declarations before marking this PR ready for review.
Before merge
type(scope): outcome.