Skip to content

Fix export help JSON output#2949

Open
Yeachan-Heo wants to merge 1 commit intoultraworkers:mainfrom
Yeachan-Heo:fix/export-help-json
Open

Fix export help JSON output#2949
Yeachan-Heo wants to merge 1 commit intoultraworkers:mainfrom
Yeachan-Heo:fix/export-help-json

Conversation

@Yeachan-Heo
Copy link
Copy Markdown
Contributor

Summary

  • preserve --output-format json when routing local subcommand help
  • add a bounded structured JSON help envelope for claw export --help
  • keep export help plaintext in text mode and cover both contracts with Rust regressions

Tests

  • cargo fmt
  • cargo test -p rusty-claude-cli --test output_format_contract
  • cargo test -p rusty-claude-cli subcommand_help_flag_has_one_contract_across_all_subcommands_141
  • cargo test -p rusty-claude-cli export_help_json_is_bounded_and_parseable_384

@Yeachan-Heo
Copy link
Copy Markdown
Contributor Author

OMX review verdict: APPROVE, with owner-confirmation gate before merge.

Reviewed PR head 51b9e6b37ff3f842dbb712f5232de8e0fbc2997b against current upstream/main.

Changed files:

  • rust/crates/rusty-claude-cli/src/main.rs
  • rust/crates/rusty-claude-cli/tests/output_format_contract.rs

What changed:

  • CliAction::HelpTopic now carries CliOutputFormat.
  • Local subcommand help routing preserves --output-format json.
  • claw export --help --output-format json now emits bounded structured JSON instead of plaintext.
  • Other local help topics requested with JSON now emit a generic help JSON envelope.

GitHub state:

  • Open / non-draft
  • MERGEABLE / CLEAN
  • Checks passing: docs source-of-truth, cargo fmt, cargo test --workspace, cargo clippy --workspace

Local verification passed:

git diff --check upstream/main...pr-2949-fetched
git merge-tree $(git merge-base upstream/main pr-2949-fetched) upstream/main pr-2949-fetched
cd rust && cargo fmt --check
cd rust && cargo test -p rusty-claude-cli --test output_format_contract -- --nocapture
cd rust && cargo test -p rusty-claude-cli export_help_json_is_bounded_and_parseable_384 -- --nocapture
cargo run -p rusty-claude-cli -- export --help --output-format json | python3 -m json.tool
cargo run -q -p rusty-claude-cli -- export --help
cargo run -q -p rusty-claude-cli -- status --help --output-format json | python3 -m json.tool

Merge risk: low. No blockers found.

Important merge gate: this changes user-facing CLI/help/JSON behavior. Even though the change matches the PR goal and tests cover it, exact help JSON output is a user-facing contract surface, so merge should wait for explicit owner confirmation.


[repo owner's gaebal-gajae (clawdbot) 🦞]

@Yeachan-Heo
Copy link
Copy Markdown
Contributor Author

Review verdict: APPROVE

Reviewed PR #2949 against current origin/main.

  • PR head: 51b9e6b
  • Current origin/main: 57096b0
  • GitHub base / merge-base: e939777f
  • Changed files:
    • rust/crates/rusty-claude-cli/src/main.rs
    • rust/crates/rusty-claude-cli/tests/output_format_contract.rs

What changed:

  • CliAction::HelpTopic now carries CliOutputFormat.
  • Local subcommand help preserves --output-format json.
  • claw export --help --output-format json now emits bounded structured JSON.
  • Non-export local help JSON now emits a generic { kind, topic, command, message } envelope.
  • claw export --help plaintext behavior is preserved.

CI is green: cargo test, clippy, fmt, and docs source-of-truth all pass.

Targeted local checks passed on a fresh review clone:

  • cargo fmt --check
  • cargo test -p rusty-claude-cli --test output_format_contract export_help -- --nocapture
  • cargo test -p rusty-claude-cli export_help_json_is_bounded_and_parseable_384 -- --nocapture
  • cargo test -p rusty-claude-cli subcommand_help_flag_has_one_contract_across_all_subcommands_141 -- --nocapture
  • cargo run -q -p rusty-claude-cli -- export --help --output-format json | python3 -m json.tool
  • cargo run -q -p rusty-claude-cli -- export --help smoke check
  • cargo run -q -p rusty-claude-cli -- status --help --output-format json smoke check

Blockers: none found.

Merge risk: LOW technically, but merge should remain gated on owner confirmation because this changes user-facing CLI/help/JSON contract behavior.

Notes:

  • A local pipe check for status --help --output-format json initially hit a Python stdin composition mistake, then passed when redirected to a file; no CLI failure.
  • The branch is based on an older main, but git merge-tree showed no textual conflict markers against current main and GitHub reports the PR clean.


[repo owner's gaebal-gajae (clawdbot) 🦞]

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