Repository navigation
feat(reports): mention & citation evidence sections + Brand Citations naming - #444
Merged
Merged
Conversation
… naming Closes #429. A report reader asking 'which answers mentioned me, and which URLs are these citations?' can now answer it inside the report — including the forwarded PDF: - Mention Evidence: the top 10 mentioning answers in the window, each with its prompt, platform, date and the passage of the answer around the brand mention (markdown-stripped, word-bounded excerpt; falls back to the answer's opening when the mention came via a domain). Server-side ORDER BY mention_count + LIMIT — no scan. - Citation Evidence: the top 10 cited URLs with citation counts and up to 3 tracked prompts whose answers cited each. Own paginated scan (1000-row pages, 50k ceiling) because the citations overview doesn't keep prompt attribution; URL normalization matches the Citations page so the lists line up. - Both are pickable sections following the payload-presence pattern: registered in the template registry (executive_summary gets both, citation_sources gains citationEvidence), gathered only when picked, rendered as cards on the detail page and as tables in the PDF. Old reports without the fields render unchanged. - Naming: the KPI is now 'Brand Citations' with a one-line footnote (web + PDF), the citations section header notes it covers ALL cited sources, and the domains table no longer borrows the KPI label. Deliberately out: KPI drill-down links into Insights/Citations — those pages don't support date-prefilter URLs yet; noted as follow-up.
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
Reports currently show aggregate numbers (mentions, citations) with no way to see what's behind them, and the "Citations" KPI is easily confused with the Citations page total (it only counts citations to the brand's own domains, excluding
chatgpt-shopping). This PR adds two pickable evidence sections and clarifies the metric naming:Both sections are part of the
executive_summarytemplate by default;citation_sourcesincludes Citation Evidence. Snapshots stay immutable: existing reports have no evidence fields and simply don't render the new sections.Related issue
Closes #429
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)