Open-source agentic AI Search Execution Platform. Track AI visibility, find opportunities, and let agents turn signals into prioritized actions and drafted fixes across ChatGPT, Claude, Gemini, Google AI Overviews, Google AI Mode, Perplexity, Grok, and Microsoft Copilot.
TypeScript aeoai-agentai-searchanswer-engine-optimizationbrand-monitoringchatgptclaudecopilotdockergeminigeogoogle-ai-overviewsgrokmcpnextjsopen-sourceperplexityseosupabasetypescript
fix(content): say both what to check in the feed and which product links to change when both rules are open (#1654)
Cihan47c9023574a5
diff --git a/web/messages/en.json b/web/messages/en.jsonindex 8ac948e7d..a8cf37e6a 100644--- a/web/messages/en.json+++ b/web/messages/en.json@@ -4078,6 +4078,7 @@"nothingToFix": "Content Agent found nothing it could change without new facts.","breaks": "Would break {names}","nothingToFixLocked": "Content Agent's changes were all in passages AI answers quote, which it keeps. Unlock the ones you're fine to change (Edit anyway), or change them yourself.",+ "notForAgentFeedShopping": "Content Agent doesn't change a price, GTIN or stock, or which products the page links: check which is right, the page or your product feed, and fix that one; then remove or replace the links to products that are out of stock, refused or gone.","notForAgent": "Content Agent doesn't change heading levels: make the extra H1s H2s in the toolbar.","notForAgentFeed": "Content Agent doesn't change a price, GTIN or stock: check which is right, the page or your product feed, and fix that one.","notForAgentShopping": "Content Agent doesn't change which products the page links: remove or replace the links to sold-out, refused or gone products yourself.",diff --git a/web/src/lib/content/rules.test.ts b/web/src/lib/content/rules.test.tsindex c6502c9e3..3c5231913 100644--- a/web/src/lib/content/rules.test.ts+++ b/web/src/lib/content/rules.test.ts@@ -1,4 +1,5 @@import { describe, expect, it } from 'vitest';+import messages from '../../../messages/en.json';import { htmlBlockElement } from './html-allowlist';import type { ShoppingCheck, ShoppingLinkState } from './shopping-check';import {@@ -604,15 +605,27 @@ describe('shopping path rules (shopping path, part 6)', () => {});});- it('says what to do instead when only a sold-out link is open: not the feed’s message', () => {+ it('says what to do instead when only a sold-out link is open, and both when the feed’s is too', () => {expect(notForAgentMessage([{ rule: { key: 'shopLinksLive' } }])).toBe('notForAgentShopping');expect(notForAgentMessage([{ rule: { key: 'shopLinksLive' } }, { rule: { key: 'feedMatch' } }]),- ).toBe('notForAgentFeed');+ ).toBe('notForAgentFeedShopping');expect(notForAgentMessage([{ rule: { key: 'shopLinksLive' } }, { rule: { key: 'oneH1' } }]),).toBe('notForAgent');});++ it('has a message in the editor for each of its answers', () => {+ const answers = [+ [{ rule: { key: 'oneH1' } }],+ [{ rule: { key: 'feedMatch' } }],+ [{ rule: { key: 'shopLinksLive' } }],+ [{ rule: { key: 'feedMatch' } }, { rule: { key: 'shopLinksLive' } }],+ ].map(notForAgentMessage);+ expect(new Set(answers).size).toBe(4);+ const suggestions: Record<string, unknown> = messages.contentEditor.editor.suggestions;+ for (const key of answers) expect(suggestions[key]).toEqual(expect.any(String));+ });});describe('style', () => {diff --git a/web/src/lib/content/rules.ts b/web/src/lib/content/rules.tsindex f3ea163de..ce8496e56 100644--- a/web/src/lib/content/rules.ts+++ b/web/src/lib/content/rules.ts@@ -835,12 +835,14 @@ export const NOT_FOR_AGENT = new Set(['oneH1', 'feedMatch', 'shopLinksLive']);/*** What to do instead, for the open rules the agent doesn't fix: its- * message's key, the extra H1s' first, then the feed's.+ * message's key, the extra H1s' first, then the feed's and the shopping+ * links', one message for both when both are open.*/export const notForAgentMessage = (open: readonly { rule: { key: string } }[]) => {const has = (key: string) => open.some(({ rule }) => rule.key === key);if (has('oneH1')) return 'notForAgent';- return has('shopLinksLive') && !has('feedMatch') ? 'notForAgentShopping' : 'notForAgentFeed';+ if (!has('shopLinksLive')) return 'notForAgentFeed';+ return has('feedMatch') ? 'notForAgentFeedShopping' : 'notForAgentShopping';};/**