Add open award slot bounty filter#260
Conversation
weilixiong
left a comment
There was a problem hiding this comment.
Review ✅ APPROVED
LOW — verified diff clean, no unrelated files. MW #219 round 7.
weilixiong
left a comment
There was a problem hiding this comment.
Review ✅ APPROVED — LOW risk, clean diff, MW #219 round 7.
|
No blockers from my review. Evidence checked:
The filter is opt-in, so existing bounty list callers keep their current response shape. |
MolhamHamwi
left a comment
There was a problem hiding this comment.
No blockers from my review.
Evidence checked:
- Inspected
app/main.py::list_bounties_by_status()andapi_bounties()and confirmedopen_awards_onlyis applied after status/search filters and requires bothBounty.status == "open"andBounty.max_awards > Bounty.awards_paid, matching the publicawards_remainingsemantics. - Inspected
docs/api-examples.mdand confirmed the newopen_awards_only=trueexample is documented as an agent-facing filter for bounties with remaining award slots. - Inspected
tests/test_api_mcp.py::test_bounty_api_filters_to_open_award_slotsand verified it covers an available multi-award bounty, an exhausted paid bounty, a closed bounty, search combined with the filter, and an explicitstatus=paid&open_awards_only=trueempty result. - Hosted check
Quality, readiness, docs, and image checksis green. - Ran
./.venv/bin/python -m pytest tests/test_api_mcp.py::test_bounty_api_filters_to_open_award_slots -q-> 1 passed. - Ran
./.venv/bin/python -m pytest tests/test_api_mcp.py -q-> 42 passed, 1 existing httpx deprecation warning. - Ran Ruff check and format-check on touched files; all passed.
- Ran
git diff --check origin/main...HEAD-> clean.
No secrets, wallet/private-key material, payout credentials, private deployment values, private vulnerability details, or MRWK price claims were reviewed or disclosed.
ayskobtw-lil
left a comment
There was a problem hiding this comment.
No blockers from my review.
Evidence checked:
- Inspected the full diff in
app/main.py,docs/api-examples.md, andtests/test_api_mcp.py. - Verified
open_awards_onlyis bounded to API use only and composes with existing status/search handling by addingBounty.status == "open"andBounty.max_awards > Bounty.awards_paidafter the existing filters. - Checked the regression covers the three important cases: an open multi-award bounty with remaining slots is returned, a fully paid bounty is excluded, and a closed bounty with unused reserve is excluded.
- Verified
status=paid&open_awards_only=truereturns an empty list, which matches the documented meaning of "open and still has award slots" rather than treating the new flag as only an awards_remaining filter. - Ran
python -m pytest tests/test_api_mcp.py::test_bounty_api_filters_to_open_award_slots tests/test_api_mcp.py::test_bounty_api_filters_by_status -q-> 2 passed. - Ran
python -m ruff check app/main.py tests/test_api_mcp.py-> passed. - Ran
python -m ruff format --check app/main.py tests/test_api_mcp.py-> 2 files already formatted. - Ran
git diff --check origin/main...HEAD-> clean.
No secrets, wallet private keys, deployment values, payout details, private vulnerability details, or MRWK price claims were reviewed or disclosed.
TateLyman
left a comment
There was a problem hiding this comment.
No blockers from my pass. The new open_awards_only flag is scoped to the public bounties API and composes cleanly with the existing status and text filters without changing default list behavior.
Evidence checked:
- Inspected
list_bounties_by_status()and/api/v1/bountiesinapp/main.py; the default remainsFalse, and opt-in filtering adds bothBounty.status == "open"andBounty.max_awards > Bounty.awards_paid. - Inspected
docs/api-examples.md; the new example documents this as an agent-facing filter for bounties with remaining award slots. - Inspected
tests/test_api_mcp.py; coverage includes available/open, exhausted/paid, closed, search composition, andstatus=paid&open_awards_only=truereturning no rows. - Ran
uv run pytest tests/test_api_mcp.py::test_bounty_api_filters_to_open_award_slots tests/test_api_mcp.py::test_bounty_api_filters_by_status -q-> 2 passed. - Ran
uv run ruff check app/main.py docs/api-examples.md tests/test_api_mcp.py,uv run ruff format --check app/main.py tests/test_api_mcp.py,uv run mypy app, andgit diff --check origin/main...HEAD-> passed. - Checked hosted
Quality, readiness, docs, and image checksmetadata -> success.
Non-blocking note: this intentionally does not add a /bounties page control, so browser users still use the existing status/search UI while API agents can query open award slots directly.
Summary
open_awards_only=trueto/api/v1/bountiesso agents can request only bounties that are open and still have award slots remaining.statusandqfilters composable with the new availability filter.Bounty #164
Verification
.\.venv\Scripts\python.exe -m pytest tests\test_api_mcp.py -q-> 42 passed, 1 warning..\.venv\Scripts\python.exe -m ruff check app\main.py tests\test_api_mcp.py-> passed..\.venv\Scripts\python.exe -m ruff format --check app\main.py tests\test_api_mcp.py-> passed.