Align submit_work_proof MCP contract#856
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe PR tightens the ChangesMCP Tool Input Validation
Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
xiefuzheng713-alt
left a comment
There was a problem hiding this comment.
Reviewed current head 400fbba82a98c60557f7cc79a10d42b41f3ac6ae for Bounty #838 review evidence.
I inspected the focused diff in app/mcp.py, app/mcp_tools.py, and tests/test_api_mcp.py. The schema change keeps additionalProperties: false, preserves the existing bounty_id vs issue_number mutual exclusion, and now advertises the runtime selector contract that repo only applies with issue_number. The runtime change rejects undeclared submit_work_proof arguments before selecting generic or bounty-specific guidance, so typoed fields such as formta and extra fields such as unexpected no longer silently fall through.
I also reproduced the live behavior before this fix with read-only MCP calls against production: submit_work_proof with {format:json,unexpected:ignored} still returned generic structured guidance, and {formta:json} still returned generic text guidance instead of invalid tool arguments.
Local validation on this head:
uv run --extra dev pytest tests/test_api_mcp.py::test_mcp_submit_work_proof_rejects_invalid_bounty_selectors tests/test_api_mcp.py::test_mcp_submit_work_proof_rejects_undeclared_arguments tests/test_api_mcp.py::test_mcp_tools_list_and_call -q-> 16 passed, 1 warning.uv run --extra dev pytest tests/test_api_mcp.py tests/test_mcp_tools.py -q-> 116 passed, 1 warning.uv run --extra dev ruff check app/mcp.py app/mcp_tools.py tests/test_api_mcp.py tests/test_mcp_tools.py-> passed.uv run --extra dev ruff format --check app/mcp.py app/mcp_tools.py tests/test_api_mcp.py tests/test_mcp_tools.py-> passed.uv run --extra dev mypy app/mcp.py app/mcp_tools.py-> success.uv run --extra dev python scripts/docs_smoke.py-> docs smoke ok.git diff --check origin/main...HEAD-> clean.git merge-tree --write-tree origin/main HEAD-> clean tree547aa5801115e47661ee37b737f7aa64bd435dfe.- GitHub hosted
Quality, readiness, docs, and image checksis SUCCESS on this head.
Duplicate/eligibility check: scripts/review_bounty_candidates.py --repo ramimbo/mergework --reviewer xiefuzheng713-alt --format text reports PR #856 as candidate_for_fresh_review with no current-head human review found. I do not see an overlapping open useful PR for this exact submit_work_proof unknown-argument/schema-contract fix.
No issues found in the reviewed scope.
Summary
submit_work_proofMCP arguments instead of silently ignoring themsubmit_work_proofinput schema with the runtime selector rules sorepois only valid withissue_numberBounty #799
Source reports:
Production evidence before fix
POST https://api.mrwk.online/mcptools/call submit_work_proofwith{"format":"json","unexpected":"ignored"}returned a successful structured result instead ofinvalid tool arguments.POST https://api.mrwk.online/mcptools/call submit_work_proofwith{"formta":"json"}returned successful generic text guidance instead ofinvalid tool arguments.tools/listadvertisedadditionalProperties: false, but the schema did not encode the runtime rule thatrepoonly works withissue_numberand not withbounty_id.Validation
uv run --extra dev python -m pytest tests/test_api_mcp.py tests/test_mcp_tools.py -q->116 passed, 1 warningruff check app/mcp.py app/mcp_tools.py tests/test_api_mcp.py tests/test_mcp_tools.py-> passedruff format --check app/mcp.py app/mcp_tools.py tests/test_api_mcp.py tests/test_mcp_tools.py-> passeduv run --extra dev python -m mypy app-> successuv run --extra dev python scripts/docs_smoke.py-> docs smoke okgit diff --check -- app/mcp.py app/mcp_tools.py tests/test_api_mcp.py-> cleangit merge-tree --write-tree origin/main HEAD-> clean treeabda6f4c7b8cc6d19c1ef4bc0fd2711b121cfce1Scope
submit_work_proofcontractSummary by CodeRabbit