Skip to content

refactor(acp,plugins): reorder functions and tests top-down by behavior - #1222

Merged
hakula139 merged 1 commit into
mainfrom
refactor/reorder-plugins-and-acp
Dec 6, 2026
Merged

hakula139 merged 1 commit into
mainfrom
refactor/reorder-plugins-and-acp

Conversation

@hakula139

Copy link
Copy Markdown
Member

Summary

Reorder functions, match arms, and unit tests across plugins/ and crates/ox-acp/ to read top-down from caller to callee and group tests by behavior (normal cases before edge and error cases), with zero behavior changes.

  • plugins/ox-plugin-compaction/src/lib.rs: reorder production functions top-down (serve -> parse_initialize_params, plugin_manifest_json, handle_compaction -> default_compaction_prompt, format_transcript -> truncate_chars, request_host_complete).
  • plugins/ox-plugin-stats/src/lib.rs: reorder production functions top-down (serve -> parse_initialize_params, plugin_manifest_json -> stats_command_json, handle_command_invoke -> resolve_db_path -> default_state_db_path, query_usage_since -> now_millis, format_usage_markdown -> format_cost_usd), order StatsRange::parse match arms to match enum order ("day", "week", "month", "" | "all"), and move seed_state_store next to rpc_roundtrip in mod tests.
  • plugins/ox-plugin-mcp/src/mcp.rs, src/mcp/http.rs, and src/config.rs: move paginate_list below list_tools / list_prompts (next to request / notify), move post_json below request and notify, and move defer_tools_defaults_to_true_and_supports_overrides before split_cli_spec_rejects_* and validate_rejects_*.
  • crates/ox-acp/src/lib.rs and src/prompt.rs: move DropNotifier and BlockingTool to the top test helper block, move multimodal_prompt_blocks_convert_and_reject_invalid_inputs next to the normal prompt tests, group prompt_agent_error_emits_internal_error with handles_jsonrpc_and_agent_errors, and order filename_from_uri before parse_file_uri to match into_content_block call order.

Test plan

  • nix develop -c run-hooks passed all 20 hooks (rustfmt, clippy, cspell, and repository checks).
  • cargo test -p ox-acp -p ox-plugin-compaction -p ox-plugin-stats -p ox-plugin-mcp passed all 43 tests (ox-acp: 9, ox-plugin-compaction: 3, ox-plugin-mcp: 25 unit + 2 integration, ox-plugin-stats: 4).

@hakula139 hakula139 added refactor Behavior-preserving restructuring area: extensions Touches hooks, skills, packages, or MCP integration area: acp Touches ACP stdio server or protocol handling labels Dec 6, 2026
@hakula139 hakula139 self-assigned this Dec 6, 2026
@codecov

codecov Bot commented Dec 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.26406% with 48 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
plugins/ox-plugin-stats/src/lib.rs 73.91% 30 Missing ⚠️
plugins/ox-plugin-compaction/src/lib.rs 84.94% 14 Missing ⚠️
plugins/ox-plugin-mcp/src/mcp.rs 93.33% 2 Missing ⚠️
crates/ox-acp/src/lib.rs 99.03% 1 Missing ⚠️
crates/ox-acp/src/prompt.rs 87.50% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@hakula139
hakula139 merged commit 00d4c73 into main Dec 6, 2026
7 checks passed
@hakula139
hakula139 deleted the refactor/reorder-plugins-and-acp branch December 6, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: acp Touches ACP stdio server or protocol handling area: extensions Touches hooks, skills, packages, or MCP integration refactor Behavior-preserving restructuring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant