Skip to content

Scope MCP work proof guidance by repo#350

Closed
TUPM96 wants to merge 1 commit into
ramimbo:mainfrom
TUPM96:codex/bounty-315-repo-scoped-work-proof
Closed

Scope MCP work proof guidance by repo#350
TUPM96 wants to merge 1 commit into
ramimbo:mainfrom
TUPM96:codex/bounty-315-repo-scoped-work-proof

Conversation

@TUPM96
Copy link
Copy Markdown
Contributor

@TUPM96 TUPM96 commented May 26, 2026

Refs #315

Summary

  • Add an optional repo selector to submit_work_proof when selecting by issue_number so agents can disambiguate duplicate issue numbers across repositories.
  • Keep text/json response behavior intact while returning structured JSON for the selected bounty.
  • Document the repo selector in the MCP tool description and add regression coverage for repo-scoped lookup and invalid selector combinations.

Tests

  • python -m pytest tests\test_api_mcp.py -q
  • python -m pytest -q
  • python -m ruff check .

Summary by CodeRabbit

  • New Features

    • Work proof submission now supports an optional repository parameter to filter bounties by repository when selecting via issue number.
    • Added validation to prevent invalid parameter combinations.
  • Documentation

    • Tool documentation updated to clarify available parameters and supported output formats.

Review Change Stack

Copilot AI review requested due to automatic review settings May 26, 2026 01:23
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 87f5c507-327b-41cc-9882-2e98858ce371

📥 Commits

Reviewing files that changed from the base of the PR and between ac99d79 and d16094c.

📒 Files selected for processing (3)
  • app/main.py
  • app/mcp.py
  • tests/test_api_mcp.py

📝 Walkthrough

Walkthrough

This PR adds an optional repo selector to the submit_work_proof MCP tool that filters bounty matches by repository when used with issue_number. It includes argument parsing, validation, query filtering, documentation updates, and comprehensive tests.

Changes

Repo-scoped issue number bounty selection

Layer / File(s) Summary
Repo argument parsing and validation
app/main.py
Added internal helper to parse and validate optional repo argument with length constraints and lowercase normalization. Extended tool validation to reject repo without issue_number and reject using both bounty_id and repo together.
Issue number scoped filtering by repo
app/main.py
Updated issue_number-based bounty lookup query to apply case-insensitive repo filtering when repo selector is provided.
Tool documentation for repo selector
app/mcp.py
Expanded submit_work_proof tool description in MCP_TOOLS to document the optional repo parameter and output format capabilities.
Test repo-scoped selection and invalid argument cases
tests/test_api_mcp.py
Added test_mcp_submit_work_proof_scopes_issue_number_by_repo to verify repo-scoped bounty matching across repositories. Extended parametrized invalid-selector test with repo-related invalid cases including type validation, size limits, and invalid combination checks.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • ramimbo/mergework#287: Both PRs modify the submit_work_proof MCP tool's selector-handling around issue_number (the retrieved PR adds/validates issue_number-based bounty selection and guidance, while the main PR further scopes issue_number matches by an optional repo and extends validation/tests for repo-related invalid combinations).

Suggested reviewers

  • TateLyman
  • weilixiong
  • Karry2019web
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Scope MCP work proof guidance by repo' directly and clearly describes the main change: adding repository scoping to the MCP work proof submission feature.
Description check ✅ Passed The description covers the key objectives and includes test commands, but deviates from the template structure by using 'Tests' instead of 'Test Evidence' and omitting the checkbox format and other required sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds repo as an optional selector for the MCP submit_work_proof tool when querying by issue_number, enabling disambiguation of bounties that share the same issue number across different repositories.

Changes:

  • Added MCP argument parsing/validation for an optional repo selector (only allowed with issue_number) and applied it to the bounty lookup query.
  • Updated MCP tool description to mention repo + format.
  • Added tests covering repo-scoped selection and new invalid-selector cases.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tests/test_api_mcp.py Adds regression tests for repo-scoped issue_number selection and validation cases.
app/mcp.py Updates the MCP tool metadata description for submit_work_proof to reflect new selector options.
app/main.py Implements repo selector parsing + validation and applies it to issue_number bounty queries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/mcp.py
Comment on lines +42 to +43
"Return submission instructions, optionally for a bounty_id or issue_number "
"and repo, with text or json format"
Comment thread app/main.py
if repo is None:
return None
if len(repo) > 200:
raise ValueError("repo is too long")
Comment thread app/main.py
Bounty.issue_number == positive_int_arg("issue_number")
)
if repo_selector is not None:
issue_query = issue_query.where(func.lower(Bounty.repo) == repo_selector)
@TUPM96
Copy link
Copy Markdown
Contributor Author

TUPM96 commented May 26, 2026

Superseded by #351, which keeps the repo-scoped MCP guidance change in one focused PR.

@TUPM96 TUPM96 closed this May 26, 2026
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