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(content-editor): confirm the author the site names for E-E-A-T, instead of picking one (00271) (#1473)
Cihanb7d54c8c6530
diff --git a/supabase/migrations/00271_content_draft_author_confirmed.sql b/supabase/migrations/00271_content_draft_author_confirmed.sqlnew file mode 100644index 000000000..c8a45d245--- /dev/null+++ b/supabase/migrations/00271_content_draft_author_confirmed.sql@@ -0,0 +1,74 @@+-- ============================================================================+-- 00271: Quality — the page's author confirmed by the person (E-E-A-T)+-- ============================================================================+-- E-E-A-T counts who stands behind a page: a real, named author (the+-- byline) with a profile (a bio and links). Many sites already show their+-- author through the CMS, so picking one of Ansvisor's authors isn't the+-- only way: the person can confirm, page by page,+--+-- * author_real: the page's author is a real person, named on our site;+-- * author_profile: their profile there has a bio and links.+--+-- Each is the person's own statement, kept with who made it and when; a+-- trigger stamps both from the session, so no one confirms in another's+-- name, and unticking clears them.++alter table public.content_drafts+ add column if not exists author_real_at timestamptz,+ add column if not exists author_real_by uuid references public.profiles(id) on delete set null,+ add column if not exists author_profile_at timestamptz,+ add column if not exists author_profile_by uuid references public.profiles(id) on delete set null;++comment on column public.content_drafts.author_real_at is+ 'Quality (00271): when a member confirmed the page''s author is a real person named on the site (E-E-A-T byline); null when not confirmed.';+comment on column public.content_drafts.author_profile_at is+ 'Quality (00271): when a member confirmed the author''s profile on the site has a bio and links (E-E-A-T profile); null when not confirmed.';++-- Who and when come from the session, not the request: a confirmation is+-- stamped now, by the member making it; a change to who alone is undone,+-- clearing it too. Only a role that bypasses RLS changes who alone: the+-- profiles FK's on delete set null, run as the table's owner. On insert+-- OLD is null: a draft starts with only what the session stamps.+create or replace function public.content_drafts_author_confirmed()+returns trigger+language plpgsql+set search_path = ''+as $$+begin+ if new.author_real_at is distinct from old.author_real_at then+ if new.author_real_at is null then+ -- Unticked: the profile's word goes with the author's.+ new.author_real_by := null;+ new.author_profile_at := null;+ new.author_profile_by := null;+ return new;+ end if;+ new.author_real_at := now();+ new.author_real_by := auth.uid();+ elsif new.author_real_by is distinct from old.author_real_by+ and (tg_op = 'INSERT'+ or not (select rolbypassrls from pg_catalog.pg_roles where rolname = current_user)) then+ new.author_real_by := old.author_real_by;+ end if;+ if new.author_profile_at is distinct from old.author_profile_at then+ if new.author_profile_at is null then+ new.author_profile_by := null;+ else+ new.author_profile_at := now();+ new.author_profile_by := auth.uid();+ end if;+ elsif new.author_profile_by is distinct from old.author_profile_by+ and (tg_op = 'INSERT'+ or not (select rolbypassrls from pg_catalog.pg_roles where rolname = current_user)) then+ new.author_profile_by := old.author_profile_by;+ end if;+ return new;+end;+$$;++drop trigger if exists content_drafts_author_confirmed on public.content_drafts;+create trigger content_drafts_author_confirmed+ before insert or update on public.content_drafts+ for each row execute function public.content_drafts_author_confirmed();++notify pgrst, 'reload schema';diff --git a/supabase/schema.sql b/supabase/schema.sqlindex d3fedcd97..9879fa2fa 100644--- a/supabase/schema.sql+++ b/supabase/schema.sql@@ -39110,3 +39110,81 @@ comment on table public.content_draft_own_images isnotify pgrst, 'reload schema';+-- ─────────────────────────────────────────────────────────────────────────+-- migrations/00271_content_draft_author_confirmed.sql+-- ─────────────────────────────────────────────────────────────────────────+-- ============================================================================+-- 00271: Quality — the page's author confirmed by the person (E-E-A-T)+-- ============================================================================+-- E-E-A-T counts who stands behind a page: a real, named author (the+-- byline) with a profile (a bio and links). Many sites already show their+-- author through the CMS, so picking one of Ansvisor's authors isn't the+-- only way: the person can confirm, page by page,+--+-- * author_real: the page's author is a real person, named on our site;+-- * author_profile: their profile there has a bio and links.+--+-- Each is the person's own statement, kept with who made it and when; a+-- trigger stamps both from the session, so no one confirms in another's+-- name, and unticking clears them.++alter table public.content_drafts+ add column if not exists author_real_at timestamptz,+ add column if not exists author_real_by uuid references public.profiles(id) on delete set null,+ add column if not exists author_profile_at timestamptz,+ add column if not exists author_profile_by uuid references public.profiles(id) on delete set null;++comment on column public.content_drafts.author_real_at is+ 'Quality (00271): when a member confirmed the page''s author is a real person named on the site (E-E-A-T byline); null when not confirmed.';+comment on column public.content_drafts.author_profile_at is+ 'Quality (00271): when a member confirmed the author''s profile on the site has a bio and links (E-E-A-T profile); null when not confirmed.';++-- Who and when come from the session, not the request: a confirmation is+-- stamped now, by the member making it; a change to who alone is undone,+-- clearing it too. Only a role that bypasses RLS changes who alone: the+-- profiles FK's on delete set null, run as the table's owner. On insert+-- OLD is null: a draft starts with only what the session stamps.+create or replace function public.content_drafts_author_confirmed()+returns trigger+language plpgsql+set search_path = ''+as $$+begin+ if new.author_real_at is distinct from old.author_real_at then+ if new.author_real_at is null then+ -- Unticked: the profile's word goes with the author's.+ new.author_real_by := null;+ new.author_profile_at := null;+ new.author_profile_by := null;+ return new;+ end if;+ new.author_real_at := now();+ new.author_real_by := auth.uid();+ elsif new.author_real_by is distinct from old.author_real_by+ and (tg_op = 'INSERT'+ or not (select rolbypassrls from pg_catalog.pg_roles where rolname = current_user)) then+ new.author_real_by := old.author_real_by;+ end if;+ if new.author_profile_at is distinct from old.author_profile_at then+ if new.author_profile_at is null then+ new.author_profile_by := null;+ else+ new.author_profile_at := now();+ new.author_profile_by := auth.uid();+ end if;+ elsif new.author_profile_by is distinct from old.author_profile_by+ and (tg_op = 'INSERT'+ or not (select rolbypassrls from pg_catalog.pg_roles where rolname = current_user)) then+ new.author_profile_by := old.author_profile_by;+ end if;+ return new;+end;+$$;++drop trigger if exists content_drafts_author_confirmed on public.content_drafts;+create trigger content_drafts_author_confirmed+ before insert or update on public.content_drafts+ for each row execute function public.content_drafts_author_confirmed();++notify pgrst, 'reload schema';+diff --git a/web/messages/en.json b/web/messages/en.jsonindex e47d557fe..e4844fa37 100644--- a/web/messages/en.json+++ b/web/messages/en.json@@ -4490,6 +4490,7 @@"noImage": "None in the page","noSlug": "None from the title: set it in your CMS","noAuthor": "Not read yet: set it in your CMS",+ "siteAuthor": "Your site's own: your CMS keeps it","copy": "Copy","copyLabel": "Copy {field}","copied": "{field} copied"@@ -4545,7 +4546,9 @@"inContent": "Exports put \"{line}\" under the H1: this brand adds the byline to content, for a CMS with no author field.","unknown": "The authors couldn't be read here, so the code below leaves the author out. Set the page's author in your CMS.","none": "No author yet",- "noneDetail": "The page goes out as {byline}, with the brand's Organization schema. A real author raises E-E-A-T."+ "noneDetail": "The page goes out as {byline}, with the brand's Organization schema. A real author raises E-E-A-T.",+ "confirmed": "Author named on your site",+ "confirmedDetail": "You confirmed the page's author is a real person your site names. Check your CMS sets them as the author."},"dates": {"title": "Visible published and updated dates",@@ -4645,6 +4648,10 @@"addAuthor": "Add author","editAuthor": "Edit author","todos": {+ "confirm": {+ "real": "The author is a real person, named on your site",+ "profile": "Their profile on your site has a short bio and profile links"+ },"experience": {"title": "Add your own experience","next": "add your own experience",@@ -4686,10 +4693,11 @@"addAuthor": "add an author for the page"},"detail": {- "pickAuthor": "It's by {byline} now: a named person shows who stands behind the page",+ "pickAuthor": "It's by {byline} now: a named person shows who stands behind the page. Or, if your site names the author, confirm it","addAuthor": "Add the people who write for you in Settings › Authors. Real people only: the agent can't add them"},- "done": "By {name}"+ "done": "By {name}",+ "confirmedDone": "You confirmed your site names a real person as the author"},"authorProfile": {"title": "Complete {name}'s profile",@@ -4698,6 +4706,7 @@"nextNoAuthor": "complete the author's profile","detail": {"noAuthor": "Once the page has an author: two sentences on what they know, and a profile link",+ "confirm": "Or, if your site shows their profile, confirm it","both": "Add them in Settings › Authors: two sentences on what they know, and a LinkedIn or other profile link","bio": "Add a short bio in Settings › Authors: two sentences on what they know","links": "Add a LinkedIn or other profile link in Settings › Authors"@@ -4707,7 +4716,8 @@"bio": "{member, select, yes {{name}, whoever added them or an admin can add a short bio in Settings › Authors} other {Whoever added {name} or an admin can add a short bio in Settings › Authors}}","links": "{member, select, yes {{name}, whoever added them or an admin can add a profile link in Settings › Authors} other {Whoever added {name} or an admin can add a profile link in Settings › Authors}}"},- "done": "Short bio and profile links are in"+ "done": "Short bio and profile links are in",+ "confirmedDone": "You confirmed their profile on your site has a bio and links"}},"nudge": {@@ -4740,6 +4750,7 @@"claimsLimited": "Today's AI checks of this page's claims are used up. Paragraphs you change now are checked when you open the page again tomorrow.","aiPaused": "Sources the rules can't place wait for an AI check: this month's AI usage is used up. They count again when it renews.","keepFailed": "Couldn't keep the source. Try again.",+ "confirmFailed": "Couldn't save that. Try again.","keepFull": "This page keeps 50 sources already: replace one instead.","weakSource": "A weak source: a forum, a social post or a competitor's page. See Quality to replace or keep it.","formulas": {diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_before-publish.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_before-publish.test.tsxindex e3993e59d..c00965263 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_before-publish.test.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_before-publish.test.tsx@@ -294,6 +294,14 @@ describe('BeforePublish', () => {expect(jsonLd()).not.toHaveProperty('author');});+ it('names an author the person confirmed their site names as checked, not missing (00271)', async () => {+ await render(quality({ author: null, authorConfirmed: { real: true, profile: false } }));+ expect(rows()[0]).toContain('Author named on your site · check it');+ expect(rows()[0]).toContain('Check your CMS sets them as the author.');+ // Not the brand's Organization: the author isn't named here, so left out.+ expect(jsonLd()).not.toHaveProperty('author');+ });+it('names the team byline as missing, and keeps a live page its published date', async () => {await render(quality({ author: null }), { isNew: false, image: null });const [author, , schema] = rows();diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_before-publish.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_before-publish.tsxindex 13b2da597..0c17daa43 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_before-publish.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_before-publish.tsx@@ -130,7 +130,8 @@ export function BeforePublish({? jsonLdScript(articleJsonLd({title,- author: authorsRead ? author : undefined,+ // An author only confirmed (00271) isn't named here: left out, as unknown.+ author: authorsRead && !(!author && quality.authorConfirmed?.real) ? author : undefined,authorUrl:(author &&siteTrust?.checks.authorPages.authors.find((a) => a.name === author.name)?.url) ||@@ -154,11 +155,14 @@ export function BeforePublish({? t('author.inContent', { line: contentByline }): t('author.okDetail', { name: author.name }),}- : {- state: 'missing',- title: t('author.none'),- detail: t('author.noneDetail', { byline: quality.team }),- },+ : quality.authorConfirmed?.real+ ? // The person confirmed the author their site names (00271).+ { state: 'check', title: t('author.confirmed'), detail: t('author.confirmedDetail') }+ : {+ state: 'missing',+ title: t('author.none'),+ detail: t('author.noneDetail', { byline: quality.team }),+ },...(article? [{ state: 'check' as const, title: t('dates.title'), detail: t('dates.detail') },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.tsxindex 11c0655ce..1dd391601 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@@ -41,6 +41,7 @@ import {unmarkContentDraftReady,restoreDraftVersion,setContentDraftAuthor,+ confirmDraftAuthor,keepDraftSource,setContentDraftPageType,startAgentWriting,@@ -571,9 +572,33 @@ export function DraftEditor({// E-E-A-T from the author (and, in phase 2, the person's experience and// data), Trust from the page's figures and links (their reads from the// API): with Readability, the scores and the header chip's average (CE-039).+ // With no author picked, the person's own word for the one their site+ // names (00271): ticked here, saved behind, put back if the save fails.+ const [authorConfirmed, setAuthorConfirmed] = useState(draft.authorConfirmed);+ // One save at a time (the boxes wait): a failed one puts back the pair as saved.+ const [confirming, setConfirming] = useState(false);+ const confirmAuthor = (what: 'real' | 'profile', on: boolean) => {+ if (confirming) return;+ const before = authorConfirmed;+ // Unticking the author unticks their profile too, as the database does.+ setAuthorConfirmed(+ what === 'real' && !on ? { real: false, profile: false } : { ...before, [what]: on },+ );+ setConfirming(true);+ confirmDraftAuthor(draft.id, what, on)+ .catch((err) => {+ console.error('Failed to save the author confirmation:', err);+ setAuthorConfirmed(before);+ toast.error(t('quality.confirmFailed'));+ })+ .finally(() => setConfirming(false));+ };const eeatScore = useMemo(- () => (qualityOn && authorsRead && !inputsPending ? eeat({ author: pageAuthor, used }) : null),- [qualityOn, authorsRead, inputsPending, pageAuthor, used],+ () =>+ qualityOn && authorsRead && !inputsPending+ ? eeat({ author: pageAuthor, used, confirmed: authorConfirmed })+ : null,+ [qualityOn, authorsRead, inputsPending, pageAuthor, used, authorConfirmed],);const { checks: linkChecks, pending: linksPending } = useLinkChecks(draft.id,@@ -793,6 +818,7 @@ export function DraftEditor({used,given: inputs ? inputsGiven(inputs) : null,trust: trustScore,+ confirmed: authorConfirmed,}): [];const quality: QualityRead | null = qualityOn@@ -812,6 +838,8 @@ export function DraftEditor({claimsPaused: claimsRead.paused,claimsLimited: claimsRead.limited,claimsReading: claimsRead.reading,+ authorConfirmed,+ authorConfirming: confirming,}: null;// Quality's Pick author opens the header's menu.@@ -1674,10 +1702,17 @@ export function DraftEditor({// The byline line a brand with Add byline to content puts under the H1,// in the page's language (its Language rule, else the brand's), as// Readability reads it: the language the writer writes the page in.+ // An author the person confirmed their site names (00271) isn't the team:+ // no "By {Brand} Team" line goes in for them.const contentByline =- bylineInContent && authorsRead+ bylineInContent && authorsRead && (pageAuthor || !authorConfirmed.real)? bylineText(language, pageAuthor?.name ?? null, brandName): null;+ // The team for the CMS's author field (Export, Send to CMS), in the page's+ // language; until the authors are read, who it is by isn't known. Not for+ // an author the person confirmed their site names: the CMS keeps its own.+ const teamByline =+ authorsRead && (pageAuthor || !authorConfirmed.real) ? teamName(language, brandName) : '';// Export (CE-057), once Quality is live: where it goes, its checks and fields.// The page as it was when Export opened: what it shows stays still while open.const [exportOpen, setExportOpen] = useState<{@@ -2731,6 +2766,7 @@ export function DraftEditor({onPickAuthor={() => setAuthorMenuOpen(true)}yourInput={inputsRead.status === 'off' ? null : inputsRead}onAddInput={addInput}+ onConfirmAuthor={confirmAuthor}onKeepSource={sourcesOn ? (url) => void keepSource(url) : undefined}onAddSource={sourcesOn ? addSource : undefined}onRemoveClaim={sourcesOn ? removeClaim : undefined}@@ -2748,9 +2784,8 @@ export function DraftEditor({isNew={draft.method === 'create'}sourceUrl={draft.sourceUrl}author={pageAuthor}- // Until the authors are read, who it is by isn't known. It goes to- // the CMS's author field, so in the page's language.- teamByline={authorsRead ? teamName(language, brandName) : ''}+ teamByline={teamByline}+ siteAuthor={!pageAuthor && authorConfirmed.real}byline={contentByline}checks={exportChecks}linksPending={linksPending}@@ -2766,7 +2801,7 @@ export function DraftEditor({quality.trust?.score != null && quality.trust.score < TRUST_GATE? quality.trust.score: null,- noAuthor: quality.eeat !== null && !quality.author,+ noAuthor: quality.eeat !== null && !quality.author && !authorConfirmed.real,article: isArticlePage(pageType),onReview: () => {setExportOpen(null);@@ -2784,9 +2819,7 @@ export function DraftEditor({html={sendOpen.html}sourceUrl={draft.sourceUrl}author={pageAuthor}- // Until the authors are read, who it is by isn't known. It goes to- // the CMS's author field, so in the page's language, as Export's.- teamByline={authorsRead ? teamName(language, brandName) : ''}+ teamByline={teamByline}byline={contentByline}onFillNow={() => {setSendOpen(null);diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_export-dialog.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_export-dialog.tsxindex 7ce54fb87..b115adb0a 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_export-dialog.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_export-dialog.tsx@@ -165,6 +165,7 @@ export function ExportDialog({sourceUrl,author,teamByline,+ siteAuthor = false,byline,checks,linksPending,@@ -181,8 +182,10 @@ export function ExportDialog({/** The live page an optimized draft is for: its address is the slug. */sourceUrl: string | null;author: ContentAuthor | null;- /** The team byline; empty while the authors aren't read. */+ /** The team byline; empty while the authors aren't read, or for the site's own author. */teamByline: string;+ /** No author picked, the one the site names confirmed (00271): the CMS keeps its own. */+ siteAuthor?: boolean;/** The byline line the brand puts in the content (Add byline to content), or null. */byline: string | null;checks: PasteChecks;@@ -418,7 +421,7 @@ export function ExportDialog({value: fields.author || null,shown: fields.author? t(byline ? 'fields.authorInContent' : 'fields.authorValue', { name: fields.author })- : t('fields.noAuthor'),+ : t(siteAuthor ? 'fields.siteAuthor' : 'fields.noAuthor'),},{label: t('fields.featuredImage'),diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_quality-tab.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_quality-tab.test.tsxindex 40aa88b6f..7d97f9a4c 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_quality-tab.test.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_quality-tab.test.tsx@@ -90,6 +90,7 @@ const onPickAuthor = vi.fn();const onShowPlaceholder = vi.fn();const onAddInput = vi.fn();const onKeep = vi.fn();+const onConfirmAuthor = vi.fn();async function render(quality: QualityRead | Readability | null) {const q = quality && 'eeat' in quality ? quality : read(quality as Readability | null);@@ -103,6 +104,7 @@ async function render(quality: QualityRead | Readability | null) {onPickAuthor={onPickAuthor}onAddInput={onAddInput}onKeep={onKeep}+ onConfirmAuthor={onConfirmAuthor}/></NextIntlClientProvider>,);@@ -113,6 +115,7 @@ beforeEach(() => {onShow.mockReset();onPickAuthor.mockReset();onKeep.mockReset();+ onConfirmAuthor.mockReset();container = document.createElement('div');root = createRoot(container);});@@ -180,6 +183,45 @@ describe('QualityTab', () => {expect(container.textContent).toContain('Nothing to raise here for now');});+ it('offers to confirm the author the site names, then their profile (00271)', async () => {+ const withConfirmed = (real: boolean, profile: boolean): QualityRead => {+ const score = eeat({ author: null, confirmed: { real, profile } });+ return {+ ...read(null, null),+ eeat: score,+ authorConfirmed: { real, profile },+ todos: qualityTodos({+ eeat: score,+ author: null,+ hasAuthors: true,+ confirmed: { real, profile },+ }),+ };+ };+ await render(withConfirmed(false, false));+ const box = () => container.querySelectorAll<HTMLButtonElement>('[role="checkbox"]');+ expect(box()).toHaveLength(1);+ expect(box()[0].closest('li')!.textContent).toContain(+ 'The author is a real person, named on your site',+ );+ await act(async () => box()[0].click());+ expect(onConfirmAuthor).toHaveBeenCalledWith('real', true);++ // Confirmed: the byline checked, the profile's own box offered.+ await render(withConfirmed(true, false));+ const [byline, profile] = [...container.querySelectorAll('[aria-label="Your to-dos"] li')];+ expect(byline.textContent).toContain(+ 'You confirmed your site names a real person as the author',+ );+ expect(profile.textContent).toContain('Or, if your site shows their profile, confirm it');+ expect(box()).toHaveLength(2);+ await act(async () => box()[1].click());+ expect(onConfirmAuthor).toHaveBeenLastCalledWith('profile', true);+ expect(container.querySelector('[aria-label="Quality scores"]')!.textContent).toContain(+ 'E-E-A-T60',+ );+ });+it("lists picking the page's author as a to-do, and opens the menu", async () => {await render(read(result, null));const scores = container.querySelector('[aria-label="Quality scores"]')!;@@ -190,7 +232,7 @@ describe('QualityTab', () => {);const [row, profile] = [...todos.querySelectorAll('li')];expect(row.textContent).toBe(- "Pick the page's author · To doIt's by Acme Team now: a named person shows who stands behind the page · +60 E-E-A-TPick author",+ "Pick the page's author · To doIt's by Acme Team now: a named person shows who stands behind the page. Or, if your site names the author, confirm it · +60 E-E-A-TPick author",);// The profile waits on the author: listed, with no button yet.expect(profile.textContent).toBe(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.tsxindex 14a430f25..5566d3f9c 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@@ -1,9 +1,11 @@'use client';+import { useId } from 'react';import { useFormatter, useTranslations } from 'next-intl';import { Check } from 'lucide-react';import { Link } from '@/i18n/navigation';import { Button, buttonVariants } from '@/components/ui/button';+import { Checkbox } from '@/components/ui/checkbox';import { normalizeDomain } from '@/lib/citations/classify';import type { ContentAuthor } from '@/lib/content/authors';import { BAND_CLASSES, qualityBand } from '@/lib/content/quality';@@ -57,6 +59,13 @@ export interface QualityRead {claimsLimited?: boolean;/** Some of the page's claims aren't read yet: Trust may change (CE-045). */claimsReading?: boolean;+ /**+ * With no author picked, what the person confirmed of the author their+ * site names (00271): a real person, and their profile there.+ */+ authorConfirmed?: { real: boolean; profile: boolean };+ /** A confirmation being saved: the boxes wait for it. */+ authorConfirming?: boolean;}type ScoreName = 'eeat' | 'trust' | 'readability';@@ -94,6 +103,7 @@ export function QualityTab({onKeep,onAddSource,onRemove,+ onConfirmAuthor,}: {quality: QualityRead;/** Scrolls the draft to a passage and marks it. */@@ -108,6 +118,8 @@ export function QualityTab({onKeep?: (url: string) => void;/** Selects a claim's words and opens the link dialog on them (CE-045). */onAddSource?: (claim: ClaimMark) => void;+ /** Ticks or unticks what the person confirms of the author their site names (00271). */+ onConfirmAuthor?: (what: 'real' | 'profile', on: boolean) => void;/** Takes a claim's sentence out of the page (CE-045). */onRemove?: (claim: ClaimMark) => void;}) {@@ -178,6 +190,7 @@ export function QualityTab({onShowPlaceholder={onShowPlaceholder}onPickAuthor={onPickAuthor}onAddInput={onAddInput}+ onConfirm={onConfirmAuthor}/>))}</ul>@@ -321,9 +334,11 @@ export function useTodoCopy() {detail:todo.done && author? t('byline.done', { name: author.name })- : action === 'addAuthor'- ? t('byline.detail.addAuthor')- : t('byline.detail.pickAuthor', { byline: team }),+ : todo.done+ ? t('byline.confirmedDone')+ : action === 'addAuthor'+ ? t('byline.detail.addAuthor')+ : t('byline.detail.pickAuthor', { byline: team }),};}// What only the person can give (Brief › Your input, CE-048).@@ -342,7 +357,12 @@ export function useTodoCopy() {return {title: t('authorProfile.titleNoAuthor'),next: t('authorProfile.nextNoAuthor'),- detail: t('authorProfile.detail.noAuthor'),+ // Once the person confirmed a real author their site names, their profile there may be too.+ detail: todo.done+ ? t('authorProfile.confirmedDone')+ : todo.confirm+ ? t('authorProfile.detail.confirm')+ : t('authorProfile.detail.noAuthor'),};}const { bio, links } = authorProfile(author);@@ -373,15 +393,19 @@ function TodoRow({onShowPlaceholder,onPickAuthor,onAddInput,+ onConfirm,}: {todo: QualityTodo;quality: QualityRead;onShowPlaceholder: () => void;onPickAuthor: () => void;onAddInput?: () => void;+ onConfirm?: (what: 'real' | 'profile', on: boolean) => void;}) {const t = useTranslations('contentEditor.editor.quality');const { title, detail } = useTodoCopy()(todo, quality);+ const confirmId = useId();+ const { confirm } = todo;return (<liclassName={cn(@@ -429,6 +453,21 @@ function TodoRow({</>)}</p>+ {/* Or the person's own word for the author their site names (00271). */}+ {confirm && onConfirm && (+ <div className="mt-1.5 flex items-start gap-2">+ <Checkbox+ id={confirmId}+ className="mt-px"+ checked={confirm.on}+ disabled={quality.authorConfirming}+ onCheckedChange={(on) => onConfirm(confirm.what, on === true)}+ />+ <label htmlFor={confirmId} className="text-xs leading-snug text-foreground">+ {t(`todos.confirm.${confirm.what}`)}+ </label>+ </div>+ )}</div>{!todo.done &&todo.action &&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.tsxindex 26bc88ad1..0f12579b0 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@@ -132,6 +132,7 @@ export function EditorSidePanel({onPickAuthor,yourInput = null,onAddInput,+ onConfirmAuthor,onKeepSource,onAddSource,onRemoveClaim,@@ -190,6 +191,8 @@ export function EditorSidePanel({yourInput?: DraftInputsRead | null;/** Opens Brief › Your input: Quality's Add. */onAddInput?: () => void;+ /** Quality's tick boxes for the author the site names (00271). */+ onConfirmAuthor?: (what: 'real' | 'profile', on: boolean) => void;/** Keeps a weak source or a competitor's on the page (Quality CE-046), once phase 2 is live. */onKeepSource?: (url: string) => void;/** Selects a claim's words and opens the link dialog on them: Quality's Add source (CE-045). */@@ -441,6 +444,7 @@ export function EditorSidePanel({onShowPlaceholder={() => onShowPlaceholder?.()}onPickAuthor={() => onPickAuthor?.()}onAddInput={onAddInput}+ onConfirmAuthor={onConfirmAuthor}onKeep={onKeepSource}onAddSource={onAddSource}onRemove={onRemoveClaim}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.tsxindex 6995c1fea..b46f2fea1 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@@ -19,6 +19,7 @@ const saveContentDraft = vi.fn();const setContentDraftPageType = vi.fn();const setContentDraftAuthor = vi.fn();const keepDraftSource = vi.fn();+const confirmDraftAuthor = vi.fn();const checkDraftClaims = vi.fn();const checkDraftLinks = vi.fn();const getSiteTrust = vi.fn();@@ -85,6 +86,7 @@ vi.mock('@/lib/actions/content-drafts', () => ({setContentDraftPageType: (...args: unknown[]) => setContentDraftPageType(...args),setContentDraftAuthor: (...args: unknown[]) => setContentDraftAuthor(...args),keepDraftSource: (...args: unknown[]) => keepDraftSource(...args),+ confirmDraftAuthor: (...args: unknown[]) => confirmDraftAuthor(...args),checkDraftClaims: (...args: unknown[]) => checkDraftClaims(...args),checkDraftLinks: (...args: unknown[]) => checkDraftLinks(...args),}));@@ -209,6 +211,7 @@ const draft = (over: Partial<ContentDraft> = {}): ContentDraft => ({authorId: null,rules: { set: null, source: null, overrides: {}, textRules: [] },keptSources: [],+ authorConfirmed: { real: false, profile: false },action: null,agentState: null,agentSince: null,@@ -284,6 +287,7 @@ beforeEach(() => {setContentDraftPageType.mockReset().mockResolvedValue(undefined);setContentDraftAuthor.mockReset().mockResolvedValue(undefined);keepDraftSource.mockReset();+ confirmDraftAuthor.mockReset().mockResolvedValue(undefined);checkDraftClaims.mockReset().mockResolvedValue({ blocks: [], pending: 0, limited: false });checkDraftLinks.mockReset().mockResolvedValue({ links: [], skipped: [] });getSiteTrust.mockReset().mockRejectedValue(new Error('not in this test'));@@ -2476,6 +2480,57 @@ describe('the side panel', () => {).not.toContainEqual(expect.stringContaining('Quality'));});+ it('saves the author the site names as confirmed, and puts it back when the save fails (00271)', async () => {+ process.env.NEXT_PUBLIC_CONTENT_QUALITY_PHASE = '1';+ getContentAuthors.mockResolvedValue({+ authors: [],+ brands: [{ id: 'b1', name: 'Acme' }],+ me: { id: 'u1', role: 'admin' },+ });+ getContentDraft.mockResolvedValue(readable);+ window.innerWidth = 1440;+ await renderPage();+ const chip = [...container.querySelectorAll<HTMLButtonElement>('header button')].find((b) =>+ b.textContent?.startsWith('Quality'),+ )!;+ await act(async () => chip.click());+ const box = () => panel()!.querySelector<HTMLButtonElement>('[role="checkbox"]')!;+ expect(box().getAttribute('aria-checked')).toBe('false');+ await act(async () => box().click());+ expect(confirmDraftAuthor).toHaveBeenCalledWith(readable.id, 'real', true);+ expect(box().getAttribute('aria-checked')).toBe('true');+ expect(panel()!.textContent).toContain('E-E-A-T60');++ vi.spyOn(console, 'error').mockImplementation(() => {});+ try {+ confirmDraftAuthor.mockRejectedValueOnce(new Error('offline'));+ await act(async () => box().click());+ expect(toast.error).toHaveBeenCalledWith("Couldn't save that. Try again.");+ expect(box().getAttribute('aria-checked')).toBe('true');++ // Unticking the author unticks the profile too: a failed save puts both back.+ const profile = () => panel()!.querySelectorAll<HTMLButtonElement>('[role="checkbox"]')[1]!;+ await act(async () => profile().click());+ expect(profile().getAttribute('aria-checked')).toBe('true');+ confirmDraftAuthor.mockRejectedValueOnce(new Error('offline'));+ await act(async () => box().click());+ expect(box().getAttribute('aria-checked')).toBe('true');+ expect(profile().getAttribute('aria-checked')).toBe('true');++ // One save at a time: the boxes wait for it.+ let saved!: () => void;+ confirmDraftAuthor.mockReturnValueOnce(new Promise<void>((resolve) => (saved = resolve)));+ await act(async () => profile().click());+ expect(profile().getAttribute('aria-checked')).toBe('false');+ expect(box().disabled).toBe(true);+ expect(profile().disabled).toBe(true);+ await act(async () => saved());+ expect(profile().disabled).toBe(false);+ } finally {+ vi.mocked(console.error).mockRestore();+ }+ });+it('scores the page as written, in the header and Instructions › Quality', async () => {process.env.NEXT_PUBLIC_CONTENT_QUALITY_PHASE = '1';getContentDraft.mockResolvedValue(readable);@@ -3601,6 +3656,26 @@ describe('the side panel', () => {}});+ it('sends no author for one the site names, nor the team’s byline line (00271)', async () => {+ process.env.NEXT_PUBLIC_CONTENT_QUALITY_PHASE = '1';+ getContentAuthors.mockResolvedValue({+ authors: [],+ brands: [{ id: 'b1', name: 'Acme', bylineInContent: true }],+ me: { id: 'u1', role: 'admin' },+ });+ getContentDraft.mockResolvedValue(+ draft({ pageType: 'blog_post', authorConfirmed: { real: true, profile: false } }),+ );+ await renderPage();+ await act(async () => button('Send to CMS')!.click());+ await act(async () => inDialog('Continue to send').click());+ await act(async () => inDialog('Send').click());+ // The CMS keeps its own author.+ expect(sendPagesToCms).toHaveBeenCalledWith('b1', [+ expect.objectContaining({ draftId: 'd1', author: null, html: '<p>Teams trust it.</p>' }),+ ]);+ });+it('opens Before you publish first while Quality is on', async () => {process.env.NEXT_PUBLIC_CONTENT_QUALITY_PHASE = '1';getContentDraft.mockResolvedValue(draft({ pageType: 'blog_post' }));@@ -3750,6 +3825,17 @@ describe('the side panel', () => {expect(inDialog('Download Word').disabled).toBe(false);});+ it('leaves the author to the CMS for one the site names, with no warning (00271)', async () => {+ getContentDraft.mockResolvedValue(+ draft({ pageType: 'blog_post', authorConfirmed: { real: true, profile: false } }),+ );+ await renderPage();+ await act(async () => button('Export')!.click());+ expect(dialog()!.textContent).toContain('Content · ready to paste');+ expect(dialog()!.textContent).not.toContain('no author yet');+ expect(dialog()!.textContent).toContain("AuthorYour site's own: your CMS keeps it");+ });+it('names the team in the page’s language in the CMS author field', async () => {brandState.brands = [{ id: 'b1', language: 'tr' } as never, { id: 'b2' }];try {diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/library/page.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/library/page.test.tsxindex e8c453801..4410c8826 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/content/library/page.test.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/library/page.test.tsx@@ -403,6 +403,7 @@ describe('Send to CMS from a Library row (#1331)', () => {bodyHtml: '<h1>Pipeline forecasting</h1><p>Teams save [figure] hours.</p>',sourceUrl: null,authorId: null,+ authorConfirmed: false,language: null,},],@@ -525,6 +526,7 @@ describe('Send to CMS from a Library row (#1331)', () => {bodyHtml: '<h1>Pipeline forecasting</h1><p>Teams trust it.</p>',sourceUrl: null,authorId: null,+ authorConfirmed: false,language: null,},],diff --git a/web/src/lib/actions/content-drafts-pages.test.ts b/web/src/lib/actions/content-drafts-pages.test.tsindex 624aa5d6a..1593a9c5d 100644--- a/web/src/lib/actions/content-drafts-pages.test.ts+++ b/web/src/lib/actions/content-drafts-pages.test.ts@@ -44,6 +44,7 @@ const page = (n: number) => ({body_html: `<h1>Draft ${n}</h1>`,source_url: null,author_id: null,+ author_real_at: null,rules: null,});@@ -63,6 +64,7 @@ describe('getContentDraftPages', () => {bodyHtml: '<h1>Draft 3</h1>',sourceUrl: null,authorId: null,+ authorConfirmed: false,language: null,});expect(reads).toEqual([{ brand: BRAND, ids: [id(3), id(9), id(1)] }]);@@ -71,16 +73,21 @@ describe('getContentDraftPages', () => {it('gives the author and the language the draft’s own Language rule names', async () => {const rules = (language: unknown) => ({ set: null, overrides: { language } });stored = [- { ...page(1), author_id: id(7), rules: rules({ value: ' Turkish ' }) },+ {+ ...page(1),+ author_id: id(7),+ author_real_at: '2026-10-24T10:00:00Z',+ rules: rules({ value: ' Turkish ' }),+ },// Off, or on without a value of its own: the brand's language.{ ...page(2), rules: rules({ on: false, value: 'German' }) },{ ...page(3), rules: rules({ on: true }) },];const { pages } = await getContentDraftPages(BRAND, [id(1), id(2), id(3)]);- expect(pages.map((p) => [p.authorId, p.language])).toEqual([- [id(7), 'Turkish'],- [null, null],- [null, null],+ expect(pages.map((p) => [p.authorId, p.authorConfirmed, p.language])).toEqual([+ [id(7), true, 'Turkish'],+ [null, false, null],+ [null, false, null],]);});diff --git a/web/src/lib/actions/content-drafts.test.ts b/web/src/lib/actions/content-drafts.test.tsindex f9b3ba77f..1154fdcbf 100644--- a/web/src/lib/actions/content-drafts.test.ts+++ b/web/src/lib/actions/content-drafts.test.ts@@ -93,6 +93,7 @@ const {restoreDraftVersion,saveContentDraft,setContentDraftAuthor,+ confirmDraftAuthor,setContentDraftPageType,unmarkContentDraftReady,} = await import('./content-drafts');@@ -349,6 +350,28 @@ describe('setContentDraftAuthor', () => {});});+describe('confirmDraftAuthor (00271)', () => {+ it('ticks or unticks the author the site names, or their profile; the database stamps who and when', async () => {+ updated = { id: DRAFT };+ await confirmDraftAuthor(DRAFT, 'real', true);+ expect(calls[0]).toMatchObject({ op: 'update', filters: [['eq', 'id', DRAFT]] });+ expect(Object.keys(calls[0].value as object)).toEqual(['author_real_at']);+ expect((calls[0].value as { author_real_at: string }).author_real_at).toMatch(/^\d{4}-/);+ await confirmDraftAuthor(DRAFT, 'profile', false);+ expect(calls[1]).toMatchObject({ op: 'update', value: { author_profile_at: null } });+ });++ it('refuses what it doesn’t know, and says so when the draft isn’t the member’s', async () => {+ await expect(confirmDraftAuthor('d1', 'real', true)).rejects.toThrow('invalid');+ await expect(confirmDraftAuthor(DRAFT, 'bio' as 'real', true)).rejects.toThrow('invalid');+ await expect(confirmDraftAuthor(DRAFT, 'real', 'yes' as unknown as boolean)).rejects.toThrow(+ 'invalid',+ );+ expect(calls).toEqual([]);+ await expect(confirmDraftAuthor(DRAFT, 'real', true)).rejects.toThrow('not_found');+ });+});+describe('classifyDraftSources (Quality CE-046, part b)', () => {afterEach(() => vi.unstubAllGlobals());diff --git a/web/src/lib/actions/content-drafts.ts b/web/src/lib/actions/content-drafts.tsindex 21f08a472..c4e00588b 100644--- a/web/src/lib/actions/content-drafts.ts+++ b/web/src/lib/actions/content-drafts.ts@@ -227,7 +227,7 @@ export async function getContentDraft(id: string): Promise<ContentDraft | null>const { data, error } = await supabase.from('content_drafts').select(- `id, brand_id, title, page_type, page_type_source, method, status, body_html, author, author_id, source_url, rules, kept_sources, action_id, agent_state, agent_state_at, agent_run, updated_at, archived_at, ${BRAND_SITE}, actions(action_no)`,+ `id, brand_id, title, page_type, page_type_source, method, status, body_html, author, author_id, source_url, rules, kept_sources, author_real_at, author_profile_at, action_id, agent_state, agent_state_at, agent_run, updated_at, archived_at, ${BRAND_SITE}, actions(action_no)`,).eq('id', id).maybeSingle();@@ -248,6 +248,7 @@ export async function getContentDraft(id: string): Promise<ContentDraft | null>authorId: data.author_id,rules: draftRulesSchema.safeParse(data.rules).data ?? NO_DRAFT_RULES,keptSources: data.kept_sources ?? [],+ authorConfirmed: { real: !!data.author_real_at, profile: !!data.author_profile_at },action:data.action_id && data.actions? { id: data.action_id, number: data.actions.action_no }@@ -268,6 +269,11 @@ export interface DraftPage {sourceUrl: string | null;/** Who the page is by (CE-038), for Send to CMS. */authorId: string | null;+ /**+ * The person confirmed their site names the page's author (00271): with+ * none picked, Send to CMS names no team, the CMS keeps its own.+ */+ authorConfirmed: boolean;/** The language the draft's own Language rule names, or null: the brand's. */language: string | null;}@@ -308,7 +314,7 @@ export async function getContentDraftPages(const supabase = await createClient();const { data, error } = await supabase.from('content_drafts')- .select('id, title, body_html, source_url, author_id, rules')+ .select('id, title, body_html, source_url, author_id, author_real_at, rules').eq('brand_id', brandId).in('id', parsed.data);if (error) throw new Error(error.message);@@ -321,6 +327,7 @@ export async function getContentDraftPages(bodyHtml: row.body_html,sourceUrl: row.source_url,authorId: row.author_id,+ authorConfirmed: row.author_real_at !== null,language: draftLanguage(row.rules),},]),@@ -1364,6 +1371,35 @@ export async function setContentDraftAuthor(id: string, authorId: string | null)if (!data) throw new Error('not_found');}+/**+ * Confirms, or takes back, what the person says of the author their site+ * names (00271): a real person (`real`), their profile with a bio and links+ * (`profile`). Who and when are stamped by the database, from the session.+ */+export async function confirmDraftAuthor(+ id: string,+ what: 'real' | 'profile',+ on: boolean,+): Promise<void> {+ if (+ !draftId.safeParse(id).success ||+ (what !== 'real' && what !== 'profile') ||+ typeof on !== 'boolean'+ ) {+ throw new Error('invalid');+ }+ const at = on ? new Date().toISOString() : null;+ const supabase = await createClient();+ const { data, error } = await supabase+ .from('content_drafts')+ .update(what === 'real' ? { author_real_at: at } : { author_profile_at: at })+ .eq('id', id)+ .select('id')+ .maybeSingle();+ if (error) throw new Error(error.message);+ if (!data) throw new Error('not_found');+}+/*** Keeps a weak source or a competitor's on the page (Quality CE-046): the* person trusts it, so it no longer lowers Trust. Returns the draft's keptdiff --git a/web/src/lib/content/cms-send.test.ts b/web/src/lib/content/cms-send.test.tsindex 285b75a6a..53ee23488 100644--- a/web/src/lib/content/cms-send.test.ts+++ b/web/src/lib/content/cms-send.test.ts@@ -178,6 +178,7 @@ describe('cmsSource', () => {bodyHtml: '<h1>Pour-over</h1><p>Brew it slowly.</p>',sourceUrl: 'https://acme.example/pour-over',authorId: 'a1',+ authorConfirmed: false,language: null,};const ada = { id: 'a1', name: 'Ada Lovelace' } as ContentAuthor;@@ -230,6 +231,19 @@ describe('cmsSource', () => {expect(source({ brandName: '' }).teamByline).toBe('');});+ it('names no team, nor its byline line, for an author the site names (00271)', () => {+ const confirmed = { ...stored, authorId: null, authorConfirmed: true };+ expect(source({ authors: authors(true), page: confirmed })).toMatchObject({+ author: null,+ teamByline: '',+ byline: null,+ });+ // A picked author is the page's either way.+ expect(+ source({ authors: authors(true), page: { ...stored, authorConfirmed: true } }),+ ).toMatchObject({ author: ada, teamByline: 'Acme Team', byline: 'By Ada Lovelace' });+ });+it('gives no author or team byline while Quality is off', () => {expect(source({ authors: null })).toMatchObject({ author: null, teamByline: '', byline: null });});diff --git a/web/src/lib/content/cms-send.ts b/web/src/lib/content/cms-send.tsindex 021f1cd2e..f6f64ba47 100644--- a/web/src/lib/content/cms-send.ts+++ b/web/src/lib/content/cms-send.ts@@ -135,7 +135,9 @@ export interface CmsSource {* field as Export names it, and the brand's byline line, both in the page's* language (its own Language rule, else the brand's; a workspace's My rules* for the type aren't read here). `authors` is null while Quality is off,- * as the editor reads none then.+ * as the editor reads none then. With no author picked and the one the site+ * names confirmed (00271), neither the team nor its byline line: the CMS+ * keeps its own author.*/export function cmsSource({page,@@ -153,14 +155,15 @@ export function cmsSource({const language = page.language ?? brandLanguage;const author = authors?.authors.find((a) => a.id === page.authorId) ?? null;const inContent = authors?.brands.find((b) => b.id === brandId)?.bylineInContent ?? false;+ const confirmed = !author && page.authorConfirmed;return {draftId: page.id,title: page.title,html: publishableHtml(page.bodyHtml),sourceUrl: page.sourceUrl,author,- teamByline: authors ? teamName(language, brandName) : '',- byline: inContent ? bylineText(language, author?.name ?? null, brandName) : null,+ teamByline: authors && !confirmed ? teamName(language, brandName) : '',+ byline: inContent && !confirmed ? bylineText(language, author?.name ?? null, brandName) : null,};}diff --git a/web/src/lib/content/drafts.ts b/web/src/lib/content/drafts.tsindex 97aecd590..60b94473c 100644--- a/web/src/lib/content/drafts.ts+++ b/web/src/lib/content/drafts.ts@@ -168,6 +168,11 @@ export interface ContentDraft {rules: DraftRules;/** Weak or competitors' sources the person kept (Quality CE-046, 00263): they don't lower Trust. */keptSources: string[];+ /**+ * With no author picked, what a member confirmed of the author the site+ * names (00271): a real person, and their profile with a bio and links.+ */+ authorConfirmed: { real: boolean; profile: boolean };/** The Action Center action the draft is the work of (CE-022), shown as "from Action AC-214". */action: { id: string; number: number } | null;/** Where the Content Agent is on it (CE-015): the editor waits while it writes. */diff --git a/web/src/lib/content/quality-checks.test.ts b/web/src/lib/content/quality-checks.test.tsindex a02c24af8..f539f6c08 100644--- a/web/src/lib/content/quality-checks.test.ts+++ b/web/src/lib/content/quality-checks.test.ts@@ -47,6 +47,17 @@ describe('eeat (Phase 1: the author)', () => {expect(scoreGain(result, ['byline'])).toBe(60);});+ it('counts the author the site names once the person confirms them, the profile with them', () => {+ expect(eeat({ author: null, confirmed: { real: true, profile: false } }).score).toBe(60);+ expect(eeat({ author: null, confirmed: { real: true, profile: true } }).score).toBe(100);+ // A profile with no real author confirmed counts nothing.+ expect(eeat({ author: null, confirmed: { real: false, profile: true } }).score).toBe(0);+ // A picked author is read as it is: confirmations don't add to it.+ expect(+ eeat({ author: author({ sameAs: [] }), confirmed: { real: true, profile: true } }).score,+ ).toBe(80);+ });+it('gives half the profile points for a bio or links alone', () => {// byline 15 + bio 5 of 25.expect(eeat({ author: author({ sameAs: [] }) }).score).toBe(80);diff --git a/web/src/lib/content/quality-checks.ts b/web/src/lib/content/quality-checks.tsindex 8f2f35b35..50eb12b4f 100644--- a/web/src/lib/content/quality-checks.ts+++ b/web/src/lib/content/quality-checks.ts@@ -123,8 +123,15 @@ export function authorProfile(author: ContentAuthor | null): { bio: boolean; linexport function eeat({author,used = null,+ confirmed = null,}: {author: ContentAuthor | null;+ /**+ * With no author picked, what the person confirmed of the one their site+ * names (00271): a real person (the byline's points), and their profile+ * there with a bio and links (the profile's, with the first).+ */+ confirmed?: { real: boolean; profile: boolean } | null;/*** Phase 2 (CE-048): whether the page uses the person's experience and* their data (Brief › Your input, inputsUsed); left out before.@@ -147,10 +154,18 @@ export function eeat({},]: []),- { id: 'byline', points: author ? EEAT_WEIGHTS.byline : 0, max: EEAT_WEIGHTS.byline },+ {+ id: 'byline',+ points: author || confirmed?.real ? EEAT_WEIGHTS.byline : 0,+ max: EEAT_WEIGHTS.byline,+ },{id: 'authorBio',- points: author ? (EEAT_WEIGHTS.authorBio * ((bio ? 1 : 0) + (links ? 1 : 0))) / 2 : 0,+ points: author+ ? (EEAT_WEIGHTS.authorBio * ((bio ? 1 : 0) + (links ? 1 : 0))) / 2+ : confirmed?.real && confirmed.profile+ ? EEAT_WEIGHTS.authorBio+ : 0,max: EEAT_WEIGHTS.authorBio,},]);diff --git a/web/src/lib/content/quality-todos.test.ts b/web/src/lib/content/quality-todos.test.tsindex 57e1bf420..7bc2cbee7 100644--- a/web/src/lib/content/quality-todos.test.ts+++ b/web/src/lib/content/quality-todos.test.ts@@ -185,4 +185,36 @@ describe('qualityTodos', () => {it('has no input to-dos before Your input is read', () => {expect(todos(author()).map((t) => t.id)).toEqual(['byline', 'authorProfile']);});++ it('offers to confirm the author the site names instead of picking one, the profile once they are', () => {+ const read = (real: boolean, profile: boolean) =>+ qualityTodos({+ eeat: eeat({ author: null, confirmed: { real, profile } }),+ author: null,+ hasAuthors: true,+ confirmed: { real, profile },+ }).map(({ id, done, confirm }) => ({ id, done, confirm }));+ expect(read(false, false)).toEqual([+ { id: 'byline', done: false, confirm: { what: 'real', on: false } },+ { id: 'authorProfile', done: false, confirm: undefined },+ ]);+ expect(read(true, false)).toEqual([+ { id: 'byline', done: true, confirm: { what: 'real', on: true } },+ { id: 'authorProfile', done: false, confirm: { what: 'profile', on: false } },+ ]);+ expect(read(true, true)[1]).toEqual({+ id: 'authorProfile',+ done: true,+ confirm: { what: 'profile', on: true },+ });+ // A picked author: nothing to confirm.+ expect(+ qualityTodos({+ eeat: eeat({ author: author() }),+ author: author(),+ hasAuthors: true,+ confirmed: { real: false, profile: false },+ }).map((t) => t.confirm),+ ).toEqual([undefined, undefined]);+ });});diff --git a/web/src/lib/content/quality-todos.ts b/web/src/lib/content/quality-todos.tsindex c462f1953..8e23df762 100644--- a/web/src/lib/content/quality-todos.ts+++ b/web/src/lib/content/quality-todos.ts@@ -49,6 +49,11 @@ export interface QualityTodo {given?: boolean;/** How many it is about (placeholders). */count?: number;+ /**+ * With no author picked: the person's own word for the author their site+ * names (00271), a tick box beside the to-do, and whether it's ticked.+ */+ confirm?: { what: 'real' | 'profile'; on: boolean };}/**@@ -68,6 +73,7 @@ export function qualityTodos({used = null,given = null,trust = null,+ confirmed = null,}: {eeat: Score<EeatCheckId> | null;author: ContentAuthor | null;@@ -85,6 +91,8 @@ export function qualityTodos({given?: { experience: boolean; data: boolean; quote: boolean } | null;/** Trust, for an expert quote's gain. */trust?: Score<TrustCheckId> | null;+ /** What the person confirmed of the author their site names (00271), or null where they can't. */+ confirmed?: { real: boolean; profile: boolean } | null;}): QualityTodo[] {const fill: QualityTodo[] =placeholders.count || placeholders.had@@ -100,12 +108,16 @@ export function qualityTodos({]: [];if (!eeat || eeat.score === null) return fill;+ // No author picked: the one the site names may be confirmed instead, the+ // profile once the author is.+ const byConfirm = !author && !!confirmed;const byline: QualityTodo = {id: 'byline',- done: !!author,+ done: !!author || (byConfirm && confirmed.real),gain: scoreGain(eeat, ['byline']),score: 'eeat',action: author || hasAuthors ? 'pickAuthor' : 'addAuthor',+ ...(byConfirm ? { confirm: { what: 'real' as const, on: confirmed.real } } : {}),};const { bio, links } = authorProfile(author);return [@@ -113,10 +125,13 @@ export function qualityTodos({byline,{id: 'authorProfile',- done: !!author && bio && links,+ done: (!!author && bio && links) || (byConfirm && confirmed.real && confirmed.profile),gain: scoreGain(eeat, ['authorBio']),score: 'eeat',action: author && canEdit ? 'editAuthor' : null,+ ...(byConfirm && confirmed.real+ ? { confirm: { what: 'profile' as const, on: confirmed.profile } }+ : {}),},...(used? ([diff --git a/web/src/types/supabase.ts b/web/src/types/supabase.tsindex 887960bfa..4f1690bc5 100644--- a/web/src/types/supabase.ts+++ b/web/src/types/supabase.ts@@ -983,6 +983,10 @@ export type Database = {archived_by: string | nullauthor: stringauthor_id: string | null+ author_profile_at: string | null+ author_profile_by: string | null+ author_real_at: string | null+ author_real_by: string | nullbody_html: stringbrief: Json | nullbrand_id: string@@ -1017,6 +1021,10 @@ export type Database = {archived_by?: string | nullauthor?: stringauthor_id?: string | null+ author_profile_at?: string | null+ author_profile_by?: string | null+ author_real_at?: string | null+ author_real_by?: string | nullbody_html?: stringbrief?: Json | nullbrand_id: string@@ -1051,6 +1059,10 @@ export type Database = {archived_by?: string | nullauthor?: stringauthor_id?: string | null+ author_profile_at?: string | null+ author_profile_by?: string | null+ author_real_at?: string | null+ author_real_by?: string | nullbody_html?: stringbrief?: Json | nullbrand_id?: string