Skip to content

feat: add MCP input schemas#738

Open
JONASXZB wants to merge 6 commits into
ramimbo:mainfrom
JONASXZB:codex/mcp-input-schemas-710
Open

feat: add MCP input schemas#738
JONASXZB wants to merge 6 commits into
ramimbo:mainfrom
JONASXZB:codex/mcp-input-schemas-710

Conversation

@JONASXZB
Copy link
Copy Markdown
Contributor

@JONASXZB JONASXZB commented May 31, 2026

Summary

  • Addresses Proposed work: add input schemas for all MCP tools #710 by adding conservative inputSchema metadata for every MCP tool that accepts arguments.
  • Mirrors existing runtime validation for integer bounds, enums, booleans, wallet/public-key/signature/hash patterns, labels, memos, and required fields without changing handler behavior.
  • Documents tools/list schemas as the preflight argument contract while keeping server validators authoritative.

Testing

  • .venv/bin/python -m pytest tests/test_api_mcp.py tests/test_docs_public_urls.py -q (114 passed, 1 warning)
  • .venv/bin/python scripts/docs_smoke.py
  • .venv/bin/python -m ruff check app/mcp.py tests/test_api_mcp.py
  • .venv/bin/python -m ruff format --check app/mcp.py tests/test_api_mcp.py
  • git diff --check

Source issue: #710

Summary by CodeRabbit

  • New Features

    • Tools now publish per-tool input validation schemas with standardized numeric-id/limit handling (accepts JSON integers or integer-strings) and reused integer/limit validators.
  • Documentation

    • Clarified that tools expose inputSchema for preflight checking and that list limits for certain endpoints are capped at 100.
  • Tests

    • Added assertions verifying inputSchema presence and correctness, including integer-or-string numeric checks, enums, patterns, required fields, and limits.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 31, 2026

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds shared numeric JSON-Schema constants, expands MCP_TOOLS entries with per-tool inputSchema objects, updates submit_work_proof to reuse the positive-integer schema, updates docs to advertise these schemas and the list limit cap, and extends tests with a helper and assertions verifying schema shapes.

Changes

MCP Tool Input Schema Contract

Layer / File(s) Summary
Schema constants and MCP_TOOLS expansion
app/mcp.py
Adds POSITIVE_INTEGER_SCHEMA, NONNEGATIVE_INTEGER_SCHEMA, LIST_LIMIT_SCHEMA, and replaces minimal MCP_TOOLS entries with full inputSchema definitions (properties, required, patterns, enums, defaults, bounded limit, additionalProperties: False).
submit_work_proof numeric schema reuse
app/mcp.py
Replaces duplicated inline integer constraints for bounty_id and issue_number with POSITIVE_INTEGER_SCHEMA via dict unpacking.
API Documentation
docs/api-examples.md
Documents that tools/list returns per-argument inputSchema, clarifies numeric id/limit parsing (JSON integer or integer string), and records the limit cap (100) for list_bounties/list_bounty_attempts.
Tests: schema assertions and helper
tests/test_api_mcp.py, tests/test_docs_public_urls.py
Adds Any import and _assert_integer_or_string_schema helper; expands test_mcp_tools_list_and_call to assert inputSchema presence and detailed field constraints for multiple tools; adds doc assertions enforcing numeric format text and limit cap.

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: add MCP input schemas' clearly and concisely names the changed surface, directly matching the main change of adding inputSchema metadata to MCP tools.
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.
Mergework Public Artifact Hygiene ✅ Passed No investment, price, cash-out, fabricated payout, or problematic security claims found. MRWK correctly described as native project coin requiring discussion for future features.
Bounty Pr Focus ✅ Passed PR references Bounty #647 and Issue #710; diff includes exactly 4 stated files with focused MCP input schema changes across 4 commits; no unrelated scope detected.
Description check ✅ Passed PR description covers summary, evidence, testing checklist (all items verified), and bounty reference per maintainer feedback.

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


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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2adb2242-5567-4f86-bed6-60e1a5e2f1cd

📥 Commits

Reviewing files that changed from the base of the PR and between 0eb12a3 and 7d8fdf5.

📒 Files selected for processing (3)
  • app/mcp.py
  • docs/api-examples.md
  • tests/test_api_mcp.py

Comment thread app/mcp.py Outdated
Comment thread docs/api-examples.md
Copy link
Copy Markdown
Contributor

@Gwani-28 Gwani-28 left a comment

Choose a reason for hiding this comment

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

Requesting changes for one schema/runtime mismatch in the signed transfer tool.\n\nThe new docs say tools/list inputSchema is the preflight argument contract while server validation remains authoritative, and #710 asks that schemas mirror current handler validation. For submit_wallet_transfer, the schema currently allows two values the runtime can never accept:\n\n- app/mcp.py:112-115 uses pattern ^\d+(?:.\d{1,6})?$ for amount_mrwk, which admits "0" and "0.000000". The authoritative parser parse_mrwk_amount rejects non-positive amounts with "amount must be positive".\n- app/mcp.py:116 declares nonce minimum 0. Wallets start at nonce 0 and _verify_wallet_payload requires nonce == wallet.nonce + 1, so nonce 0 is not a valid transfer nonce for any normal registered wallet state.\n\nBecause these are wallet-transfer fields, agents using the new schema for preflight would still generate calls that the server rejects immediately. Please tighten the schema/test coverage so transfer preflight rejects zero MRWK amounts and nonce 0, or otherwise document why the schema is intentionally wider than the runtime validator.\n\nLocal validation on current head 7d8fdf5:\n- .venv/bin/python -m pytest tests/test_api_mcp.py tests/test_docs_public_urls.py -q -> 114 passed, 1 existing Starlette/httpx warning\n- .venv/bin/ruff check app/mcp.py tests/test_api_mcp.py -> passed\n- .venv/bin/ruff format --check app/mcp.py tests/test_api_mcp.py -> 2 files already formatted\n- .venv/bin/python scripts/docs_smoke.py -> docs smoke ok\n- git diff --check origin/main...HEAD -> clean\n- git merge-tree --write-tree origin/main HEAD -> clean tree 91f8e8e98ea8d18e1be9b2bac3775a97b7aa6880\n- gh pr checks 738 --repo ramimbo/mergework -> CodeRabbit passed/skipped and Quality/readiness/docs/image checks passed\n\nNo private data, credentials, wallet material, production mutation, price/exchange/bridge/off-ramp behavior, or fabricated payout claims were used.

Copy link
Copy Markdown
Contributor

@Gwani-28 Gwani-28 left a comment

Choose a reason for hiding this comment

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

Rechecked current head 6f403d2 after the schema-alignment follow-up.

The new commit improves the MCP contract by allowing integer strings for ids/limits and by documenting the MCP 100-row limit separately from the REST 200-row limit. That addresses the numeric-string/doc mismatch from the earlier review path.

The signed transfer schema mismatch is still not fully resolved, though. submit_wallet_transfer.amount_mrwk still uses ^\d+(?:\.\d{1,6})?$, so schema preflight accepts 0 and 0.000000; parse_mrwk_amount() rejects those as non-positive. nonce is now widened to NONNEGATIVE_INTEGER_SCHEMA, but that still allows integer/string zero even though wallet transfers require the next nonce and registered wallets start at nonce 0, so nonce 0 remains an immediately rejected preflight value for normal transfer calls.

Since the docs now explicitly position inputSchema as the agent-side preflight contract while server validators stay authoritative, these wallet-transfer fields should be tightened or the intentional looseness should be documented with tests.

