Repository navigation
refactor(acp,plugins): reorder functions and tests top-down by behavior - #1222
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reorder functions, match arms, and unit tests across
plugins/andcrates/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), orderStatsRange::parsematch arms to match enum order ("day","week","month","" | "all"), and moveseed_state_storenext torpc_roundtripinmod tests.plugins/ox-plugin-mcp/src/mcp.rs,src/mcp/http.rs, andsrc/config.rs: movepaginate_listbelowlist_tools/list_prompts(next torequest/notify), movepost_jsonbelowrequestandnotify, and movedefer_tools_defaults_to_true_and_supports_overridesbeforesplit_cli_spec_rejects_*andvalidate_rejects_*.crates/ox-acp/src/lib.rsandsrc/prompt.rs: moveDropNotifierandBlockingToolto the top test helper block, movemultimodal_prompt_blocks_convert_and_reject_invalid_inputsnext to the normal prompt tests, groupprompt_agent_error_emits_internal_errorwithhandles_jsonrpc_and_agent_errors, and orderfilename_from_uribeforeparse_file_urito matchinto_content_blockcall order.Test plan
nix develop -c run-hookspassed 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-mcppassed all 43 tests (ox-acp: 9,ox-plugin-compaction: 3,ox-plugin-mcp: 25 unit + 2 integration,ox-plugin-stats: 4).