Skip to content

test(output_format_contract): add plugins json coverage to inventory_commands test#2972

Merged
Yeachan-Heo merged 1 commit intomainfrom
test/plugins-json-output-format-contract
Apr 30, 2026
Merged

test(output_format_contract): add plugins json coverage to inventory_commands test#2972
Yeachan-Heo merged 1 commit intomainfrom
test/plugins-json-output-format-contract

Conversation

@code-yeongyu
Copy link
Copy Markdown
Collaborator

Adds four assertions to the existing inventory_commands_emit_structured_json_when_requested test in output_format_contract.rs:

  • kind == "plugin"
  • action == "list"
  • reload_runtime is boolean
  • target is null when no plugin is targeted

claw plugins --output-format json was the only major JSON surface with zero contract coverage. Every other surface (agents, mcp, skills, status, sandbox, doctor, help, version, acp, bootstrap-plan, system-prompt, init, diff, config) already had assertions.

Local test run: cargo test -p rusty-claude-cli -- inventory_commands_emit_structured_json_when_requested → 2 passed (0 failed).

…commands test

Add four assertions to inventory_commands_emit_structured_json_when_requested:
- kind == "plugin"
- action == "list"
- reload_runtime is boolean
- target is null when no plugin is targeted

Closes the only major --output-format json surface with zero contract
coverage. All other surfaces (agents, mcp, skills, status, sandbox,
doctor, help, version, acp, bootstrap-plan, system-prompt, init, diff,
config) already had test assertions.
@Yeachan-Heo
Copy link
Copy Markdown
Contributor

Review verdict: APPROVE

Inspected exact diff against current main:

  • Base: 57096b0
  • Head: 7cd5277
  • Changed files: one test file only
    • rust/crates/rusty-claude-cli/tests/output_format_contract.rs
  • Diff size: +12
  • No source/runtime files changed.

Coverage verified: the PR adds claw --output-format json plugins assertions inside inventory_commands_emit_structured_json_when_requested, exercising the relevant path through assert_json_command(&root, &["--output-format", "json", "plugins"]).

Assertions added/checked:

  • kind == "plugin"
  • action == "list"
  • reload_runtime is boolean
  • target is null when no plugin target is provided

Current implementation sanity checked: plugin JSON output already emits kind, action, target, and reload_runtime; this PR locks existing behavior with contract coverage.

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

Targeted local test passed from PR head:

  • cargo test -p rusty-claude-cli --test output_format_contract inventory_commands_emit_structured_json_when_requested -- --nocapture

The filter also matched resumed_inventory_commands_emit_structured_json_when_requested; both passed.

Merge risk: very low. Blockers: none. Owner confirmation: not needed, test-only coverage addition.


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

@Yeachan-Heo
Copy link
Copy Markdown
Contributor

Review verdict: APPROVE

Inspected PR #2972 against current origin/main.

Scope:

  • Test-only change in rust/crates/rusty-claude-cli/tests/output_format_contract.rs
  • No source/runtime files changed

What it covers:

  • Adds claw --output-format json plugins coverage inside inventory_commands_emit_structured_json_when_requested
  • Verifies the existing contract fields:
    • kind == "plugin"
    • action == "list"
    • reload_runtime is a boolean
    • target == null when no plugin target is provided

Verification:

  • GitHub CI is green: fmt, clippy, workspace tests, docs source-of-truth
  • Local targeted run passed:
    • cargo test -p rusty-claude-cli --test output_format_contract inventory_commands_emit_structured_json_when_requested -- --nocapture

Merge risk: very low. This is narrow test coverage for the already-existing plugins JSON contract, so no owner confirmation gate is needed.


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

@Yeachan-Heo Yeachan-Heo merged commit 8e45f18 into main Apr 30, 2026
4 checks passed
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.

2 participants