Local validation on current head 6f403d2:

  • .venv/bin/python -m pytest tests/test_api_mcp.py tests/test_docs_public_urls.py -q -> 114 passed, 1 existing Starlette/httpx warning
  • .venv/bin/ruff check app/mcp.py tests/test_api_mcp.py -> passed
  • .venv/bin/ruff format --check app/mcp.py tests/test_api_mcp.py -> 2 files already formatted
  • .venv/bin/python scripts/docs_smoke.py -> docs smoke ok
  • git diff --check origin/main...HEAD -> clean
  • git merge-tree --write-tree origin/main HEAD -> clean tree 46f4e12398e1966e7a97a9b6a2a2bd9d13b3413f
  • gh pr checks 738 --repo ramimbo/mergework -> Quality/readiness/docs/image checks passed; CodeRabbit was still pending at review time

No private data, credentials, wallet material, production mutation, price/exchange/bridge/off-ramp behavior, or fabricated payout claims were used.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 79cfce9f-6432-4838-99ab-64575e727c80

📥 Commits

Reviewing files that changed from the base of the PR and between 7d8fdf5 and 6f403d2.

📒 Files selected for processing (4)
  • app/mcp.py
  • docs/api-examples.md
  • tests/test_api_mcp.py
  • tests/test_docs_public_urls.py

Comment thread app/mcp.py
@JONASXZB
Copy link
Copy Markdown
Contributor Author

Addressed the current-head review feedback in af04930:

  • tightened submit_wallet_transfer.amount_mrwk so zero values such as 0 / 0.000000 no longer pass the preflight schema;
  • changed submit_wallet_transfer.nonce from nonnegative to positive integer/string schema, matching the normal next-nonce runtime path for registered wallets;
  • extended the MCP schema test for both fields.

Verification: .venv/bin/python -m pytest tests/test_api_mcp.py tests/test_docs_public_urls.py -q -> 114 passed / 1 warning; docs smoke, targeted Ruff check/format, and git diff --check passed.

Copy link
Copy Markdown
Contributor

@xyjk0511 xyjk0511 left a comment

Choose a reason for hiding this comment

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

Reviewed current head af049303081e71282744217c1a04a22d7a613a17 as a current-head follow-up.

What I checked:

  • inspected the latest MCP schema updates in app/mcp.py, plus docs/test updates in docs/api-examples.md, tests/test_api_mcp.py, and tests/test_docs_public_urls.py;
  • verified the latest head tightens numeric preflight semantics with integer-or-string schemas that include control-character exclusion and bounded limits for list endpoints;
  • verified the previously reported transfer preflight mismatch is now narrowed: submit_wallet_transfer.amount_mrwk rejects zero-valued amounts by schema pattern, and transfer nonce now requires positive integer-or-string (minimum=1 equivalent);
  • verified docs now explicitly distinguish MCP list limit cap (100) from REST list cap (200) and describe inputSchema as preflight contract while server validators remain authoritative.

Validation run locally:

  • $env:PYTEST_DISABLE_PLUGIN_AUTOLOAD='1'; python -m pytest tests/test_api_mcp.py tests/test_docs_public_urls.py -q -> 114 passed
  • python -m ruff check app/mcp.py tests/test_api_mcp.py tests/test_docs_public_urls.py -> passed
  • python -m ruff format --check app/mcp.py tests/test_api_mcp.py tests/test_docs_public_urls.py -> 3 files already formatted
  • python scripts/docs_smoke.py -> docs smoke ok
  • git diff --check origin/main...HEAD -> clean
  • git merge-tree --write-tree origin/main HEAD -> clean tree 2af78b676a09c435545e535f7775d80e43d9f91f
  • hosted Quality/readiness/docs/image checks are green; CodeRabbit was pending at review time.

I did not find a blocker on this current head.

No private data, credentials, wallet material, production mutation, payout/proof/ledger execution, exchange/bridge/cash-out, or price behavior was used or changed.

Copy link
Copy Markdown
Contributor

@Difficult-Burger Difficult-Burger left a comment

Choose a reason for hiding this comment

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

Reviewed current head af049303081e71282744217c1a04a22d7a613a17 as a current-head follow-up after the earlier stale requested-changes review.

No blocker found for the MCP input schema change.

