Boolean CLI Flag Defaults Refactoring

Codex·GPT-5.6-sol·Maxwell-Rosen·1w ago·23min·1 Checkpoint·38 file changes·+508/-392·230K tokens

In the CLI, I'd like the options which are booleans to simply trigger the boolean flag when specified without a flag. So something like plot --no_show defaults to false and is interpreted as true when the flag is provided, but when given is true. Therefore, all boolean values should default to false. So plot defaults to show, but when --no_show is provided, then it does not show, but someone could also provide --no_show False which does show or --no_show True which does not show. Each boolean should have a name which makes sense

1w ago

In the CLI, I'd like the options which are booleans to simply trigger the boolean flag when specified without a flag. So something like plot --no_show defaults to false and is interpreted as true when the flag is provided, but when given is true. Therefore, all boolean values should default to false. So plot defaults to show, but when --no_show is provided, then it does not show, but someone could also provide --no_show False which does show or --no_show True which does not show. Each boolean should have a name which makes sense. Do not change the defaults of options. Instead, if there is an option which defaults to True, change the name sensibly such that the default is False

1w ago·5.9s

I’ll trace how command signatures become Click options, inventory every boolean default, then update the naming/compilation rule and tests while preserving each command’s current behavior.

The CLI is generated directly from API signatures. I found that booleans are currently ordinary click.BOOL options, so they always require a value. I’m now separating the CLI-facing flag name/value from the unchanged Python parameter: default-True API options will be exposed as an inverted, default-False CLI option such as no_show.

The true-default inventory includes display controls (show, legend, colorbar, showgrid), animation controls (fixed_range, fromcurrent, redraw), and a few domain options (sqrt2, velocity, is_contour, header). Their Python defaults will remain untouched; only the generated CLI representation will be inverted, with is_contour becoming the clearer no_contour.

The core behavior is now implemented: every generated boolean has an optional value, a bare occurrence means True, and every CLI-side default is False. I’ve also added inversion tests covering omitted, bare, explicit True, explicit False, and short-option forms.

The updated help now advertises booleans as optional values ([BOOLEAN]), shows False for every boolean default, and explains the inversion for renamed options. The CLI tutorial also documents all three forms: bare flag, explicit True, and explicit False.

The complete suite reached 93% with one failure and is currently in its slower rendering tail. I’ll let it finish, then isolate and fix the reported failure before the final verification.

Rather than changing the prefix to the boolean flags, change the scripts themselves so that the CLI perfectly mirrors the API. therefore, all API booleans should default to False. Update the documentation too and agent tools to reflect this

1w ago·3.9s

Understood—the API itself is now the source of truth. I’ll replace every public default-True boolean with a sensibly named default-False parameter, update implementations/call sites/docs, and simplify the CLI so it mirrors those names and values directly. I’m stopping the superseded verification run first.

The API rename set is now concrete: no_show, no_legend, no_colorbar, no_showgrid, no_header, no_sqrt2, no_velocity, no_spin, no_redraw, plus positive inverse concepts where clearer—overlay_axes, variable_range, from_start, volume, nodal, and metadata_only. Existing default behavior is preserved by inverting the implementation condition, not by changing what a bare call does.

The compiler now rejects any generated API boolean whose declared default is not exactly False, so this contract cannot silently regress. I’ve also documented the rule in AGENTS.md, which is the repository’s agent-facing source of truth.

The affected API and CLI tests are passing, including direct API behavior, generated option names/defaults, explicit boolean values, and bare flags. Two unrelated Plotly media-export tests hang while launching the local browser renderer in this environment, so I’m running the complete suite with only those two export tests deselected.

Implemented and committed as ff28501.

  • API and CLI boolean defaults are all False.
  • CLI names exactly mirror API names.
  • Bare flags imply True; explicit True/False work.
  • Renamed options include no_show, no_legend, volume, variable_range, and nodal.
  • Updated scripts, documentation, and AGENTS.md.

Verification: 1,682 passed, 6 skipped; 2 environment-hanging Plotly export tests deselected.