Add structured MCP work-proof availability state#339
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR extends MCP work proof guidance responses to include structured availability metadata. The ChangesWork Proof Availability Metadata
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
tolga-tom-nook
left a comment
There was a problem hiding this comment.
Reviewed PR #339 on head ecc3dbb.
No blockers found. The structured MCP submit_work_proof change is narrowly scoped and preserves the existing text response while adding machine-readable availability state.
Evidence checked:
- Inspected
app/main.pyand confirmedcan_submitis derived fromstatus == "open"plus remaining award slots, with paid/closed/exhausted bounties returningavailability: "not_currently_open"and explicit warnings. - Inspected
tests/test_api_mcp.pyand confirmed coverage for open bounty guidance, generic guidance, paid bounty guidance, and closed bounty guidance; the test also assertsstructuredContentstays byte-for-byte aligned with the JSON text payload. - Ran
./.venv/bin/python -m pytest tests/test_api_mcp.py -q-> 74 passed. - Ran
./.venv/bin/python -m ruff check app/main.py tests/test_api_mcp.py-> passed. - Ran
./.venv/bin/python -m mypy app-> passed. - Ran
git diff --check origin/main...HEAD-> passed.
Refs #315
Summary
submit_work_proofJSON guidance:availability,can_submit, andavailability_warnings.submit_work_proofbehavior unchanged.Agent impact
Structured MCP callers can now decide whether a bounty is actually open for submissions without inferring from separate
statusandawards_remainingfields. Paid, closed, and exhausted bounties returncan_submit: false,availability: "not_currently_open", and concrete warnings such asbounty is paidandbounty has no award slots remaining.Generic no-selector guidance remains machine-readable but reports
availability: "unknown_without_bounty"andcan_submit: nullbecause no concrete bounty was selected.Validation
./.venv/bin/python -m pytest tests/test_api_mcp.py::test_mcp_submit_work_proof_returns_structured_bounty_guidance tests/test_api_mcp.py::test_mcp_submit_work_proof_returns_structured_generic_guidance tests/test_api_mcp.py::test_mcp_submit_work_proof_structures_terminal_bounty_availability -q-> 3 passed./.venv/bin/python -m pytest tests/test_api_mcp.py -q-> 74 passed./.venv/bin/python -m pytest -q-> 319 passed./.venv/bin/python -m ruff check app/main.py tests/test_api_mcp.py-> passed./.venv/bin/python -m ruff format --check app/main.py tests/test_api_mcp.py-> passed./.venv/bin/python -m mypy app/main.py-> passed./.venv/bin/python scripts/docs_smoke.py-> docs smoke okgit diff --check-> cleanNo secrets, wallet private keys, payout credentials, private vulnerability details, deployment values, or MRWK price claims are included.
Summary by CodeRabbit
New Features
Tests