Evidence checked:

  • applied the PR patch cleanly onto base origin/main 0eb12a384da80cacf669b0fb98dc06afefbbd2e3 in an isolated mergework-review-738-local worktree;
  • inspected app/mcp.py, app/mcp_tools.py, app/ledger/service.py, docs/api-examples.md, tests/test_api_mcp.py, and tests/test_docs_public_urls.py;
  • confirmed tools/list now exposes schemas for the argument-taking MCP tools without changing handler dispatch or runtime validators;
  • confirmed numeric id and limit schemas accept integer values and integer strings while preserving the runtime positive-int/list-limit behavior, including the MCP limit <= 100 cap;
  • rechecked the previously reported wallet-transfer mismatch and confirmed the current head tightens amount_mrwk to reject zero-valued amounts and requires positive nonce semantics, matching the normal wallet.nonce + 1 transfer path;
  • confirmed the docs now distinguish MCP list limits from REST bounty list limits.

Validation run in the isolated dollar-hunt-mergework conda env:

  • PYTHONPATH=$PWD conda run -n dollar-hunt-mergework pytest tests/test_api_mcp.py tests/test_docs_public_urls.py -q -> 114 passed, 1 existing Starlette/httpx warning
  • PYTHONPATH=$PWD conda run -n dollar-hunt-mergework python scripts/docs_smoke.py -> docs smoke ok
  • PYTHONPATH=$PWD conda run -n dollar-hunt-mergework ruff check app/mcp.py tests/test_api_mcp.py tests/test_docs_public_urls.py -> passed
  • PYTHONPATH=$PWD conda run -n dollar-hunt-mergework ruff format --check app/mcp.py tests/test_api_mcp.py tests/test_docs_public_urls.py -> 3 files already formatted
  • PYTHONPATH=$PWD conda run -n dollar-hunt-mergework python -m py_compile app/mcp.py -> passed
  • git diff --check -> clean

Hosted state checked before review: Quality/readiness/docs/image check passed, CodeRabbit passed, and GitHub reports the PR as mergeable.

No private data, credentials, wallet material, production mutation, payout/proof/ledger execution, exchange/bridge/cash-out, price behavior, or fabricated payout claims were used or changed.

@ramimbo ramimbo added the mrwk:needs-info More information needed label Jun 1, 2026
@ramimbo
Copy link
Copy Markdown
Owner

ramimbo commented Jun 1, 2026

Maintainer triage 2026-06-01T05:10Z: holding for bounty-path cleanup. The implementation has useful current-head reviews, but the PR body does not include a live Bounty #<issue> reference, so it cannot be accepted or paid through the webhook path. #647 is now filled; wait for a live successor route before treating this as payable bounty work.

Copy link
Copy Markdown
Contributor

@Jorel97 Jorel97 left a comment

Choose a reason for hiding this comment

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

Reviewed current head af049303081e71282744217c1a04a22d7a613a17 after the PR became dirty against the current base.

Requesting changes because the branch no longer merges cleanly into current origin/main:

  • git merge-tree --write-tree origin/main HEAD reports content conflicts in app/mcp.py and tests/test_api_mcp.py.
  • GitHub also reports mergeStateStatus: DIRTY for the PR.
  • The conflict is on the same MCP surface this PR changes, so it should be resolved before maintainers can safely merge/review the final combined schema behavior.

What I checked on the PR head itself:

  • inspected the MCP schema changes in app/mcp.py, plus docs/tests in docs/api-examples.md, tests/test_api_mcp.py, and tests/test_docs_public_urls.py;
  • verified the latest branch-local test target still passes: python -m pytest tests/test_api_mcp.py -q -> 82 passed, 1 existing Starlette/httpx warning;
  • python scripts/docs_smoke.py -> docs smoke ok;
  • python -m ruff check app/mcp.py tests/test_api_mcp.py docs/api-examples.md tests/test_docs_public_urls.py -> passed;
  • python -m ruff format --check app/mcp.py tests/test_api_mcp.py -> 2 files already formatted;
  • git diff --check -> clean;
  • hosted checks are green (Quality, readiness, docs, and image checks, CodeRabbit).

So the branch-local implementation looks healthy, but the current-base merge conflict is a blocker that needs a rebase/update. No private data, credentials, wallet material, production mutation, payout/proof/ledger execution, exchange/bridge/cash-out, price behavior, or fabricated payout claims were used.

@JONASXZB
Copy link
Copy Markdown
Contributor Author

JONASXZB commented Jun 1, 2026

Updated the PR body to include the exact live bounty reference Bounty #647 and source issue #710 for the bounty-path cleanup requested in maintainer triage.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
app/mcp.py (2)

14-38: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Tighten the integer-string schema to canonical forms only.

These regexes still preflight-accept values like "+3", "03", and " 3", but the MCP runtime now rejects those forms. That means tools/list can tell clients an argument is valid and tools/call immediately rejects the same payload.

Proposed fix
-INTEGER_STRING_PADDING = r"(?!.*[\u0000-\u001f\u007f-\u009f])\s*"
+INTEGER_STRING_PADDING = r"(?!.*[\u0000-\u001f\u007f-\u009f])"
 POSITIVE_INTEGER_SCHEMA: dict[str, Any] = {
     "anyOf": [
         {"type": "integer", "minimum": 1},
         {
             "type": "string",
-            "pattern": rf"^{INTEGER_STRING_PADDING}\+?(?:0*[1-9][0-9]*)\s*$",
+            "pattern": rf"^{INTEGER_STRING_PADDING}[1-9][0-9]*$",
         },
     ]
 }
 NONNEGATIVE_INTEGER_SCHEMA: dict[str, Any] = {
     "anyOf": [
         {"type": "integer", "minimum": 0},
-        {"type": "string", "pattern": rf"^{INTEGER_STRING_PADDING}\+?[0-9]+\s*$"},
+        {"type": "string", "pattern": rf"^{INTEGER_STRING_PADDING}(?:0|[1-9][0-9]*)$"},
     ]
 }
 LIST_LIMIT_SCHEMA: dict[str, Any] = {
     "anyOf": [
         {"type": "integer", "minimum": 1, "maximum": 100},
         {
             "type": "string",
-            "pattern": rf"^{INTEGER_STRING_PADDING}\+?0*(?:[1-9]|[1-9][0-9]|100)\s*$",
+            "pattern": rf"^{INTEGER_STRING_PADDING}(?:[1-9][0-9]?|100)$",
         },
     ]
 }

186-214: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

submit_work_proof still permits invalid selector shapes.

This schema only blocks bounty_id and issue_number together. It still allows {"repo": "owner/name"} and {"bounty_id": 1, "repo": "owner/name"}, even though the handler rejects both. Since {} is also valid for generic guidance, the schema needs to model the three allowed shapes explicitly: generic/no selector, bounty_id selector, or issue_number selector with optional repo.

tests/test_api_mcp.py (1)

18-29: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

The schema helper does not verify the canonical string contract.

This only checks that the regex contains the control-character guard, so it would still pass patterns that allow "+3", "03", or "3 ". Add a few re.fullmatch(...) allow/deny cases here so the schema tests actually lock down the runtime-compatible forms. As per coding guidelines, tests/**/*.py: Focus on whether tests prove the changed behavior and include negative, replay, boundary, or regression cases where relevant.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2d16adba-6d52-40a8-9a8f-b282414fa114

📥 Commits

Reviewing files that changed from the base of the PR and between af04930 and 5ac3cff.

📒 Files selected for processing (4)
  • app/mcp.py
  • docs/api-examples.md
  • tests/test_api_mcp.py
  • tests/test_docs_public_urls.py

@JONASXZB
Copy link
Copy Markdown
Contributor Author

JONASXZB commented Jun 2, 2026

