Repository navigation
feat(content): read the opportunity list through prompt clusters - #932
Merged
Merged
Conversation
Cluster opportunities (#930) were listed among thousands of untouched per-prompt ones, and the prompt filter only matched an opportunity's own prompt_id (#857). - Migration 00103 archives the per-prompt backlog: status 'new', no cluster, no brief. Nothing is deleted; Restore on the detail page sets one back to 'new'. The list, its summary and the MCP list hide archived rows unless the Archived status is chosen. - The prompt filter matches the opportunities of the prompt's cluster, own or merged, and still matches older ones by prompt_id. Its option counts are computed the same way. - A topic filter matches opportunities whose own or merged clusters are in the topic, with options from GET /brand/:id/topics. - content_opportunity_aggregates takes the topic filter, matches prompts through clusters and returns the brand's signal count: the prompts and fan-out queries its clusters were built from. The first KPI card shows it as "from N signals analyzed". - A run picks at most one cluster per topic, so its few suggestions spread across the brand's topics.
This was referenced Oct 7, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Third of three PRs for #857 (after #925 and #930). The Content page now reads opportunities through prompt clusters, and the old per-prompt backlog is archived.
Archiving the per-prompt backlog
archivedstatus when it is stillnew, has no cluster and has no brief. On the hosted database this archived 9,286 rows.new, are left alone.list_content_opportunitiestool hide archived rows unlessarchivedis the status asked for.new.Filters
prompt_idit is. Older per-prompt rows still match byprompt_id. The option counts in/brand/:id/promptsare computed the same way, which also gives feat(prompts): show a prompt's content opportunities on its detail page #838 the right numbers.GET /brand/:id/topics, and the filter shows when there are two or more topics.content_opportunity_aggregatestakes the topic filter and matches prompts through clusters, so the summary cards follow the list.Signals analyzed
One cluster per topic per run
Tried on production data
Related issue
Part of #857. This completes Phase 1 of the plan; Phases 2–4 stay open there.
Type of change
feat— New featuretest— Adding or updating testsHow to test
opportunity-limits.test.jsadds the one-cluster-per-topic case.Checklist
yarn lint,yarn typecheck,yarn format:check,yarn test(404) andyarn buildpass (run fromweb/)yarn lint,yarn format:checkandyarn test(945) pass (run fromserver/)supabase/schema.sqlrebuilt withbuild-schema.sh🤖 Generated with Claude Code