Skip to content

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.

feat(content-editor): ask a comparison to show when it was last checked, with Add line (CE-052, part c) (#1495)

Cihan7a7cdd24ef0e
diff --git a/web/messages/en.json b/web/messages/en.json
index cde9311cc..3534c9fae 100644
--- a/web/messages/en.json
+++ b/web/messages/en.json
@@ -4700,6 +4700,7 @@
"needsWork": "Needs work"
},
"estimate": "Ansvisor estimates based on Google's published quality signals. Not a Google score.",
+ "addLine": "Add line",
"weightsFor": {
"line": "Checks and weights for {type}{detected, select, yes { (detected)} other {}}:",
"noType": "an article (no page type yet)",
@@ -4709,7 +4710,7 @@
"product": "no author (your brand's), your own product photos, proof for claims, prices that match, shipping and returns, a specs table and short plain copy.",
"category": "your own product images, your brand's information on its site, prices and claims that match, an intro and a buying FAQ.",
"feature": "your own screenshots and data, sourced metrics, a price that matches, a comparison table, proof per section and use case steps in scannable sections.",
- "comparison": "an author who says how the picks were made, balance and a disclosure, a side-by-side table, the summary first."
+ "comparison": "an author who says how the picks were made and when they were last checked, balance and a disclosure, a side-by-side table, the summary first."
},
"tooShort": "Write a few paragraphs: Readability is read from the page as you write.",
"tooShortShort": "Too short yet",
@@ -4755,6 +4756,16 @@
"given": "It's in Your input, but the page doesn't quote it word for word yet",
"done": "The page quotes an expert word for word"
},
+ "checkDate": {
+ "title": "Show when you last checked",
+ "titleOld": "Update when you last checked",
+ "next": "show when you last checked, once you've checked the products",
+ "detail": "Comparison readers trust a date they can see. Add line puts this month's under the opening paragraph: check the products first",
+ "detailReplace": "The page's check date is over a year old. Add line replaces it with this month's: check the products first",
+ "detailOld": "The page's check date is over a year old. Add line puts this month's under the opening paragraph: check the products first, then update or remove the old date",
+ "detailWrite": "Comparison readers trust a date they can see: write when you last checked the products",
+ "done": "The page shows when it was last checked"
+ },
"shippingReturns": {
"title": "Say how shipping and returns work",
"next": "say how shipping and returns work",
@@ -4865,7 +4876,8 @@
"addProof": "Add now",
"confirmImage": "Confirm now",
"pickReviewer": "Pick now",
- "addImage": "Add now"
+ "addImage": "Add now",
+ "addCheckDate": "Add now"
},
"later": "Later"
},
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_draft-editor.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_draft-editor.tsx
index 7935937a3..622258dc3 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_draft-editor.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_draft-editor.tsx
@@ -115,6 +115,7 @@ import {
unplacedSites,
type ClaimMark,
} from '@/lib/content/quality-checks';
+import { checkDateOnPage, checkDateText, isCheckDateLine } from '@/lib/content/check-date';
import {
PROFILE_WEIGHTS,
checksOff,
@@ -763,6 +764,14 @@ export function DraftEditor({
// page's type (an article's before, and for most types).
const profile = profileFor(pageType);
const weights = PROFILE_WEIGHTS[profile];
+ // A comparison's check date (CE-052): E-E-A-T's check and its to-do.
+ const checkDateRead = useMemo(
+ () =>
+ qualityOn && profile === 'comparison'
+ ? checkDateOnPage(pageBlocks.map((b) => b.text))
+ : null,
+ [qualityOn, profile, pageBlocks],
+ );
// A product page's shipping and returns (CE-052): Trust's check, and a
// to-do that needs no Trust read.
const shippingRead = useMemo(
@@ -859,6 +868,7 @@ export function DraftEditor({
confirmed: authorConfirmed,
// The brand's own information: only a type that weighs it counts it.
siteTrust,
+ checkDate: checkDateRead === null ? null : checkDateRead.found,
}),
weights.eeat,
)
@@ -875,6 +885,7 @@ export function DraftEditor({
aiChecks,
authorConfirmed,
siteTrust,
+ checkDateRead,
brandInfoRead,
weights,
],
@@ -1087,6 +1098,8 @@ export function DraftEditor({
reviewer: regulated && authorsRead ? { topic: regulated, picked: !!pageReviewer } : null,
confirmed: authorConfirmed,
shipping: shippingRead,
+ checkDate:
+ checkDateRead === null ? null : { ...checkDateRead, line: checkDateText(language) },
off: checksOff(profile),
})
: [];
@@ -1643,10 +1656,11 @@ export function DraftEditor({
const disclosureOnPage =
!!disclosureLine &&
squeeze(pageBlocks.map((b) => b.text).join('')).includes(squeeze(disclosureLine));
- // The disclosure line (CE-050) under the page's opening paragraph (the
- // answer Answer first reads, past an image, a byline or a date), else
- // under the page's H1, else at the top; never twice. One undo takes it out.
- const addDisclosure = (line: string) => {
+ // A line the page says of itself (the disclosure, CE-050; a check date,
+ // CE-052) under the page's opening paragraph (the answer Answer first
+ // reads, past an image, a byline or a date), else under the page's H1,
+ // else at the top; never twice. One undo takes it out.
+ const addLineUnderAnswer = (line: string) => {
if (!editor || editor.isDestroyed) return;
const { doc } = editor.state;
if (squeeze(doc.textContent).includes(squeeze(line))) return;
@@ -1678,6 +1692,32 @@ export function DraftEditor({
.insertContentAt(at, { type: 'paragraph', content: [{ type: 'text', text: line }] })
.run();
};
+ // Quality's Add line for a comparison's check date (CE-052): this month's,
+ // over its own line from before (a top-level paragraph that is only that
+ // line), else under the answer: a date in the person's words (a byline,
+ // the answer) stays theirs. One undo takes it back.
+ const addCheckDate = () => {
+ const line = checkDateText(language);
+ if (!line || !editor || editor.isDestroyed) return;
+ let found: { pos: number; size: number } | null = null;
+ editor.state.doc.forEach((node, pos) => {
+ if (!found && node.type.name === 'paragraph' && isCheckDateLine(node.textContent)) {
+ found = { pos, size: node.nodeSize };
+ }
+ });
+ const at = found as { pos: number; size: number } | null;
+ if (!at) {
+ addLineUnderAnswer(line);
+ return;
+ }
+ editor
+ .chain()
+ .insertContentAt(
+ { from: at.pos, to: at.pos + at.size },
+ { type: 'paragraph', content: [{ type: 'text', text: line }] },
+ )
+ .run();
+ };
const fillFirstPlaceholder = () => {
if (htmlSource !== null) {
const m = new RegExp(PLACEHOLDER.source, 'iu').exec(blankCode(htmlSource, { words: true }));
@@ -3236,6 +3276,7 @@ export function DraftEditor({
onShowPlaceholder={showFirstPlaceholder}
onPickAuthor={() => setAuthorMenuOpen(true)}
onPickReviewer={() => setReviewerMenuOpen(true)}
+ onAddCheckDate={htmlSource === null ? addCheckDate : undefined}
onAddInput={addInput}
onAddSource={sourcesOn ? addSource : undefined}
onConfirmImages={() => setConfirmingImages(true)}
@@ -3278,6 +3319,7 @@ export function DraftEditor({
onShowPlaceholder={showFirstPlaceholder}
onPickAuthor={() => setAuthorMenuOpen(true)}
onPickReviewer={() => setReviewerMenuOpen(true)}
+ onAddCheckDate={htmlSource === null ? addCheckDate : undefined}
onChangeType={() => setTypeMenuOpen(true)}
handOff={handOffCard}
yourInput={inputsRead.status === 'off' ? null : inputsRead}
@@ -3395,7 +3437,7 @@ export function DraftEditor({
// Not while the HTML view holds the page: its source is what goes out.
disclosureLine={htmlSource === null ? disclosureLine : null}
disclosureAdded={disclosureOnPage}
- onAddDisclosure={addDisclosure}
+ onAddDisclosure={addLineUnderAnswer}
onMarkReady={(anyway) => {
setPublishOpen(null);
void markReady(anyway ?? undefined);
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_next-nudge.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_next-nudge.tsx
index 6f26f9f28..a6181b005 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_next-nudge.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_next-nudge.tsx
@@ -95,6 +95,7 @@ export function NextNudge({
onConfirmImages,
onAddImage,
onPickReviewer,
+ onAddCheckDate,
onLater,
onAct,
}: {
@@ -113,6 +114,7 @@ export function NextNudge({
onAddImage?: () => void;
/** A regulated page's: the header's reviewer menu (CE-049). */
onPickReviewer?: () => void;
+ onAddCheckDate?: () => void;
onLater: () => void;
/** It was acted on: it goes. */
onAct: () => void;
@@ -220,6 +222,19 @@ export function NextNudge({
{t('act.pickReviewer')}
</button>
)
+ ) : action === 'addCheckDate' ? (
+ onAddCheckDate && (
+ <button
+ type="button"
+ className={actClass}
+ onClick={() => {
+ onAct();
+ onAddCheckDate();
+ }}
+ >
+ {t('act.addCheckDate')}
+ </button>
+ )
) : action === 'reviewBrandFacts' ? (
quality.brandFactsPath && (
<Link href={quality.brandFactsPath} className={actClass} onClick={onAct}>
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_quality-tab.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_quality-tab.tsx
index 8ba05dd1e..22f76d69d 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_quality-tab.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_quality-tab.tsx
@@ -144,6 +144,7 @@ export function QualityTab({
onConfirmImages,
onAddImage,
onPickReviewer,
+ onAddCheckDate,
handOff = null,
onConfirmAuthor,
onChangeType,
@@ -173,6 +174,8 @@ export function QualityTab({
onAddImage?: () => void;
/** Opens the header's reviewer menu (CE-049). */
onPickReviewer?: () => void;
+ /** A comparison's check date to-do: Add line puts this month's under the answer (CE-052). */
+ onAddCheckDate?: () => void;
/** Hand it off to Content Agent (CE-051): with Quality's phase 2. */
handOff?: HandOff | null;
}) {
@@ -270,6 +273,7 @@ export function QualityTab({
onConfirmImages={onConfirmImages}
onAddImage={onAddImage}
onPickReviewer={onPickReviewer}
+ onAddCheckDate={onAddCheckDate}
onConfirm={onConfirmAuthor}
/>
))}
@@ -480,6 +484,24 @@ export function useTodoCopy() {
: t('visualProof.detail.add'),
};
}
+ // A comparison's check date (CE-052): only the person knows when they checked.
+ if (todo.id === 'checkDate') {
+ return {
+ title: t(todo.old && !todo.done ? 'checkDate.titleOld' : 'checkDate.title'),
+ next: t('checkDate.next'),
+ detail: todo.done
+ ? t('checkDate.done')
+ : todo.action === 'addCheckDate'
+ ? t(
+ todo.old === 'line'
+ ? 'checkDate.detailReplace'
+ : todo.old === 'text'
+ ? 'checkDate.detailOld'
+ : 'checkDate.detail',
+ )
+ : t('checkDate.detailWrite'),
+ };
+ }
// A product page's shipping and returns (CE-052): only the person knows them.
if (todo.id === 'shippingReturns') {
return {
@@ -552,6 +574,7 @@ function TodoRow({
onConfirmImages,
onAddImage,
onPickReviewer,
+ onAddCheckDate,
onConfirm,
}: {
todo: QualityTodo;
@@ -564,6 +587,8 @@ function TodoRow({
onConfirmImages?: () => void;
onAddImage?: () => void;
onPickReviewer?: () => void;
+ /** A comparison's check date to-do: Add line puts this month's under the answer (CE-052). */
+ onAddCheckDate?: () => void;
onConfirm?: (what: 'real' | 'profile', on: boolean) => void;
}) {
const t = useTranslations('contentEditor.editor.quality');
@@ -686,6 +711,12 @@ function TodoRow({
{t('pickReviewer')}
</Button>
)
+ ) : todo.action === 'addCheckDate' ? (
+ onAddCheckDate && (
+ <Button variant="outline" size="sm" className="h-7 shrink-0" onClick={onAddCheckDate}>
+ {t('addLine')}
+ </Button>
+ )
) : todo.action === 'reviewBrandFacts' ? (
quality.brandFactsPath && (
<Link
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_side-panel.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_side-panel.tsx
index cadfb73c6..6c95c1dc6 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_side-panel.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_side-panel.tsx
@@ -139,6 +139,7 @@ export function EditorSidePanel({
onConfirmImages,
onAddImage,
onPickReviewer,
+ onAddCheckDate,
onChangeType,
handOff = null,
}: {
@@ -209,6 +210,8 @@ export function EditorSidePanel({
onAddImage?: () => void;
/** Quality's Pick reviewer: the header's reviewer menu (CE-049). */
onPickReviewer?: () => void;
+ /** Quality's Add line for a comparison's check date (CE-052). */
+ onAddCheckDate?: () => void;
/** Quality's Change: the header's page type menu (CE-052). */
onChangeType?: () => void;
/** Hand it off to Content Agent, Quality's (CE-051). */
@@ -465,6 +468,7 @@ export function EditorSidePanel({
onConfirmImages={onConfirmImages}
onAddImage={onAddImage}
onPickReviewer={onPickReviewer}
+ onAddCheckDate={onAddCheckDate}
onChangeType={onChangeType}
handOff={handOff}
/>
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/page.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/page.test.tsx
index ee0582d03..e29e057fa 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/page.test.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/page.test.tsx
@@ -2601,6 +2601,121 @@ describe('the side panel', () => {
expect(text).not.toContain('Add an author for the page');
});
+ it('leaves a date in the person’s words alone, and replaces only its own old line (#1495 review)', async () => {
+ process.env.NEXT_PUBLIC_CONTENT_QUALITY_PHASE = '3';
+ vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] });
+ getContentAuthors.mockResolvedValue({
+ authors: [],
+ brands: [{ id: 'b1', name: 'Acme' }],
+ me: { id: 'u1', role: 'admin' },
+ });
+ const byline = 'By Jane Doe · Updated March 2023';
+ const answer = 'We tested 9 CRMs in 2024; HubSpot fits small teams best.';
+ getContentDraft.mockResolvedValue({
+ ...readable,
+ pageType: 'comparison',
+ bodyHtml:
+ `<h1>Best CRMs for small teams</h1><p>${byline}</p><p>${answer}</p>` +
+ '<h2>How we picked</h2><p>We set each one up with a real pipeline and a team of three.</p>' +
+ '<p>Last checked: May 2021</p>',
+ });
+ window.innerWidth = 1440;
+ await renderPage();
+ await act(async () => void (await vi.advanceTimersByTimeAsync(3_000)));
+ const chip = [...container.querySelectorAll<HTMLButtonElement>('header button')].find((b) =>
+ b.textContent?.startsWith('Quality'),
+ )!;
+ await act(async () => chip.click());
+ const row = [...panel()!.querySelectorAll('[aria-label="Your to-dos"] li')].find((li) =>
+ li.textContent?.startsWith('Update when you last checked'),
+ )!;
+ expect(row.textContent).toContain('Add line replaces it with this month');
+ await act(async () =>
+ [...row.querySelectorAll('button')].find((b) => b.textContent === 'Add line')!.click(),
+ );
+ const { state } = (
+ container.querySelector('.ProseMirror') as HTMLElement & { editor: Editor }
+ ).editor;
+ const blocks: string[] = [];
+ state.doc.forEach((node) => void blocks.push(node.textContent));
+ // The byline and the answer stay; the old line is this month's now, once.
+ expect(blocks).toContain(byline);
+ expect(blocks).toContain(answer);
+ expect(blocks.filter((text) => text.startsWith('Last checked:'))).toEqual([
+ expect.stringMatching(/^Last checked: \w+ \d{4}$/),
+ ]);
+ expect(blocks.at(-1)).not.toBe('Last checked: May 2021');
+ });
+
+ it('asks a comparison to show when it was last checked, and Add line puts it under the answer (CE-052)', async () => {
+ process.env.NEXT_PUBLIC_CONTENT_QUALITY_PHASE = '3';
+ vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] });
+ getContentAuthors.mockResolvedValue({
+ authors: [],
+ brands: [{ id: 'b1', name: 'Acme' }],
+ me: { id: 'u1', role: 'admin' },
+ });
+ getContentDraft.mockResolvedValue({ ...readable, pageType: 'comparison' });
+ window.innerWidth = 1440;
+ await renderPage();
+ await act(async () => void (await vi.advanceTimersByTimeAsync(3_000)));
+ const chip = [...container.querySelectorAll<HTMLButtonElement>('header button')].find((b) =>
+ b.textContent?.startsWith('Quality'),
+ )!;
+ await act(async () => chip.click());
+ const row = () =>
+ [...panel()!.querySelectorAll('[aria-label="Your to-dos"] li')].find((li) =>
+ li.textContent?.startsWith('Show when you last checked'),
+ )!;
+ expect(row().textContent).toContain('Add line puts this month');
+ await act(async () =>
+ [...row().querySelectorAll('button')].find((b) => b.textContent === 'Add line')!.click(),
+ );
+ const { state } = (
+ container.querySelector('.ProseMirror') as HTMLElement & { editor: Editor }
+ ).editor;
+ // Under the opening paragraph, the answer first.
+ expect(state.doc.child(2).textContent).toMatch(/^Last checked: \w+ \d{4}$/);
+ await act(async () => void (await vi.advanceTimersByTimeAsync(500)));
+ expect(row().textContent).toContain('The page shows when it was last checked');
+ });
+
+ it('replaces a stale check date with this month’s rather than adding a second (CE-052)', async () => {
+ process.env.NEXT_PUBLIC_CONTENT_QUALITY_PHASE = '3';
+ vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] });
+ getContentAuthors.mockResolvedValue({
+ authors: [],
+ brands: [{ id: 'b1', name: 'Acme' }],
+ me: { id: 'u1', role: 'admin' },
+ });
+ getContentDraft.mockResolvedValue({
+ ...readable,
+ pageType: 'comparison',
+ bodyHtml: readable.bodyHtml.replace('</h1>', '</h1><p>Last checked: May 2021</p>'),
+ });
+ window.innerWidth = 1440;
+ await renderPage();
+ await act(async () => void (await vi.advanceTimersByTimeAsync(3_000)));
+ const chip = [...container.querySelectorAll<HTMLButtonElement>('header button')].find((b) =>
+ b.textContent?.startsWith('Quality'),
+ )!;
+ await act(async () => chip.click());
+ const row = [...panel()!.querySelectorAll('[aria-label="Your to-dos"] li')].find((li) =>
+ li.textContent?.startsWith('Update when you last checked'),
+ )!;
+ await act(async () =>
+ [...row.querySelectorAll('button')].find((b) => b.textContent === 'Add line')!.click(),
+ );
+ const { state } = (
+ container.querySelector('.ProseMirror') as HTMLElement & { editor: Editor }
+ ).editor;
+ const texts: string[] = [];
+ state.doc.forEach((node) => texts.push(node.textContent));
+ expect(texts.filter((t) => t.startsWith('Last checked:'))).toHaveLength(1);
+ expect(texts[1]).toMatch(/^Last checked: \w+ \d{4}$/);
+ expect(texts[1]).not.toContain('2021');
+ });
+
it('shows nothing of Quality until its first phase is live', async () => {
getContentDraft.mockResolvedValue(readable);
window.innerWidth = 1440;
diff --git a/web/src/lib/content/check-date.test.ts b/web/src/lib/content/check-date.test.ts
new file mode 100644
index 000000000..7e6ccf62e
--- /dev/null
+++ b/web/src/lib/content/check-date.test.ts
@@ -0,0 +1,98 @@
+import { describe, expect, it } from 'vitest';
+import { checkDateOnPage, checkDateText, isCheckDateLine, pageCheckDate } from './check-date';
+import { isByline } from './readability';
+
+/** A comparison's visible check date (Quality spec §11, CE-052). */
+
+const NOW = new Date('2026-10-25T12:00:00Z');
+
+describe('checkDateText', () => {
+ it('says this month in the page’s language, none for a language without a line', () => {
+ expect(checkDateText('English (US)', NOW)).toBe('Last checked: October 2026');
+ expect(checkDateText('tr', NOW)).toBe('Son kontrol: Ekim 2026');
+ expect(checkDateText('de', NOW)).toBe('Zuletzt geprüft: Oktober 2026');
+ expect(checkDateText('Japanese', NOW)).toBeNull();
+ });
+
+ it('is read back in every language, and Answer first reads past it as a date', () => {
+ for (const language of ['en', 'tr', 'de', 'fr', 'es', 'pt', 'it', 'nl', 'sv']) {
+ const line = checkDateText(language, NOW)!;
+ expect(pageCheckDate([line], NOW)).toBe(true);
+ expect(isByline(line)).toBe(true);
+ }
+ });
+});
+
+describe('pageCheckDate', () => {
+ it('reads a check date from the last two years, as a verb or a label', () => {
+ for (const text of [
+ 'We tested each tool in March 2025.',
+ 'Last update: October 2026',
+ 'Son güncelleme: Ekim 2026',
+ 'İncelendi: Ekim 2026',
+ 'Letzte Aktualisierung: Oktober 2026',
+ 'Dernière mise à jour : octobre 2026',
+ 'Última actualización: octubre de 2026',
+ 'Ultimo aggiornamento: ottobre 2026',
+ 'Letzte Prüfung: Oktober 2026',
+ 'Actualisé le 3 octobre 2026',
+ 'Testato a ottobre 2026',
+ 'Last modified: October 2026',
+ 'Verificado en octubre de 2026',
+ ]) {
+ expect(pageCheckDate([text], NOW), text).toBe(true);
+ }
+ });
+
+ it('reads none from an old date, a year with no check, a word inside another, or a check far from its year', () => {
+ for (const text of [
+ 'Last checked: May 2021.',
+ 'Founded in 2026 by two engineers.',
+ 'We checked every plan.',
+ 'Areas of improvement for 2026.',
+ 'Untested before 2026.',
+ // Words that aren't a check: a verification, updates, a control.
+ 'Email verification since 2025.',
+ 'Free updates since 2025.',
+ "Ebeveyn kontrolü 2025'te geldi.",
+ 'We tested a dozen tools for this guide, comparing price, speed, support and integrations for small teams; Acme launched in 2026.',
+ ]) {
+ expect(pageCheckDate([text], NOW), text).toBe(false);
+ }
+ });
+
+ it('tells Add line’s own line at any year, for it to replace, and no one else’s date (#1495 review)', () => {
+ for (const language of ['en', 'tr', 'de', 'fr', 'es', 'pt', 'it', 'nl', 'sv']) {
+ expect(isCheckDateLine(checkDateText(language, new Date('2021-05-10'))!), language).toBe(
+ true,
+ );
+ }
+ for (const text of [
+ 'By Jane Doe · Updated March 2023',
+ 'We tested 9 CRMs in 2024; HubSpot fits small teams best.',
+ 'Acme updated its pricing in 2023, and the Pro plan now costs more.',
+ 'Last checked: May 2021, by our team.',
+ 'Our pick for small teams.',
+ ]) {
+ expect(isCheckDateLine(text), text).toBe(false);
+ }
+ });
+});
+
+describe('checkDateOnPage', () => {
+ it('tells a recent date, an old line Add line replaces, and an old date in the person’s words', () => {
+ expect(checkDateOnPage(['Last checked: October 2026'], NOW)).toEqual({
+ found: true,
+ old: null,
+ });
+ expect(checkDateOnPage(['Last checked: May 2021'], NOW)).toEqual({ found: false, old: 'line' });
+ expect(checkDateOnPage(['By Jane Doe · Updated March 2023'], NOW)).toEqual({
+ found: false,
+ old: 'text',
+ });
+ expect(checkDateOnPage(['Our pick for small teams.'], NOW)).toEqual({
+ found: false,
+ old: null,
+ });
+ });
+});
diff --git a/web/src/lib/content/check-date.ts b/web/src/lib/content/check-date.ts
new file mode 100644
index 000000000..5146193c8
--- /dev/null
+++ b/web/src/lib/content/check-date.ts
@@ -0,0 +1,107 @@
+import { languageCode } from './readability';
+
+/**
+ * A visible check date (Content Editor Quality spec §11, Phase 3, CE-052):
+ * a comparison is trusted for saying when its products were last checked.
+ * E-E-A-T counts one on the page; the to-do's Add line puts this month's in
+ * the page's language, as the disclosure line goes in (CE-050). A language
+ * not here gets none: the person writes it.
+ */
+
+// No full stop: a short line that isn't a sentence, which Answer first reads
+// past as it does a byline or a date (isByline).
+const LINES: Record<string, string> = {
+ en: 'Last checked: {date}',
+ tr: 'Son kontrol: {date}',
+ de: 'Zuletzt geprüft: {date}',
+ fr: 'Dernière vérification : {date}',
+ es: 'Última revisión: {date}',
+ pt: 'Última verificação: {date}',
+ it: 'Ultimo controllo: {date}',
+ nl: 'Laatst gecontroleerd: {date}',
+ sv: 'Senast kontrollerad: {date}',
+};
+
+/** This month's check date line for a page in `language`, or null for a language not here. */
+export function checkDateText(
+ language: string | null | undefined,
+ now = new Date(),
+): string | null {
+ const code = languageCode(language) ?? '';
+ const line = LINES[code];
+ if (!line) return null;
+ const date = new Intl.DateTimeFormat(code, { month: 'long', year: 'numeric' }).format(now);
+ return line.replace('{date}', () => date);
+}
+
+/**
+ * Add line's own line, in any of the languages above: its label, then a
+ * month and a year, and nothing else ("Last checked: May 2021", "Última
+ * revisión: octubre de 2026"). Only this is replaced: a date in the
+ * person's own words (a byline, the answer) is theirs.
+ */
+const CHECK_DATE_LINE = new RegExp(
+ `^\\s*(?:${Object.values(LINES)
+ .map((line) => line.replace(/\s*:\s*\{date\}$/u, '').replace(/[.*+?^${}()|[\]\\]/g, '\\$&'))
+ .join('|')})\\s*:\\s*[\\p{L}.]+(?:\\s+de)?\\s+\\d{4}\\s*$`,
+ 'iu',
+);
+
+/** Whether a block is Add line's own check date line, at any date: Add line replaces it. */
+export const isCheckDateLine = (text: string) =>
+ CHECK_DATE_LINE.test(text) || CHECK_DATE_LINE.test(text.toLocaleLowerCase('tr'));
+
+/**
+ * Words (and their stems) that say a page was checked, tested, reviewed or
+ * updated, the verb or the label ("Last update", "Son güncelleme",
+ * "Letzte Aktualisierung", "Letzte Prüfung"), in the languages above; each
+ * at a word's start ("untested", "areas of" aren't one), and in the forms
+ * that mean checked ("verification", "updates", "kontrolü" aren't).
+ */
+const CHECKED =
+ /(?<!\p{L})(?:checked|tested|reviewed|verified|updated|last update|last modified|as of|son kontrol|kontrol edil|güncelle|incele|test edil|doğrula|geprüft|überprüf|prüfung|getestet|aktualisier|stand:|vérifi|mise? à jour|actualisé|testé|révis|revis|actualiza|verificad[oa]|verificaç|verificat[oaie](?!\p{L})|probad|atualiza|testad|testato|controllat|controllo|aggiorna|gecontroleerd|getest|bijgewerkt|kontrollerad|uppdaterad|granskad)/giu;
+const YEAR = /(?<!\d)(?:19|20)\d{2}(?!\d)/g;
+/** A block this short is a label ("Updated March 2026"): its date is the page's. */
+const LABEL_WORDS = 12;
+/** In a longer one, the year must be this near the word ("we tested each in March 2025"). */
+const NEAR_CHARS = 40;
+
+/** The years a block says it was checked in (any year), as written or lowercased the Turkish way. */
+function checkedYears(text: string): number[] {
+ const out: number[] = [];
+ for (const form of [text, text.toLocaleLowerCase('tr')]) {
+ const label = form.split(/\s+/).filter(Boolean).length <= LABEL_WORDS;
+ for (const word of form.matchAll(CHECKED)) {
+ const from = label ? 0 : Math.max(0, word.index - NEAR_CHARS);
+ const to = label ? form.length : word.index + word[0].length + NEAR_CHARS;
+ for (const year of form.slice(from, to).matchAll(YEAR)) out.push(Number(year[0]));
+ }
+ }
+ return out;
+}
+
+/**
+ * Whether the page says when it was last checked: a block with a "checked"
+ * word and a year from the last two (a check date older than that tells the
+ * reader the comparison is stale).
+ */
+export function pageCheckDate(texts: readonly string[], now = new Date()): boolean {
+ const from = now.getFullYear() - 1;
+ return texts.some((text) =>
+ checkedYears(text).some((year) => year >= from && year <= now.getFullYear()),
+ );
+}
+
+/**
+ * What the page says of when it was checked: a recent date (found), else an
+ * older one, in Add line's own line (it replaces it) or in the person's
+ * words (they update it), or none.
+ */
+export function checkDateOnPage(
+ texts: readonly string[],
+ now = new Date(),
+): { found: boolean; old: 'line' | 'text' | null } {
+ if (pageCheckDate(texts, now)) return { found: true, old: null };
+ if (texts.some(isCheckDateLine)) return { found: false, old: 'line' };
+ return { found: false, old: texts.some((text) => checkedYears(text).length) ? 'text' : null };
+}
diff --git a/web/src/lib/content/quality-checks.ts b/web/src/lib/content/quality-checks.ts
index 90cc9c4a8..a8cfc6b2b 100644
--- a/web/src/lib/content/quality-checks.ts
+++ b/web/src/lib/content/quality-checks.ts
@@ -43,9 +43,13 @@ export const EEAT_WEIGHTS = {
dates: 10,
authorSchema: 10,
brandInfo: 0,
+ // Phase 3 (CE-052): a comparison's visible check date; weighed there.
+ checkDate: 0,
} as const;
/** The brand info check's points before a page type weighs it (weighed keeps its share). */
const BRAND_INFO_POINTS = 10;
+/** The check date's points before a page type weighs it. */
+const CHECK_DATE_POINTS = 10;
export type EeatCheckId = keyof typeof EEAT_WEIGHTS;
/**
@@ -275,8 +279,14 @@ export function eeat({
how = null,
confirmed = null,
siteTrust = null,
+ checkDate = null,
}: {
author: ContentAuthor | null;
+ /**
+ * Phase 3 (CE-052): whether a comparison shows when its products were
+ * last checked (pageCheckDate); left out elsewhere.
+ */
+ checkDate?: boolean | null;
/**
* The site's trust (its five checks in Site Audit, CE-043): the brand's own
* information, which only a page type that weighs it counts (CE-052).
@@ -356,6 +366,15 @@ export function eeat({
: 0,
max: EEAT_WEIGHTS.authorBio,
},
+ ...(checkDate !== null
+ ? [
+ {
+ id: 'checkDate' as const,
+ points: checkDate ? CHECK_DATE_POINTS : 0,
+ max: CHECK_DATE_POINTS,
+ },
+ ]
+ : []),
...(siteTrust
? [
{
diff --git a/web/src/lib/content/quality-profiles.test.ts b/web/src/lib/content/quality-profiles.test.ts
index b5d6fe72a..12c4bf8b0 100644
--- a/web/src/lib/content/quality-profiles.test.ts
+++ b/web/src/lib/content/quality-profiles.test.ts
@@ -54,8 +54,13 @@ describe('PROFILE_WEIGHTS', () => {
it('asks a product page for no author, and a comparison for balance and a disclosure', () => {
expect(checksOff('product')).toContain('byline');
expect(checksOff('product')).toContain('authorBio');
- // An article counts every check but the brand's information, the type rules and shipping.
- expect([...checksOff('article')].sort()).toEqual(['brandInfo', 'shippingReturns', 'typeRules']);
+ // An article counts every check but the brand's information, the check date, shipping and the type rules.
+ expect([...checksOff('article')].sort()).toEqual([
+ 'brandInfo',
+ 'checkDate',
+ 'shippingReturns',
+ 'typeRules',
+ ]);
expect(PROFILE_WEIGHTS.comparison.trust.balanced).toBeGreaterThan(
PROFILE_WEIGHTS.article.trust.balanced,
);
diff --git a/web/src/lib/content/quality-profiles.ts b/web/src/lib/content/quality-profiles.ts
index d4a989b39..abd06c80d 100644
--- a/web/src/lib/content/quality-profiles.ts
+++ b/web/src/lib/content/quality-profiles.ts
@@ -84,6 +84,7 @@ export const PROFILE_WEIGHTS: Readonly<Record<QualityProfile, ProfileWeights>> =
dates: 0,
authorSchema: 0,
brandInfo: 0,
+ checkDate: 0,
},
trust: {
claimsSourced: 25,
@@ -123,6 +124,7 @@ export const PROFILE_WEIGHTS: Readonly<Record<QualityProfile, ProfileWeights>> =
dates: 0,
authorSchema: 0,
brandInfo: 40,
+ checkDate: 0,
},
trust: {
claimsSourced: 25,
@@ -161,6 +163,7 @@ export const PROFILE_WEIGHTS: Readonly<Record<QualityProfile, ProfileWeights>> =
dates: 0,
authorSchema: 0,
brandInfo: 0,
+ checkDate: 0,
},
trust: {
claimsSourced: 35,
@@ -186,20 +189,22 @@ export const PROFILE_WEIGHTS: Readonly<Record<QualityProfile, ProfileWeights>> =
typeRules: 10,
},
},
- // An author, saying how the picks were made; balance and a disclosure,
+ // An author, saying how the picks were made and when they were last
+ // checked; balance and a disclosure,
// each rival's facts from its own pages; the summary first and a table
// side by side.
comparison: {
eeat: {
- experience: 20,
+ experience: 15,
originalData: 10,
byline: 15,
authorBio: 10,
visualProof: 10,
- whoHowWhy: 20,
- dates: 10,
- authorSchema: 5,
+ whoHowWhy: 15,
+ dates: 5,
+ authorSchema: 0,
brandInfo: 0,
+ checkDate: 20,
},
trust: {
claimsSourced: 25,
diff --git a/web/src/lib/content/quality-todos.test.ts b/web/src/lib/content/quality-todos.test.ts
index 32d9e8e8c..1f809e2fc 100644
--- a/web/src/lib/content/quality-todos.test.ts
+++ b/web/src/lib/content/quality-todos.test.ts
@@ -103,6 +103,37 @@ describe('qualityTodos', () => {
).toBe(false);
});
+ it('asks a comparison to show when it was last checked, with Add line where it has one (CE-052)', () => {
+ const run = (checkDate: {
+ found: boolean;
+ old?: 'line' | 'text' | null;
+ line: string | null;
+ }) =>
+ qualityTodos({
+ eeat: weighed(
+ eeat({ author: author(), checkDate: checkDate.found }),
+ PROFILE_WEIGHTS.comparison.eeat,
+ ),
+ author: author(),
+ hasAuthors: true,
+ checkDate,
+ off: checksOff('comparison'),
+ }).find((t) => t.id === 'checkDate');
+ expect(run({ found: false, line: 'Last checked: October 2026.' })).toMatchObject({
+ done: false,
+ action: 'addCheckDate',
+ score: 'eeat',
+ });
+ expect(run({ found: false, line: 'x' })!.gain).toBeGreaterThan(0);
+ // A language without a line: the person writes it.
+ expect(run({ found: false, line: null })!.action).toBeNull();
+ expect(run({ found: true, line: 'x' })).toMatchObject({ done: true, action: null, gain: 0 });
+ // An old date: Add line's own line (it replaces it) or the person's words (#1495 review).
+ expect(run({ found: false, old: 'line', line: 'x' })).toMatchObject({ old: 'line' });
+ expect(run({ found: false, old: 'text', line: 'x' })).toMatchObject({ old: 'text' });
+ expect(run({ found: true, old: null, line: 'x' })).not.toHaveProperty('old');
+ });
+
it('asks to add an author when the workspace has none', () => {
expect(todos(null, false)[0]).toEqual({
id: 'byline',
diff --git a/web/src/lib/content/quality-todos.ts b/web/src/lib/content/quality-todos.ts
index dfd3889b5..860de452f 100644
--- a/web/src/lib/content/quality-todos.ts
+++ b/web/src/lib/content/quality-todos.ts
@@ -34,7 +34,8 @@ export type QualityTodoId =
| 'proof'
| 'reviewer'
| 'brandFacts'
- | 'shippingReturns';
+ | 'shippingReturns'
+ | 'checkDate';
/**
* A to-do's one button: Show (the first placeholder, selected to type over),
@@ -51,7 +52,8 @@ export type QualityTodoAction =
| 'confirmImage'
| 'addImage'
| 'pickReviewer'
- | 'reviewBrandFacts';
+ | 'reviewBrandFacts'
+ | 'addCheckDate';
export interface QualityTodo {
id: QualityTodoId;
@@ -77,6 +79,8 @@ export interface QualityTodo {
* names (00271), a tick box beside the to-do, and whether it's ticked.
*/
confirm?: { what: 'real' | 'profile'; on: boolean };
+ /** A check date the page has, over a year old: Add line's own line (it replaces it), or the person's words. */
+ old?: 'line' | 'text';
}
/**
@@ -104,6 +108,7 @@ export function qualityTodos({
reviewer = null,
confirmed = null,
shipping = null,
+ checkDate = null,
off = NONE_OFF,
}: {
eeat: Score<EeatCheckId> | null;
@@ -151,6 +156,11 @@ export function qualityTodos({
* work (Trust's read): only the person knows them.
*/
shipping?: { shipping: boolean; returns: boolean } | null;
+ /**
+ * Phase 3 (CE-052): whether a comparison shows when it was last checked,
+ * and the line Add line puts in (null for a language without one).
+ */
+ checkDate?: { found: boolean; old?: 'line' | 'text' | null; line: string | null } | null;
/**
* Phase 3 (CE-052): the checks the page's type leaves out (checksOff): no
* to-do asks for them (a product page has the brand's byline, no author).
@@ -284,6 +294,19 @@ export function qualityTodos({
// that can't be read too.
...visualTodo(eeat, visual),
...howTodo(eeat),
+ ...(checkDate
+ ? [
+ {
+ id: 'checkDate',
+ done: checkDate.found,
+ gain: scoreGain(eeat, ['checkDate']),
+ score: 'eeat',
+ // Only the person knows when they checked: Add line says this month's.
+ action: checkDate.found || !checkDate.line ? null : 'addCheckDate',
+ ...(!checkDate.found && checkDate.old ? { old: checkDate.old } : {}),
+ } satisfies QualityTodo,
+ ]
+ : []),
...(used
? ([
{