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): keep on the brief what the pages AI cites have, and write toward it (learning C2) (#1723)
Cihanaf9fb80ea760
diff --git a/docs/guides/content-editor.mdx b/docs/guides/content-editor.mdxindex 97db9810e..68f50cd03 100644--- a/docs/guides/content-editor.mdx+++ b/docs/guides/content-editor.mdx@@ -139,7 +139,7 @@ Words in square brackets, such as `[figure, source]` or `[competitor]`, are placThe panel opens on **Rules**. Its tabs are **Rules · Brief · Sources · Live page**.- **Rules**: the rules the page is written to, for its page type. They come in five groups: page type rules, length and structure, fan-outs and keywords, links and sources, and style. Most rules can be turned on or off, and many have a value you can change; its status is read from the page as you write. Rules marked **AI check** are judged by the Content Agent and aren't counted yet. Changes apply to this draft only: **Save as my rules** keeps them for your workspace's next drafts of this type, and **Reset** goes back to the default set. Under **Your text rules**, write a rule in your own words, or **Paste many** from a style guide.-- **Brief**: the page type, target URL, goal, audience, length, outline and keywords. **Edit brief** to change it. **Rebuild outline** writes a new outline from the sources you keep, each H2 answering a search AI ran for your prompts (a fan-out). **Rewrite from brief** (a new page) or **Suggest changes from brief** (an existing page) hands the page to the Content Agent; the page you have now stays in History.+- **Brief**: the page type, target URL, goal, audience, length, outline and keywords. **Edit brief** to change it. **Rebuild outline** writes a new outline from the sources you keep, each H2 answering a search AI ran for your prompts (a fan-out). It also reads a few of the pages AI cited for them: their typical length shows beside **Length**, and **Cited pages have** lists what Site Audit's checks find on at least half of them (an FAQ schema, tables, statistics…). The Content Agent then writes the page toward what its text can carry (tables, statistics, quotes…), not its schema, dates or byline, which your site sets. **Rewrite from brief** (a new page) or **Suggest changes from brief** (an existing page) hands the page to the Content Agent; the page you have now stays in History.- **Sources**: what the draft is built from: **Prompts**, **Fan-outs**, **Cited pages** (what AI quotes today) and **Search Console** queries. Each source shows where the draft uses it. Uncheck one to leave it out, or **Add source** (a prompt, a page URL or a Search Console query), then **Rebuild with selection**.- **Live page**: for a draft that optimizes a live page, how that page does now: **Citations**, **AI visits**, **Google clicks** and **Prompts cited**, over 7 days to a year, against the period before. It is not a forecast of what the draft will get. Prompts that stopped citing the page are marked **Lost**, and **Use the lost prompts in this draft** adds them to the sources and rebuilds the brief. A new page has nothing to measure yet.diff --git a/server/src/lib/content-brief.js b/server/src/lib/content-brief.jsindex 5cc189287..f6ee4811c 100644--- a/server/src/lib/content-brief.js+++ b/server/src/lib/content-brief.js@@ -538,6 +538,18 @@ export async function rebuildDraftBrief({ draftId, brandId, sources, rules = []}}+/**+ * The cited pages' read as the brief keeps it: their length (CE-030), and+ * what Site Audit's checks find on them (learning C2), when read.+ */+function citedOf(cited) {+ if (!cited) return { citedLength: null };+ return {+ citedLength: { characters: cited.characters, pages: cited.pages },+ ...(cited.features ? { citedFeatures: cited.features } : {}),+ };+}+/** The rebuild itself, step by step: nothing is saved once it is stopped. */async function briefWithRun({draft,@@ -611,7 +623,7 @@ async function briefWithRun({pages: sources.pages.length,queries: sources.queries.length,},- citedLength: await citedLength,+ ...citedOf(await citedLength),};// Stopped meanwhile: the brief stays as it was.await stopIfStopped(run);diff --git a/server/src/lib/content-brief.test.js b/server/src/lib/content-brief.test.jsindex b788aba00..1fadb0ec5 100644--- a/server/src/lib/content-brief.test.js+++ b/server/src/lib/content-brief.test.js@@ -293,6 +293,20 @@ describe('rebuildDraftBrief', () => {]);});+ /** What the cited pages have (learning C2), read with their length, kept on the brief. */+ it('keeps what the cited pages have beside their length', async () => {+ const features = { pages: 2, checks: [{ key: 'faq-schema', label: 'FAQ schema', pages: 2 }] };+ citedPagesLength.mockResolvedValue({ characters: 4300, pages: 2, features });+ const brief = await rebuildDraftBrief({ draftId: DRAFT, brandId: BRAND, sources: sources() });+ expect(brief.citedLength).toEqual({ characters: 4300, pages: 2 });+ expect(brief.citedFeatures).toEqual(features);++ citedPagesLength.mockResolvedValue(null);+ const none = await rebuildDraftBrief({ draftId: DRAFT, brandId: BRAND, sources: sources() });+ expect(none.citedLength).toBeNull();+ expect(none).not.toHaveProperty('citedFeatures');+ });+it('refuses a draft of another brand before any model call', async () => {rows.content_drafts = {...rows.content_drafts,diff --git a/server/src/lib/content-cited-length.js b/server/src/lib/content-cited-length.jsindex d5771bf8c..c08de3e90 100644--- a/server/src/lib/content-cited-length.js+++ b/server/src/lib/content-cited-length.js@@ -3,6 +3,8 @@ import { linkKey } from './content-links.js';import { logger } from './logger.js';import { MAX_CONTENT_LENGTH, extractPageContent, textLength } from './page-content.js';import { fetchPage } from './safe-fetch.js';+import { FEATURE_CHECKS, pageFeatures } from './action-center/page-features.js';+import { describeSignal } from './audit/rubric.js';/*** The cited pages' length (Content Editor v1.1, CE-030): the brief's Length@@ -23,13 +25,38 @@ export const CITED_MIN_PAGES = 2;/** Shorter than this, what was read is a wall (a sign-in, a consent page), not the page. */export const CITED_MIN_CHARACTERS = 500;-/** One page's main text length; it throws when the page can't be read, or `signal` ends it. */+/**+ * One page's main text length, and what Site Audit's checks find on it+ * (learning C2) from the same read; it throws when the page can't be read,+ * or `signal` ends it.+ */async function readLength(url, signal) {const page = await fetchPage(url, { timeoutMs: READ_TIMEOUT_MS, signal });const content = extractPageContent(page.html, page.url);// Past what a page brought into the editor may be (content-pages.js): no benchmark.if (content.html.length > MAX_CONTENT_LENGTH) return null;- return textLength(content.html);+ return {+ length: textLength(content.html),+ features: await pageFeatures(page.url, page.html).catch(() => null),+ };+}++/**+ * The checks at least half the pages read pass (learning C2), the most+ * passed first; none from fewer than CITED_MIN_PAGES pages with features.+ */+export function citedFeatures(reads) {+ const read = reads.filter((r) => r.features?.checks);+ if (read.length < CITED_MIN_PAGES) return null;+ const needed = Math.ceil(read.length / 2);+ const checks = FEATURE_CHECKS.map((key) => ({+ key,+ label: describeSignal(key)?.label ?? key,+ pages: read.filter((r) => r.features.checks[key] === 'pass').length,+ }))+ .filter((check) => check.pages >= needed)+ .sort((a, b) => b.pages - a.pages);+ return { pages: read.length, checks };}/**@@ -76,13 +103,15 @@ function median(lengths) {/*** How long the cited pages kept are: the median of those read, rounded to a* hundred, and how many were read; null when fewer than two could be (no- * number is made up). The page the draft optimizes is left out, however its address+ * number is made up). With them, what Site Audit's checks find on the same+ * pages (citedFeatures, learning C2), from the same reads. The page the draft optimizes is left out, however its address* was cited (www, tracking parameters): it is no benchmark for itself.** @param {{ brandId: string, pages: { url: string }[], ownUrl?: string | null, signal?: AbortSignal | null }} input* `signal`: the run's Stop, which settles it on null at once.- * @param {{ read?: (url: string) => Promise<number | null> }} [deps] tests replace the read- * @returns {Promise<{ characters: number, pages: number } | null>}+ * @param {{ read?: (url: string) => Promise<number | { length: number, features: object | null } | null> }} [deps]+ * tests replace the read+ * @returns {Promise<{ characters: number, pages: number, features?: object } | null>}*/export async function citedPagesLength({ brandId, pages, ownUrl = null, signal = null },@@ -99,16 +128,29 @@ export async function citedPagesLength(async function measure({ brandId, pages, ownUrl, signal }, read) {try {const own = ownUrl ? linkKey(ownUrl) : null;- const urls = [...new Set(pages.map((p) => p.url))].filter(- (url) => !own || linkKey(url) !== own,- );+ // One page cited under two addresses (www, tracking parameters) is read+ // once, at the first: twice, it would count as two of the cited pages.+ const seen = new Set();+ const urls = pages+ .map((p) => p.url)+ .filter((url) => {+ const key = linkKey(url) ?? url;+ if ((own && key === own) || seen.has(key)) return false;+ seen.add(key);+ return true;+ });if (!urls.length) return null;const picked = await brandCited(brandId, urls);- const lengths = (- await Promise.all(picked.map((url) => read(url, signal).catch(() => null)))- ).filter((n) => Number.isFinite(n) && n >= CITED_MIN_CHARACTERS);- if (lengths.length < CITED_MIN_PAGES) return null;- return { characters: Math.round(median(lengths) / 100) * 100, pages: lengths.length };+ const reads = (await Promise.all(picked.map((url) => read(url, signal).catch(() => null))))+ .map((r) => (typeof r === 'number' ? { length: r } : r))+ .filter((r) => Number.isFinite(r?.length) && r.length >= CITED_MIN_CHARACTERS);+ if (reads.length < CITED_MIN_PAGES) return null;+ const features = citedFeatures(reads);+ return {+ characters: Math.round(median(reads.map((r) => r.length)) / 100) * 100,+ pages: reads.length,+ ...(features ? { features } : {}),+ };} catch (err) {// A benchmark is never worth the brief: it goes without one.logger.warn({ err }, 'cited pages length read failed');diff --git a/server/src/lib/content-cited-length.test.js b/server/src/lib/content-cited-length.test.jsindex 7aadfdff7..f38bf9d7a 100644--- a/server/src/lib/content-cited-length.test.js+++ b/server/src/lib/content-cited-length.test.js@@ -39,7 +39,8 @@ vi.mock('./logger.js', () => ({ logger: { warn: vi.fn(), error: vi.fn() } }));const fetchPage = vi.fn();vi.mock('./safe-fetch.js', () => ({ fetchPage: (...args) => fetchPage(...args) }));-const { CITED_LENGTH_PAGES, citedPagesLength } = await import('./content-cited-length.js');+const { CITED_LENGTH_PAGES, citedFeatures, citedPagesLength } =+ await import('./content-cited-length.js');const url = (n) => `https://site${n}.example/a`;const page = (n) => ({ url: url(n), kind: 'blog' });@@ -100,6 +101,19 @@ describe('citedPagesLength', () => {expect(read.mock.calls.map(([address]) => address)).toEqual([url(2)]);});+ it('reads one page cited under two addresses once, at the first', async () => {+ const variant = 'https://www.site2.example/a/?utm_source=chatgpt.com';+ urlRows.push({ id: 9, url: variant });+ citedIds.push(9);+ const read = vi.fn(async () => 3000);+ const result = await citedPagesLength(+ { brandId: BRAND, pages: [page(2), { url: variant }, page(3)] },+ { read },+ );+ expect(read.mock.calls.map(([address]) => address)).toEqual([url(2), url(3)]);+ expect(result).toEqual({ characters: 3000, pages: 2 });+ });+it('reads at most a few, in the Sources order, and stops looking once it has them', async () => {const read = vi.fn(async () => 2000);await citedPagesLength(@@ -137,7 +151,10 @@ describe('citedPagesLength', () => {const result = await citedPagesLength({ brandId: BRAND, pages: [1, 2, 3].map(page) });expect(fetchPage).toHaveBeenCalledWith(url(1), { timeoutMs: 8000, signal: null });// Their main text, about 1,000 characters; the page that answered 404 isn't counted.- expect(result).toEqual({ characters: 1000, pages: 2 });+ expect(result).toMatchObject({ characters: 1000, pages: 2 });+ // What Site Audit's checks find on the same two pages (learning C2): both have an H1.+ expect(result.features.pages).toBe(2);+ expect(result.features.checks.every((check) => check.pages >= 1)).toBe(true);});it('makes up no number: null when fewer than two could be read, or only walls were', async () => {@@ -185,3 +202,33 @@ describe('citedPagesLength', () => {expect(read).not.toHaveBeenCalled();});});++/** What the cited pages have (learning C2), from the reads the length takes. */+describe('citedFeatures', () => {+ const read = (...passing) => ({+ length: 3000,+ features: { words: 500, checks: Object.fromEntries(passing.map((key) => [key, 'pass'])) },+ });++ it('names the checks at least half the pages read pass, the most passed first', () => {+ expect(+ citedFeatures([read('faq-schema', 'tables'), read('faq-schema'), read('lists')]),+ ).toEqual({+ pages: 3,+ checks: [{ key: 'faq-schema', label: expect.any(String), pages: 2 }],+ });+ });++ it('says nothing from fewer than two pages with features', () => {+ expect(citedFeatures([read('faq-schema'), { length: 3000, features: null }])).toBeNull();+ });++ it('keeps the length when a reader gives only numbers', async () => {+ const lengths = { [url(1)]: 4000, [url(2)]: 4400 };+ const result = await citedPagesLength(+ { brandId: BRAND, pages: [page(1), page(2)] },+ { read: async (address) => lengths[address] },+ );+ expect(result).toEqual({ characters: 4200, pages: 2 });+ });+});diff --git a/server/src/lib/content-writer.js b/server/src/lib/content-writer.jsindex 4e08051d6..0cfda9146 100644--- a/server/src/lib/content-writer.js+++ b/server/src/lib/content-writer.js@@ -296,6 +296,40 @@ export function sourcedPage(page, known, people = knownPeople()) {};}+/**+ * The cited pages' checks the writer can give a page in its body HTML. Not+ * its schema (FAQ schema, JSON-LD), date markup or freshness, which the+ * site's template or CMS sets, nor its byline, which would name a person the+ * writer doesn't know. The Brief tab still shows them all.+ */+export const WRITER_CHECKS = Object.freeze([+ 'length',+ 'structural-depth',+ 'h2-coverage',+ 'lists',+ 'tables',+ 'statistic-density',+ 'quotations',+ 'citation-density',+ 'outbound-authority-links',+ 'readability',+]);++/**+ * What the pages AI cites for the draft's prompts have (learning C2), as the+ * brief's rebuild read them through Site Audit's checks: seen, not guessed.+ * Only what the writer can give the page (WRITER_CHECKS).+ */+export function citedHave(features) {+ const checks = (features?.checks ?? []).filter(+ (c) => c?.label && c.pages > 0 && WRITER_CHECKS.includes(c.key),+ );+ if (!checks.length) return '';+ return `\nWhat the pages AI cites for these prompts have (Site Audit's checks, ${features.pages} pages read): ${checks+ .map((c) => `${c.label} on ${c.pages}`)+ .join('; ')}. Give the page these where they serve its readers.`;+}+/** The brief as the model reads it: the draft's own, else its opportunity's. */export function briefText(draftBrief, opportunityBrief, { links = true } = {}) {if (draftBrief?.outline?.length || draftBrief?.goal) {@@ -309,7 +343,7 @@ export function briefText(draftBrief, opportunityBrief, { links = true } = {}) {Audience: ${draftBrief.audience || '—'}Outline:${list(sections)}-Keywords: ${(draftBrief.keywords ?? []).join(', ') || '—'}${plan ? `\n${plan}` : ''}`;+Keywords: ${(draftBrief.keywords ?? []).join(', ') || '—'}${citedHave(draftBrief.citedFeatures)}${plan ? `\n${plan}` : ''}`;}if (opportunityBrief?.outline?.length) {const sections = opportunityBrief.outline.map(diff --git a/server/src/lib/content-writer.test.js b/server/src/lib/content-writer.test.jsindex d3b618309..0a6d5b208 100644--- a/server/src/lib/content-writer.test.js+++ b/server/src/lib/content-writer.test.js@@ -94,6 +94,7 @@ vi.mock('./content-agent.js', async (importOriginal) => ({}));const {+ WRITER_CHECKS,WRITE_SYSTEM_PROMPT,buildWritePrompt,headingCase,@@ -110,6 +111,7 @@ const {const { WRITING_GUARDRAIL } = await import('./content-brief.js');const { REWRITE_SYSTEM_PROMPT } = await import('./content-rewrite.js');const { NAME_PLACEHOLDER, QUOTE_PLACEHOLDER, knownPeople } = await import('./content-people.js');+const { FEATURE_CHECKS } = await import('./action-center/page-features.js');const { textLength } = await import('./content-rewrite.js');const {PLACEHOLDER_RULE,@@ -277,6 +279,53 @@ describe('briefText', () => {).toContain('- Gear');expect(briefText(null, null)).toMatch(/^No brief/);});++ /** What the pages AI cites have (learning C2), as the brief's rebuild read them. */+ it('tells the writer what the cited pages have, seen rather than guessed', () => {+ const text = briefText(+ {+ goal: 'Sell beans',+ outline: [{ heading: 'Ratio' }],+ citedFeatures: {+ pages: 4,+ checks: [+ { key: 'statistic-density', label: 'Statistics', pages: 3 },+ { key: 'tables', label: 'Tables', pages: 2 },+ ],+ },+ },+ null,+ );+ expect(text).toContain(+ "What the pages AI cites for these prompts have (Site Audit's checks, 4 pages read): Statistics on 3; Tables on 2. Give the page these where they serve its readers.",+ );+ expect(briefText({ goal: 'Sell beans', outline: [] }, null)).not.toContain('pages AI cites');+ });++ it("doesn't ask the writer for what the page's body can't give: schema, dates, a byline", () => {+ const template = [+ { key: 'faq-schema', label: 'FAQ schema', pages: 4 },+ { key: 'json-ld-presence', label: 'JSON-LD', pages: 4 },+ { key: 'date-markup', label: 'Date markup', pages: 3 },+ { key: 'freshness', label: 'Freshness', pages: 3 },+ { key: 'author-byline', label: 'Author byline', pages: 2 },+ ];+ const brief = (checks) => ({+ goal: 'Sell beans',+ outline: [{ heading: 'Ratio' }],+ citedFeatures: { pages: 4, checks },+ });+ const text = briefText(+ brief([...template, { key: 'tables', label: 'Tables', pages: 2 }]),+ null,+ );+ expect(text).toContain("(Site Audit's checks, 4 pages read): Tables on 2.");+ for (const { label } of template) expect(text).not.toContain(label);+ // Nothing the body can give: no line at all.+ expect(briefText(brief(template), null)).not.toContain('pages AI cites');+ // Each is a check the cited pages are read for.+ expect(WRITER_CHECKS.filter((key) => !FEATURE_CHECKS.includes(key))).toEqual([]);+ });});describe('startDraftWriting', () => {diff --git a/web/messages/en.json b/web/messages/en.jsonindex 202a075c0..ddf75205b 100644--- a/web/messages/en.json+++ b/web/messages/en.json@@ -5159,6 +5159,9 @@"lengthValue": "{count} characters · ~{words} words","lengthFrom": "From the rules","lengthFromCited": "From the rules · a typical cited page has {count} characters (median of {pages})",+ "citedHave": "Cited pages have",+ "citedHaveCheck": "{check} ({count} of {of})",+ "citedHaveFrom": "Site Audit's checks on the same cited pages","outline": "Outline","answers": "Answers “{fanout}”","keywords": "Keywords",diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_brief-tab.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_brief-tab.test.tsxindex 0d828e54a..c0c14ce2b 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_brief-tab.test.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_brief-tab.test.tsx@@ -165,6 +165,26 @@ describe('the Brief tab', () => {);});+ it('says what the cited pages have, from the same read (learning C2)', async () => {+ await render({+ status: 'ready',+ brief: {+ ...brief,+ citedLength: { characters: 4300, pages: 3 },+ citedFeatures: {+ pages: 3,+ checks: [+ { key: 'faq-schema', label: 'FAQ schema', pages: 3 },+ { key: 'tables', label: 'Tables', pages: 2 },+ ],+ },+ },+ });+ expect(fields()['Cited pages have']).toBe(+ "FAQ schema (3 of 3) · Tables (2 of 3)Site Audit's checks on the same cited pages",+ );+ });+it('offers Run Agent for a new page without a brief, or H2s added by hand', async () => {await render({ status: 'ready', brief: null },diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_brief-tab.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_brief-tab.tsxindex 0a2663ec3..5aac2dea3 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_brief-tab.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_brief-tab.tsx@@ -257,6 +257,24 @@ export function BriefTab({: t('lengthFrom')}</span></dd>+ {/* What the cited pages have (learning C2), read with their length. */}+ {brief?.citedFeatures && brief.citedFeatures.checks.length > 0 && (+ <>+ <dt className="text-muted-foreground">{t('citedHave')}</dt>+ <dd>+ {brief.citedFeatures.checks+ .map((check) =>+ t('citedHaveCheck', {+ check: check.label,+ count: check.pages,+ of: brief.citedFeatures!.pages,+ }),+ )+ .join(' · ')}+ <span className="block text-muted-foreground">{t('citedHaveFrom')}</span>+ </dd>+ </>+ )}</dl>{brief && brief.outline.length > 0 ? (diff --git a/web/src/lib/content/brief.test.ts b/web/src/lib/content/brief.test.tsindex 0afa6bb51..d37b6ef69 100644--- a/web/src/lib/content/brief.test.ts+++ b/web/src/lib/content/brief.test.ts@@ -117,6 +117,17 @@ describe('the brief', () => {).toBe(false);});+ /** What the cited pages have (learning C2); one that doesn't read as that is left out. */+ it('keeps what the cited pages have, and leaves out a shape it can’t read', () => {+ const features = { pages: 3, checks: [{ key: 'faq-schema', label: 'FAQ schema', pages: 2 }] };+ expect(draftBriefSchema.parse({ ...brief, citedFeatures: features }).citedFeatures).toEqual(+ features,+ );+ expect(+ draftBriefSchema.parse({ ...brief, citedFeatures: { pages: 0, checks: [] } }).citedFeatures,+ ).toBeUndefined();+ });+it('reads version 2 as the server writes it, and a brief from before it as it was (brief-v2.json)', () => {const read = draftBriefSchema.parse(v2);// Every field kept: the server's sample, as it's tested there too.diff --git a/web/src/lib/content/brief.ts b/web/src/lib/content/brief.tsindex 22650c054..5aaf87950 100644--- a/web/src/lib/content/brief.ts+++ b/web/src/lib/content/brief.ts@@ -92,6 +92,14 @@ export interface DraftBrief {* none could be.*/citedLength?: { characters: number; pages: number } | null;+ /**+ * What Site Audit's checks find on the same cited pages (learning C2): the+ * checks at least half of them pass, by name, and on how many pages.+ */+ citedFeatures?: {+ pages: number;+ checks: { key: string; label: string; pages: number }[];+ } | null;/** 2 once it plans with the brief rules (2026); absent before. */version?: 2;/** The page's essentials, for its top. */@@ -221,6 +229,22 @@ export const draftBriefSchema = z.object({}).nullable().optional(),+ citedFeatures: z+ .object({+ pages: z.number().int().min(1).max(30),+ checks: z+ .array(+ z.object({+ key: z.string().min(1).max(60),+ label: z.string().min(1).max(120),+ pages: z.number().int().min(1).max(30),+ }),+ )+ .max(20),+ })+ .nullable()+ .optional()+ .catch(undefined),// A later version reads as the rules it shares with this one.version: z.literal(2).optional().catch(undefined),tldr: v2text(L.tldr),