Skip to content

fix(cli): omit inherited body flags from intent commands - #64

Merged
TristanSpeakEasy merged 5 commits into
mainfrom
fix/cli-intent-body-flags
Oct 2, 2026
Merged

TristanSpeakEasy merged 5 commits into
mainfrom
fix/cli-intent-body-flags

Conversation

@TristanSpeakEasy

@TristanSpeakEasy TristanSpeakEasy commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Why

Single-route intent commands inherit the backing operation's body flags, defaults, and union descriptions. Those can contradict the intent's pinned variant and declared inputs, while exposing a second whole-body flag alongside the intended JSON body escape.

What changed

  • Register only non-body operation metadata on intents with a JSON body escape. Preserve parameter-only intents and multipart upload fields.
  • Align flag-name/shorthand collision checks and machine-readable usage with the registered flags.
  • Remove obsolete inherited-body aliases and backing-input fallbacks. Update JSON body help to describe the existing merge and duplicate-key rejection behaviour.
  • Add regression coverage for help/usage, absent inherited flags, combined positional/model/body inputs, and retained multipart and mixed-operation parameters. Update documentation, the CLI changeset, and generated review output.

Review notes

Inherited body-field flags are no longer available on JSON-body intents. Use the intent's declared inputs and JSON body flag, or the generated operation command for full field-level control. Multipart intents retain their existing upload flags. Body merging and preset precedence are unchanged.

Testing

  • npm run format and make check-template-cli: passed.
  • TARGET=review make test-cli: passed (539 tests, 2 skipped).
  • TARGET=primary make test-cli: 1,440 tests ran with one obsolete assertion expecting an inherited body alias. Updated that assertion, regenerated both fixtures, and ran the focused checks below successfully. The full primary suite was not repeated after that correction.
  • TARGET=review make build-cli and TARGET=primary make build-cli: passed on the final implementation, including compile and staticcheck.
  • go test ./tests -run 'TestIntent|TestReadmeExamples|TestUsage' -count=1: passed in both generated fixtures after the final changes.
  • Manual JSON dry-run confirmed positional input, -m, and --body all survive in the request.
  • git diff --check: passed.
  • make lint: blocked by the existing gofmt failure in unchanged templates/perms.go.

Public-safety check

  • This change contains no credentials, customer documents, private repository URLs, private filesystem paths, or unredacted private logs.
  • Title, body, comments, and commit messages name no customers or customer-derived identifiers, private paths or trackers, or workflow provenance, and are understandable without private context.
  • Generated fixtures and review SDK changes are public-safe.
  • I reviewed git diff --check.

Summary by cubic

Fixes intent commands so a JSON body escape no longer inherits the backing operation's body flags, defaults, or union descriptions. Intent commands now expose only their declared inputs plus the --body JSON escape, avoiding a second, contradictory whole-body flag.

  • Registers only non-body metadata on JSON-body intents; multipart upload fields and parameter-only intents keep their flags.
  • Documents that --body merges with intent inputs and rejects duplicate keys, with updated usage, help, and regression tests.
  • Removes the obsolete dual-body merge coverage and adds a multipart upload intent fixture plus a CI check that release tags match the generated CLI version.

Written for commit 0e62306. Summary will update on new commits.

Review in cubic

@TristanSpeakEasy
TristanSpeakEasy requested a review from a team as a code owner October 2, 2026 00:37
@TristanSpeakEasy TristanSpeakEasy added the bug Something isn't working label Oct 2, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 25 files

Shadow auto-approve: would not auto-approve because issues were found.

Fix all with cubic | Re-trigger cubic

Comment thread templates/templates/cli/README.md Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would auto-approve. Fixes generated CLI intent commands to stop inheriting the backing operation's body flags, removing contradictory flags and updating help, usage, fixtures, docs, and regression tests. The change is bounded and exposure-reducing, with no operational tradeoffs requiring human judgment.

Re-trigger cubic

Comment thread templates/templates/cli/tests/primary/intents_test.go.stmpl
Comment thread templates/templates/cli/tests/primary/intents_test.go.stmpl Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 2 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would auto-approve. Fixes generated CLI intent commands to stop inheriting the backing operation's body flags, removing contradictory flags and updating help, usage, fixtures, docs, and regression tests. The change is bounded and exposure-reducing, with no operational tradeoffs requiring human judgment.

Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 13 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would auto-approve. Fixes generated CLI intent commands to stop inheriting backing operation body flags, removing contradictory dual body surfaces and updating help, usage, docs, and tests. The change is bounded and exposure-reducing, with no operational tradeoff needing human judgment.

Re-trigger cubic

@TristanSpeakEasy
TristanSpeakEasy added this pull request to the merge queue Oct 2, 2026
Merged via the queue into main with commit 0cdc850 Oct 2, 2026
864 of 873 checks passed
@TristanSpeakEasy
TristanSpeakEasy deleted the fix/cli-intent-body-flags branch October 2, 2026 04:35
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants