Repository navigation
feat: feed prompt suggestions with real Search Console demand - #650
Merged
Merged
Conversation
Contributor
Author
|
Pushed three hardening improvements on top: dismissed GSC suggestions can no longer resurrect on refresh (their queries are excluded from mining for 30 days), sourceQuery provenance matching is now case/whitespace-normalized so a cosmetic LLM rewrite can't drop real provenance, and GSC-sourced cards hide the modeled estVolume badge — measured impressions and a modeled estimate side by side read as a contradiction. |
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
GSC integration phase 3a: the prompt-suggestion generator now feeds on the brand's real Search Console demand. Every step up to the LLM handoff is deterministic:
gsc_candidate_queries()SQL function aggregates the last 28 days per query in the DB (≥30 impressions, top 200) instead of shipping tens of thousands of daily rows to the app.dataforseo_competition_cache),GSC_SUGGESTION_ENRICHMENT=offkill-switch;competition_index ≤33→ Low competition badge. Enrichment failure degrades to unbadged candidates, never breaks generation.sourceQueryschema field. Only a verbatim match against a provided candidate becomessource: 'gsc'+source_data— a hallucinated sourceQuery degrades to a plainllmrow.gsc_query_statsrows older than 90 days.Brands without GSC (no connection, no mapping, or no Composio env) are untouched: the candidate list is empty and both system and user prompts are byte-identical to the pre-GSC build — no new API calls, no behavior change.
Migration
00048:prompt_suggestions.source_datajsonb, the widenedsourcecheck (adds'gsc'), the aggregation function, and the competition cache table. Applied to hosted;types/supabase.tssynced.Related issue
Closes #648
Type of change
feat— New featureHow to test
Manually tested end-to-end against live GSC data (3.2k queries): mining, badges, provenance, and the no-GSC path verified.
Checklist
feature/)yarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)