Skip to content

fix(citations): report not_measurable when the provider returns no sources and the brand is not mentioned - #781

Merged
auriti merged 3 commits into
mainfrom
fix/citations-not-measurable-verdict-20261201
Dec 2, 2026
Merged

auriti merged 3 commits into
mainfrom
fix/citations-not-measurable-verdict-20261201

Conversation

@auriti

@auriti auriti commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Draft. D10 decided by the owner: the new not_measurable verdict is approved; keep it as a draft PR.

What changes

geo citations and POST /api/citations: when the provider returns no sources (every provider except Perplexity) and the answers do not mention the brand either, the verdict is now not_measurable instead of invisible.

Without sources the check cannot tell "not cited" from "sources not available" (source_observation_status is already not_supported for these providers since #761). invisible read as a measured absence.

  • Existing verdicts (strong, cited, mentioned_only, invisible) keep their names and meaning. Perplexity still gives invisible.
  • mentioned_only keeps its name; second commit: its CLI text no longer says "never cites" when the provider returns no sources (only Perplexity and serpbase can show that).
  • The serpbase path is unchanged: it reads organic and AI Overview results, so an absence there is observed.
  • New value in the CLI text and advice tables; the stable flag uses the same rule.

Not in this PR

The first half of the handoff item (the (?!\.\w) guard on the platform-name match) is already on main: utils/brand_match.py applies it to every brand match (7efa0c2), with tests tests/test_brand_match.py:24 and tests/test_citations.py:70 for geoready.app. No commit was needed.

Impact on the platform (read-only check)

  • frontend/src/components/CitationCheckContent.tsx maps verdicts to text; an unknown one shows "—" / "No verdict for this check." (no crash). It only calls Perplexity today, so it never receives not_measurable.
  • frontend/src/lib/api.ts:1375 types verdict as a closed union: add "not_measurable" when the platform adopts this engine version.
  • backend/services/one_shot_service.py:175 copies verdict through as a string.

Tests

  • 4 new tests in tests/test_citations.py::TestProviderWithoutSources (no mention + no sources, mention + no sources, Perplexity still invisible, CLI tables). Two of them fail without the change.
  • Full suite: 2885 passed, 7 skipped. ruff check and ruff format --check clean on the touched files.
  • No version bump, no tag. Entry under "Unreleased" in CHANGELOG.md.

…urces and the brand is not mentioned

For every provider except Perplexity the check cannot see sources, so "no citation"
is not an observation. With no brand mention either, the verdict was "invisible",
which reads as a measured absence. It is now "not_measurable". The existing
verdicts keep their names and meaning.
…s no sources

geo citations printed "never cites" for mentioned_only from every provider. Only
providers that return sources (Perplexity, serpbase) can show that. For the others
the text now says the brand is named and that citations cannot be checked.
@auriti auriti closed this Dec 1, 2026
@auriti auriti reopened this Dec 1, 2026
@auriti
auriti marked this pull request as ready for review December 2, 2026 11:44
@auriti
auriti merged commit 6d4097b into main Dec 2, 2026
16 checks passed

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.

Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant