feat(audit): Site Audit — 47-signal AEO/GEO page scoring with AI fixes#259
Merged
Conversation
…fixes Scores any page against a 47-signal AEO/GEO rubric across 5 weighted categories (structure, content, authority, trust, E-E-A-T) and returns page-specific, AI-written fix recommendations with ready-to-paste drafts. Server (server/src/lib/audit/ + routes/audits.js): - Scrape.do fetcher (proxy + JS render) with smart robots.txt/llms.txt fallback - 33 deterministic signals (cheerio DOM parsing + readability/links/meta) - 13 LLM-judged signals in one batched structured-output call; pages are evaluated on their own inferred topic (no external/brand context injected) - Wikidata brand-entity lookup - AI fix recommendations (own LLM call) for the fixable failing signals, with drafted snippets; model is provider-flexible via AUDIT_LLM_MODEL (default google/gemini-3-flash-preview) - Runs async: POST returns a running row immediately, client polls GET /:id - Feature-gated (content_optimization) + monthly per-org quota (Starter 100 / Growth 500; Enterprise & self-hosted unlimited) Web (dashboard/audit): - Site Audit page under Content Optimization: score gauge + grade, pass/warn/ fail summary, category breakdown, signal list with findings + AI fixes, recent audits with delete, issues-only filter, staged loading + empty state Migrations 00017 (tables + RLS), 00018 (recommendations), 00019 (usage quota).
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
A new Site Audit feature (under Content Optimization) that scores any page against a 47-signal AEO/GEO rubric and returns page-specific, AI-written fix recommendations with ready-to-paste drafts.
The rubric is an open standard implemented entirely in-house — no third-party scoring API.
How it works
POST /api/audits {url, brandId}returns arunningrow immediately; the audit runs in the background and the client pollsGET /api/audits/:iduntil it flips tocompleted/failed. Per audit:Score = weighted category mean, normalized over evaluated signals (coverage shown as
X/47).Guardrails
content_optimization(server-side, not just UI).resolveModel— envAUDIT_LLM_MODEL(defaultgoogle/gemini-3-flash-preview); self-hosters can point it at any provider with a key.Web UI
Site Audit page: circular score gauge + grade, pass/warn/fail summary chips, category breakdown bars, signals grouped by category (each expands to finding + why + AI-written fix with copy), an AI Recommendations card, recent-audits list with delete, an issues-only filter, staged loading state, and an empty state.
Schema
00017_site_audit.sql—site_audits+audit_signal_results(+ RLS, org-membership scoped).00018_site_audit_recommendations.sql—recommendationsjsonb column.00019_site_audit_usage.sql—site_audit_usagequota table (RLS, service-role only).New env vars (see
server/.env.example)SCRAPEDO_API_KEY— page fetching.AUDIT_LLM_MODEL— defaults togoogle/gemini-3-flash-preview.Notes
cheerioto the server package.