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(action-center): count a page's Site Audit score as low only below 50 out of 100 (#1407)
Gökhan Geyik3800c7b7c706
diff --git a/server/src/config/action-engine.js b/server/src/config/action-engine.jsindex 14757e9e9..c56fac1c2 100644--- a/server/src/config/action-engine.js+++ b/server/src/config/action-engine.js@@ -113,8 +113,9 @@ export const ENGINE_THRESHOLDS = Object.freeze({citationGapMultiple: 2,citationGapMinAbsolute: 20,- /** Site Audit score below this is a problem; an audit older than this is- * not evidence about the page as it stands today. */+ /** Site Audit score below this (out of 100; audits store 0–1) is a+ * problem; an audit older than this is not evidence about the page as+ * it stands today. */auditLowScore: 50,auditMaxAgeDays: 90,diff --git a/server/src/lib/signals/audit-low-score.test.js b/server/src/lib/signals/audit-low-score.test.jsindex 0e29971d8..e17f2e5c3 100644--- a/server/src/lib/signals/audit-low-score.test.js+++ b/server/src/lib/signals/audit-low-score.test.js@@ -30,14 +30,30 @@ function serve(rows) {supabaseAdmin.from.mockReturnValue(query);}-const audit = (i, score) => ({+/** A stored audit: Site Audit keeps its score from 0 to 1, the threshold is out of 100. */+const audit = (i, points) => ({url: `https://acme.example/p${i}`,- total_score: score,+ total_score: points / 100,completed_at: now.toISOString(),});/** Site Audit's low pages (AC-009): the ten lowest to show, every address past them. */describe('auditCandidates', () => {+ it('counts a page low only below the threshold out of 100', async () => {+ serve([audit(0, 63), audit(1, auditLowScore), audit(2, auditLowScore - 1), audit(3, 10)]);+ const [signal] = await auditCandidates('b1', now);+ expect(signal.currentValue).toBe(2);+ expect(signal.payload.urls).toEqual([+ { url: 'https://acme.example/p3', score: 0.1 },+ { url: 'https://acme.example/p2', score: (auditLowScore - 1) / 100 },+ ]);+ });++ it('raises nothing when every page scores at or above the threshold', async () => {+ serve([audit(0, 63), audit(1, 88)]);+ expect(await auditCandidates('b1', now)).toEqual([]);+ });+it('lists no addresses beside the ten it shows', async () => {serve(Array.from({ length: 10 }, (_, i) => audit(i, auditLowScore - 1 - i)));const [signal] = await auditCandidates('b1', now);diff --git a/server/src/lib/signals/record.js b/server/src/lib/signals/record.jsindex ff262cdc2..35983f002 100644--- a/server/src/lib/signals/record.js+++ b/server/src/lib/signals/record.js@@ -322,9 +322,10 @@ export async function auditCandidates(brandId, now) {if (!latestByUrl.has(audit.url)) latestByUrl.set(audit.url, audit);}+ // Site Audit stores a score from 0 to 1; the threshold is out of 100.const low = [...latestByUrl.values()].map((audit) => ({ url: audit.url, score: Number(audit.total_score) }))- .filter((audit) => audit.score < detection.auditLowScore)+ .filter((audit) => audit.score * 100 < detection.auditLowScore).sort((a, b) => a.score - b.score);if (low.length === 0) return [];