// Step 875: whetstone_plan_transpilation_run MCP tool (8 tests) #include "MCPServer.h" #include static int p=0,f=0; #define T(n) { std::cout << " " << #n << "... "; } #define P() { std::cout << "PASS\n"; ++p; } #define F(m) { std::cout << "FAIL: " << m << "\n"; ++f; } #define C(c,m) if(!(c)){F(m);return;} void t1(){T(tool_registered); MCPServer srv; auto r=srv.handleRequest({{"jsonrpc","2.0"},{"id",1},{"method","tools/list"},{"params",{}}}); bool found=false; for(auto& t:r["result"]["tools"]) if(t["name"]=="whetstone_plan_transpilation_run") found=true; C(found,"tool found");P();} void t2(){T(no_pair_id_fails); MCPServer srv; auto r=srv.handleRequest({{"jsonrpc","2.0"},{"id",1},{"method","tools/call"},{"params",{{"name","whetstone_plan_transpilation_run"},{"arguments",nlohmann::json::object()}}}}); auto res=nlohmann::json::parse(r["result"]["content"][0]["text"].get()); C(!res["success"].get(),"fail");P();} void t3(){T(valid_pair_succeeds); MCPServer srv; auto r=srv.handleRequest({{"jsonrpc","2.0"},{"id",1},{"method","tools/call"},{"params",{{"name","whetstone_plan_transpilation_run"},{"arguments",{{"pair_id","py->cpp"}}}}}}); auto res=nlohmann::json::parse(r["result"]["content"][0]["text"].get()); C(res["success"].get(),"success");P();} void t4(){T(plans_array); MCPServer srv; auto r=srv.handleRequest({{"jsonrpc","2.0"},{"id",1},{"method","tools/call"},{"params",{{"name","whetstone_plan_transpilation_run"},{"arguments",{{"pair_id","py->cpp"}}}}}}); auto res=nlohmann::json::parse(r["result"]["content"][0]["text"].get()); C(res["plans"].is_array(),"plans");P();} void t5(){T(three_plans); MCPServer srv; auto r=srv.handleRequest({{"jsonrpc","2.0"},{"id",1},{"method","tools/call"},{"params",{{"name","whetstone_plan_transpilation_run"},{"arguments",{{"pair_id","py->cpp"}}}}}}); auto res=nlohmann::json::parse(r["result"]["content"][0]["text"].get()); C(res["plan_count"].get()==3,"count");P();} void t6(){T(base_cost_tier); MCPServer srv; auto r=srv.handleRequest({{"jsonrpc","2.0"},{"id",1},{"method","tools/call"},{"params",{{"name","whetstone_plan_transpilation_run"},{"arguments",{{"pair_id","py->cpp"}}}}}}); auto res=nlohmann::json::parse(r["result"]["content"][0]["text"].get()); C(res.contains("base_cost_tier"),"tier");P();} void t7(){T(budget_decision_in_plans); MCPServer srv; auto r=srv.handleRequest({{"jsonrpc","2.0"},{"id",1},{"method","tools/call"},{"params",{{"name","whetstone_plan_transpilation_run"},{"arguments",{{"pair_id","py->cpp"},{"budget_limit",0.1}}}}}}); auto res=nlohmann::json::parse(r["result"]["content"][0]["text"].get()); C(res["plans"][0].contains("budget_decision"),"budget");P();} void t8(){T(pair_id_in_response); MCPServer srv; auto r=srv.handleRequest({{"jsonrpc","2.0"},{"id",1},{"method","tools/call"},{"params",{{"name","whetstone_plan_transpilation_run"},{"arguments",{{"pair_id","rust->go"}}}}}}); auto res=nlohmann::json::parse(r["result"]["content"][0]["text"].get()); C(res["pair_id"]=="rust->go","pair_id");P();} int main(){ std::cout<<"Step 875: whetstone_plan_transpilation_run\n"; t1();t2();t3();t4();t5();t6();t7();t8(); std::cout<<"\nResults: "<