Skip to content

Expose public work discovery queue#840

Open
SYZBZ wants to merge 2 commits into
ramimbo:mainfrom
SYZBZ:syzbz-work-discovery-800
Open

Expose public work discovery queue#840
SYZBZ wants to merge 2 commits into
ramimbo:mainfrom
SYZBZ:syzbz-work-discovery-800

Conversation

@SYZBZ
Copy link
Copy Markdown
Contributor

@SYZBZ SYZBZ commented Jun 3, 2026

Summary

  • Adds GET /api/v1/work-discovery, a public read-only work queue for agents and contributors.
  • Groups live claimable bounty rows under claimable_now and pending create_bounty proposals under opening_soon.
  • Includes issue number, title, issue URL, reward, max awards, effective awards remaining, and source API URLs for bounty/proposal records.
  • Documents the endpoint in the agent guide and API examples, with docs smoke coverage.

Bounty #800

Evidence

  • Live bounty rows require status=open and positive effective_awards_remaining.
  • Pending create_bounty proposals are shown as pending_create with executes_after and proposal source URLs, not as claimable work.
  • Closed, paid, exhausted, pending payout, proposed-work, and board/index states are documented outside the claimable bucket.

Example output shape:

{
  type: work_discovery,
  summary: {claimable_now_count: 1, opening_soon_count: 1, not_claimable_count: 1},
  claimable_now: [{availability_state: live_bounty, issue_number: 800, reward_mrwk: 600, effective_awards_remaining: 1}],
  opening_soon: [{availability_state: pending_create, issue_number: 900, reward_mrwk: 75, executes_after: <timestamp>}]
}

Test Evidence

  • uv run --extra dev pytest tests\test_work_discovery.py tests\test_bounty_api.py tests\test_bounty_api_routes.py tests\test_treasury_proposals.py tests\test_docs_public_urls.py -q -> 133 passed, 1 existing TestClient warning
  • uv run --extra dev python scripts\docs_smoke.py -> docs smoke ok
  • uv run --extra dev ruff check app\work_discovery.py app\bounty_api.py tests\test_work_discovery.py tests\test_docs_public_urls.py scripts\docs_smoke.py -> passed
  • uv run --extra dev ruff format --check app\work_discovery.py app\bounty_api.py tests\test_work_discovery.py tests\test_docs_public_urls.py scripts\docs_smoke.py -> passed
  • uv run --extra dev mypy app -> success
  • git diff --check origin/main...HEAD -> clean
  • git merge-tree --write-tree origin/main HEAD -> clean tree 95c0eab9089b7d4b1f09165647260e4cf02283ba

Scope and Safety

  • No admin token APIs are used by the new endpoint.
  • No labels, comments, bounty creation, proposal execution, payouts, ledger mutation, wallet material, exchange, bridge, cash-out, or price behavior is invoked or changed.
  • The endpoint reads local public bounty and treasury proposal state only.

Summary by CodeRabbit

  • New Features

    • Public GET /api/v1/work-discovery: read-only view grouping claimable live bounties, upcoming create-bounty proposals, and non-claimable items; supports optional limit.
  • Documentation

    • Added usage guidance, curl examples, full response example, and state definitions for the new endpoint.
  • Tests

    • Added integration tests covering response structure, grouping semantics, timestamps, and limit behavior.
  • Chores

    • Strengthened docs smoke checks to require the new endpoint and fields.

Copilot AI review requested due to automatic review settings June 3, 2026 12:13
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a read-only GET /api/v1/work-discovery endpoint and new module that serializes open bounties and pending create_bounty proposals into grouped arrays (claimable_now, opening_soon, not_claimable) with state definitions, docs, and integration tests.

Changes

Work Discovery Public API

