From e2919d2efd5ad65552fea678392ac3f2e18ab601 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Mon, 16 Nov 2026 19:19:58 -0800 Subject: [PATCH 01/10] fix(library): attribute sim counts by clause and table row, not capitalized words --- scripts/check-library-content.test.ts | 27 ++++++++++- scripts/check-library-content.ts | 64 ++++++++++++++++----------- 2 files changed, 64 insertions(+), 27 deletions(-) diff --git a/scripts/check-library-content.test.ts b/scripts/check-library-content.test.ts index 57dc6171d4b..bb10b2a1559 100644 --- a/scripts/check-library-content.test.ts +++ b/scripts/check-library-content.test.ts @@ -330,6 +330,26 @@ describe('check-library-content', () => { ['Sim listens for events with 300+ triggers.', '300+ triggers', 'stale'], ['Sim has **1,000+** integrations.', '1,000+ integrations', 'overstates'], ['Sim has 1,000+ Integrations.', '1,000+ Integrations', 'overstates'], + [ + '[Sim](https://www.sim.ai) combines [Chat](https://docs.sim.ai/execution/chat) with 1,000+ integrations.', + '1,000+ integrations', + 'overstates', + ], + [ + "Sim's Agent blocks support 28 LLM providers, and the workspace connects to 1,000+ integrations.", + '1,000+ integrations', + 'overstates', + ], + [ + '| Sim | Governed agents across SaaS tools | 1,000+ integrations |', + '1,000+ integrations', + 'overstates', + ], + [ + '| [Sim](https://www.sim.ai) | Governed agents | 1,000+ integrations |', + '1,000+ integrations', + 'overstates', + ], ])('rejects a Sim count the catalog does not support: %s', async (body, claim, verdict) => { writePost('library', 'post', body) expect(await findingsFor('library', 'post')).toEqual([ @@ -361,7 +381,12 @@ describe('check-library-content', () => { "Zapier lists 9,000+ integrations, while Sim's 280+ integrations focus on agents.", 'Compared with Sim, MindStudio advertises 1,000+ integrations.', 'Sim is open source. Workato cites 14,000+ integrations.', - 'Sim can call any tool that the connector marketplaces built on open protocols expose, often 1,000+ integrations.', + 'Unlike Sim, Zapier lists 9,000+ integrations.', + 'Like Sim, n8n ships 2,000+ integrations.', + 'Sim has 280+ integrations, while Zapier lists 9,000+ integrations.', + "Sim has 280+ integrations, fewer than Zapier's 9,000+ integrations.", + '| n8n | Self-hosted, unlike Sim | 2,000+ integrations |', + 'Teams that need 20 integrations and five builders often pick Sim.', '```text\nSim has 1,000+ integrations\n```', '````md\n```text\nSim has 1,000+ integrations\n````', ].join('\n\n') diff --git a/scripts/check-library-content.ts b/scripts/check-library-content.ts index d754043ea1e..58ae366d062 100644 --- a/scripts/check-library-content.ts +++ b/scripts/check-library-content.ts @@ -33,8 +33,9 @@ * against the generated catalog (`INTEGRATION_TOTALS`): no higher than the total, and no * lower than 90% of it. Answer engines quote these figures, so an overclaim such as * "1,000+ integrations" or a figure left from an older catalog spreads to third-party sites. - * A count belongs to Sim when the nearest "Sim" before it on the line is at most 12 words back - * with no capitalized word between, which leaves competitor counts alone. + * A count belongs to Sim when "Sim" comes before it in the same clause and no other product's + * possessive directly precedes it, or when it sits in a table row whose label cell is Sim. + * Sentence ends and contrasts ("while", "unlike", "compared with") start a new clause. * Blog and changelog posts are dated, so their counts are true as of publication. * * Run one post with `--slug
/` or `--slug `. @@ -138,35 +139,46 @@ const ROUTE_FILES = ['page.tsx', 'page.ts', 'route.tsx', 'route.ts'] const COUNT_CLAIM = /\b(\d{1,3}(?:,\d{3})+|\d+)\+?\s+(integrations|actions|triggers)\b/gi /** Inline emphasis and code markers, which would otherwise split "**1,000+** integrations". */ const INLINE_MARKERS = /\*\*|__|[*`]/g -const SIM_NAME = /\bSim\b/g -const SIM_CLAIM_MAX_WORDS = 12 +const SIM_NAME = /\bSim\b/ +/** A table row's label cell naming Sim, plain or linked: "Sim" or "[Sim](https://www.sim.ai)". */ +const SIM_LABEL = /^\[?Sim\b/ +/** Words that turn a sentence toward another product: "while Zapier lists...", "Unlike Sim, ...". */ +const CONTRAST = String.raw`(?:while|whereas|but|unlike|compared (?:with|to)|versus|vs\.?)` +/** A sentence end, or a contrast that hands the rest of the sentence to another subject. */ +const CLAUSE_BREAK = new RegExp(String.raw`(?<=[.!?;:])\s+|,?\s+${CONTRAST}\s+`, 'i') +/** An opening comparison ("Unlike Sim, ...", "Like Sim, ...") whose main clause is about another product. */ +const LEADING_CONTRAST = new RegExp(String.raw`^(?:like|${CONTRAST})\b[^,]*,\s*`, 'i') +/** The product whose possessive directly precedes a count, as in "Zapier's 9,000+". */ +const POSSESSIVE_OWNER = /([\w.-]+)['’]s\s*$/ /** A Sim count below this share of the catalog total is left from an older catalog. */ const SIM_COUNT_FLOOR = 0.9 -/** - * The counts on one line of text that belong to Sim, with the claim as written. A sentence or - * clause that moves on to another product starts with a capitalized word, which ends Sim's claim. - */ +/** Every count in a table row whose first cell names Sim. */ +function simTableRowCounts(row: string): RegExpMatchArray[] { + return SIM_LABEL.test(row.split('|')[1]?.trim() ?? '') ? [...row.matchAll(COUNT_CLAIM)] : [] +} + +/** Each count whose clause names Sim before it, unless another product's possessive owns it. */ +function simProseCounts(text: string): RegExpMatchArray[] { + return text.split(CLAUSE_BREAK).flatMap((sentence) => { + const clause = sentence.replace(LEADING_CONTRAST, '') + return [...clause.matchAll(COUNT_CLAIM)].filter((match) => { + const before = clause.slice(0, match.index) + const owner = POSSESSIVE_OWNER.exec(before)?.[1] + return SIM_NAME.test(before) && (owner === undefined || owner === 'Sim') + }) + }) +} + +/** The counts on one line of text that belong to Sim, with the claim as written. */ function simCountClaims(line: string): { claim: string; count: number; unit: SimCountUnit }[] { - const claims: { claim: string; count: number; unit: SimCountUnit }[] = [] const text = line.replace(INLINE_MARKERS, '') - for (const match of text.matchAll(COUNT_CLAIM)) { - const before = text.slice(0, match.index) - const lastSim = [...before.matchAll(SIM_NAME)].at(-1) - if (lastSim?.index === undefined) continue - const words = before - .slice(lastSim.index + lastSim[0].length) - .split(/\s+/) - .map((word) => word.replace(/^[^A-Za-z0-9]+/, '')) - .filter(Boolean) - if (words.length > SIM_CLAIM_MAX_WORDS || words.some((word) => /^[A-Z]/.test(word))) continue - claims.push({ - claim: match[0], - count: Number.parseInt(match[1].replaceAll(',', ''), 10), - unit: match[2].toLowerCase() as SimCountUnit, - }) - } - return claims + const matches = text.trimStart().startsWith('|') ? simTableRowCounts(text) : simProseCounts(text) + return matches.map((match) => ({ + claim: match[0], + count: Number.parseInt(match[1].replaceAll(',', ''), 10), + unit: match[2].toLowerCase() as SimCountUnit, + })) } function isSection(value: string): value is Section { From d6b1536ca2406bedbb9ff2a942a03b1104767b07 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Mon, 16 Nov 2026 19:29:10 -0800 Subject: [PATCH 02/10] fix(library): handle colon lists, parenthetical comparisons, relative clauses, prefixes, and linked names in sim-count --- scripts/check-library-content.test.ts | 9 ++++++- scripts/check-library-content.ts | 38 +++++++++++++++++++-------- 2 files changed, 35 insertions(+), 12 deletions(-) diff --git a/scripts/check-library-content.test.ts b/scripts/check-library-content.test.ts index bb10b2a1559..20d25c84fc8 100644 --- a/scripts/check-library-content.test.ts +++ b/scripts/check-library-content.test.ts @@ -330,6 +330,9 @@ describe('check-library-content', () => { ['Sim listens for events with 300+ triggers.', '300+ triggers', 'stale'], ['Sim has **1,000+** integrations.', '1,000+ integrations', 'overstates'], ['Sim has 1,000+ Integrations.', '1,000+ Integrations', 'overstates'], + ['Sim offers: 1,000+ integrations.', '1,000+ integrations', 'overstates'], + ['Sim, unlike Zapier, has 1,000+ integrations.', '1,000+ integrations', 'overstates'], + ['Sim, which ships 1,000+ integrations, runs agents.', '1,000+ integrations', 'overstates'], [ '[Sim](https://www.sim.ai) combines [Chat](https://docs.sim.ai/execution/chat) with 1,000+ integrations.', '1,000+ integrations', @@ -383,13 +386,17 @@ describe('check-library-content', () => { 'Sim is open source. Workato cites 14,000+ integrations.', 'Unlike Sim, Zapier lists 9,000+ integrations.', 'Like Sim, n8n ships 2,000+ integrations.', + '- Unlike Sim, Zapier lists 9,000+ integrations.', + "Sim has fewer than [Zapier](https://zapier.com)'s 9,000+ integrations.", + 'Sim is an alternative to Zapier, which has 9,000+ integrations.', 'Sim has 280+ integrations, while Zapier lists 9,000+ integrations.', "Sim has 280+ integrations, fewer than Zapier's 9,000+ integrations.", '| n8n | Self-hosted, unlike Sim | 2,000+ integrations |', 'Teams that need 20 integrations and five builders often pick Sim.', '```text\nSim has 1,000+ integrations\n```', '````md\n```text\nSim has 1,000+ integrations\n````', - ].join('\n\n') + ].join('\n\n'), + { faq: '\n - q: "Is Sim like n8n?"\n a: "Like Sim, n8n ships 2,000+ integrations."' } ) expect(await findingsFor('library', 'post')).toEqual([]) }) diff --git a/scripts/check-library-content.ts b/scripts/check-library-content.ts index 58ae366d062..d8d2fba5df6 100644 --- a/scripts/check-library-content.ts +++ b/scripts/check-library-content.ts @@ -139,15 +139,25 @@ const ROUTE_FILES = ['page.tsx', 'page.ts', 'route.tsx', 'route.ts'] const COUNT_CLAIM = /\b(\d{1,3}(?:,\d{3})+|\d+)\+?\s+(integrations|actions|triggers)\b/gi /** Inline emphasis and code markers, which would otherwise split "**1,000+** integrations". */ const INLINE_MARKERS = /\*\*|__|[*`]/g +/** A Markdown link, read as its visible text so "[Zapier](https://zapier.com)'s" names Zapier. */ +const LINK_TEXT = /\[([^\]\n]*)\]\([^)\n]*\)/g +/** List, heading, and quote markers, or a quoted YAML key such as `a: "`, ahead of the sentence. */ +const LINE_PREFIX = /^\s*(?:(?:[-*+>]|\d+[.)]|#{1,6})\s+)*(?:\w+:\s*["'])?/ const SIM_NAME = /\bSim\b/ -/** A table row's label cell naming Sim, plain or linked: "Sim" or "[Sim](https://www.sim.ai)". */ -const SIM_LABEL = /^\[?Sim\b/ -/** Words that turn a sentence toward another product: "while Zapier lists...", "Unlike Sim, ...". */ +/** Words that turn a sentence toward another product: "while Zapier lists ...", "unlike Zapier". */ const CONTRAST = String.raw`(?:while|whereas|but|unlike|compared (?:with|to)|versus|vs\.?)` -/** A sentence end, or a contrast that hands the rest of the sentence to another subject. */ -const CLAUSE_BREAK = new RegExp(String.raw`(?<=[.!?;:])\s+|,?\s+${CONTRAST}\s+`, 'i') -/** An opening comparison ("Unlike Sim, ...", "Like Sim, ...") whose main clause is about another product. */ -const LEADING_CONTRAST = new RegExp(String.raw`^(?:like|${CONTRAST})\b[^,]*,\s*`, 'i') +/** A comparison set off by commas inside a sentence, as in "Sim, unlike Zapier, has ...". */ +const PARENTHETICAL_COMPARISON = new RegExp(String.raw`,\s+(?:like|${CONTRAST})\s+[^,\d]*,`, 'gi') +/** + * A sentence end, a contrast that hands the rest of the sentence to another subject, or a + * relative clause about a product other than Sim ("Zapier, which has ..."). + */ +const CLAUSE_BREAK = new RegExp( + String.raw`(?<=[.!?;])\s+|,?\s+${CONTRAST}\s+|(? { - const clause = sentence.replace(LEADING_CONTRAST, '') + const sentences = text + .replace(LINE_PREFIX, '') + .replace(PARENTHETICAL_COMPARISON, '') + .split(CLAUSE_BREAK) + return sentences.flatMap((sentence) => { + const clause = sentence.replace(LEADING_COMPARISON, '') return [...clause.matchAll(COUNT_CLAIM)].filter((match) => { const before = clause.slice(0, match.index) const owner = POSSESSIVE_OWNER.exec(before)?.[1] @@ -172,7 +188,7 @@ function simProseCounts(text: string): RegExpMatchArray[] { /** The counts on one line of text that belong to Sim, with the claim as written. */ function simCountClaims(line: string): { claim: string; count: number; unit: SimCountUnit }[] { - const text = line.replace(INLINE_MARKERS, '') + const text = line.replace(INLINE_MARKERS, '').replace(LINK_TEXT, '$1') const matches = text.trimStart().startsWith('|') ? simTableRowCounts(text) : simProseCounts(text) return matches.map((match) => ({ claim: match[0], From ef60353de2e5e7e88a7d4ee7aed1d2d00eb34f91 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Mon, 16 Nov 2026 19:37:02 -0800 Subject: [PATCH 03/10] fix(library): keep sim relative clauses attached, anchor parenthetical comparisons to sim, and detect pipe-less table rows --- scripts/check-library-content.test.ts | 10 ++++++++- scripts/check-library-content.ts | 32 +++++++++++++++------------ 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/scripts/check-library-content.test.ts b/scripts/check-library-content.test.ts index 20d25c84fc8..37751012626 100644 --- a/scripts/check-library-content.test.ts +++ b/scripts/check-library-content.test.ts @@ -333,6 +333,13 @@ describe('check-library-content', () => { ['Sim offers: 1,000+ integrations.', '1,000+ integrations', 'overstates'], ['Sim, unlike Zapier, has 1,000+ integrations.', '1,000+ integrations', 'overstates'], ['Sim, which ships 1,000+ integrations, runs agents.', '1,000+ integrations', 'overstates'], + [ + 'Sim is an AI workspace, which connects to 1,000+ integrations.', + '1,000+ integrations', + 'overstates', + ], + ['Sim, unlike n8n, has 1,000+ integrations.', '1,000+ integrations', 'overstates'], + ['Sim | Governed agents | 1,000+ integrations |', '1,000+ integrations', 'overstates'], [ '[Sim](https://www.sim.ai) combines [Chat](https://docs.sim.ai/execution/chat) with 1,000+ integrations.', '1,000+ integrations', @@ -388,7 +395,8 @@ describe('check-library-content', () => { 'Like Sim, n8n ships 2,000+ integrations.', '- Unlike Sim, Zapier lists 9,000+ integrations.', "Sim has fewer than [Zapier](https://zapier.com)'s 9,000+ integrations.", - 'Sim is an alternative to Zapier, which has 9,000+ integrations.', + 'Sim has 280+ integrations, unlike Zapier, which has 9,000+ integrations.', + 'n8n | Alternative to Sim | 2,000+ integrations |', 'Sim has 280+ integrations, while Zapier lists 9,000+ integrations.', "Sim has 280+ integrations, fewer than Zapier's 9,000+ integrations.", '| n8n | Self-hosted, unlike Sim | 2,000+ integrations |', diff --git a/scripts/check-library-content.ts b/scripts/check-library-content.ts index d8d2fba5df6..3a99b00f76d 100644 --- a/scripts/check-library-content.ts +++ b/scripts/check-library-content.ts @@ -36,6 +36,8 @@ * A count belongs to Sim when "Sim" comes before it in the same clause and no other product's * possessive directly precedes it, or when it sits in a table row whose label cell is Sim. * Sentence ends and contrasts ("while", "unlike", "compared with") start a new clause. + * A count whose owner is ambiguous within its clause is treated as Sim's; when it belongs to + * another product, name that product as its owner ("Zapier's 9,000+") or give it a sentence. * Blog and changelog posts are dated, so their counts are true as of publication. * * Run one post with `--slug
/` or `--slug `. @@ -146,16 +148,16 @@ const LINE_PREFIX = /^\s*(?:(?:[-*+>]|\d+[.)]|#{1,6})\s+)*(?:\w+:\s*["'])?/ const SIM_NAME = /\bSim\b/ /** Words that turn a sentence toward another product: "while Zapier lists ...", "unlike Zapier". */ const CONTRAST = String.raw`(?:while|whereas|but|unlike|compared (?:with|to)|versus|vs\.?)` -/** A comparison set off by commas inside a sentence, as in "Sim, unlike Zapier, has ...". */ -const PARENTHETICAL_COMPARISON = new RegExp(String.raw`,\s+(?:like|${CONTRAST})\s+[^,\d]*,`, 'gi') /** - * A sentence end, a contrast that hands the rest of the sentence to another subject, or a - * relative clause about a product other than Sim ("Zapier, which has ..."). + * A comparison set off by commas right after Sim, as in "Sim, unlike Zapier, has ...". The span + * ends at the first comma that is not a thousands separator, so "Sim, unlike n8n, ..." matches. */ -const CLAUSE_BREAK = new RegExp( - String.raw`(?<=[.!?;])\s+|,?\s+${CONTRAST}\s+|(? cell.trim()).find((cell) => cell !== '') ?? '' + return SIM_NAME.test(label.split(/\s/)[0]) + ? cells.flatMap((cell) => [...cell.matchAll(COUNT_CLAIM)]) : [] } @@ -174,7 +177,7 @@ function simTableRowCounts(row: string): RegExpMatchArray[] { function simProseCounts(text: string): RegExpMatchArray[] { const sentences = text .replace(LINE_PREFIX, '') - .replace(PARENTHETICAL_COMPARISON, '') + .replace(SIM_PARENTHETICAL, 'Sim') .split(CLAUSE_BREAK) return sentences.flatMap((sentence) => { const clause = sentence.replace(LEADING_COMPARISON, '') @@ -189,7 +192,8 @@ function simProseCounts(text: string): RegExpMatchArray[] { /** The counts on one line of text that belong to Sim, with the claim as written. */ function simCountClaims(line: string): { claim: string; count: number; unit: SimCountUnit }[] { const text = line.replace(INLINE_MARKERS, '').replace(LINK_TEXT, '$1') - const matches = text.trimStart().startsWith('|') ? simTableRowCounts(text) : simProseCounts(text) + const cells = text.split('|') + const matches = cells.length > 2 ? simTableRowCounts(cells) : simProseCounts(text) return matches.map((match) => ({ claim: match[0], count: Number.parseInt(match[1].replaceAll(',', ''), 10), @@ -486,7 +490,7 @@ export async function checkPost( count > total ? `"${claim}" overstates Sim's catalog, which has ${total} ${unit}.` : `"${claim}" is stale: Sim's catalog has ${total} ${unit}.`, - `Write ${formatLowerBound(total)} ${unit}, the catalog-derived figure (INTEGRATION_TOTALS in packages/deployment-config/src/integration-totals.ts).` + `Write ${formatLowerBound(total)} ${unit}, the catalog-derived figure (INTEGRATION_TOTALS in packages/deployment-config/src/integration-totals.ts). If the count is another product's, name it as the owner ("Zapier's 9,000+") or give it its own sentence.` ) } } From 4d56436a32588bfc7f0012972990e72624e8c714 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Mon, 16 Nov 2026 19:46:02 -0800 Subject: [PATCH 04/10] fix(library): remove sim-count comparison asides for any subject and keep counted openers --- scripts/check-library-content.test.ts | 8 ++++++++ scripts/check-library-content.ts | 27 +++++++++++++++++++-------- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/scripts/check-library-content.test.ts b/scripts/check-library-content.test.ts index 37751012626..65ac0d2e076 100644 --- a/scripts/check-library-content.test.ts +++ b/scripts/check-library-content.test.ts @@ -339,6 +339,11 @@ describe('check-library-content', () => { 'overstates', ], ['Sim, unlike n8n, has 1,000+ integrations.', '1,000+ integrations', 'overstates'], + [ + 'While Sim has 1,000+ integrations, Zapier focuses on simple automations.', + '1,000+ integrations', + 'overstates', + ], ['Sim | Governed agents | 1,000+ integrations |', '1,000+ integrations', 'overstates'], [ '[Sim](https://www.sim.ai) combines [Chat](https://docs.sim.ai/execution/chat) with 1,000+ integrations.', @@ -396,6 +401,9 @@ describe('check-library-content', () => { '- Unlike Sim, Zapier lists 9,000+ integrations.', "Sim has fewer than [Zapier](https://zapier.com)'s 9,000+ integrations.", 'Sim has 280+ integrations, unlike Zapier, which has 9,000+ integrations.', + 'Zapier, unlike Sim, has 9,000+ integrations.', + 'Zapier, like Sim, has 9,000+ integrations.', + 'Sim, unlike Zapier, which has 9,000+ integrations, is open source.', 'n8n | Alternative to Sim | 2,000+ integrations |', 'Sim has 280+ integrations, while Zapier lists 9,000+ integrations.', "Sim has 280+ integrations, fewer than Zapier's 9,000+ integrations.", diff --git a/scripts/check-library-content.ts b/scripts/check-library-content.ts index 3a99b00f76d..0dc8d69d1d7 100644 --- a/scripts/check-library-content.ts +++ b/scripts/check-library-content.ts @@ -149,17 +149,24 @@ const SIM_NAME = /\bSim\b/ /** Words that turn a sentence toward another product: "while Zapier lists ...", "unlike Zapier". */ const CONTRAST = String.raw`(?:while|whereas|but|unlike|compared (?:with|to)|versus|vs\.?)` /** - * A comparison set off by commas right after Sim, as in "Sim, unlike Zapier, has ...". The span - * ends at the first comma that is not a thousands separator, so "Sim, unlike n8n, ..." matches. + * A comparison set off by commas, as in "Sim, unlike Zapier, has ..." or "Zapier, like Sim, has + * ...", removed so the sentence keeps its subject. The span ends at the first comma that is not a + * thousands separator, and it is kept when a relative clause follows ("unlike Zapier, which has"). */ -const SIM_PARENTHETICAL = new RegExp( - String.raw`\bSim,\s+(?:like|${CONTRAST})\s+(?:[^,]|,(?=\d))*?,(?!\d)`, +const PARENTHETICAL_COMPARISON = new RegExp( + String.raw`,\s+(?:like|${CONTRAST})\s+(?:[^,]|,(?=\d))*?,(?!\d)(?!\s*(?:which|that|who)\b)`, 'gi' ) /** A sentence end, or a contrast that hands the rest of the sentence to another subject. */ const CLAUSE_BREAK = new RegExp(String.raw`(?<=[.!?;])\s+|,?\s+${CONTRAST}\s+`, 'i') -/** An opening comparison ("Unlike Sim, ...") whose main clause is about another product. */ -const LEADING_COMPARISON = new RegExp(String.raw`^(?:like|${CONTRAST})\b[^,]*,\s*`, 'i') +/** + * An opening comparison ("Unlike Sim, ...") whose main clause is about another product. An opener + * that states a count of its own ("While Sim has 280+ integrations, ...") is kept. + */ +const LEADING_COMPARISON = new RegExp( + String.raw`^(?:like|${CONTRAST})\b(?:[^,]|,(?=\d))*?,(?!\d)\s*`, + 'i' +) /** The product whose possessive directly precedes a count, as in "Zapier's 9,000+". */ const POSSESSIVE_OWNER = /([\w.-]+)['’]s\s*$/ /** A Sim count below this share of the catalog total is left from an older catalog. */ @@ -177,10 +184,14 @@ function simTableRowCounts(cells: string[]): RegExpMatchArray[] { function simProseCounts(text: string): RegExpMatchArray[] { const sentences = text .replace(LINE_PREFIX, '') - .replace(SIM_PARENTHETICAL, 'Sim') + .replace(PARENTHETICAL_COMPARISON, '') .split(CLAUSE_BREAK) return sentences.flatMap((sentence) => { - const clause = sentence.replace(LEADING_COMPARISON, '') + const opener = LEADING_COMPARISON.exec(sentence)?.[0] + const clause = + opener !== undefined && opener.match(COUNT_CLAIM) === null + ? sentence.slice(opener.length) + : sentence return [...clause.matchAll(COUNT_CLAIM)].filter((match) => { const before = clause.slice(0, match.index) const owner = POSSESSIVE_OWNER.exec(before)?.[1] From 4502eddc257303f16f738265280e2fdda1bc1a02 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Mon, 16 Nov 2026 19:47:42 -0800 Subject: [PATCH 05/10] fix(library): keep sim-count comparison spans inside their sentence --- scripts/check-library-content.test.ts | 5 +++++ scripts/check-library-content.ts | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/check-library-content.test.ts b/scripts/check-library-content.test.ts index 65ac0d2e076..9ecf84af9b9 100644 --- a/scripts/check-library-content.test.ts +++ b/scripts/check-library-content.test.ts @@ -339,6 +339,11 @@ describe('check-library-content', () => { 'overstates', ], ['Sim, unlike n8n, has 1,000+ integrations.', '1,000+ integrations', 'overstates'], + [ + 'Zapier lists thousands of apps, while Make lists 3,000 apps. Sim has 1,000+ integrations, and more.', + '1,000+ integrations', + 'overstates', + ], [ 'While Sim has 1,000+ integrations, Zapier focuses on simple automations.', '1,000+ integrations', diff --git a/scripts/check-library-content.ts b/scripts/check-library-content.ts index 0dc8d69d1d7..95b5861a6c4 100644 --- a/scripts/check-library-content.ts +++ b/scripts/check-library-content.ts @@ -150,11 +150,12 @@ const SIM_NAME = /\bSim\b/ const CONTRAST = String.raw`(?:while|whereas|but|unlike|compared (?:with|to)|versus|vs\.?)` /** * A comparison set off by commas, as in "Sim, unlike Zapier, has ..." or "Zapier, like Sim, has - * ...", removed so the sentence keeps its subject. The span ends at the first comma that is not a - * thousands separator, and it is kept when a relative clause follows ("unlike Zapier, which has"). + * ...", removed so the sentence keeps its subject. The span stays inside its sentence, ends at the + * first comma that is not a thousands separator, and is kept when a relative clause follows + * ("unlike Zapier, which has"). */ const PARENTHETICAL_COMPARISON = new RegExp( - String.raw`,\s+(?:like|${CONTRAST})\s+(?:[^,]|,(?=\d))*?,(?!\d)(?!\s*(?:which|that|who)\b)`, + String.raw`,\s+(?:like|${CONTRAST})\s+(?:[^,.!?;]|[,.](?=\d))*?,(?!\d)(?!\s*(?:which|that|who)\b)`, 'gi' ) /** A sentence end, or a contrast that hands the rest of the sentence to another subject. */ @@ -164,7 +165,7 @@ const CLAUSE_BREAK = new RegExp(String.raw`(?<=[.!?;])\s+|,?\s+${CONTRAST}\s+`, * that states a count of its own ("While Sim has 280+ integrations, ...") is kept. */ const LEADING_COMPARISON = new RegExp( - String.raw`^(?:like|${CONTRAST})\b(?:[^,]|,(?=\d))*?,(?!\d)\s*`, + String.raw`^(?:like|${CONTRAST})\b(?:[^,.!?;]|[,.](?=\d))*?,(?!\d)\s*`, 'i' ) /** The product whose possessive directly precedes a count, as in "Zapier's 9,000+". */ From 7b9d781909143a432f5b8977a8baa48b2538d795 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Mon, 16 Nov 2026 19:57:53 -0800 Subject: [PATCH 06/10] refactor(library): read sim-count comparisons as their own clauses instead of deleting them --- scripts/check-library-content.test.ts | 14 ++++++ scripts/check-library-content.ts | 61 +++++++++++++++------------ 2 files changed, 47 insertions(+), 28 deletions(-) diff --git a/scripts/check-library-content.test.ts b/scripts/check-library-content.test.ts index 9ecf84af9b9..56dba796cb5 100644 --- a/scripts/check-library-content.test.ts +++ b/scripts/check-library-content.test.ts @@ -344,6 +344,18 @@ describe('check-library-content', () => { '1,000+ integrations', 'overstates', ], + [ + 'Zapier, while Sim has 1,000+ integrations, focuses on simple automations.', + '1,000+ integrations', + 'overstates', + ], + [ + 'Zapier is popular, while Sim has 1,000+ integrations, and both support webhooks.', + '1,000+ integrations', + 'overstates', + ], + ['Sim, unlike Make.com, has 1,000+ integrations.', '1,000+ integrations', 'overstates'], + ['Sim connects tools like Slack to 1,000+ integrations.', '1,000+ integrations', 'overstates'], [ 'While Sim has 1,000+ integrations, Zapier focuses on simple automations.', '1,000+ integrations', @@ -407,6 +419,8 @@ describe('check-library-content', () => { "Sim has fewer than [Zapier](https://zapier.com)'s 9,000+ integrations.", 'Sim has 280+ integrations, unlike Zapier, which has 9,000+ integrations.', 'Zapier, unlike Sim, has 9,000+ integrations.', + 'Sim is open source but Zapier has 9,000+ integrations.', + 'While Sim has 280+ integrations, Zapier lists 9,000+ integrations.', 'Zapier, like Sim, has 9,000+ integrations.', 'Sim, unlike Zapier, which has 9,000+ integrations, is open source.', 'n8n | Alternative to Sim | 2,000+ integrations |', diff --git a/scripts/check-library-content.ts b/scripts/check-library-content.ts index 95b5861a6c4..8bc7418bf69 100644 --- a/scripts/check-library-content.ts +++ b/scripts/check-library-content.ts @@ -35,7 +35,8 @@ * "1,000+ integrations" or a figure left from an older catalog spreads to third-party sites. * A count belongs to Sim when "Sim" comes before it in the same clause and no other product's * possessive directly precedes it, or when it sits in a table row whose label cell is Sim. - * Sentence ends and contrasts ("while", "unlike", "compared with") start a new clause. + * A comparison ("while", "unlike", "compared with", or "like" after a comma) is its own clause + * up to the next comma, and the sentence's main clause resumes after it. * A count whose owner is ambiguous within its clause is treated as Sim's; when it belongs to * another product, name that product as its owner ("Zapier's 9,000+") or give it a sentence. * Blog and changelog posts are dated, so their counts are true as of publication. @@ -148,26 +149,20 @@ const LINE_PREFIX = /^\s*(?:(?:[-*+>]|\d+[.)]|#{1,6})\s+)*(?:\w+:\s*["'])?/ const SIM_NAME = /\bSim\b/ /** Words that turn a sentence toward another product: "while Zapier lists ...", "unlike Zapier". */ const CONTRAST = String.raw`(?:while|whereas|but|unlike|compared (?:with|to)|versus|vs\.?)` +const SENTENCE_END = /(?<=[.!?;])\s+/ /** - * A comparison set off by commas, as in "Sim, unlike Zapier, has ..." or "Zapier, like Sim, has - * ...", removed so the sentence keeps its subject. The span stays inside its sentence, ends at the - * first comma that is not a thousands separator, and is kept when a relative clause follows - * ("unlike Zapier, which has"). + * Where a comparison clause starts: a contrast word, or "like" when it opens the sentence or + * follows a comma ("Like Sim, ...", "Zapier, like Sim, ..."), but not "tools like Slack". */ -const PARENTHETICAL_COMPARISON = new RegExp( - String.raw`,\s+(?:like|${CONTRAST})\s+(?:[^,.!?;]|[,.](?=\d))*?,(?!\d)(?!\s*(?:which|that|who)\b)`, - 'gi' +const COMPARISON_START = new RegExp( + String.raw`(?:^|,\s*|\s+)(?=${CONTRAST}\b)|(?:^|,\s*)(?=like\b)`, + 'i' ) -/** A sentence end, or a contrast that hands the rest of the sentence to another subject. */ -const CLAUSE_BREAK = new RegExp(String.raw`(?<=[.!?;])\s+|,?\s+${CONTRAST}\s+`, 'i') /** - * An opening comparison ("Unlike Sim, ...") whose main clause is about another product. An opener - * that states a count of its own ("While Sim has 280+ integrations, ...") is kept. + * Where a comparison clause ends: the first comma that is neither a thousands separator nor the + * start of a relative clause continuing it ("unlike Zapier, which has 9,000+ integrations"). */ -const LEADING_COMPARISON = new RegExp( - String.raw`^(?:like|${CONTRAST})\b(?:[^,.!?;]|[,.](?=\d))*?,(?!\d)\s*`, - 'i' -) +const COMPARISON_END = /,(?!\d)(?!\s*(?:which|that|who)\b)/ /** The product whose possessive directly precedes a count, as in "Zapier's 9,000+". */ const POSSESSIVE_OWNER = /([\w.-]+)['’]s\s*$/ /** A Sim count below this share of the catalog total is left from an older catalog. */ @@ -181,24 +176,34 @@ function simTableRowCounts(cells: string[]): RegExpMatchArray[] { : [] } +/** + * A sentence's clauses: its main clause, with each comparison taken out and read as a clause of + * its own, so "Sim, unlike Zapier, has ..." reads as "Sim has ..." plus "unlike Zapier". + */ +function sentenceClauses(sentence: string): string[] { + const main: string[] = [] + const comparisons: string[] = [] + let rest = sentence + for (let start = COMPARISON_START.exec(rest); start; start = COMPARISON_START.exec(rest)) { + main.push(rest.slice(0, start.index)) + const comparison = rest.slice(start.index + start[0].length) + const end = COMPARISON_END.exec(comparison) + comparisons.push(end ? comparison.slice(0, end.index) : comparison) + rest = end ? comparison.slice(end.index + 1) : '' + } + return [[...main, rest].join(' '), ...comparisons] +} + /** Each count whose clause names Sim before it, unless another product's possessive owns it. */ function simProseCounts(text: string): RegExpMatchArray[] { - const sentences = text - .replace(LINE_PREFIX, '') - .replace(PARENTHETICAL_COMPARISON, '') - .split(CLAUSE_BREAK) - return sentences.flatMap((sentence) => { - const opener = LEADING_COMPARISON.exec(sentence)?.[0] - const clause = - opener !== undefined && opener.match(COUNT_CLAIM) === null - ? sentence.slice(opener.length) - : sentence - return [...clause.matchAll(COUNT_CLAIM)].filter((match) => { + const clauses = text.replace(LINE_PREFIX, '').split(SENTENCE_END).flatMap(sentenceClauses) + return clauses.flatMap((clause) => + [...clause.matchAll(COUNT_CLAIM)].filter((match) => { const before = clause.slice(0, match.index) const owner = POSSESSIVE_OWNER.exec(before)?.[1] return SIM_NAME.test(before) && (owner === undefined || owner === 'Sim') }) - }) + ) } /** The counts on one line of text that belong to Sim, with the claim as written. */ From 9527a5957a0913916e125f59ecf4130fff7116fe Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Mon, 16 Nov 2026 20:10:30 -0800 Subject: [PATCH 07/10] fix(library): split sim-count contrasts nested in comparisons, keep count lists together, and end sentences before closing quotes --- scripts/check-library-content.test.ts | 7 +++++++ scripts/check-library-content.ts | 14 +++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/scripts/check-library-content.test.ts b/scripts/check-library-content.test.ts index 56dba796cb5..cefa7a37853 100644 --- a/scripts/check-library-content.test.ts +++ b/scripts/check-library-content.test.ts @@ -356,6 +356,11 @@ describe('check-library-content', () => { ], ['Sim, unlike Make.com, has 1,000+ integrations.', '1,000+ integrations', 'overstates'], ['Sim connects tools like Slack to 1,000+ integrations.', '1,000+ integrations', 'overstates'], + [ + 'While Sim has 280+ integrations, 9,000+ actions, and 530+ triggers, Zapier focuses on simple automations.', + '9,000+ actions', + 'overstates', + ], [ 'While Sim has 1,000+ integrations, Zapier focuses on simple automations.', '1,000+ integrations', @@ -420,6 +425,8 @@ describe('check-library-content', () => { 'Sim has 280+ integrations, unlike Zapier, which has 9,000+ integrations.', 'Zapier, unlike Sim, has 9,000+ integrations.', 'Sim is open source but Zapier has 9,000+ integrations.', + 'While Sim has 280+ integrations but Zapier has 9,000+ integrations, both support webhooks.', + '"Sim is open source." Zapier has 9,000+ integrations.', 'While Sim has 280+ integrations, Zapier lists 9,000+ integrations.', 'Zapier, like Sim, has 9,000+ integrations.', 'Sim, unlike Zapier, which has 9,000+ integrations, is open source.', diff --git a/scripts/check-library-content.ts b/scripts/check-library-content.ts index 8bc7418bf69..c53565f571d 100644 --- a/scripts/check-library-content.ts +++ b/scripts/check-library-content.ts @@ -149,7 +149,8 @@ const LINE_PREFIX = /^\s*(?:(?:[-*+>]|\d+[.)]|#{1,6})\s+)*(?:\w+:\s*["'])?/ const SIM_NAME = /\bSim\b/ /** Words that turn a sentence toward another product: "while Zapier lists ...", "unlike Zapier". */ const CONTRAST = String.raw`(?:while|whereas|but|unlike|compared (?:with|to)|versus|vs\.?)` -const SENTENCE_END = /(?<=[.!?;])\s+/ +/** Sentence punctuation, with any closing quote or bracket, before whitespace. */ +const SENTENCE_END = /(?<=[.!?;]['"”’)\]]*)\s+/ /** * Where a comparison clause starts: a contrast word, or "like" when it opens the sentence or * follows a comma ("Like Sim, ...", "Zapier, like Sim, ..."), but not "tools like Slack". @@ -159,10 +160,13 @@ const COMPARISON_START = new RegExp( 'i' ) /** - * Where a comparison clause ends: the first comma that is neither a thousands separator nor the - * start of a relative clause continuing it ("unlike Zapier, which has 9,000+ integrations"). + * Where a comparison clause ends: the first comma that is not a thousands separator, not the + * start of a relative clause continuing it ("unlike Zapier, which has 9,000+ integrations"), and + * not the next item in a list of counts ("280+ integrations, 9,000+ actions, and 530+ triggers"). */ -const COMPARISON_END = /,(?!\d)(?!\s*(?:which|that|who)\b)/ +const COMPARISON_END = /,(?!\d)(?!\s*(?:which|that|who)\b)(?!\s*(?:and\s+)?\d)/ +/** A contrast inside a comparison clause, which starts a clause of its own ("..., but Zapier"). */ +const INNER_CONTRAST = new RegExp(String.raw`,?\s+(?=${CONTRAST}\b)`, 'i') /** The product whose possessive directly precedes a count, as in "Zapier's 9,000+". */ const POSSESSIVE_OWNER = /([\w.-]+)['’]s\s*$/ /** A Sim count below this share of the catalog total is left from an older catalog. */ @@ -188,7 +192,7 @@ function sentenceClauses(sentence: string): string[] { main.push(rest.slice(0, start.index)) const comparison = rest.slice(start.index + start[0].length) const end = COMPARISON_END.exec(comparison) - comparisons.push(end ? comparison.slice(0, end.index) : comparison) + comparisons.push(...(end ? comparison.slice(0, end.index) : comparison).split(INNER_CONTRAST)) rest = end ? comparison.slice(end.index + 1) : '' } return [[...main, rest].join(' '), ...comparisons] From 168317ba5410defed51f261eb22b4a764fa1caec Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Mon, 16 Nov 2026 20:21:49 -0800 Subject: [PATCH 08/10] fix(library): start sim-count clauses only at a new capitalized subject and tell count lists from new clauses --- scripts/check-library-content.test.ts | 9 +++++++ scripts/check-library-content.ts | 35 ++++++++++++++++++--------- 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/scripts/check-library-content.test.ts b/scripts/check-library-content.test.ts index cefa7a37853..cde7d1b81eb 100644 --- a/scripts/check-library-content.test.ts +++ b/scripts/check-library-content.test.ts @@ -356,6 +356,13 @@ describe('check-library-content', () => { ], ['Sim, unlike Make.com, has 1,000+ integrations.', '1,000+ integrations', 'overstates'], ['Sim connects tools like Slack to 1,000+ integrations.', '1,000+ integrations', 'overstates'], + ['Sim is open source but has 1,000+ integrations.', '1,000+ integrations', 'overstates'], + ['Sim is open source, but has 1,000+ integrations.', '1,000+ integrations', 'overstates'], + [ + 'While Sim is open source but has 1,000+ integrations, Zapier is proprietary.', + '1,000+ integrations', + 'overstates', + ], [ 'While Sim has 280+ integrations, 9,000+ actions, and 530+ triggers, Zapier focuses on simple automations.', '9,000+ actions', @@ -427,6 +434,8 @@ describe('check-library-content', () => { 'Sim is open source but Zapier has 9,000+ integrations.', 'While Sim has 280+ integrations but Zapier has 9,000+ integrations, both support webhooks.', '"Sim is open source." Zapier has 9,000+ integrations.', + 'While Sim has 280+ integrations, 9,000+ integrations are available in Zapier.', + 'Sim has 280+ integrations, and Zapier has 9,000+ integrations.', 'While Sim has 280+ integrations, Zapier lists 9,000+ integrations.', 'Zapier, like Sim, has 9,000+ integrations.', 'Sim, unlike Zapier, which has 9,000+ integrations, is open source.', diff --git a/scripts/check-library-content.ts b/scripts/check-library-content.ts index c53565f571d..8228058a6bb 100644 --- a/scripts/check-library-content.ts +++ b/scripts/check-library-content.ts @@ -35,8 +35,9 @@ * "1,000+ integrations" or a figure left from an older catalog spreads to third-party sites. * A count belongs to Sim when "Sim" comes before it in the same clause and no other product's * possessive directly precedes it, or when it sits in a table row whose label cell is Sim. - * A comparison ("while", "unlike", "compared with", or "like" after a comma) is its own clause - * up to the next comma, and the sentence's main clause resumes after it. + * A comparison that opens a sentence or names a new subject ("while Zapier", "Zapier, like + * Sim,") is its own clause up to the next comma, and the main clause resumes after it; ", and" + * before a capitalized word also starts a new clause. * A count whose owner is ambiguous within its clause is treated as Sim's; when it belongs to * another product, name that product as its owner ("Zapier's 9,000+") or give it a sentence. * Blog and changelog posts are dated, so their counts are true as of publication. @@ -149,24 +150,32 @@ const LINE_PREFIX = /^\s*(?:(?:[-*+>]|\d+[.)]|#{1,6})\s+)*(?:\w+:\s*["'])?/ const SIM_NAME = /\bSim\b/ /** Words that turn a sentence toward another product: "while Zapier lists ...", "unlike Zapier". */ const CONTRAST = String.raw`(?:while|whereas|but|unlike|compared (?:with|to)|versus|vs\.?)` +/** The same words opening a sentence, plus "Like" ("Like Sim, n8n ..."). */ +const OPENING_CONTRAST = String.raw`(?:While|Whereas|But|Unlike|Like|Compared (?:with|to)|Versus|Vs\.?)` /** Sentence punctuation, with any closing quote or bracket, before whitespace. */ const SENTENCE_END = /(?<=[.!?;]['"”’)\]]*)\s+/ +/** ", and" before a capitalized word, which starts a clause with its own subject. */ +const NEW_SUBJECT = /,\s+and\s+(?=[A-Z])/ /** - * Where a comparison clause starts: a contrast word, or "like" when it opens the sentence or - * follows a comma ("Like Sim, ...", "Zapier, like Sim, ..."), but not "tools like Slack". + * Where a comparison clause starts: a sentence-opening contrast ("Unlike Sim, ..."), or a contrast + * followed by a capitalized word, the new subject ("..., while Zapier", "Zapier, like Sim, ..."). + * A contrast that keeps the subject ("open source but has ...") does not start one. */ const COMPARISON_START = new RegExp( - String.raw`(?:^|,\s*|\s+)(?=${CONTRAST}\b)|(?:^|,\s*)(?=like\b)`, - 'i' + String.raw`^(?=${OPENING_CONTRAST}\b)|,\s*(?=(?:like|${CONTRAST})\s+[A-Z])|\s+(?=${CONTRAST}\s+[A-Z])` ) +/** A count continuing a list ("..., 9,000+ actions, and 530+ triggers, ..."), not a new clause. */ +const COUNT_LIST_ITEM = String.raw`(?:and\s+)?\d[\d,]*\+?\s+(?:integrations|actions|triggers)\b\s*(?:,|and\b|$)` /** * Where a comparison clause ends: the first comma that is not a thousands separator, not the * start of a relative clause continuing it ("unlike Zapier, which has 9,000+ integrations"), and - * not the next item in a list of counts ("280+ integrations, 9,000+ actions, and 530+ triggers"). + * not the next item in a list of counts. */ -const COMPARISON_END = /,(?!\d)(?!\s*(?:which|that|who)\b)(?!\s*(?:and\s+)?\d)/ -/** A contrast inside a comparison clause, which starts a clause of its own ("..., but Zapier"). */ -const INNER_CONTRAST = new RegExp(String.raw`,?\s+(?=${CONTRAST}\b)`, 'i') +const COMPARISON_END = new RegExp( + String.raw`,(?!\d)(?!\s*(?:which|that|who)\b)(?!\s*${COUNT_LIST_ITEM})` +) +/** A contrast with a new subject inside a comparison clause ("..., but Zapier has ..."). */ +const INNER_CONTRAST = new RegExp(String.raw`,?\s+(?=${CONTRAST}\s+[A-Z])`) /** The product whose possessive directly precedes a count, as in "Zapier's 9,000+". */ const POSSESSIVE_OWNER = /([\w.-]+)['’]s\s*$/ /** A Sim count below this share of the catalog total is left from an older catalog. */ @@ -200,7 +209,11 @@ function sentenceClauses(sentence: string): string[] { /** Each count whose clause names Sim before it, unless another product's possessive owns it. */ function simProseCounts(text: string): RegExpMatchArray[] { - const clauses = text.replace(LINE_PREFIX, '').split(SENTENCE_END).flatMap(sentenceClauses) + const clauses = text + .replace(LINE_PREFIX, '') + .split(SENTENCE_END) + .flatMap((sentence) => sentence.split(NEW_SUBJECT)) + .flatMap(sentenceClauses) return clauses.flatMap((clause) => [...clause.matchAll(COUNT_CLAIM)].filter((match) => { const before = clause.slice(0, match.index) From ceabe2b956a40d3904e2685d9cffa8960b175544 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Mon, 16 Nov 2026 20:29:42 -0800 Subject: [PATCH 09/10] fix(library): check sim claims in feature-first table cells and treat digit product names as new subjects --- scripts/check-library-content.test.ts | 8 ++++++++ scripts/check-library-content.ts | 21 +++++++++++++-------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/scripts/check-library-content.test.ts b/scripts/check-library-content.test.ts index cde7d1b81eb..35627b521a4 100644 --- a/scripts/check-library-content.test.ts +++ b/scripts/check-library-content.test.ts @@ -357,6 +357,12 @@ describe('check-library-content', () => { ['Sim, unlike Make.com, has 1,000+ integrations.', '1,000+ integrations', 'overstates'], ['Sim connects tools like Slack to 1,000+ integrations.', '1,000+ integrations', 'overstates'], ['Sim is open source but has 1,000+ integrations.', '1,000+ integrations', 'overstates'], + ['| Catalog | Sim has 1,000+ integrations |', '1,000+ integrations', 'overstates'], + [ + 'Sim has 280+ integrations while working across 9,000+ actions.', + '9,000+ actions', + 'overstates', + ], ['Sim is open source, but has 1,000+ integrations.', '1,000+ integrations', 'overstates'], [ 'While Sim is open source but has 1,000+ integrations, Zapier is proprietary.', @@ -436,6 +442,8 @@ describe('check-library-content', () => { '"Sim is open source." Zapier has 9,000+ integrations.', 'While Sim has 280+ integrations, 9,000+ integrations are available in Zapier.', 'Sim has 280+ integrations, and Zapier has 9,000+ integrations.', + 'Sim has 280+ integrations, while n8n lists 2,000+ integrations.', + '| Catalog | Sim has 280+ integrations | n8n lists 2,000+ integrations |', 'While Sim has 280+ integrations, Zapier lists 9,000+ integrations.', 'Zapier, like Sim, has 9,000+ integrations.', 'Sim, unlike Zapier, which has 9,000+ integrations, is open source.', diff --git a/scripts/check-library-content.ts b/scripts/check-library-content.ts index 8228058a6bb..6966f6676bc 100644 --- a/scripts/check-library-content.ts +++ b/scripts/check-library-content.ts @@ -154,15 +154,17 @@ const CONTRAST = String.raw`(?:while|whereas|but|unlike|compared (?:with|to)|ver const OPENING_CONTRAST = String.raw`(?:While|Whereas|But|Unlike|Like|Compared (?:with|to)|Versus|Vs\.?)` /** Sentence punctuation, with any closing quote or bracket, before whitespace. */ const SENTENCE_END = /(?<=[.!?;]['"”’)\]]*)\s+/ -/** ", and" before a capitalized word, which starts a clause with its own subject. */ -const NEW_SUBJECT = /,\s+and\s+(?=[A-Z])/ +/** The start of a new subject: a capitalized word, or a lowercase product name with a digit (n8n). */ +const SUBJECT = String.raw`(?:[A-Z]|[a-z]+\d)` +/** ", and" before a new subject, which starts a clause of its own ("..., and Zapier has ..."). */ +const NEW_SUBJECT = new RegExp(String.raw`,\s+and\s+(?=${SUBJECT})`) /** * Where a comparison clause starts: a sentence-opening contrast ("Unlike Sim, ..."), or a contrast - * followed by a capitalized word, the new subject ("..., while Zapier", "Zapier, like Sim, ..."). - * A contrast that keeps the subject ("open source but has ...") does not start one. + * followed by a new subject ("..., while Zapier", "Zapier, like Sim, ..."). A contrast that keeps + * the subject ("open source but has ...", "while working") does not start one. */ const COMPARISON_START = new RegExp( - String.raw`^(?=${OPENING_CONTRAST}\b)|,\s*(?=(?:like|${CONTRAST})\s+[A-Z])|\s+(?=${CONTRAST}\s+[A-Z])` + String.raw`^(?=${OPENING_CONTRAST}\b)|,\s*(?=(?:like|${CONTRAST})\s+${SUBJECT})|\s+(?=${CONTRAST}\s+${SUBJECT})` ) /** A count continuing a list ("..., 9,000+ actions, and 530+ triggers, ..."), not a new clause. */ const COUNT_LIST_ITEM = String.raw`(?:and\s+)?\d[\d,]*\+?\s+(?:integrations|actions|triggers)\b\s*(?:,|and\b|$)` @@ -175,18 +177,21 @@ const COMPARISON_END = new RegExp( String.raw`,(?!\d)(?!\s*(?:which|that|who)\b)(?!\s*${COUNT_LIST_ITEM})` ) /** A contrast with a new subject inside a comparison clause ("..., but Zapier has ..."). */ -const INNER_CONTRAST = new RegExp(String.raw`,?\s+(?=${CONTRAST}\s+[A-Z])`) +const INNER_CONTRAST = new RegExp(String.raw`,?\s+(?=${CONTRAST}\s+${SUBJECT})`) /** The product whose possessive directly precedes a count, as in "Zapier's 9,000+". */ const POSSESSIVE_OWNER = /([\w.-]+)['’]s\s*$/ /** A Sim count below this share of the catalog total is left from an older catalog. */ const SIM_COUNT_FLOOR = 0.9 -/** Every count in a table row whose label (first non-empty cell) names Sim. */ +/** + * The Sim counts in a table row: every count when its label (first non-empty cell) names Sim, and + * otherwise each cell's own Sim claims, read like prose ("| Catalog | Sim has 280+ integrations |"). + */ function simTableRowCounts(cells: string[]): RegExpMatchArray[] { const label = cells.map((cell) => cell.trim()).find((cell) => cell !== '') ?? '' return SIM_NAME.test(label.split(/\s/)[0]) ? cells.flatMap((cell) => [...cell.matchAll(COUNT_CLAIM)]) - : [] + : cells.flatMap(simProseCounts) } /** From 144f9e2a32414d3ecb99ee033d5c12ae7f4f0794 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Mon, 16 Nov 2026 20:36:28 -0800 Subject: [PATCH 10/10] docs(library): describe sim-count table cells and new-subject clauses accurately --- scripts/check-library-content.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/check-library-content.ts b/scripts/check-library-content.ts index 6966f6676bc..52b6b026524 100644 --- a/scripts/check-library-content.ts +++ b/scripts/check-library-content.ts @@ -34,10 +34,10 @@ * lower than 90% of it. Answer engines quote these figures, so an overclaim such as * "1,000+ integrations" or a figure left from an older catalog spreads to third-party sites. * A count belongs to Sim when "Sim" comes before it in the same clause and no other product's - * possessive directly precedes it, or when it sits in a table row whose label cell is Sim. - * A comparison that opens a sentence or names a new subject ("while Zapier", "Zapier, like - * Sim,") is its own clause up to the next comma, and the main clause resumes after it; ", and" - * before a capitalized word also starts a new clause. + * possessive directly precedes it, or when it sits in a table row whose label cell is Sim + * (other rows are read cell by cell). A comparison that opens a sentence or names a new subject + * ("while Zapier", "Zapier, like Sim,") is its own clause up to the next comma, and the main + * clause resumes after it; ", and" before a new subject also starts a clause. * A count whose owner is ambiguous within its clause is treated as Sim's; when it belongs to * another product, name that product as its owner ("Zapier's 9,000+") or give it a sentence. * Blog and changelog posts are dated, so their counts are true as of publication.