Document activity search filter#536
Conversation
📝 WalkthroughWalkthroughDocumentation for the ChangesActivity filter query parameter documentation
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
| `/api/v1/activity` accepts optional `q` text search. It filters accepted-work | ||
| rows by account, amount, submission reference, bounty reference, issue URL, PR | ||
| URL, proof hash, or note; the HTML `/activity` page uses the same filter. |
There was a problem hiding this comment.
Remove unsupported note filter claim from /api/v1/activity docs.
The implementation does not search a note field. Current matching is against account, amount_mrwk, submission_url, proof_hash, bounty_id, bounty_repo, bounty_issue_url, and bounty_issue_number (app/serializers.py, _activity_row_matches). Please update this sentence to avoid documenting behavior that does not exist.
Proposed doc fix
-`/api/v1/activity` accepts optional `q` text search. It filters accepted-work
-rows by account, amount, submission reference, bounty reference, issue URL, PR
-URL, proof hash, or note; the HTML `/activity` page uses the same filter.
+`/api/v1/activity` accepts optional `q` text search. It filters accepted-work
+rows by account, amount, submission/PR reference, bounty id or repo, issue URL
+or issue number, and proof hash; the HTML `/activity` page uses the same filter.As per coding guidelines, docs under docs/**/*.md must be short, concrete, and avoid unsupported/speculative claims.
adliebe
left a comment
There was a problem hiding this comment.
Reviewed PR #536 at current head 3c5ad3675f93309018a5615ad1cf8e8512fccd60 as a non-author.
Scope checked:
docs/agent-guide.mdadds the read-only examplecurl -s "$API_HOST/api/v1/activity?q=<account-or-pr-or-proof>".- The guide now explains that
/api/v1/activityfilters accepted-work rows by account, amount, submission reference, bounty reference, issue URL, PR URL, proof hash, or note, and that the HTML/activitypage uses the same filter.
Implementation/evidence checked:
app/activity.pyexposesq: str | None = Query(None)on both/api/v1/activityand/activity, and passes it intoactivity_context(session, q).app/serializers.pynormalizes the query and matches it against the documented row fields.- Existing
tests/test_activity.pycovers API query filtering and HTML/activity?q=...behavior. - Existing
docs/api-examples.mdalready documents/api/v1/activity?q=p3xilland the query field set, so the agent guide now aligns with the API examples.
Validation:
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest tests/test_docs_public_urls.py::test_agent_guide_documents_activity_endpoint -q->1 passedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest tests/test_activity.py::test_activity_api_filters_accepted_work_by_query tests/test_activity.py::test_activity_page_renders_empty_and_paid_states -q->2 passedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python scripts/docs_smoke.py->docs smoke okuv run --extra dev ruff check docs/agent-guide.md app/activity.py app/serializers.py tests/test_activity.py tests/test_docs_public_urls.py-> passeduv run --extra dev ruff format --check app/activity.py app/serializers.py tests/test_activity.py tests/test_docs_public_urls.py-> passedgit diff --check origin/main...HEAD-> clean- GitHub
Quality, readiness, docs, and image checks-> success - CodeRabbit status -> success
Verdict: approved. The change is small, matches existing route behavior, and improves agent discoverability without adding payout, off-ramp, private credential, or price-claim language.
weilixiong
left a comment
There was a problem hiding this comment.
QUALITY_GATE: LOW risk ✅
1 file, +5/-0: Documents the q text search filter on /api/v1/activity in agent-guide.md. Adds endpoint example curl and a 2-line description paragraph.
docs/agent-guide.md: +5/-0 (activity?q= curl example, filter description)
Verification: pytest tests/test_docs_public_urls.py -k activity → 2/2 passed. docs_smoke.py → ok (RC=0).
Docs-only change, single file, no functional code.
Juanpablo24-06
left a comment
There was a problem hiding this comment.
Reviewed PR #536 at current head 3c5ad3675f93309018a5615ad1cf8e8512fccd60 as non-author Juanpablo24-06.
I found one docs/implementation mismatch that should be fixed before merge: the new agent-guide paragraph says /api/v1/activity filters accepted-work rows by note, but the actual activity search path does not include proof note metadata.
Evidence checked:
- The PR diff only changes
docs/agent-guide.mdand adds the phrase "proof hash, or note" to the activity search description. app/activity.pypassesqthrough toactivity_context(session, q)/activity_to_dict(session, q).app/serializers.py::_activity_row()builds rows from account, amount, submission URL, bounty repo/issue/id, and proof hash, but does not exposeverifier_result.notefrom the proof payload.app/serializers.py::_activity_row_matches()searches only account, amount, submission URL, proof hash, bounty id, bounty repo, bounty issue URL, and bounty issue number.- Existing
tests/test_activity.py::test_activity_api_filters_accepted_work_by_querycovers account, repo, proof hash, and no-match behavior, but not note search.
Validation run locally:
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest tests/test_activity.py::test_activity_api_filters_accepted_work_by_query -q->1 passedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python scripts/docs_smoke.py->docs smoke okuv run --extra dev ruff check app/serializers.py app/activity.py tests/test_activity.py docs/agent-guide.md-> passed
Suggested fix: remove or note from the new agent-guide sentence, or extend the implementation/tests to actually include proof notes in activity search. For this docs-only PR, removing the note claim is the smaller scoped fix.
tolga-tom-nook
left a comment
There was a problem hiding this comment.
Reviewed PR #536 at current head 3c5ad367 for the rolling review bounty #447.
I checked the docs-only diff in docs/agent-guide.md against the current implementation in app/activity.py and app/serializers.py, then ran:
python3 scripts/docs_smoke.py->docs smoke okpython3 -m pytest tests/test_docs_public_urls.py::test_agent_guide_documents_activity_endpoint tests/test_activity_routes.py -q->2 passed
Requesting one small correction before merge: the new sentence says /api/v1/activity?q=... filters by "note", but _activity_row_matches() only searches account, amount_mrwk, submission_url, proof_hash, bounty_id, bounty_repo, bounty_issue_url, and bounty_issue_number. The payout verifier note can exist in proof metadata, but it is not exposed in _activity_row() or included in the searchable tuple. Please either remove "note" from the documented filter list or add it to the activity row/search behavior with test coverage.
eliasx45
left a comment
There was a problem hiding this comment.
I found one blocker on current head 3c5ad3675f93309018a5615ad1cf8e8512fccd60.
The new agent-guide text says /api/v1/activity?q=... filters accepted-work rows by note, but the implementation does not search proof/verifier notes. _activity_row() builds rows with account, amount, submission URL, bounty repo/issue/id/URL, proof hash/URL, and timestamps; _activity_row_matches() searches only account, amount, submission URL, proof hash, bounty id, bounty repo, bounty issue URL, and bounty issue number. No proof verifier_result.note value is exposed in the row or included in the searchable tuple.
Please either remove or note from the docs, or add note to the activity row/search behavior with regression coverage.
Evidence checked:
- PR diff is docs-only in
docs/agent-guide.mdand addsproof hash, or noteto the activity search description. app/activity.pypassesqintoactivity_to_dict(session, q).app/serializers.py::_activity_row()does not expose proof/verifier note metadata.app/serializers.py::_activity_row_matches()does not search any note field.- Existing
tests/test_activity.py::test_activity_api_filters_accepted_work_by_querycovers account/repo/proof/no-match behavior, not notes.
Validation I ran:
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .\.venv\Scripts\python.exe -m pytest tests\test_docs_public_urls.py::test_agent_guide_documents_activity_endpoint tests\test_activity.py::test_activity_api_filters_accepted_work_by_query -q-> 2 passedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .\.venv\Scripts\python.exe scripts\docs_smoke.py-> docs smoke ok.\.venv\Scripts\python.exe -m ruff check tests\test_docs_public_urls.py tests\test_activity.py app\serializers.py app\activity.py-> passed.\.venv\Scripts\python.exe -m ruff format --check tests\test_docs_public_urls.py tests\test_activity.py app\serializers.py app\activity.py-> 4 files already formattedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .\.venv\Scripts\python.exe -m mypy app\activity.py app\serializers.py-> successgit diff --check origin/main...HEAD-> clean
|
Holding with |
Refs #426\n\nUpdates the agent guide to show the current search filter alongside the existing accepted-work activity example.\n\nEvidence:\n- registers with optional .\n- passes the query into .\n- filters activity rows by account, amount, submission reference, bounty reference, issue URL, PR URL, proof hash, and note.\n\nValidation:\n- docs smoke ok →
Summary by CodeRabbit
/api/v1/activitydocumentation with examples of theqquery parameter for activity filtering