Layer / File(s) Summary
Work discovery data model and transformations
app/work_discovery.py
Defines DEFAULT_WORK_DISCOVERY_LIMIT/MAX_WORK_DISCOVERY_LIMIT, STATE_DEFINITIONS, and NON_CLAIMABLE_ISSUE_STATES; implements helpers to serialize bounty rows and pending create_bounty TreasuryProposal rows; partitions items into claimable_now, opening_soon, and not_claimable, enforces the capped limit, and returns the discovery dict.
API route and database integration
app/bounty_api.py
Imports discovery constants/function and registers GET /api/v1/work-discovery, validating the limit query param (canonical/repeated checks), opening a DB session via session_scope(db_url), and returning work_discovery_to_dict(session, limit=limit).
Public documentation and usage examples
docs/agent-guide.md, docs/api-examples.md
Adds the endpoint to the public API list, provides curl examples (including limit), documents bucket semantics (claimable vs opening-soon vs non-claimable), describes returned work-item fields and state_definitions, and includes a representative JSON payload.
Integration tests and documentation validation
tests/test_work_discovery.py, tests/test_docs_public_urls.py, scripts/docs_smoke.py
Adds end-to-end tests that seed bounties and treasury proposals and assert the discovery response structure, executes_after formatting, and limit behavior; adds a docs smoke check and a docs consistency test asserting the endpoint and example availability-state text appear in docs.

Possibly related issues

Possibly related PRs

  • ramimbo/mergework#393: Modifies the same route registration area (register_bounty_api_routes) where this PR adds /api/v1/work-discovery.
  • ramimbo/mergework#669: Also updates scripts/docs_smoke.py to enforce required documentation phrases.
🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Expose public work discovery queue' clearly describes the main change: adding a new public API endpoint for work discovery.
Description check ✅ Passed The description includes all required sections: Summary, Evidence, Test Evidence with all checks, and MRWK tracking. All checkboxes are addressed with specific test results.
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 claims, or private security details found. MRWK correctly described as native coin supporting future snapshots/bridges/onchain claims.
Bounty Pr Focus ✅ Passed PR #840 does not contain a "Bounty #N" or "Refs #N" reference, so the check condition is not applicable. Changes are focused and scoped to work-discovery feature.

✏️ 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

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 a public “work discovery” API surface and accompanying documentation/tests so agents can fetch a single read-only queue that separates claimable bounties from pending create-bounty proposals.

Changes:

  • Introduces GET /api/v1/work-discovery and serialization logic for its response payload.
  • Adds integration tests validating claimable/opening-soon/not-claimable grouping and docs coverage tests.
  • Updates agent docs + API examples and extends docs smoke checks to include the new endpoint.

Reviewed changes

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

Show a summary per file
File Description
tests/test_work_discovery.py Adds an integration test to verify work-discovery grouping and key fields.
tests/test_docs_public_urls.py Adds a doc test ensuring the new endpoint is documented.
scripts/docs_smoke.py Extends docs smoke assertions to cover work-discovery strings.
docs/api-examples.md Documents the new endpoint and provides a sample response.
docs/agent-guide.md Adds endpoint mention and guidance on when to use it.
app/work_discovery.py Implements the work-discovery response builder and state definitions.
app/bounty_api.py Wires the new GET /api/v1/work-discovery route into the FastAPI app.

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

Comment thread app/work_discovery.py Outdated
Comment on lines +70 to +71
bounties = session.scalars(select(Bounty).order_by(Bounty.id.desc())).all()
bounty_rows = bounties_to_dict(bounties, session=session)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 701fb4c: /api/v1/work-discovery now has limit=1..100 with default 50, and work_discovery_to_dict() uses capped server-side queries for open bounties, terminal bounties, and pending create_bounty proposals.

Comment thread app/work_discovery.py
Comment on lines +12 to +21
STATE_DEFINITIONS = {
"live_bounty": "Public bounty row is open and has positive effective_awards_remaining.",
"pending_create": "Public treasury proposal exists but the bounty row is not live yet.",
"pending_payout": "Accepted work has a pending pay_bounty proposal, not proof-backed payment.",
"closed_or_exhausted": "Bounty is closed, paid, or has no effective award capacity.",
"proposed_work": (
"GitHub proposed-work issue is intake only until a create_bounty proposal executes."
),
"board_or_index": "Index issues help discovery but are not claimable bounty work.",
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 701fb4c: emitted availability_state values now match STATE_DEFINITIONS; terminal rows use closed_or_exhausted, fully covered pending payouts use pending_payout, and proposed-work/board states are emitted under non_claimable_issue_states.

Comment thread app/work_discovery.py Outdated
Comment on lines +75 to +78
if row["status"] == "open" and int(row["effective_awards_remaining"]) > 0:
claimable_now.append(_bounty_work_item(row, "live_bounty"))
else:
not_claimable.append(_bounty_work_item(row, str(row["availability_state"])))
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 701fb4c: not_claimable no longer emits raw undefined states such as paid; raw bounty state remains available as bounty_availability_state while public work state is normalized.

Comment thread docs/api-examples.md
Comment on lines +168 to +183
"claimable_now": [
{
"availability_state": "live_bounty",
"bounty_id": 108,
"issue_number": 800,
"title": "MRWK bounty: public work discovery",
"issue_url": "https://github.com/ramimbo/mergework/issues/800",
"reward_mrwk": "600",
"max_awards": 1,
"effective_awards_remaining": 1,
"source_urls": {
"bounty": "/api/v1/bounties/108",
"attempts": "/api/v1/bounties/108/attempts",
"github_issue": "https://github.com/ramimbo/mergework/issues/800"
}
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 701fb4c: the API example now includes limit, bounty_availability_state, pending_payout_awards, not_claimable, and non_claimable_issue_states.

Comment on lines +108 to +110
"effective_awards_remaining": 0,
"executes_after": body["opening_soon"][0]["executes_after"],
"source_urls": {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 701fb4c: the test now asserts executes_after ends with Z and can be parsed as an ISO/RFC3339 UTC timestamp.

@SYZBZ SYZBZ force-pushed the syzbz-work-discovery-800 branch from 0caf25b to 701fb4c Compare June 3, 2026 12:21
@SYZBZ
Copy link
Copy Markdown
Contributor Author

SYZBZ commented Jun 3, 2026

Post-review follow-up complete on head 701fb4ce84a932d3e2fcefeac702a82f49dfb34e.

Changes after automated review:

  • bounded /api/v1/work-discovery with limit=1..100, default 50;
  • switched work-state output to a controlled STATE_DEFINITIONS set while preserving raw bounty state as bounty_availability_state;
  • documented the complete bounty item shape, including pending_payout_awards, not_claimable, and non_claimable_issue_states;
  • strengthened executes_after test coverage to assert UTC parseability.

Current hosted state:

  • Quality, readiness, docs, and image checks -> success
  • CodeRabbit -> success / no actionable comments
  • GitHub merge state -> CLEAN

Latest local verification:

  • uv run --extra dev pytest tests\test_work_discovery.py tests\test_bounty_api.py tests\test_bounty_api_routes.py tests\test_treasury_proposals.py tests\test_docs_public_urls.py -q -> 134 passed, 1 existing TestClient warning
  • uv run --extra dev python scripts\docs_smoke.py -> docs smoke ok
  • targeted ruff check and format check passed
  • uv run --extra dev mypy app -> success
  • git diff --check origin/main...HEAD -> clean
  • git merge-tree --write-tree origin/main HEAD -> clean tree 898f1c142a801aff011f5a6fc7a10ac0fd895ac6

No admin token APIs, private state, bounty/proposal creation, proposal execution, payouts, ledger mutation, wallet material, exchange, bridge, cash-out, or price behavior were invoked or changed.

Copy link
Copy Markdown
Contributor

@jakerated-r jakerated-r 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 701fb4ce84a932d3e2fcefeac702a82f49dfb34e as a non-author.

Scope inspected:

  • app/work_discovery.py: verified claimable_now, opening_soon, not_claimable, and non_claimable_issue_states are built from public bounty/proposal state and distinguish live rows from pending create_bounty proposals.
  • app/bounty_api.py: verified GET /api/v1/work-discovery is public read-only, uses Query(ge=1, le=100), rejects repeated limit, and rejects non-canonical integer forms before calling the serializer.
  • tests/test_work_discovery.py: verified coverage for one live bounty, one pending create proposal, one closed/paid bounty, ISO executes_after, source URLs, state definitions, and bucket limits.
  • docs/agent-guide.md, docs/api-examples.md, tests/test_docs_public_urls.py, and scripts/docs_smoke.py: verified agent-facing documentation and smoke checks mention the new endpoint and live-vs-pending distinction.

Validation run on the current head:

  • uv run --extra dev pytest tests/test_work_discovery.py tests/test_bounty_api.py tests/test_bounty_api_routes.py tests/test_treasury_proposals.py tests/test_docs_public_urls.py -q -> 134 passed, 1 existing Starlette/httpx warning.
  • uv run --extra dev pytest -q -> 752 passed, 1 existing Starlette/httpx warning.
  • uv run --extra dev ruff format --check app/work_discovery.py app/bounty_api.py tests/test_work_discovery.py tests/test_docs_public_urls.py scripts/docs_smoke.py -> passed.
  • uv run --extra dev ruff check app/work_discovery.py app/bounty_api.py tests/test_work_discovery.py tests/test_docs_public_urls.py scripts/docs_smoke.py -> passed.
  • uv run --extra dev mypy app -> success.
  • uv run --extra dev 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 c795c451157dc753b2c6ba44acdd7b03a5d64a07.

Currentness and duplicate checks before review:

  • GitHub mergeStateStatus is CLEAN.
  • Hosted Quality and CodeRabbit checks are SUCCESS.
  • I found no #654 claim hit for PR #840 before posting this review.
  • The only prior review entries I found were Copilot comments and author self-comments, not a non-author human current-head review.

No blocker found. The endpoint is narrow, read-only, documented, tested, and aligned with bounty #800's live/pending discovery requirement without touching admin-token APIs, labels, comments, proposal execution, payout, wallet, exchange, bridge, cash-out, or private-data behavior.

@ramimbo
Copy link
Copy Markdown
Owner

ramimbo commented Jun 3, 2026

Maintainer queue status: held before merge/payment. Current head is clean with passing checks and one useful current-head human approval; the queue gate requires two useful current-head human reviews before acceptance.

Copy link
Copy Markdown
Contributor

@tolga-tom-nook tolga-tom-nook 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 701fb4ce84a932d3e2fcefeac702a82f49dfb34e as a non-author.

Scope checked:

  • app/work_discovery.py: verified the public output is read-only, separates claimable_now, opening_soon, not_claimable, and static board/proposed-work notes, and keeps raw bounty state in bounty_availability_state rather than confusing it with public work-state names.
  • app/bounty_api.py: verified /api/v1/work-discovery is public, validates repeated/noncanonical limit, and caps limit to 1..100 through FastAPI plus work_discovery_to_dict().
  • tests/test_work_discovery.py: covers live bounty vs pending create_bounty, terminal/non-claimable rows, board issue #785 guidance, capped buckets, and parseable UTC executes_after.
  • docs/agent-guide.md and docs/api-examples.md: document the endpoint and warn agents not to claim board/proposed/pending/closed work as live bounty work.

Local validation on this head:

  • python3 -m pytest tests/test_work_discovery.py tests/test_bounty_api.py tests/test_bounty_api_routes.py tests/test_treasury_proposals.py tests/test_docs_public_urls.py -q -> 134 passed
  • python3 scripts/docs_smoke.py -> docs smoke ok
  • python3 -m ruff check app/work_discovery.py app/bounty_api.py tests/test_work_discovery.py tests/test_docs_public_urls.py scripts/docs_smoke.py -> passed
  • python3 -m ruff format --check app/work_discovery.py app/bounty_api.py tests/test_work_discovery.py tests/test_docs_public_urls.py scripts/docs_smoke.py -> passed
  • python3 -m mypy app -> success

I did not find an acceptance-blocking issue in the current head. The implementation matches Bounty #800's read-only discovery requirement and the maintainer's two-human-review queue gate.

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 focused implementation. I ran the advertised validation and the new endpoint/test/docs path is generally clean:

  • uv run --extra dev pytest tests/test_work_discovery.py tests/test_bounty_api.py tests/test_bounty_api_routes.py tests/test_treasury_proposals.py tests/test_docs_public_urls.py -q -> 134 passed, 1 warning
  • uv run --extra dev ruff check app/work_discovery.py app/bounty_api.py tests/test_work_discovery.py tests/test_docs_public_urls.py scripts/docs_smoke.py
  • uv run --extra dev ruff format --check app/work_discovery.py app/bounty_api.py tests/test_work_discovery.py tests/test_docs_public_urls.py scripts/docs_smoke.py
  • uv run --extra dev mypy app
  • uv run --extra dev python scripts/docs_smoke.py
  • git diff --check origin/main...HEAD
  • git merge-tree --write-tree origin/main HEAD -> clean tree 99895e01fecf4d3eb821470d3450c369350afce8

Blocking issue: limit is applied to raw open bounty rows before work_discovery_to_dict() separates them into claimable_now and not_claimable (app/work_discovery.py:100-116). That can hide real claimable work behind newer open-but-unclaimable rows.

Minimal local repro I ran:

  1. Create an older open bounty with one effective award remaining.
  2. Create a newer open bounty with max_awards=1.
  3. Add a pending pay_bounty proposal for the newer bounty, making its serialized availability pending_payouts_full / effective_awards_remaining=0 while the bounty status is still open.
  4. Request GET /api/v1/work-discovery?limit=1.

Observed response excerpt:

summary={'claimable_now_count': 0, 'opening_soon_count': 0, 'not_claimable_count': 1, 'limit': 1}
claimable_now=[]
not_claimable=[issue_number 101, availability_state pending_payout]

The older live bounty is still claimable, but it never reaches claimable_now because the SQL query only fetched the newest one open row before filtering. The docs say limit caps each returned bucket, and #800 asks for a stable discovery surface that helps agents find claimable-now work, so this can make agents incorrectly conclude there is no claimable work when there is.

Please either filter for effectively-claimable rows before applying the claimable bucket limit, or overfetch/page until claimable_now is filled/counted accurately, and add a regression test with a newer pending_payouts_full open bounty ahead of an older live bounty.

@SYZBZ
Copy link
Copy Markdown
Contributor Author

SYZBZ commented Jun 4, 2026

Addressed the requested limit=1 claimable starvation case on head 7dbcc3107a58a113833ed396f80cb9ff7a07b32e.

Fix:

  • app/work_discovery.py no longer applies the public bucket limit to raw open bounty rows before separating claimable_now from not_claimable.
  • The public response still caps returned buckets by limit, but open rows are partitioned first so a newer pending_payouts_full bounty cannot hide an older effectively claimable bounty.
  • Added test_work_discovery_limit_keeps_older_claimable_bounty_visible, covering the exact regression: older live bounty, newer max_awards=1 open bounty with pending pay_bounty, and GET /api/v1/work-discovery?limit=1 returning the older bounty in claimable_now while the newer row stays not_claimable / pending_payout.

Validation run locally:

  • uv run --extra dev pytest tests/test_work_discovery.py -q -> 3 passed, 1 existing Starlette/httpx warning.
  • uv run --extra dev pytest tests/test_bounty_api.py tests/test_bounty_api_routes.py tests/test_treasury_proposals.py tests/test_docs_public_urls.py -q -> 132 passed, 1 existing Starlette/httpx warning.
  • uv run --extra dev pytest -q -> 753 passed, 1 existing Starlette/httpx warning.
  • uv run --extra dev ruff format --check app/work_discovery.py tests/test_work_discovery.py -> passed.
  • uv run --extra dev ruff check app/work_discovery.py tests/test_work_discovery.py -> passed.
  • uv run --extra dev mypy app -> success.
  • uv run --extra dev python scripts/docs_smoke.py -> docs smoke ok.
  • git diff --check origin/main...HEAD -> clean.
  • git merge-tree --write-tree origin/main HEAD after fetching latest origin/main -> clean tree 99895e01fecf4d3eb821470d3450c369350afce8.

No admin-token APIs, labels, comments outside this PR reply, proposal execution, payout, ledger mutation, wallet material, exchange, bridge, cash-out, price behavior, or private-data behavior were changed.

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: a34c5c0b-203e-461c-96d4-b3143b930495

📥 Commits

Reviewing files that changed from the base of the PR and between 701fb4c and 7dbcc31.

📒 Files selected for processing (2)
  • app/work_discovery.py
  • tests/test_work_discovery.py

Comment thread app/work_discovery.py
Comment on lines +101 to +102
select(Bounty).where(Bounty.status == "open").order_by(Bounty.id.desc())
).all()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Bound the open-bounties scan on this public endpoint.

Line 101 now loads all open bounties with no SQL limit. That makes /api/v1/work-discovery unbounded in DB and serialization cost per request, which is a scalability/reliability risk on a public route. Please switch to a bounded scan strategy (e.g., paged fetch with a hard scan ceiling) while preserving the “older claimable remains visible” behavior.

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.

Reviewed current head 7dbcc3107a58a113833ed396f80cb9ff7a07b32e as a non-author follow-up after my earlier changes-requested review.

I focused on the new fix for the limit=1 claimable-starvation case:

  • app/work_discovery.py no longer limits raw open bounty rows before partitioning them into claimable_now and not_claimable.
  • tests/test_work_discovery.py::test_work_discovery_limit_keeps_older_claimable_bounty_visible now covers the exact regression: a newer open bounty with a pending pay_bounty consuming its only award no longer hides an older live bounty from claimable_now when limit=1.
  • The public response still applies the caller's limit to returned buckets, so the endpoint remains bounded while preserving the discovery purpose.

Validation I ran on this head:

  • uv run --extra dev pytest tests/test_work_discovery.py -q -> 3 passed, 1 existing Starlette/httpx warning.
  • uv run --extra dev pytest tests/test_bounty_api.py tests/test_bounty_api_routes.py tests/test_treasury_proposals.py tests/test_docs_public_urls.py -q -> 132 passed, 1 existing Starlette/httpx warning.
  • uv run --extra dev pytest -q -> 753 passed, 1 existing Starlette/httpx warning.
  • uv run --extra dev ruff check app/work_discovery.py app/bounty_api.py tests/test_work_discovery.py tests/test_bounty_api.py tests/test_bounty_api_routes.py tests/test_treasury_proposals.py tests/test_docs_public_urls.py scripts/docs_smoke.py -> passed.
  • uv run --extra dev ruff format --check app/work_discovery.py app/bounty_api.py tests/test_work_discovery.py tests/test_bounty_api.py tests/test_bounty_api_routes.py tests/test_treasury_proposals.py tests/test_docs_public_urls.py scripts/docs_smoke.py -> 8 files already formatted.
  • uv run --extra dev mypy app/work_discovery.py app/bounty_api.py -> success.
  • uv run --extra dev 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 bc820d30b8662ba28f9d3f52d2994484fa58f0d7.

GitHub state checked before this review: mergeStateStatus=CLEAN, mergeable=MERGEABLE, hosted Quality/readiness/docs/image and CodeRabbit statuses were successful, and no non-author human review existed on the current head. The prior human approvals and my previous changes-requested review were all on the older 701fb4ce... head.

I do not see a current-head blocker. The follow-up directly addresses the previously reported starvation bug and stays within #800's read-only public work-discovery scope. No admin-token APIs, labels, comments from application code, bounty/proposal creation, proposal execution, payout, ledger mutation, wallet material, exchange, bridge, cash-out, price behavior, private data, or secrets are changed.

Copy link
Copy Markdown
Contributor

@aglichandrap aglichandrap left a comment

Choose a reason for hiding this comment

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

Review evidence (head SHA: b16bf7bae2):

  • Scope: Adds GET /api/v1/work-discovery endpoint with limit param.
  • Validation: Query(ge=1, le=MAX_WORK_DISCOVERY_LIMIT), rejects repeated and non-canonical int params.
  • Imports: Uses work_discovery_to_dict, DEFAULT_WORK_DISCOVERY_LIMIT, MAX_WORK_DISCOVERY_LIMIT from app/work_discovery.py.
  • Files: 7 files, +496/-0 — larger but well-structured.
  • Mergeable: state=clean.

No blockers. Approve.

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.

Reviewed current head as non-author. /claim #800

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.

7 participants