Addressed the current-base merge blocker on PR #738 in head 5ac3cff.

  • Merged current origin/main and resolved the MCP surface conflicts in app/mcp.py and tests/test_api_mcp.py.
  • Kept the inputSchema preflight coverage from this PR while adding the current list_bounties.availability contract from main.
  • GitHub now reports the PR as mergeable/clean, and the hosted Quality/readiness/docs/image check passed for 5ac3cff.

Local validation:

  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv/bin/python -m pytest tests/test_api_mcp.py tests/test_docs_public_urls.py -q -> 134 passed, 1 warning
  • .venv/bin/python scripts/docs_smoke.py -> docs smoke ok
  • .venv/bin/python -m ruff check app/mcp.py tests/test_api_mcp.py tests/test_docs_public_urls.py docs/api-examples.md -> passed
  • .venv/bin/python -m ruff format --check app/mcp.py tests/test_api_mcp.py tests/test_docs_public_urls.py -> passed
  • git diff --check -> clean
  • git merge-tree --write-tree origin/main HEAD -> clean

Copy link
Copy Markdown

@weilixiong weilixiong left a comment

Choose a reason for hiding this comment

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

Requesting changes on current head 5ac3cff218140589ba908ac1adf88a731e00b661 after a fresh current-main review.

Blocker: the numeric inputSchema string patterns do not match the actual MCP runtime parser. POSITIVE_INTEGER_SCHEMA, NONNEGATIVE_INTEGER_SCHEMA, and LIST_LIMIT_SCHEMA permit padded / signed forms such as "+1", "001", and " 1 ". But app/mcp_tools.py:int_arg() currently applies MCP_INTEGER_RE.fullmatch(value) directly with MCP_INTEGER_RE = re.compile(r"^(?:0|-?[1-9][0-9]*)$"); it does not strip padding and does not accept a leading + or leading zeroes. A strict MCP client can therefore pass preflight and still fail tools/call.

This also conflicts with the new docs statement that numeric ids and limits accept integer strings that match the runtime parsers. Please either tighten the schema patterns to the runtime regex semantics or deliberately widen int_arg() and add execution-level tests for the accepted padded forms.

Verification evidence:

  • reviewed app/mcp.py, app/mcp_tools.py, docs, and the MCP tests on current head;
  • git merge-tree --write-tree upstream/main pr-738 succeeds (62397c93309dc9b7c3062990f5b3dfb6d096514d);
  • python3 -m pytest tests/test_api_mcp.py tests/test_docs_public_urls.py -q -> 114 passed;
  • python3 scripts/docs_smoke.py, Ruff check, Ruff format check, and git diff --check pass.

The existing tests assert schema shape but do not call the runtime parser with the newly schema-accepted string variants, which is why this mismatch passes locally.

@JONASXZB
Copy link
Copy Markdown
Contributor Author

JONASXZB commented Jun 2, 2026

Addressed the requested schema/runtime mismatch in head 186096a.

Changes made:

  • Tightened POSITIVE_INTEGER_SCHEMA, NONNEGATIVE_INTEGER_SCHEMA, and LIST_LIMIT_SCHEMA string patterns to canonical runtime-compatible forms only: no whitespace, no leading +, no leading zeroes except the single "0" where zero is allowed.
  • Replaced the broad submit_work_proof selector guard with an explicit oneOf for the three runtime-valid shapes: generic/no selector, bounty_id selector, and issue_number selector with optional repo.
  • Expanded schema tests to run re.fullmatch(...) allow/deny cases so the preflight schema contract stays aligned with the MCP runtime parser.
  • Updated docs to describe canonical integer strings.

Validation:

  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv/bin/python -m pytest tests/test_api_mcp.py tests/test_docs_public_urls.py -q -> 134 passed, 1 warning
  • .venv/bin/python scripts/docs_smoke.py -> docs smoke ok
  • .venv/bin/python -m ruff check app/mcp.py tests/test_api_mcp.py tests/test_docs_public_urls.py docs/api-examples.md -> passed
  • .venv/bin/python -m ruff format --check app/mcp.py tests/test_api_mcp.py tests/test_docs_public_urls.py -> passed
  • git diff --check -> clean
  • git merge-tree --write-tree origin/main HEAD -> clean (62397c93309dc9b7c3062990f5b3dfb6d096514d)

