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
feat(audit): show the month's audits as the v2 quota card and summary strip (#1140)
Cihan8bdaab6d1f7f
diff --git a/server/src/lib/audit/overview.js b/server/src/lib/audit/overview.jsindex ecf75c56c..5d1a1d934 100644--- a/server/src/lib/audit/overview.js+++ b/server/src/lib/audit/overview.js@@ -1,13 +1,14 @@/*** The Site Audit hub's KPI cards (SA-018): site score, pages audited, and the- * Authority and E-E-A-T scores with their biggest gaps. Pure, so the route- * only reads rows and this decides what they add up to.+ * Authority and E-E-A-T scores with their biggest gaps; and the summary+ * strip's lowest category (SA-019). Pure, so the route only reads rows and+ * this decides what they add up to.** Everything covers the brand's primary domain, like the Score over time* chart, and each page counts once, through its latest completed audit.*/-import { signalsByKey } from './rubric.js';+import { categories, signalsByKey } from './rubric.js';/** The categories the Authority · E-E-A-T card reads. */export const AUTHORITY_CATEGORIES = ['authority', 'eeat'];@@ -72,12 +73,22 @@ export function buildOverview(own, categoryScoresById, failingRows) {.sort((a, b) => b.pages - a.pages || a.key.localeCompare(b.key)).slice(0, OVERVIEW_GAPS);+ // The weakest of the five categories; a tie goes to the rubric's order.+ let lowestCategory = null;+ for (const { key } of categories) {+ const score = categoryAverage(key);+ if (score !== null && (lowestCategory === null || score < lowestCategory.score)) {+ lowestCategory = { key, score };+ }+ }+return {pages: own.length,siteScore,siteScoreChange,authority: categoryAverage('authority'),eeat: categoryAverage('eeat'),+ lowestCategory,gaps,};}diff --git a/server/src/lib/audit/overview.test.js b/server/src/lib/audit/overview.test.jsindex 734c10625..fdc4d981f 100644--- a/server/src/lib/audit/overview.test.js+++ b/server/src/lib/audit/overview.test.js@@ -48,6 +48,28 @@ describe('buildOverview', () => {// Pages without a category score are left out of its average.expect(overview.authority).toBeCloseTo(0.38);expect(overview.eeat).toBeCloseTo(0.3);+ // The summary strip's weakest category (SA-019).+ expect(overview.lowestCategory).toEqual({ key: 'eeat', score: 0.3 });+ });++ it('finds the lowest category among all five, a tie going to the rubric order', () => {+ const all = new Map([+ [+ 'a',+ {+ structure: { score: 0.8 },+ content: { score: 0.5 },+ authority: { score: 0.5 },+ eeat: { score: 0.6 },+ trust: { score: 0.9 },+ },+ ],+ ]);+ // The rubric lists authority before content.+ expect(buildOverview([page('a', 0.6)], all, []).lowestCategory).toEqual({+ key: 'authority',+ score: 0.5,+ });});it('has no change when no page was audited twice, and nothing without pages', () => {@@ -58,6 +80,7 @@ describe('buildOverview', () => {siteScoreChange: null,authority: null,eeat: null,+ lowestCategory: null,gaps: [],});});diff --git a/server/src/lib/plan-guard-site-audit.test.js b/server/src/lib/plan-guard-site-audit.test.jsindex 26f9c8f2d..410d04e35 100644--- a/server/src/lib/plan-guard-site-audit.test.js+++ b/server/src/lib/plan-guard-site-audit.test.js@@ -10,6 +10,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';let used;let autoUsed;let running;+let autoRunning;let runningQuery;let settings;let recordedDays;@@ -37,6 +38,9 @@ function query(table) {return resolve({ count: auto ? autoUsed : used, error: null });}if (table === 'site_audits') {+ if (filters.some(([, col, val]) => col === 'source' && val === 'auto')) {+ return resolve({ count: autoRunning, error: null });+ }runningQuery = filters;return resolve({ count: running, error: null });}@@ -62,6 +66,7 @@ beforeEach(async () => {used = 0;autoUsed = 0;running = 0;+ autoRunning = 0;settings = null;recordedDays = [];vi.doMock('../config/supabase.js', () => ({ default: { from: (t) => query(t) } }));@@ -128,16 +133,21 @@ describe('Site Audit quota', () => {recordedDays = [1];used = 30;autoUsed = 5;+ running = 3;+ autoRunning = 2;expect(await quota.getSiteAuditQuotaStatus('org-1', { now })).toMatchObject({used: 30,+ running: 3,limit: 100,- remaining: 50,+ remaining: 47,auto: {enabled: true,setting: null,perRun: 5,reserved: 20,used: 5,+ // Of the running audits, the runs' own (SA-019's card).+ running: 2,due: { day: 7 },nextRun: { day: 7, at: now.toISOString() },periodStart: '2026-10-01T00:00:00.000Z',@@ -153,17 +163,17 @@ describe('Site Audit quota', () => {});// The user can't take the runs' slots; a run can.- await expect(quota.enforceSiteAuditQuota('org-1', 51, { now })).rejects.toThrow(- 'These 51 audits need more than the 50 left this month on the Starter plan (20 more are kept for auto-audits). Select up to 50.',+ await expect(quota.enforceSiteAuditQuota('org-1', 48, { now })).rejects.toThrow(+ 'These 48 audits need more than the 47 left this month on the Starter plan (20 more are kept for auto-audits). Select up to 47.',);await expect(quota.enforceSiteAuditQuota('org-1', 5, { source: 'auto', now }),- ).resolves.toMatchObject({ remaining: 70 });+ ).resolves.toMatchObject({ remaining: 67 });// Day 7 recorded: its unused slots are back in the user's pool.recordedDays = [1, 7];expect(await quota.getSiteAuditQuotaStatus('org-1', { now })).toMatchObject({- remaining: 55,+ remaining: 52,auto: { reserved: 15, due: null, nextRun: { day: 14 } },});});diff --git a/server/src/lib/plan-guard.js b/server/src/lib/plan-guard.jsindex 37e573c0d..1d98ccdec 100644--- a/server/src/lib/plan-guard.js+++ b/server/src/lib/plan-guard.js@@ -529,18 +529,21 @@ async function countSiteAuditUsage(orgId, periodStart) {const SITE_AUDIT_IN_FLIGHT_MS = AUDIT_RUN_TIMEOUT_MS;/**- * Audits of the org's brands still running. They're charged when they- * complete, so each holds a slot until then: otherwise a run started while- * others are in flight could take the quota past its limit.+ * Audits of the org's brands still running (only `source`'s, when given).+ * They're charged when they complete, so each holds a slot until then:+ * otherwise a run started while others are in flight could take the quota+ * past its limit.*/-async function countRunningSiteAudits(orgId) {+async function countRunningSiteAudits(orgId, source) {const since = new Date(Date.now() - SITE_AUDIT_IN_FLIGHT_MS).toISOString();- const { count } = await supabaseAdmin+ let query = supabaseAdmin.from('site_audits').select('id, brands!inner(organization_id)', { count: 'exact', head: true }).eq('status', 'running').eq('brands.organization_id', orgId).gte('created_at', since);+ if (source) query = query.eq('source', source);+ const { count } = await query;return count || 0;}@@ -615,12 +618,14 @@ async function siteAuditQuota(orgId, now) {const plan = await resolveOrgPlanByOrgId(orgId);const limit = plan.limits.maxSiteAudits;const periodStart = await quotaPeriodStart(orgId, now);- const [{ used, autoUsed }, running, auto] = await Promise.all([+ const [{ used, autoUsed }, running, autoRunning, auto] = await Promise.all([limit === -1 ? { used: 0, autoUsed: 0 } : countSiteAuditUsage(orgId, periodStart),limit === -1 ? 0 : countRunningSiteAudits(orgId),+ limit === -1 ? 0 : countRunningSiteAudits(orgId, 'auto'),siteAuditAutoStatus(orgId, limit, periodStart, now),]);- return { plan, limit, used, running, auto: { ...auto, used: autoUsed } };+ // The quota card tells the runs' audits (done and running) from the user's.+ return { plan, limit, used, running, auto: { ...auto, used: autoUsed, running: autoRunning } };}/**@@ -676,7 +681,7 @@ export async function enforceSiteAuditQuota(* Returns { used, running, limit, remaining, auto }: remaining is the user's* pool, with running audits and the auto-audit runs still to come taken out;* auto is where auto-audit stands (siteAuditAutoStatus, plus what its runs- * used this period).+ * used this period and have running).*/export async function getSiteAuditQuotaStatus(orgId, { now = new Date() } = {}) {const { limit, used, running, auto } = await siteAuditQuota(orgId, now);diff --git a/web/messages/en.json b/web/messages/en.jsonindex f4f79a7ee..f246c96cd 100644--- a/web/messages/en.json+++ b/web/messages/en.json@@ -2188,16 +2188,40 @@"noPages": "No pages audited yet","gapPages": "{pages} of {total}","auditsThisMonth": "Audits this month",- "auditsTip": "Your plan's audits this billing month. Audits still running already count; failed ones don't. Auto-audit keeps its share for the runs still to come.",+ "auditsTip": "Your plan's audits this billing month: what's left, with the share auto-audit keeps for the runs still to come. Audits still running already count; failed ones don't.","ofLeft": "of {limit} left",- "used": "{used} used",- "usedRunning": "{used} used · {running} running",- "usedReserved": "{used} used · {reserved} for auto-audit",- "usedRunningReserved": "{used} used · {running} running · {reserved} auto",- "quotaBar": "{used} of {limit} audits used","unlimited": "Unlimited","unlimitedSub": "no monthly limit"},+ "quota": {+ "bar": "Auto used {autoUsed} · Auto scheduled {autoScheduled} · You used {youUsed} · Free {free}",+ "runs": "Auto-audit runs this month",+ "run_done": "done",+ "run_next": "next run",+ "run_upcoming": "upcoming",+ "autoShare": "Auto {share}%",+ "autoOff": "Auto-audit off",+ "autoPerRun": "Auto · {perRun} pages a run",+ "howItWorks": "How it works",+ "how1": "Your plan includes <b>{limit} audits a month</b>.",+ "how2": "<b>{share}%</b> runs automatically: <b>{runShare}%</b> on days 1, 7, 14, 21 and 28 of your billing month, on the top-priority pages.",+ "how3": "The other <b>{rest}%</b> is yours: a single URL, or in bulk from Opportunities.",+ "how4": "Turn auto-audit off in <settings>Settings</settings> to keep all {limit}.",+ "howOff2": "Auto-audit is off, so all {limit} are yours: a single URL, or in bulk from Opportunities.",+ "howOff3": "Turn it on in <settings>Settings</settings> to audit the top-priority pages on days 1, 7, 14, 21 and 28.",+ "emptyPool": "You've used your {yours} audits. {scheduled} auto audits are still scheduled. <off>Turn off auto-audit</off> to use them now, or upgrade."+ },+ "strip": {+ "siteScore": "<b>{score}</b> site score",+ "pages": "{count, plural, one {# page} other {# pages}} audited",+ "noPages": "No pages audited yet",+ "lowest": "Lowest: <b>{category} {score}</b>",+ "nextAuto": "Next auto-audit <b>{when}</b> · {count, plural, one {# page} other {# pages}}",+ "today": "today",+ "tomorrow": "tomorrow",+ "onDate": "on {date}",+ "autoOff": "Auto-audit off"+ },"settings": {"button": "Settings","title": "Site Audit settings",diff --git a/web/src/app/[locale]/(dashboard)/dashboard/audit/_bulk-bar.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/audit/_bulk-bar.test.tsxindex 461494d8e..87b9d462a 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/audit/_bulk-bar.test.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/audit/_bulk-bar.test.tsx@@ -77,6 +77,33 @@ describe('AuditBulkBar', () => {expect(button('Re-audit').disabled).toBe(true);});+ it("says the runs' share is still scheduled when the user's is used up (SA-019)", () => {+ // The spec's example: 100 auto and 375 of the user's used, day 28's 25 to come.+ render(1, {+ used: 475,+ running: 0,+ limit: 500,+ remaining: 0,+ auto: {+ enabled: true,+ setting: null,+ emailAfterRun: false,+ perRun: 25,+ reserved: 25,+ used: 100,+ running: 0,+ periodStart: '2026-10-01T00:00:00.000Z',+ periodEnd: '2026-11-01T00:00:00.000Z',+ runs: [],+ nextRun: { day: 28, at: '2026-10-28T00:00:00.000Z' },+ },+ });+ expect(container.querySelector('[role=toolbar] p')?.textContent).toBe(+ "You've used your 375 audits. 25 auto audits are still scheduled. Turn off auto-audit to use them now, or upgrade.",+ );+ expect(button('Re-audit').disabled).toBe(true);+ });+it('counts nothing against an unlimited plan', () => {render(40, { used: 0, limit: -1, remaining: -1 });expect(usage()).toBeUndefined();diff --git a/web/src/app/[locale]/(dashboard)/dashboard/audit/_bulk-bar.tsx b/web/src/app/[locale]/(dashboard)/dashboard/audit/_bulk-bar.tsxindex d74b6cbfc..2768671ab 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/audit/_bulk-bar.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/audit/_bulk-bar.tsx@@ -12,6 +12,7 @@ import {} from '@/components/ui/dropdown-menu';import type { AuditQuota } from '@/lib/actions/audits';import { cn } from '@/lib/utils';+import { EmptyPoolMessage } from './_quota-meter';export type ExportFormat = 'csv' | 'xlsx';@@ -95,15 +96,19 @@ export function AuditBulkBar({className="mb-3 flex flex-wrap items-center gap-2 rounded-md border bg-muted/50 px-3 py-2"><span className="text-xs font-medium">{t('selected', { count })}</span>- {limited && (- <span className={cn('text-xs', over ? 'text-destructive' : 'text-muted-foreground')}>- {remaining === 0- ? t('noneLeft')- : over- ? t('overQuota', { count, remaining })- : t('uses', { count, remaining })}- </span>- )}+ {limited &&+ (remaining === 0 && (quota.auto?.reserved ?? 0) > 0 ? (+ // The user's share is used, the runs' isn't (spec §4.4).+ <EmptyPoolMessage quota={quota} />+ ) : (+ <span className={cn('text-xs', over ? 'text-destructive' : 'text-muted-foreground')}>+ {remaining === 0+ ? t('noneLeft')+ : over+ ? t('overQuota', { count, remaining })+ : t('uses', { count, remaining })}+ </span>+ ))}<div className="ml-auto flex flex-wrap items-center justify-end gap-1"><Buttonvariant="outline"diff --git a/web/src/app/[locale]/(dashboard)/dashboard/audit/_overview-cards.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/audit/_overview-cards.test.tsxindex 163175385..00a986af0 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/audit/_overview-cards.test.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/audit/_overview-cards.test.tsx@@ -1,9 +1,9 @@import { act } from 'react';import { createRoot, type Root } from 'react-dom/client';import { NextIntlClientProvider } from 'next-intl';-import { afterEach, beforeEach, describe, expect, it } from 'vitest';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';import messages from '../../../../../../messages/en.json';-import type { AuditOverview, AuditQuota } from '@/lib/actions/audits';+import type { AuditAutoStatus, AuditOverview, AuditQuota } from '@/lib/actions/audits';import { AuditOverviewCards } from './_overview-cards';(@@ -20,6 +20,7 @@ const overview = (over: Partial<AuditOverview> = {}): AuditOverview => ({siteScoreChange: 4,authority: 0.38,eeat: 0.36,+ lowestCategory: { key: 'eeat', score: 0.36 },gaps: [{ key: 'author-byline', label: 'Author byline', category: 'authority', pages: 31 },{ key: 'press-mentions', label: 'Press mentions', category: 'eeat', pages: 22 },@@ -30,6 +31,34 @@ const overview = (over: Partial<AuditOverview> = {}): AuditOverview => ({const growth: AuditQuota = { used: 245, running: 5, limit: 500, remaining: 250 };+/** Growth with auto-audit: four runs done (100 audits), day 28's 25 still to come. */+const auto = (over: Partial<AuditAutoStatus> = {}): AuditAutoStatus => ({+ enabled: true,+ setting: null,+ emailAfterRun: false,+ perRun: 25,+ reserved: 25,+ used: 100,+ running: 0,+ periodStart: '2026-10-01T00:00:00.000Z',+ periodEnd: '2026-11-01T00:00:00.000Z',+ runs: [1, 7, 14, 21, 28].map((day) => ({+ day,+ at: `2026-10-${String(day).padStart(2, '0')}T00:00:00.000Z`,+ done: day < 28,+ })),+ nextRun: { day: 28, at: '2026-10-28T00:00:00.000Z' },+ ...over,+});+const growthAuto: AuditQuota = {+ used: 250,+ running: 0,+ limit: 500,+ remaining: 225,+ auto: auto(),+};+const onOpenSettings = vi.fn();+let container: HTMLDivElement;let root: Root;@@ -37,7 +66,7 @@ function render(data: AuditOverview | null, quota: AuditQuota | null = growth) {act(() => {root.render(<NextIntlClientProvider locale="en" messages={messages} timeZone="UTC">- <AuditOverviewCards overview={data} quota={quota} />+ <AuditOverviewCards overview={data} quota={quota} onOpenSettings={onOpenSettings} /></NextIntlClientProvider>,);});@@ -83,11 +112,11 @@ describe('AuditOverviewCards', () => {expect(audits).toContain('Audits this month');expect(audits).toContain('250of 500 left');- expect(audits).toContain('245 used · 5 running');- // Running audits fill the bar with the used ones.+ // Running audits count as used; without auto-audit, all of it is the user's.expect(container.querySelector('[role=img][aria-label]')?.getAttribute('aria-label')).toBe(- '250 of 500 audits used',+ 'Auto used 0 · Auto scheduled 0 · You used 250 · Free 250',);+ expect(audits).toContain('Auto-audit off · How it works');});it('counts the pages on other sites apart, and says when there are no gaps or pages', () => {@@ -112,31 +141,98 @@ describe('AuditOverviewCards', () => {expect(cards()[2]).toContain('No pages audited yet');});- it('says what auto-audit keeps for the runs still to come (SA-006)', () => {- const auto = {- enabled: true,- setting: null,- emailAfterRun: false,- perRun: 25,- reserved: 75,- used: 50,- periodStart: '2026-10-01T00:00:00.000Z',- periodEnd: '2026-11-01T00:00:00.000Z',- runs: [],- nextRun: { day: 14, at: '2026-10-14T00:00:00.000Z' },- };- render(overview(), { used: 245, running: 0, limit: 500, remaining: 180, auto });- expect(cards()[3]).toContain('180of 500 left');- expect(cards()[3]).toContain('245 used · 75 for auto-audit');- render(overview(), { used: 245, running: 5, limit: 500, remaining: 175, auto });- expect(cards()[3]).toContain('245 used · 5 running · 75 auto');+ it("splits the month as the mockup: auto used, scheduled, the user's and free (SA-019)", () => {+ render(overview(), growthAuto);+ const audits = cards()[3];+ // What's left counts the runs' scheduled share.+ expect(audits).toContain('250of 500 left');+ const bar = container.querySelector('[role=img][aria-label]')!;+ expect(bar.getAttribute('aria-label')).toBe(+ 'Auto used 100 · Auto scheduled 25 · You used 150 · Free 225',+ );+ expect([...bar.children].map((seg) => (seg as HTMLElement).style.width)).toEqual([+ '20%',+ '5%',+ '30%',+ ]);+ expect(audits).toContain('Auto 25% · How it works');++ // The five runs: done, done, done, done, next.+ const runs = [...container.querySelectorAll('ol[aria-label] li')];+ expect(runs.map((li) => li.textContent)).toEqual([+ '1done',+ '7done',+ '14done',+ '21done',+ '28next run',+ ]);+ expect(runs[4].className).toContain('font-semibold');+ });++ it("counts a run's running audits as auto, not the user's", () => {+ render(overview(), {+ ...growthAuto,+ used: 240,+ running: 10,+ auto: auto({ used: 90, running: 10 }),+ });+ expect(container.querySelector('[role=img][aria-label]')?.getAttribute('aria-label')).toBe(+ 'Auto used 100 · Auto scheduled 25 · You used 150 · Free 225',+ );+ });++ it('opens How it works under the cards, with Settings opening the settings', () => {+ render(overview(), growthAuto);+ expect(container.querySelector('#audit-how-it-works')).toBeNull();+ const toggle = [...container.querySelectorAll('button')].find(+ (b) => b.textContent === 'How it works',+ )!;+ act(() => toggle.click());+ expect(toggle.getAttribute('aria-expanded')).toBe('true');+ const points = [...container.querySelectorAll('#audit-how-it-works li')].map(+ (li) => li.textContent,+ );+ expect(points).toEqual([+ 'Your plan includes 500 audits a month.',+ '25% runs automatically: 5% on days 1, 7, 14, 21 and 28 of your billing month, on the top-priority pages.',+ 'The other 75% is yours: a single URL, or in bulk from Opportunities.',+ 'Turn auto-audit off in Settings to keep all 500.',+ ]);+ const settings = [...container.querySelectorAll('#audit-how-it-works button')][0];+ act(() => (settings as HTMLElement).click());+ expect(onOpenSettings).toHaveBeenCalled();+ });++ it("says all of it is the user's when auto-audit is off, without the runs", () => {+ render(overview(), { ...growth, auto: auto({ enabled: false, reserved: 0, used: 0 }) });+ expect(container.querySelector('ol[aria-label]')).toBeNull();+ act(() =>+ [...container.querySelectorAll('button')]+ .find((b) => b.textContent === 'How it works')!+ .click(),+ );+ expect(container.querySelector('#audit-how-it-works')?.textContent).toContain(+ 'Auto-audit is off, so all 500 are yours',+ );});- it('shows an unlimited plan without a bar', () => {+ it('shows an unlimited plan without a bar, and its runs when auto-audit is on', () => {render(overview(), { used: 0, running: 0, limit: -1, remaining: -1 });expect(cards()[3]).toContain('Unlimited');expect(cards()[3]).toContain('no monthly limit');expect(cards()[3]).not.toContain('left');+ expect(container.querySelector('ol[aria-label]')).toBeNull();++ render(overview(), {+ used: 0,+ running: 0,+ limit: -1,+ remaining: -1,+ auto: auto({ reserved: 0 }),+ });+ expect(container.querySelector('[role=img][aria-label]')).toBeNull();+ expect(container.querySelectorAll('ol[aria-label] li')).toHaveLength(5);+ expect(cards()[3]).toContain('Auto · 25 pages a run');});it('holds the cards with placeholders while loading', () => {diff --git a/web/src/app/[locale]/(dashboard)/dashboard/audit/_overview-cards.tsx b/web/src/app/[locale]/(dashboard)/dashboard/audit/_overview-cards.tsxindex 193262f5a..1c3b2695c 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/audit/_overview-cards.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/audit/_overview-cards.tsx@@ -1,5 +1,6 @@'use client';+import { useState } from 'react';import { useTranslations } from 'next-intl';import { CalendarDays, FileText, Gauge, ShieldCheck } from 'lucide-react';import { Card } from '@/components/ui/card';@@ -9,6 +10,7 @@ import type { AuditOverview, AuditQuota } from '@/lib/actions/audits';import { formatNumber } from '@/lib/format';import { MetricCard } from '../insights/_kpi-cards';import { upIsGood } from '../insights/kpi-format';+import { autoSharePct, quotaShares, QuotaSegments, RunDots } from './_quota-meter';/** The Authority · E-E-A-T card's gaps: the signal, and on how many pages it fails. */function GapList({ overview }: { overview: AuditOverview }) {@@ -28,6 +30,50 @@ function GapList({ overview }: { overview: AuditOverview }) {);}+/**+ * "How it works" under the cards (spec §4.4), closed until asked for: the+ * plan's audits, the auto-audit share and the user's, and where to turn it+ * off. Settings opens the Site Audit settings.+ */+function HowItWorks({ quota, onOpenSettings }: { quota: AuditQuota; onOpenSettings?: () => void }) {+ const t = useTranslations('audit.quota');+ const auto = quota.auto;+ const limit = formatNumber(quota.limit);+ const share = auto ? autoSharePct(auto, quota.limit) : 0;+ const rich = {+ b: (chunks: React.ReactNode) => <b className="font-semibold text-foreground">{chunks}</b>,+ settings: (chunks: React.ReactNode) =>+ onOpenSettings ? (+ <button type="button" className="underline underline-offset-2" onClick={onOpenSettings}>+ {chunks}+ </button>+ ) : (+ chunks+ ),+ };+ const points = auto?.enabled+ ? [+ t.rich('how1', { ...rich, limit }),+ t.rich('how2', { ...rich, share, runShare: Math.round(share / 5) }),+ t.rich('how3', { ...rich, rest: 100 - share }),+ t.rich('how4', { ...rich, limit }),+ ]+ : [+ t.rich('how1', { ...rich, limit }),+ t.rich('howOff2', { ...rich, limit }),+ t.rich('howOff3', rich),+ ];+ return (+ <div id="audit-how-it-works" className="rounded-xl border px-4 py-3">+ <ol className="list-decimal space-y-1 pl-5 text-sm text-muted-foreground">+ {points.map((point, i) => (+ <li key={i}>{point}</li>+ ))}+ </ol>+ </div>+ );+}+// Four in a row from 1,200px, two below, one on a phone (spec §4.5). In rem,// so Tailwind orders it after sm: (a px breakpoint would sort before it).const GRID = 'grid grid-cols-1 gap-3 sm:grid-cols-2 min-[75rem]:grid-cols-4';@@ -41,11 +87,16 @@ const GRID = 'grid grid-cols-1 gap-3 sm:grid-cols-2 min-[75rem]:grid-cols-4';export function AuditOverviewCards({overview,quota,+ onOpenSettings,}: {overview: AuditOverview | null;quota: AuditQuota | null;+ /** Opens the Site Audit settings, from How it works. */+ onOpenSettings?: () => void;}) {const t = useTranslations('audit.overview');+ const tq = useTranslations('audit.quota');+ const [howOpen, setHowOpen] = useState(false);if (!overview) {return (@@ -62,74 +113,89 @@ export function AuditOverviewCards({}const domain = overview.primaryHost ?? t('yourDomain');- const limited = quota !== null && quota.limit !== -1;- const running = quota?.running ?? 0;- // What the auto-audit runs still to come keep out of what's left (SA-006).- const reserved = quota?.auto?.reserved ?? 0;- const usedSub = () => {- if (!quota) return '';- if (!limited) return t('unlimitedSub');- const used = quota.used;- if (running > 0) {- return reserved > 0- ? t('usedRunningReserved', { used, running, reserved })- : t('usedRunning', { used, running });- }- return reserved > 0 ? t('usedReserved', { used, reserved }) : t('used', { used });- };+ const shares = quota ? quotaShares(quota) : null;+ const auto = quota?.auto;const gapsSub =overview.pages === 0 ? t('noPages') : overview.gaps.length > 0 ? t('gapsSub') : t('noGaps');+ // The quota card (SA-019): the bar, the five runs, and How it works.+ const howToggle = (+ <button+ type="button"+ className="underline underline-offset-2"+ aria-expanded={howOpen}+ aria-controls="audit-how-it-works"+ onClick={() => setHowOpen((open) => !open)}+ >+ {tq('howItWorks')}+ </button>+ );+ const quotaFooter = !quota ? null : shares ? (+ <div className="space-y-2 pb-0.5">+ <QuotaSegments quota={quota} />+ {auto?.enabled && <RunDots auto={auto} />}+ <div className="truncate text-xs text-muted-foreground">+ {auto?.enabled+ ? tq('autoShare', { share: autoSharePct(auto, quota.limit) })+ : tq('autoOff')}+ {' · '}+ {howToggle}+ </div>+ </div>+ ) : auto?.enabled ? (+ <div className="space-y-2 pb-0.5">+ <RunDots auto={auto} />+ <div className="truncate text-xs text-muted-foreground">+ {tq('autoPerRun', { perRun: auto.perRun })}+ </div>+ </div>+ ) : null;+return (- <div className={GRID}>- <MetricCard- label={t('siteScore')}- tooltip={t('siteScoreTip', { domain })}- icon={Gauge}- value={pct(overview.siteScore)?.toString() ?? '—'}- delta={upIsGood(overview.siteScoreChange)}- sub={t('siteScoreSub')}- />- <MetricCard- label={t('pagesAudited')}- tooltip={t('pagesAuditedTip', { domain })}- icon={FileText}- value={formatNumber(overview.pages)}- sub={- overview.otherPages > 0- ? t('pagesSubOther', { count: overview.otherPages })- : t('pagesSub', { domain })- }- />- <MetricCard- label={t('authority')}- tooltip={t('authorityTip')}- icon={ShieldCheck}- value={`${pct(overview.authority) ?? '—'} · ${pct(overview.eeat) ?? '—'}`}- sub={gapsSub}- footer={<GapList overview={overview} />}- />- <MetricCard- label={t('auditsThisMonth')}- tooltip={t('auditsTip')}- icon={CalendarDays}- value={limited ? formatNumber(quota.remaining) : t('unlimited')}- delta={- limited- ? { text: t('ofLeft', { limit: formatNumber(quota.limit) }), tone: 'neutral' }- : null- }- sub={usedSub()}- quota={- limited- ? {- used: quota.used + running,- limit: quota.limit,- label: t('quotaBar', { used: quota.used + running, limit: quota.limit }),- }- : null- }- />+ <div className="space-y-2.5">+ <div className={GRID}>+ <MetricCard+ label={t('siteScore')}+ tooltip={t('siteScoreTip', { domain })}+ icon={Gauge}+ value={pct(overview.siteScore)?.toString() ?? '—'}+ delta={upIsGood(overview.siteScoreChange)}+ sub={t('siteScoreSub')}+ />+ <MetricCard+ label={t('pagesAudited')}+ tooltip={t('pagesAuditedTip', { domain })}+ icon={FileText}+ value={formatNumber(overview.pages)}+ sub={+ overview.otherPages > 0+ ? t('pagesSubOther', { count: overview.otherPages })+ : t('pagesSub', { domain })+ }+ />+ <MetricCard+ label={t('authority')}+ tooltip={t('authorityTip')}+ icon={ShieldCheck}+ value={`${pct(overview.authority) ?? '—'} · ${pct(overview.eeat) ?? '—'}`}+ sub={gapsSub}+ footer={<GapList overview={overview} />}+ />+ <MetricCard+ label={t('auditsThisMonth')}+ tooltip={t('auditsTip')}+ icon={CalendarDays}+ value={shares ? formatNumber(shares.left) : t('unlimited')}+ delta={+ shares && quota+ ? { text: t('ofLeft', { limit: formatNumber(quota.limit) }), tone: 'neutral' }+ : null+ }+ sub={quota && !shares ? t('unlimitedSub') : undefined}+ footer={quotaFooter}+ />+ </div>+ {howOpen && quota && shares && <HowItWorks quota={quota} onOpenSettings={onOpenSettings} />}</div>);}diff --git a/web/src/app/[locale]/(dashboard)/dashboard/audit/_quota-meter.tsx b/web/src/app/[locale]/(dashboard)/dashboard/audit/_quota-meter.tsxnew file mode 100644index 000000000..597f67c93--- /dev/null+++ b/web/src/app/[locale]/(dashboard)/dashboard/audit/_quota-meter.tsx@@ -0,0 +1,137 @@+'use client';++import { useTranslations } from 'next-intl';+import type { AuditAutoStatus, AuditQuota } from '@/lib/actions/audits';+import { formatNumber } from '@/lib/format';+import { cn } from '@/lib/utils';++/** Auto-audit's runs a month (days 1, 7, 14, 21 and 28). */+const RUNS_A_MONTH = 5;++/**+ * The month's audits as the quota card splits them (SA-019): what the+ * auto-audit runs used (done or running), what they keep for the runs still+ * to come, what the user used, and what's free. They add up to the limit.+ * `left` is the big number: everything not used yet, the runs' share+ * included. Null for a plan without a monthly limit.+ */+export function quotaShares(quota: AuditQuota) {+ if (quota.limit === -1) return null;+ const running = quota.running ?? 0;+ const autoUsed = (quota.auto?.used ?? 0) + (quota.auto?.running ?? 0);+ const autoScheduled = quota.auto?.reserved ?? 0;+ return {+ autoUsed,+ autoScheduled,+ youUsed: Math.max(0, quota.used + running - autoUsed),+ free: quota.remaining,+ left: Math.max(0, quota.limit - quota.used - running),+ };+}++/** Auto-audit's share of the quota in percent: 5 runs of 5%, so 25 for most plans. */+export function autoSharePct(auto: AuditAutoStatus, limit: number): number {+ return limit > 0 ? Math.round(((auto.perRun * RUNS_A_MONTH) / limit) * 100) : 0;+}++/** The thin bar of the quota card: auto used · auto scheduled · you used · free. */+export function QuotaSegments({ quota }: { quota: AuditQuota }) {+ const t = useTranslations('audit.quota');+ const shares = quotaShares(quota);+ if (!shares) return null;+ const width = (n: number) => `${Math.min(100, (n / quota.limit) * 100)}%`;+ const label = t('bar', {+ autoUsed: formatNumber(shares.autoUsed),+ autoScheduled: formatNumber(shares.autoScheduled),+ youUsed: formatNumber(shares.youUsed),+ free: formatNumber(shares.free),+ });+ return (+ <div+ role="img"+ aria-label={label}+ title={label}+ className="my-1.5 flex h-1.5 overflow-hidden rounded-full bg-muted"+ >+ <i className="block h-full bg-foreground" style={{ width: width(shares.autoUsed) }} />+ <i+ className="block h-full bg-muted-foreground/60"+ style={{ width: width(shares.autoScheduled) }}+ />+ <i className="block h-full bg-muted-foreground/30" style={{ width: width(shares.youUsed) }} />+ </div>+ );+}++/**+ * The five runs on one line: 1 · 7 · 14 · 21 · 28. Done filled, the next one+ * outlined and bold, the rest empty.+ */+export function RunDots({ auto }: { auto: AuditAutoStatus }) {+ const t = useTranslations('audit.quota');+ return (+ <ol aria-label={t('runs')} className="flex items-start">+ {auto.runs.map((run) => {+ const state = run.done ? 'done' : run.day === auto.nextRun?.day ? 'next' : 'upcoming';+ return (+ <li+ key={run.day}+ className={cn(+ 'relative flex flex-1 flex-col items-center gap-[3px] text-[11px] leading-none whitespace-nowrap',+ // The line to the next run.+ "after:absolute after:top-1.5 after:right-[calc(-50%+8px)] after:left-[calc(50%+8px)] after:h-px after:bg-border after:content-[''] last:after:hidden",+ state === 'next' ? 'font-semibold text-foreground' : 'text-muted-foreground',+ )}+ >+ <span+ aria-hidden+ className={cn(+ 'block h-3 w-3 rounded-full border-[1.5px]',+ state === 'done' && 'border-foreground bg-foreground',+ state === 'next' && 'border-foreground bg-card',+ state === 'upcoming' && 'border-muted-foreground/40 bg-card',+ )}+ />+ {run.day}+ <span className="sr-only">{t(`run_${state}`)}</span>+ </li>+ );+ })}+ </ol>+ );+}++/**+ * When the user's share is used up but runs are still to come (spec §4.4):+ * "You've used your 375 audits. 25 auto audits are still scheduled. Turn off+ * auto-audit to use them now, or upgrade." Null otherwise.+ */+export function EmptyPoolMessage({+ quota,+ onOpenSettings,+ className,+}: {+ quota: AuditQuota | null;+ onOpenSettings?: () => void;+ className?: string;+}) {+ const t = useTranslations('audit.quota');+ const shares = quota ? quotaShares(quota) : null;+ if (!quota || !shares || quota.remaining > 0 || shares.autoScheduled === 0) return null;+ return (+ <p className={cn('text-xs text-destructive', className)}>+ {t.rich('emptyPool', {+ yours: formatNumber(shares.youUsed),+ scheduled: formatNumber(shares.autoScheduled),+ off: (chunks) =>+ onOpenSettings ? (+ <button type="button" className="underline underline-offset-2" onClick={onOpenSettings}>+ {chunks}+ </button>+ ) : (+ chunks+ ),+ })}+ </p>+ );+}diff --git a/web/src/app/[locale]/(dashboard)/dashboard/audit/_summary-strip.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/audit/_summary-strip.test.tsxnew file mode 100644index 000000000..adafa8ace--- /dev/null+++ b/web/src/app/[locale]/(dashboard)/dashboard/audit/_summary-strip.test.tsx@@ -0,0 +1,127 @@+import { act } from 'react';+import { createRoot, type Root } from 'react-dom/client';+import { NextIntlClientProvider } from 'next-intl';+import { afterEach, beforeEach, describe, expect, it } from 'vitest';+import messages from '../../../../../../messages/en.json';+import type { AuditAutoStatus, AuditOverview, AuditQuota } from '@/lib/actions/audits';+import { AuditSummaryStrip, daysUntil } from './_summary-strip';++(+ globalThis as typeof globalThis & {+ IS_REACT_ACT_ENVIRONMENT: boolean;+ }+).IS_REACT_ACT_ENVIRONMENT = true;++const NOW = new Date(2026, 9, 27, 15, 0);++const overview = (over: Partial<AuditOverview> = {}): AuditOverview => ({+ primaryHost: 'ansvisor.com',+ pages: 48,+ otherPages: 0,+ siteScore: 0.68,+ siteScoreChange: 4,+ authority: 0.38,+ eeat: 0.36,+ lowestCategory: { key: 'eeat', score: 0.36 },+ gaps: [],+ ...over,+});++const auto = (over: Partial<AuditAutoStatus> = {}): AuditAutoStatus => ({+ enabled: true,+ setting: null,+ emailAfterRun: false,+ perRun: 25,+ reserved: 25,+ used: 100,+ running: 0,+ periodStart: '2026-10-01T00:00:00.000Z',+ periodEnd: '2026-11-01T00:00:00.000Z',+ runs: [],+ nextRun: { day: 28, at: new Date(2026, 9, 28, 0, 0).toISOString() },+ ...over,+});++const quota = (a: AuditAutoStatus | undefined): AuditQuota => ({+ used: 250,+ running: 0,+ limit: 500,+ remaining: 225,+ auto: a,+});++let container: HTMLDivElement;+let root: Root;++function render(data: AuditOverview | null, q: AuditQuota | null) {+ act(() => {+ root.render(+ <NextIntlClientProvider locale="en" messages={messages}>+ <AuditSummaryStrip overview={data} quota={q} now={NOW} />+ </NextIntlClientProvider>,+ );+ });+}++beforeEach(() => {+ container = document.createElement('div');+ document.body.appendChild(container);+ root = createRoot(container);+});++afterEach(() => {+ act(() => root.unmount());+ container.remove();+});++const items = () =>+ [...container.querySelectorAll('div > span.whitespace-nowrap')].map((s) => s.textContent);++describe('daysUntil', () => {+ it('counts calendar days, whatever the hour', () => {+ expect(daysUntil(new Date(2026, 9, 27, 23, 0).toISOString(), NOW)).toBe(0);+ expect(daysUntil(new Date(2026, 9, 28, 0, 30).toISOString(), NOW)).toBe(1);+ expect(daysUntil(new Date(2026, 10, 3).toISOString(), NOW)).toBe(7);+ });+});++describe('AuditSummaryStrip', () => {+ it('reads as the mockup: score and change, pages, lowest category, next run, domain', () => {+ render(overview(), quota(auto()));+ expect(items()).toEqual([+ '68 site score+4',+ '48 pages audited',+ 'Lowest: E-E-A-T 36',+ 'Next auto-audit tomorrow · 25 pages',+ ]);+ expect(container.textContent).toContain('ansvisor.com');+ });++ it('says today, or the date further out, and when auto-audit is off', () => {+ render(overview(), quota(auto({ nextRun: { day: 21, at: NOW.toISOString() } })));+ expect(items()[3]).toBe('Next auto-audit today · 25 pages');+ render(+ overview(),+ quota(auto({ nextRun: { day: 1, at: new Date(2026, 10, 1, 0, 0).toISOString() } })),+ );+ expect(items()[3]).toBe('Next auto-audit on Nov 1 · 25 pages');+ render(overview(), quota(auto({ enabled: false })));+ expect(items()[3]).toBe('Auto-audit off');+ });++ it('leaves out what it has no data for', () => {+ render(+ overview({+ pages: 0,+ siteScore: null,+ siteScoreChange: null,+ lowestCategory: null,+ primaryHost: null,+ }),+ quota(undefined),+ );+ expect(items()).toEqual(['No pages audited yet']);+ render(null, quota(auto()));+ expect(container.textContent).toBe('');+ });+});diff --git a/web/src/app/[locale]/(dashboard)/dashboard/audit/_summary-strip.tsx b/web/src/app/[locale]/(dashboard)/dashboard/audit/_summary-strip.tsxnew file mode 100644index 000000000..60ba08534--- /dev/null+++ b/web/src/app/[locale]/(dashboard)/dashboard/audit/_summary-strip.tsx@@ -0,0 +1,94 @@+'use client';++import { Fragment } from 'react';+import { useTranslations } from 'next-intl';+import { CATEGORY_META, pct } from '@/components/audit/audit-report';+import type { AuditOverview, AuditQuota } from '@/lib/actions/audits';+import { formatMonthDay } from '@/lib/format';+import { cn } from '@/lib/utils';++const DAY_MS = 24 * 60 * 60 * 1000;++/** Whole calendar days from `now` to `iso`, in the viewer's time zone. */+export function daysUntil(iso: string, now: Date): number {+ const day = (d: Date) => new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime();+ return Math.round((day(new Date(iso)) - day(now)) / DAY_MS);+}++/**+ * The summary strip on top of Site Audit (spec §4.4, Insights style): "68+ * site score +4 · 48 pages audited · Lowest: E-E-A-T 36 · Next auto-audit+ * tomorrow · 25 pages", the primary domain on the right.+ */+export function AuditSummaryStrip({+ overview,+ quota,+ now,+}: {+ overview: AuditOverview | null;+ quota: AuditQuota | null;+ now: Date;+}) {+ const t = useTranslations('audit.strip');+ if (!overview) return null;++ const b = (chunks: React.ReactNode) => <b className="font-semibold">{chunks}</b>;+ const items: React.ReactNode[] = [];+ const score = pct(overview.siteScore);+ if (score !== null) {+ const change = overview.siteScoreChange;+ items.push(+ <>+ {t.rich('siteScore', { b, score })}+ {change !== null && change !== 0 && (+ <span+ className={cn(+ 'tabular-nums',+ change > 0 ? 'text-green-600 dark:text-green-400' : 'text-red-600 dark:text-red-400',+ )}+ >+ {change > 0 ? `+${change}` : change}+ </span>+ )}+ </>,+ );+ }+ items.push(overview.pages > 0 ? t('pages', { count: overview.pages }) : t('noPages'));+ if (overview.lowestCategory) {+ const label =+ CATEGORY_META.find((c) => c.key === overview.lowestCategory?.key)?.label ??+ overview.lowestCategory.key;+ items.push(+ t.rich('lowest', { b, category: label, score: pct(overview.lowestCategory.score) ?? 0 }),+ );+ }+ const auto = quota?.auto;+ if (auto?.enabled && auto.nextRun) {+ const days = daysUntil(auto.nextRun.at, now);+ const when =+ days <= 0+ ? t('today')+ : days === 1+ ? t('tomorrow')+ : t('onDate', { date: formatMonthDay(auto.nextRun.at) });+ items.push(t.rich('nextAuto', { b, when, count: auto.perRun }));+ } else if (auto && !auto.enabled) {+ items.push(t('autoOff'));+ }++ return (+ <div className="flex flex-wrap items-center gap-x-3.5 gap-y-1.5 rounded-xl border bg-card px-4 py-3 text-sm">+ {items.map((item, i) => (+ <Fragment key={i}>+ {i > 0 && (+ <span aria-hidden className="h-[3px] w-[3px] rounded-full bg-muted-foreground/50" />+ )}+ <span className="flex items-center gap-1.5 whitespace-nowrap">{item}</span>+ </Fragment>+ ))}+ {overview.primaryHost && (+ <span className="ml-auto text-xs text-muted-foreground">{overview.primaryHost}</span>+ )}+ </div>+ );+}diff --git a/web/src/app/[locale]/(dashboard)/dashboard/audit/page.tsx b/web/src/app/[locale]/(dashboard)/dashboard/audit/page.tsxindex 8c651bb28..104d1ed08 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/audit/page.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/audit/page.tsx@@ -50,6 +50,8 @@ import { AuditOverviewCards } from './_overview-cards';import { OpportunitiesTable } from './_opportunities-table';import { AuditSettingsDialog } from './_settings-dialog';import { AutoRunNotice } from './_auto-run-notice';+import { AuditSummaryStrip } from './_summary-strip';+import { EmptyPoolMessage } from './_quota-meter';import { usePagesExport } from './_use-pages-export';import { cn } from '@/lib/utils';@@ -473,39 +475,46 @@ export default function SiteAuditPage() {}/>+ {/* Summary strip, as in the v2 mockup (SA-019) */}+ <AuditSummaryStrip overview={loading ? null : overview} quota={quota} now={new Date(nowMs)} />+{/* Run bar */}<Card>- <CardContent className="flex flex-col gap-3 py-4 sm:flex-row sm:items-center">- <Input- type="url"- inputMode="url"- placeholder="https://example.com/page"- aria-label="Website URL"- value={url}- onChange={(e) => setUrl(e.target.value)}- onKeyDown={(e) => e.key === 'Enter' && !running && !quotaExhausted && handleRun()}- disabled={running}- className="flex-1"- />- {/* The Audits this month card shows what's left; here only why Run is off. */}- {quotaExhausted && (- <span className="shrink-0 text-xs tabular-nums text-destructive">- {quota.remaining}/{quota.limit} {t('auditsLeft')}- </span>- )}- <Button onClick={handleRun} disabled={running || quotaExhausted} className="shrink-0">- {running ? (- <>- <Loader2 className="mr-2 h-4 w-4 animate-spin" />- {t('running')}- </>- ) : (- <>- <Search className="mr-2 h-4 w-4" />- {t('runAudit')}- </>+ <CardContent className="space-y-2 py-4">+ <div className="flex flex-col gap-3 sm:flex-row sm:items-center">+ <Input+ type="url"+ inputMode="url"+ placeholder="https://example.com/page"+ aria-label="Website URL"+ value={url}+ onChange={(e) => setUrl(e.target.value)}+ onKeyDown={(e) => e.key === 'Enter' && !running && !quotaExhausted && handleRun()}+ disabled={running}+ className="flex-1"+ />+ {/* The Audits this month card shows what's left; here only why Run is off. */}+ {quotaExhausted && !(quota.auto?.reserved ?? 0) && (+ <span className="shrink-0 text-xs tabular-nums text-destructive">+ {quota.remaining}/{quota.limit} {t('auditsLeft')}+ </span>)}- </Button>+ <Button onClick={handleRun} disabled={running || quotaExhausted} className="shrink-0">+ {running ? (+ <>+ <Loader2 className="mr-2 h-4 w-4 animate-spin" />+ {t('running')}+ </>+ ) : (+ <>+ <Search className="mr-2 h-4 w-4" />+ {t('runAudit')}+ </>+ )}+ </Button>+ </div>+ {/* The user's share is used, the runs' isn't (spec §4.4). */}+ <EmptyPoolMessage quota={quota} onOpenSettings={() => setSettingsOpen(true)} /></CardContent></Card>@@ -519,7 +528,11 @@ export default function SiteAuditPage() {{/* KPI cards, as in the v2 mockup (SA-018) */}{(loading || overview) && (- <AuditOverviewCards overview={loading ? null : overview} quota={quota} />+ <AuditOverviewCards+ overview={loading ? null : overview}+ quota={quota}+ onOpenSettings={() => setSettingsOpen(true)}+ />)}{/* Primary-domain score trend + category breakdown */}diff --git a/web/src/lib/actions/audits.ts b/web/src/lib/actions/audits.tsindex a9356e050..96166c17f 100644--- a/web/src/lib/actions/audits.ts+++ b/web/src/lib/actions/audits.ts@@ -79,8 +79,9 @@ export interface AuditAutoStatus {perRun: number;/** Audits the runs still to come keep out of `remaining`. */reserved: number;- /** Audits the runs used this period. */+ /** Audits the runs used this period, and have running now. */used: number;+ running: number;periodStart: string;periodEnd: string;runs: { day: number; at: string; done: boolean }[];@@ -315,6 +316,8 @@ export interface AuditOverview {siteScoreChange: number | null;authority: number | null;eeat: number | null;+ /** The weakest of the five categories, for the summary strip (SA-019). */+ lowestCategory: { key: string; score: number } | null;gaps: AuditGap[];}