Add bounty summary availability breakdown#705
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 (7)
📝 WalkthroughWalkthroughThe bounty list summary serializer now computes per-availability-state counts and derives metrics for pending-payout awards, reduced-capacity bounties, and effectively-unavailable bounties. Tests and API docs/agent guidance are updated to include and explain these fields. ChangesBounty Summary Capacity Metadata
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: f752f89f-eba0-4f03-803b-0e0303070e8c
📒 Files selected for processing (7)
app/serializers.pydocs/agent-guide.mddocs/api-examples.mdtests/test_bounty_api_routes.pytests/test_bounty_pages.pytests/test_public_routes.pytests/test_serializers.py
xyjk0511
left a comment
There was a problem hiding this comment.
Reviewed current head 30ac2ea3c0c55fb09d2033eac79d6bd79b8cceaf.
The serializer/test implementation looks coherent, but I found one blocking documentation inconsistency in docs/api-examples.md: the /api/v1/bounties/summary example says "bounties_shown": 1, while availability_state_counts contains both "open": 1 and "pending_payouts_partial": 1, which sums to two displayed bounty rows. This makes the public API example internally contradictory for clients copying the response shape. The smallest fix is to remove the "open": 1 entry from that example or update the surrounding totals so every count agrees.
Evidence checked:
- inspected
app/serializers.py,docs/api-examples.md,docs/agent-guide.md, and the focused serializer/API/page tests; - confirmed the implementation test
test_bounty_list_summary_breaks_down_availability_statesis internally consistent for the four-row fixture; - confirmed the docs example inconsistency is limited to the public sample payload, not the serializer computation;
- checked hosted PR state: GitHub quality/readiness/docs check passed, CodeRabbit passed, and merge state is clean.
Local verification from F:\jiedan\mergework-review-705:
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest tests\test_serializers.py tests\test_bounty_api_routes.py tests\test_bounty_pages.py tests\test_public_routes.py tests\test_docs_public_urls.py -q->71 passedpython scripts\docs_smoke.py->docs smoke okpython -m ruff check app\serializers.py tests\test_serializers.py tests\test_bounty_api_routes.py tests\test_bounty_pages.py tests\test_public_routes.py-> passpython -m ruff format --check app\serializers.py tests\test_serializers.py tests\test_bounty_api_routes.py tests\test_bounty_pages.py tests\test_public_routes.py-> passpython -m compileall app\serializers.py tests\test_serializers.py tests\test_bounty_api_routes.py tests\test_bounty_pages.py tests\test_public_routes.py-> passgit diff --check origin/main...HEAD-> pass
Requesting changes for the docs example count mismatch above.
Gwani-28
left a comment
There was a problem hiding this comment.
Reviewed PR #705 at current head 30ac2ea3c0c55fb09d2033eac79d6bd79b8cceaf.
I did not find a blocker in this patch.
Evidence checked:
- inspected the
bounty_list_summary()change inapp/serializers.py; - confirmed the new summary fields are derived from already-public row fields and do not change payout execution, treasury mutation, proof generation, wallet, ledger, bridge, exchange, cash-out, price, or claimability rules;
- checked that
availability_state_countspreserves the row-providedavailability_statebuckets while falling back to status for older rows; - checked that
pending_payout_awards,reduced_capacity_bounties, andeffectively_unavailable_bountiesexplain raw-vs-effective capacity without replacing existingopen_awardsoreffective_open_awards; - inspected the API/page/serializer tests and docs examples covering open, partial pending payout, full pending payout, and pending-close cases;
- confirmed no #643 claim comment visibly referenced PR #705 before this review.
Validation run locally:
.venv/bin/python -m pytest tests/test_serializers.py tests/test_bounty_api_routes.py tests/test_bounty_pages.py tests/test_public_routes.py tests/test_docs_public_urls.py -q-> 71 passed, 1 existing FastAPI/Starlette deprecation warning..venv/bin/ruff check app/serializers.py tests/test_serializers.py tests/test_bounty_api_routes.py tests/test_bounty_pages.py tests/test_public_routes.py tests/test_docs_public_urls.py-> passed..venv/bin/ruff format --check app/serializers.py tests/test_serializers.py tests/test_bounty_api_routes.py tests/test_bounty_pages.py tests/test_public_routes.py tests/test_docs_public_urls.py-> 6 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 tree93dd1c6fb6a3a84f0787ad9df483f84e02a88e25.- Hosted checks: GitHub quality/readiness/docs/image checks passed and CodeRabbit passed.
Residual risk: this is an aggregate summary endpoint change, so callers still need the detailed bounty rows when they need per-bounty explanations. That matches the PR's stated scope.
No private data, credentials, wallet material, production mutation, price/exchange/bridge/off-ramp claims, or fabricated payout claims used.
xyjk0511
left a comment
There was a problem hiding this comment.
Reviewed current head e7403f77c416b8c93c9d6740df7f02b7c1127b9e.
The earlier documentation-count blocker is resolved: the /api/v1/bounties/summary example now keeps bounties_shown, availability_state_counts, and the reduced-capacity fields internally consistent while the serializer exposes the new availability breakdown fields.
Validation I checked:
- inspected
app/serializers.py,docs/api-examples.md,docs/agent-guide.md, and focused API/page/serializer tests; PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest tests/test_serializers.py tests/test_bounty_api_routes.py tests/test_bounty_pages.py tests/test_public_routes.py-> 39 passed;python -m ruff check app/serializers.py tests/test_serializers.py tests/test_bounty_api_routes.py tests/test_bounty_pages.py tests/test_public_routes.py-> passed;python scripts/docs_smoke.py-> docs smoke ok;git diff --check origin/main...origin/pr/705-> clean;git merge-tree --write-tree origin/main origin/pr/705-> clean tree547a547564c3695b53467a64a1174246aa882dbb;- hosted
Quality, readiness, docs, and image checksand CodeRabbit are both green.
JONASXZB
left a comment
There was a problem hiding this comment.
Reviewed current head e7403f77c416b8c93c9d6740df7f02b7c1127b9e as a non-author.
No blocker found in the bounty-summary availability breakdown. Evidence checked:
- inspected
bounty_list_summary()and confirmed existing summary fields are preserved while addingavailability_state_counts,pending_payout_awards,reduced_capacity_bounties, andeffectively_unavailable_bounties; - verified the aggregation counts reduced capacity only when effective awards are below visible awards, and counts effectively unavailable bounties only when visible awards remain but effective awards are zero;
- checked
/api/v1/bounties/summary, public bounties context/page tests, docs, and serializer tests for open, partial pending-payout, full pending-payout, pending-close, and empty-filter cases; - ran
MERGEWORK_DATABASE_URL=sqlite:////tmp/mergework-pr705-review-test.sqlite python -m pytest tests/test_serializers.py tests/test_bounty_api_routes.py tests/test_bounty_pages.py tests/test_public_routes.py tests/test_docs_public_urls.py -q-> 71 passed, 1 warning; - ran
python scripts/docs_smoke.py, targeted Ruff check/format,python -m mypy app/serializers.py, andgit diff --check origin/main...HEAD; - ran an extra local mixed-state
bounty_list_summary()check covering open, pending-payouts-full, and paid rows; - checked mergeability with
git merge-tree --write-tree origin/main HEAD-> exit 0.
Hosted status for this head is green (CodeRabbit: success / Review skipped; Quality, readiness, docs, and image checks: success).
…bility-breakdown # Conflicts: # docs/agent-guide.md
attaboy11
left a comment
There was a problem hiding this comment.
Reviewed current head d1bba0bc430533554c8f5bd0e65a96cecf67cb9a against current origin/main 05faf1f89932d59f2935e83b71fc42ffef363c7f as a non-author.
No blocker found in the bounty-summary availability breakdown. This is a focused additive API-summary change: existing raw/effective capacity fields are preserved, and the new aggregate fields explain why effective availability differs from raw open awards without requiring clients to fetch every bounty row.
Evidence checked:
- Inspected
app/serializers.pyand confirmedbounty_list_summary()now addsavailability_state_counts,pending_payout_awards,reduced_capacity_bounties, andeffectively_unavailable_bountieswhile preserving existing summary fields. - Inspected docs/tests in
docs/agent-guide.md,docs/api-examples.md,tests/test_serializers.py,tests/test_bounty_api_routes.py,tests/test_bounty_pages.py, andtests/test_public_routes.py. - GitHub reports
mergeStateStatus: CLEAN; hosted Quality/readiness/docs/image check is successful. git merge-tree --write-tree origin/main origin/pr-705succeeds with treeea555d90269ba10f0647b52734f4c2688b972d1e.- Focused tests pass:
pytest tests/test_serializers.py tests/test_bounty_api_routes.py tests/test_bounty_pages.py tests/test_public_routes.py tests/test_docs_public_urls.py -q->74 passed, 1 warning in 1.67s. scripts/docs_smoke.pypassed; targeted Ruff check and format check passed;git diff --check origin/main...origin/pr-705passed.
No payout, wallet, treasury execution, private account, exchange, bridge, or cash-out behavior is changed here.
JONASXZB
left a comment
There was a problem hiding this comment.
APPROVE — reviewed current open head d1bba0bc430533554c8f5bd0e65a96cecf67cb9a against current origin/main f8fc36265ea763bcaabb3555d3ee4e0c885a4953 as a non-author.
Evidence checked:
- Files inspected:
app/serializers.py,docs/agent-guide.md,docs/api-examples.md,tests/test_serializers.py,tests/test_bounty_api_routes.py,tests/test_bounty_pages.py, andtests/test_public_routes.py. - The change is focused and additive: bounty summaries keep existing raw/effective capacity totals while adding
availability_state_counts,pending_payout_awards,reduced_capacity_bounties, andeffectively_unavailable_bounties. - The aggregation logic counts reduced capacity only when effective awards are below visible awards, and counts effectively unavailable rows only when visible awards remain but effective awards are zero.
- API/page/context/docs tests are updated for the expanded response shape, including empty summaries and mixed open/partial/full/close availability states.
- Focused validation passes:
.venv/bin/python -m pytest tests/test_serializers.py tests/test_bounty_api_routes.py tests/test_bounty_pages.py tests/test_public_routes.py -q-> 41 passed, 1 warning. - Docs smoke passes:
.venv/bin/python scripts/docs_smoke.py-> docs smoke ok. - Ruff passes for touched Python files:
.venv/bin/ruff check app/serializers.py tests/test_serializers.py tests/test_bounty_api_routes.py tests/test_bounty_pages.py tests/test_public_routes.py-> all checks passed;.venv/bin/ruff format --check ...-> 5 files already formatted. git diff --check origin/main...HEADclean.git merge-tree --write-tree origin/main HEADclean ->0d5da1dbb404b9c5af9cc51f604e5dc667164052.- GitHub reports mergeable/clean; CodeRabbit status is success/review skipped; hosted quality/readiness/docs/image check is success.
No blocking issues found in the current-head bounty-summary availability breakdown.
|
Current-head review for PR #705 ( I reviewed the updated head against the serializer, docs, and tests touched by this PR. I do not see a blocker in the current patch. Evidence checked:
The current production numbers make the ergonomics value concrete: issue #654 currently reports |
|
Maintainer queue pass 2026-06-02: holding this as a possible #777 candidate after that create_bounty proposal executes and GitHub finalization completes. #647 is exhausted, so this is not payable now, and #777 is not live yet. If #777 opens, retarget the PR body to |
Maintainer accepted live-lane reroute: this merged work is evaluated under live bounty #777 because it matches that acceptance scope; the original closed/exhausted round reference was issue 647.
Summary
Bounty #777
Source issue: #682
This PR adds a small availability-state breakdown to the lightweight bounty summary endpoint so agents can explain why raw capacity differs from effective capacity without fetching and aggregating every bounty row.
availability_state_countstobounty_list_summary().pending_payout_awards,reduced_capacity_bounties, andeffectively_unavailable_bountiesfields.Verification
/private/tmp/mergework-venv-312/bin/python -m pytest tests/test_serializers.py tests/test_bounty_api_routes.py tests/test_bounty_pages.py tests/test_public_routes.py tests/test_docs_public_urls.py -q-> 71 passed, 1 existing FastAPI/Starlette deprecation warning/private/tmp/mergework-venv-312/bin/python -m pytest -q-> 561 passed, 1 existing FastAPI/Starlette deprecation warning/private/tmp/mergework-venv-312/bin/python -m ruff format --check .-> 96 files already formatted/private/tmp/mergework-venv-312/bin/python -m ruff check .-> All checks passed/private/tmp/mergework-venv-312/bin/python scripts/docs_smoke.py-> docs smoke okgit diff --check-> passedDuplicate Check
gh pr list --repo ramimbo/mergework --state open --search "682"returned no open PRs.https://api.mrwk.online/api/v1/bounties/95/attemptsreturned no active attempts.Out of Scope
/api/v1/bountiesrows or per-bounty pages.Summary by CodeRabbit
New Features
Documentation
Tests