Copy link
Copy Markdown
Contributor

@keilogic keilogic left a comment

Choose a reason for hiding this comment

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

Reviewed current head 186096a7f9d169d4aa355d3ed9a205d26a0e7b6a after the follow-up updates for the MCP schema/runtime mismatch.

I did not find a remaining blocker. I checked app/mcp.py, app/mcp_tools.py, docs/api-examples.md, tests/test_api_mcp.py, and tests/test_docs_public_urls.py. The current schema patterns now match the MCP integer parser's canonical string behavior for ids and limits: no leading +, no whitespace padding, and no leading zeroes except the single "0" case where zero is valid. The wallet-transfer preflight schema rejects zero-valued amounts and requires a positive nonce, and submit_work_proof now models its valid selector shapes with oneOf so repo alone and bounty_id plus repo are not advertised as valid.

Validation:

  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv\Scripts\python.exe -m pytest tests/test_api_mcp.py tests/test_docs_public_urls.py -q -> 134 passed, 1 existing Starlette/httpx warning.
  • .venv\Scripts\python.exe scripts/docs_smoke.py -> docs smoke ok.
  • .venv\Scripts\python.exe -m ruff check app/mcp.py tests/test_api_mcp.py tests/test_docs_public_urls.py -> passed.
  • .venv\Scripts\python.exe -m ruff format --check app/mcp.py tests/test_api_mcp.py tests/test_docs_public_urls.py -> 3 files already formatted.
  • .venv\Scripts\python.exe -m mypy app/mcp.py -> success.
  • git merge-tree --write-tree origin/main HEAD -> clean tree 3d4bb42ea13cfdd7abe2db7f97c656e78b8d1fe0.
  • git diff --check origin/main...HEAD -> clean.

GitHub reports mergeStateStatus=CLEAN; hosted Quality/readiness/docs/image and CodeRabbit are green.

@ramimbo
Copy link
Copy Markdown
Owner

ramimbo commented Jun 2, 2026

Maintainer queue pass 2026-06-02: holding this as a possible #776 candidate after that create_bounty proposal executes and GitHub finalization completes. This is not payable under the old/non-live refs now, and #776 is not live yet. If #776 opens, retarget the PR body to Bounty #776 and keep MCP current-head review evidence fresh before maintainer acceptance. No accepted/paid labels now.

Copy link
Copy Markdown

@xiefuzheng713-alt xiefuzheng713-alt left a comment

Choose a reason for hiding this comment

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

Thanks for the implementation. I verified the branch-local behavior and the focused checks pass for this head:

  • uv run --extra dev pytest tests/test_api_mcp.py tests/test_docs_public_urls.py -q -> 134 passed, 1 warning
  • uv run --extra dev ruff check app/mcp.py tests/test_api_mcp.py tests/test_docs_public_urls.py
  • uv run --extra dev ruff format --check app/mcp.py tests/test_api_mcp.py tests/test_docs_public_urls.py
  • uv run --extra dev mypy app/mcp.py
  • uv run --extra dev python scripts/docs_smoke.py
  • git diff --check origin/main...HEAD

Blocking issue: the current head no longer merges cleanly with origin/main. git merge-tree --write-tree origin/main HEAD exits 1 with a content conflict in app/mcp.py:

Auto-merging app/mcp.py
CONFLICT (content): Merge conflict in app/mcp.py
Auto-merging docs/api-examples.md
Auto-merging tests/test_api_mcp.py
Auto-merging tests/test_docs_public_urls.py

GitHub also reports this PR as mergeStateStatus: DIRTY / mergeable: CONFLICTING now. Please rebase or merge current main, resolve the app/mcp.py conflict, and rerun the focused MCP/API/docs checks before merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mrwk:needs-info More information needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants