You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds prolific audience breakdown, a wrapper over POST /api/v1/eligibility-count/filter-breakdown/ that counts eligible participants matching a set of base filters, broken down by the values (or bucketed ranges, for numeric filters) of one distributable filter (BUZZ-231).
The response includes an "N/A" bucket — participants who match the base filters but don't fall into any of the breakdown filter's selected values/range (e.g. an unanswered screener question). This isn't documented anywhere public (the endpoint isn't in the published OpenAPI spec yet), so the command's own --help explains it explicitly, traced back to filter_breakdown_service.py's base_count - unsplit_count in the prolific-api repo.
Implementation
New client payload/response types (FilterBreakdownPayload/FilterBreakdownResponse) + GetFilterBreakdown method
New cmd/audience package: an audience parent command (pure router) with breakdown as its first subcommand, following the documented Two-Level Command Structure — leaves room for a future audience count; eligibility-count itself is untouched in this PR
docs/examples/filter-breakdown.json example template
contract_test.go: added a skip entry for messages_CreateConversation, an unrelated operation that appeared in the live spec and was blocking the pre-commit hook — no CLI command exists for it
Testing
cmd/audience/breakdown_test.go covers rendering, empty-filters-not-nil, input validation (missing template/workspace/breakdown filter), config read/unmarshal failures, and API error handling. make lint, make test (incl. contract test against the live spec), make build all pass.
Add Long description and Example to audience command
cmd/audience/audience.go:15
The new top-level audience command has no Long or Example, so prolific audience --help lacks the description and invocation guidance provided by the other parent commands (for example, cmd/bonus/bonus.go:14-30). Add both fields so users can discover that breakdown requires a template and workspace.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
prolific audience breakdown, a wrapper overPOST /api/v1/eligibility-count/filter-breakdown/that counts eligible participants matching a set of base filters, broken down by the values (or bucketed ranges, for numeric filters) of one distributable filter (BUZZ-231).The response includes an "N/A" bucket — participants who match the base filters but don't fall into any of the breakdown filter's selected values/range (e.g. an unanswered screener question). This isn't documented anywhere public (the endpoint isn't in the published OpenAPI spec yet), so the command's own
--helpexplains it explicitly, traced back tofilter_breakdown_service.py'sbase_count - unsplit_countin the prolific-api repo.Implementation
FilterBreakdownPayload/FilterBreakdownResponse) +GetFilterBreakdownmethodcmd/audiencepackage: anaudienceparent command (pure router) withbreakdownas its first subcommand, following the documented Two-Level Command Structure — leaves room for a futureaudience count;eligibility-countitself is untouched in this PRdocs/examples/filter-breakdown.jsonexample templatecontract_test.go: added a skip entry formessages_CreateConversation, an unrelated operation that appeared in the live spec and was blocking the pre-commit hook — no CLI command exists for itTesting
cmd/audience/breakdown_test.gocovers rendering, empty-filters-not-nil, input validation (missing template/workspace/breakdown filter), config read/unmarshal failures, and API error handling.make lint,make test(incl. contract test against the live spec),make buildall pass.🤖 Generated with Claude Code