@operstack/audit 0.35.1 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +10 -0
  2. package/package.json +5 -3
  3. package/src/client-eye.mjs +339 -0
  4. package/src/collect.mjs +94 -24
  5. package/src/etalon.mjs +1 -1
  6. package/src/fix.mjs +1 -1
  7. package/src/i18n.mjs +37 -23
  8. package/src/index.mjs +2 -0
  9. package/src/narrative.mjs +78 -31
  10. package/src/pagekind.mjs +6 -0
  11. package/src/presentation.mjs +95 -0
  12. package/src/prompts.mjs +58 -17
  13. package/src/render.mjs +41 -25
  14. package/src/rendered.mjs +8 -3
  15. package/src/tasks-pdf.mjs +1 -1
  16. package/src/verify.mjs +19 -12
  17. package/src/test-agency-ids.mjs +0 -48
  18. package/src/test-agency.mjs +0 -158
  19. package/src/test-agent-surface.mjs +0 -46
  20. package/src/test-blocked.mjs +0 -100
  21. package/src/test-crawl-links.mjs +0 -87
  22. package/src/test-demand.mjs +0 -243
  23. package/src/test-etalon.mjs +0 -42
  24. package/src/test-fix.mjs +0 -115
  25. package/src/test-flaky-files.mjs +0 -81
  26. package/src/test-foundation.mjs +0 -126
  27. package/src/test-handover.mjs +0 -148
  28. package/src/test-i18n.mjs +0 -68
  29. package/src/test-narrative.mjs +0 -117
  30. package/src/test-overall.mjs +0 -236
  31. package/src/test-planted.mjs +0 -114
  32. package/src/test-prompts.mjs +0 -142
  33. package/src/test-prospect-count.mjs +0 -12
  34. package/src/test-redirect-host.mjs +0 -63
  35. package/src/test-rendered.mjs +0 -125
  36. package/src/test-report-wording.mjs +0 -35
  37. package/src/test-ru-report.mjs +0 -95
  38. package/src/test-ru-sources.mjs +0 -41
  39. package/src/test-sample-fairness.mjs +0 -50
  40. package/src/test-sample.mjs +0 -91
  41. package/src/test-scores.mjs +0 -75
  42. package/src/test-shopify-store.mjs +0 -159
  43. package/src/test-sitemap.mjs +0 -91
  44. package/src/test-unmeasured.mjs +0 -173
package/src/prompts.mjs CHANGED
@@ -14,6 +14,7 @@
14
14
  * Заданий с собственным текстом столько, сколько проверок мы умеем чинить осмысленно. Для
15
15
  * остальных собирается общее задание из описания работы: оно короче, но не врёт.
16
16
  */
17
+ import { isListPage } from './pagekind.mjs';
17
18
  import { FIX_ACTIONS } from './fix.mjs';
18
19
  import { localiseChecks } from './i18n.mjs';
19
20
  import { vocabFor } from './niche.mjs';
@@ -222,7 +223,7 @@ const P = {
222
223
  en: { task: 'Ask the owner where the business really has profiles: social networks, directories, maps, industry sites. Put those addresses in the sameAs field of the organisation markup and link them from the footer. Do not add profiles that do not exist or are abandoned.', verify: 'The organisation JSON-LD has sameAs with at least two addresses, and each opens a profile of this very business.' },
223
224
  },
224
225
  'trust-about': {
225
- ru: { task: 'Сделай страницу «О компании» (или «Команда») и поставь на неё ссылку в меню или подвал, чтобы она была видна со всех страниц. На странице: кто стоит за сайтом, чем занимается, с какого года, где находится, как связаться. Всё только со слов владельца или из того, что уже опубликовано; если страница уже есть, просто добавь ссылку.', verify: 'Со всех проверенных страниц есть ссылка на страницу о компании, и она открывается с кодом 200.' },
226
+ ru: { task: 'Сделай страницу «О компании» (или «Команда») и поставь на неё ссылку в меню или подвал, чтобы она была видна со всех страниц. На странице: кто стоит за сайтом, чем занимается, с какого года, где находится, как связаться. Всё только со слов владельца или из того, что уже опубликовано; если страница уже есть, просто добавь ссылку.', verify: 'Ссылка на страницу о компании стоит в меню или подвале каждой страницы сайта, и страница открывается с кодом 200.' },
226
227
  en: { task: 'Make an About (or Team) page and link it from the menu or footer so it is reachable from every page. On it: who is behind the site, what they do, since when, where, how to get in touch. Use only what the owner tells you or what is already published; if the page exists, just add the link.', verify: 'Every sampled page links to the about page, and it opens with a 200.' },
227
228
  },
228
229
  'trust-policies': {
@@ -275,9 +276,19 @@ const PF = {
275
276
  title: ({ ru, v }) => (ru
276
277
  ? { task: 'Перепиши заголовок главной (тег title): до 60 знаков, словами, которыми ищут ' + v.people + ', что это за компания и чем она занимается, название компании в конце. Не повторяй слова и не пиши список ключевых слов через запятую.', verify: 'Заголовок главной от 30 до 60 знаков, в нём названо, чем занимается компания, и он отличается от заголовков других страниц.' }
277
278
  : { task: 'Rewrite the home page title: up to 60 characters, in the words ' + v.people + ' search with, saying what the business is and does, company name at the end. No repeated words, no keyword lists.', verify: 'The home page title is 30 to 60 characters, says what the business does, and differs from other page titles.' }),
278
- dates: ({ ru }) => (ru
279
- ? { task: 'Сверь даты публикации в разметке (datePublished) с настоящими датами материалов: если тема сортирует записи по этой дате, сначала переключи сортировку на настоящую дату, потом исправь даты в разметке. Затем выведи дату публикации видимой строкой на странице каждого материала.', verify: 'На странице каждого материала видна дата публикации, и она совпадает с datePublished в его разметке.' }
280
- : { task: 'Check the published dates in the markup (datePublished) against the real dates of the posts: if the theme sorts posts by that date, switch the sorting first, then correct the markup dates. Then show the published date as a visible line on every post.', verify: 'Every post shows its published date on the page, and it matches datePublished in its markup.' }),
279
+ // Дат мало: называем, где они есть, и на каких страницах их ставить; «сверь даты» исполнителю ничего не говорит (cimes.ru, 14.10.2026).
280
+ dates: ({ audit, ru }) => {
281
+ const sm = sampleOf(audit); const dated = sm.filter((p) => p.dates && (p.dates.published || p.dates.modified));
282
+ const c = (audit?.checks || []).find((x) => x.id === 'dates');
283
+ if (c && !/precede/.test(String(c.value)) && dated.length < sm.length / 2) {
284
+ const list = dated.slice(0, 5).map((p) => pathOf(p.url)).join(', ');
285
+ return ru
286
+ ? { task: `Дата публикации в разметке (datePublished) есть только на ${dated.length} из ${sm.length} страниц выборки${list ? `: ${list}` : ''}. Добавь её и видимую строку «Опубликовано: число» на страницы, у которых правда есть дата: статьи блога, новости, кейсы портфолио. Страницам услуг и контактов дата не нужна, не ставь её туда.`, verify: 'На статьях, новостях и кейсах в разметке есть datePublished, и та же дата видна на самой странице.' }
287
+ : { task: `A published date in the markup (datePublished) is on only ${dated.length} of ${sm.length} sampled pages${list ? `: ${list}` : ''}. Add it, with a visible "Published: date" line, to pages that really have a date: blog posts, news, portfolio cases. Service and contact pages need none.`, verify: 'Posts, news and cases carry datePublished in the markup, and the same date is visible on the page.' };
288
+ }
289
+ return datesGeneric({ ru });
290
+ },
291
+
281
292
  'trust-entity': ({ ru }) => (ru
282
293
  ? { task: 'После того как появится разметка организации (задача про неё выше), допиши в неё адрес: город и страну (PostalAddress с addressLocality и addressCountry). Адрес головного офиса спроси у владельца, если на сайте его нет; адреса филиалов бери со страниц сайта.', verify: 'В разметке организации есть город и страна, и они совпадают с адресом, который подтвердил владелец.' }
283
294
  : { task: 'Once the organisation markup exists (task above), add the address: city and country (PostalAddress with addressLocality and addressCountry). Ask the owner for the head office address if the site does not show it.', verify: 'The organisation markup carries city and country, matching the address the owner confirmed.' }),
@@ -326,22 +337,44 @@ const PF = {
326
337
  'faq-schema': ({ ru, v }) => (ru
327
338
  ? { task: `Собери с владельцем 5-7 частых вопросов ${v.peopleGen} с ответами, опубликуй их видимым блоком на страницах главных услуг и только потом разметь схемой FAQPage. Текст в разметке должен слово в слово совпадать с видимым. Вопросов, которых нет на странице, в разметку не добавляй.`, verify: 'На выбранных страницах есть разметка FAQPage минимум с пятью вопросами, и каждый вопрос и ответ из неё дословно виден на странице.' }
328
339
  : { task: `Collect 5 to 7 frequent questions from ${v.peopleGen} with the owner, publish them as a visible block on the main service pages, and only then mark them up with FAQPage. The markup text must match the visible text word for word.`, verify: 'The chosen pages carry FAQPage markup with at least five questions, each question and answer visible on the page word for word.' }),
340
+ // В разметке только мессенджеры: задача не «впиши то, что уже вписано», а найти настоящие профили (cimes.ru, 15.10.2026).
341
+ 'trust-profiles-messengers': ({ check, ru }) => {
342
+ // Карточка на площадке на сайте уже есть (виджет рейтинга или ссылка), а в разметке её нет: начинаем с неё (cimes.ru, 15.10.2026).
343
+ const ls = check?.listings;
344
+ if (ls && ls.length) return ru
345
+ ? { task: `Впиши в поле sameAs разметки организации адрес карточки компании: ${ls.join(', ')}. Она уже показана на сайте (рейтинг или ссылка в подвале), но в разметке не указана. Потом спроси владельца, есть ли другие настоящие карточки (2ГИС, Google Карты, отраслевые каталоги, соцсети компании), и добавь только существующие. Мессенджеры профилями не считаются.`, verify: `В sameAs разметки организации есть ${ls[0]}, и адрес открывает карточку этой компании.` }
346
+ : { task: `Add the company listing to the sameAs field of the organisation markup: ${ls.join(', ')}. The site already shows it (rating badge or footer link), but the markup does not declare it. Then ask the owner about other real listings and add only those that exist. Messengers are not profiles.`, verify: `The sameAs of the organisation markup contains ${ls[0]}, and it opens this company's listing.` };
347
+ const m = check?.messengersOnly;
348
+ if (!m || !m.length) return null;
349
+ const list = m.join(', ');
350
+ return ru
351
+ ? { task: `В разметке организации (sameAs) сейчас указаны только мессенджеры: ${list}. Это способы написать, а не профили компании на площадках. Спроси владельца, где у компании есть настоящие карточки: Яндекс Карты или Яндекс Бизнес, 2ГИС, Google Карты, отраслевые каталоги и рейтинги, соцсети компании. Впиши в sameAs только существующие адреса и поставь ссылки на них в подвал. Если таких карточек нет, задачу не делай и не выдумывай профили.`, verify: 'В sameAs разметки организации есть хотя бы одна ссылка на карточку компании на площадке (карты, каталог, соцсеть), кроме мессенджеров, и она открывает профиль этой компании.' }
352
+ : { task: `The organisation markup (sameAs) lists only messengers now: ${list}. Those are ways to write, not company profiles on platforms. Ask the owner where the business really has listings: maps, directories and ratings, its own social accounts. Put only the ones that exist into sameAs and link them from the footer. If there are none, skip this task and invent nothing.`, verify: 'The sameAs of the organisation markup has at least one link to a company listing on a platform (maps, directory, social network) besides messengers, and it opens this company\'s profile.' };
353
+ },
329
354
  sections: ({ audit, ru }) => {
330
355
  // Страница-список (CollectionPage, ItemList) разводит по подразделам, разбивать её на разделы незачем (cimes.ru, 14.10.2026).
331
- const long = sampleOf(audit).filter((p) => (p.words || 0) >= 600 && (p.h2Count || 0) < 3 && !(p.schemaTypes || []).some((t) => /^(CollectionPage|ItemList)$/.test(t)));
356
+ const long = sampleOf(audit).filter((p) => (p.words || 0) >= 600 && (p.h2Count || 0) < 3 && !isListPage(p));
332
357
  if (!long.length) return null;
333
358
  const list = long.slice(0, 5).map((p) => pathOf(p.url)).join(', ');
359
+ // В отчёте «меньше трёх H2» считается по всем страницам выборки, а в задачу идут только длинные: правило отбора пишем в тексте (cimes.ru, 14.10.2026).
360
+ const few = sampleOf(audit).filter((p) => (p.h2Count || 0) < 3);
361
+ const rest = few.filter((p) => !long.includes(p));
362
+ const isList = isListPage;
363
+ const shortOnes = rest.filter((p) => !isList(p)); const lists = rest.filter(isList);
364
+ const why = rest.length ? (ru
365
+ ? ` Из ${few.length} страниц выборки, где меньше трёх H2, сюда вошли страницы с обычным текстом от 600 слов.${shortOnes.length ? ` Короткие (${shortOnes.slice(0, 5).map((p) => pathOf(p.url)).join(', ')}) разбивать не нужно.` : ''}${lists.length ? ` Страницы-списки подразделов (${lists.slice(0, 5).map((p) => pathOf(p.url)).join(', ')}) ведут на другие страницы, разбивать их на разделы не нужно.` : ''}`
366
+ : ` Of the ${few.length} sampled pages with fewer than three H2s only the long ones, 600 words and more, are listed. The others (${rest.slice(0, 5).map((p) => pathOf(p.url)).join(', ')}) are short or are list pages: leave them.`) : '';
334
367
  // Подзаголовки уже есть, но размечены H3: задача не «придумать H2», а поднять существующие (14.10.2026).
335
368
  if (long.every((p) => (p.h3Count || 0) >= 2)) return ru
336
- ? { task: `На ${long.length === 1 ? 'странице' : 'страницах'} ${list} подзаголовки уже есть, но размечены как H3. Сделай существующие смысловые подзаголовки H2; новые добавляй, только если без них раздел не читается. Текст не дописывай.`, verify: `${long.length === 1 ? 'На странице' : 'На страницах'} ${list} не меньше трёх заголовков H2 по смыслу текста.` }
337
- : { task: `On ${list} the subheadings already exist but are marked up as H3. Make the existing meaningful subheadings H2; add new ones only where a section cannot be read without them. Do not add text.`, verify: `${list} carry at least three H2s that follow the text.` };
369
+ ? { task: `На ${long.length === 1 ? 'странице' : 'страницах'} ${list} подзаголовки уже есть, но размечены как H3. Сделай существующие смысловые подзаголовки H2; новые добавляй, только если без них раздел не читается. Текст не дописывай.${why}`, verify: `${long.length === 1 ? 'На странице' : 'На страницах'} ${list} не меньше трёх заголовков H2 по смыслу текста.` }
370
+ : { task: `On ${list} the subheadings already exist but are marked up as H3. Make the existing meaningful subheadings H2; add new ones only where a section cannot be read without them. Do not add text.${why}`, verify: `${list} carry at least three H2s that follow the text.` };
338
371
  return ru
339
- ? { task: `Разбей на разделы ${long.length === 1 ? 'длинную страницу, где' : 'длинные страницы, где'} сейчас меньше трёх заголовков H2: ${list}. Заголовки H2 по смыслу текста. Ничего не дописывай, только структурируй.`, verify: `${long.length === 1 ? 'На странице' : 'На страницах'} ${list} не меньше трёх заголовков H2 по смыслу текста.` }
340
- : { task: `Split into sections the long pages that now have fewer than three H2s: ${list}. H2s that follow the text. Add nothing, only structure.`, verify: `The pages ${list} carry at least three H2s that follow the text.` };
372
+ ? { task: `Разбей на разделы ${long.length === 1 ? 'длинную страницу, где' : 'длинные страницы, где'} сейчас меньше трёх заголовков H2: ${list}. Заголовки H2 по смыслу текста. Ничего не дописывай, только структурируй.${why}`, verify: `${long.length === 1 ? 'На странице' : 'На страницах'} ${list} не меньше трёх заголовков H2 по смыслу текста.` }
373
+ : { task: `Split into sections the long pages that now have fewer than three H2s: ${list}. H2s that follow the text. Add nothing, only structure.${why}`, verify: `The pages ${list} carry at least three H2s that follow the text.` };
341
374
  },
342
375
  'conv-cta': ({ ru, v }) => (ru
343
- ? { task: `Поставь на первый экран каждой главной страницы одно понятное действие, которое на сайте уже есть: ${v.cta}. Одно действие на экран. Не выдумывай новых обещаний и сроков.`, verify: 'На каждой такой странице в верхних 15 процентах высоты, в основном блоке страницы, а не в шапке, есть кнопка или ссылка с этим действием.' }
344
- : { task: `Put one clear action the site already offers into the first screen of every main page: ${v.cta}. One action per screen. Invent no new promises or timings.`, verify: 'Each such page has that button or link within the top 15 percent of its height, in the main content block rather than the header.' }),
376
+ ? { task: `Поставь на первый экран каждой главной страницы одно понятное действие, которое на сайте уже есть: ${v.cta}. Одно действие на экран. Не выдумывай новых обещаний и сроков.`, verify: 'На каждой такой странице кнопка или ссылка с этим действием видна на первом экране без прокрутки, в основном блоке страницы, а не в шапке.' }
377
+ : { task: `Put one clear action the site already offers into the first screen of every main page: ${v.cta}. One action per screen. Invent no new promises or timings.`, verify: 'Each such page shows that button or link in the first screen without scrolling, in the main content block rather than the header.' }),
345
378
  'conv-messenger': ({ ru }) => (ru
346
379
  ? { task: 'Спроси владельца, есть ли у компании мессенджер для связи (WhatsApp, Telegram, MAX). Если есть, поставь одну ссылку рядом с телефоном, чтобы она открывала диалог. Если нет, задачу закрой.', verify: 'Либо рядом с телефоном есть рабочая ссылка на мессенджер, либо владелец подтвердил, что его нет.' }
347
380
  : { task: 'Ask the owner whether the business uses a messenger (WhatsApp, Telegram and the like). If yes, put one link next to the phone that opens a conversation. If no, close the task.', verify: 'Either a working messenger link sits next to the phone, or the owner confirmed there is none.' }),
@@ -359,7 +392,7 @@ const PF = {
359
392
  ? { task: 'Выключи архивы авторов в плагине SEO (в Yoast: SEO, Отображение в поисковой выдаче, вкладка Архивы; в английском интерфейсе Search Appearance, Archives), тогда страница автора уйдёт из карты сайта. Если имя автора выглядит как логин (например, admin), смени отображаемое имя в профиле пользователя WordPress на название компании.', verify: 'В карте сайта нет страниц авторов, и в разметке страниц нет имени-логина.' }
360
393
  : { task: 'Switch off author archives in the SEO plugin (Yoast: Search Appearance, Archives), so the author page leaves the sitemap. If the author name looks like a login (admin, say), change the display name in the WordPress user profile to the company name.', verify: 'The sitemap has no author pages, and the page markup carries no login-like name.' }) : null),
361
394
  ttfb: ({ ru }) => (ru
362
- ? { task: 'Сначала сделай три замера из страны, где живут твои посетители. Если ответ больше 0,8 секунды (порог, который Google считает хорошим), включи кеширование готовых страниц: плагин кеша, кеш хостинга или CDN. Менять хостинг только из-за нашего замера не нужно: мы меряем не из твоей страны.', verify: 'Три замера подряд из страны посетителей (curl -o /dev/null -w "%{time_starttransfer}" адрес главной) показывают не больше 0,8 секунды.' }
395
+ ? { task: 'Сначала сделай три замера из страны, где живут посетители сайта. Если ответ больше 0,8 секунды (порог, который Google считает хорошим), включи кеширование готовых страниц: плагин кеша, кеш хостинга или CDN. Менять хостинг только из-за нашего замера не нужно: мы мерили с сервера в Германии, а не из страны посетителей сайта.', verify: 'Три замера подряд из страны посетителей (curl -o /dev/null -w "%{time_starttransfer}" адрес главной) показывают не больше 0,8 секунды.' }
363
396
  : { task: 'First take three measurements from the country your visitors live in. If the answer takes over 0.8 seconds (the level Google calls good), turn on page caching: a cache plugin, host cache or a CDN. Do not move host on our measurement alone: we measure from elsewhere.', verify: 'Three runs in a row from your visitors\' country (curl -o /dev/null -w "%{time_starttransfer}" home URL) show 0.8 seconds or less.' }),
364
397
  thin: ({ audit, ru, v }) => {
365
398
  const sm = sampleOf(audit); const home = sm[0];
@@ -388,15 +421,17 @@ const PF = {
388
421
  : null) || (ru
389
422
  ? { task: 'Политику конфиденциальности и согласие на обработку персональных данных готовит владелец или юрист: текст не сочиняй. Когда текст будет, опубликуй его отдельной страницей, поставь ссылку в подвал и добавь к каждой форме, которая собирает имя, телефон или почту, галочку согласия со ссылкой на политику. Если правила или условия услуг лежат внутри другой страницы, вынеси их на отдельную и тоже поставь ссылку в подвал.', verify: 'В подвале каждой страницы есть ссылка на политику, она открывается с кодом 200, и у каждой формы есть галочка согласия.' }
390
423
  : { task: 'The owner or a lawyer writes the privacy policy and terms: do not draft legal text. Once it exists, publish it as its own page, link it from the footer, and add a consent checkbox linking to it on every form that collects a name, phone or email.', verify: 'Every page footer links the policy, it answers 200, and every form has a consent checkbox.' }),
391
- 'trust-profiles': ({ check, ru }) => (/ссылки на сайте есть|pages link to/i.test(String(check.value)) ? (ru
424
+ 'trust-profiles': (ctx) => PF['trust-profiles-messengers'](ctx) || (/ссылки на сайте есть|pages link to/i.test(String(ctx.check.value)) ? (ctx.ru
392
425
  ? { task: 'Профили, на которые сайт уже ссылается, впиши в поле sameAs разметки организации. Спроси владельца, есть ли другие настоящие профили (карты, отраслевые каталоги, соцсети), и добавь только подтверждённые.', verify: 'В разметке организации есть sameAs со ссылками на профили, которые уже стоят на сайте, и каждая открывает профиль этой компании.' }
393
426
  : { task: 'Put the profiles the site already links to into the sameAs field of the organisation markup. Ask the owner for any other real profiles (maps, directories, social) and add only confirmed ones.', verify: 'The organisation markup carries sameAs with the profiles already linked on the site, each opening this company\'s profile.' }) : null),
394
427
  sources: ({ ru }) => (ru
395
428
  ? { task: 'Подпиши источник к каждой цифре статистики на сайте (доли, количества людей, сравнения «в N раз»): ссылкой на первоисточник или словами. Цены, адреса, телефоны и сроки услуг источника не требуют. Если источника нет ни у тебя, ни у владельца, цифру убери. Не ставь ссылку наугад.', verify: 'Рядом с каждой цифрой статистики есть ссылка на первоисточник или названный словами источник, либо цифра убрана.' }
396
429
  : { task: 'Add a source to every statistic on the site (shares, counts of people, "N times" comparisons): a link to the original or a named source. Prices, addresses, phones and service timings need none. If neither you nor the owner has a source, remove the figure. Never guess a link.', verify: 'Every statistic has a link or a named source beside it, or has been removed.' }),
397
- 'answer-first': ({ ru, v }) => (ru
398
- ? { task: `Перепиши начало главных страниц так, чтобы первый абзац сразу отвечал на вопрос ${v.peopleGen}: что это, кому и на каких условиях. От двадцати до девяноста слов, с конкретной цифрой из фактов владельца; источник цифры назови рядом. Если цифры нет, не придумывай: спроси владельца.`, verify: 'Первый абзац после заголовка на этих страницах укладывается в 20-90 слов и содержит цифру с названным источником.' }
399
- : { task: `Rewrite the opening of the main pages so the first paragraph answers what ${v.people} ask: what it is, for whom, on what terms. Twenty to ninety words with a concrete figure from the owner's facts, its source named beside it. If there is no figure, do not invent one: ask the owner.`, verify: 'The first paragraph after the heading on those pages is 20 to 90 words and carries a figure with its source named.' }),
430
+ // Какие страницы переписывать, называем адресами: «главные страницы» исполнителю ничего не говорит (cimes.ru, 14.10.2026).
431
+ 'answer-first': ({ audit, ru, v }) => { const noAnswer = sampleOf(audit).filter((p) => !p.answerFirst); const miss = noAnswer.filter((p) => !isListPage(p)).slice(0, 12).map((p) => pathOf(p.url)); const lists = noAnswer.filter(isListPage).map((p) => pathOf(p.url)); const where = (miss.length ? (ru ? ` Страницы выборки без такого начала: ${miss.join(', ')}.` : ` Sampled pages without such an opening: ${miss.join(', ')}.`) : '') + (lists.length ? (ru ? ` Остальные (${lists.slice(0, 5).join(', ')}) это страницы-списки подразделов, их начало переписывать не нужно.` : ` The others (${lists.slice(0, 5).join(', ')}) are list pages leading to sub-pages: leave their opening as it is.`) : ''); const r = (ru
432
+ ? { task: `Перепиши начало главных страниц так, чтобы первый абзац сразу отвечал на вопрос ${v.peopleGen}: что это, кому и на каких условиях. От двадцати до девяноста слов, с конкретной цифрой из фактов владельца; источник цифры назови рядом (у собственных цен и сроков источник сам владелец, отдельно его называть не нужно). Если цифры нет, не придумывай: спроси владельца.`, verify: 'Первый абзац после заголовка на этих страницах укладывается в 20-90 слов и содержит цифру; если цифра не своя (не цена и не срок владельца), рядом назван источник.' }
433
+ : { task: `Rewrite the opening of the main pages so the first paragraph answers what ${v.people} ask: what it is, for whom, on what terms. Twenty to ninety words with a concrete figure from the owner's facts, its source named beside it (the owner's own prices and timings need no source). If there is no figure, do not invent one: ask the owner.`, verify: 'The first paragraph after the heading on those pages is 20 to 90 words and carries a figure; if the figure is not the owner\'s own price or timing, its source is named beside it.' }); return { ...r, task: `${r.task}${where}` }; },
434
+
400
435
  };
401
436
 
402
437
  const HEAD = {
@@ -513,6 +548,10 @@ export function agentPrompt(check, opts = {}) {
513
548
  }
514
549
 
515
550
  /** Все задания по открытым находкам аудита, в порядке важности. */
551
+ const datesGeneric = ({ ru }) => (ru
552
+ ? { task: 'Сверь даты публикации в разметке (datePublished) с настоящими датами материалов: если тема сортирует записи по этой дате, сначала переключи сортировку на настоящую дату, потом исправь даты в разметке. Затем выведи дату публикации видимой строкой на странице каждого материала.', verify: 'На странице каждого материала видна дата публикации, и она совпадает с datePublished в его разметке.' }
553
+ : { task: 'Check the published dates in the markup (datePublished) against the real dates of the posts: if the theme sorts posts by that date, switch the sorting first, then correct the markup dates. Then show the published date as a visible line on every post.', verify: 'Every post shows its published date on the page, and it matches datePublished in its markup.' });
554
+
516
555
  export function agentPrompts(audit, opts = {}) {
517
556
  const lang = opts.lang === 'ru' ? 'ru' : 'en';
518
557
  const limit = Number(opts.limit ?? 0);
@@ -524,7 +563,9 @@ export function agentPrompts(audit, opts = {}) {
524
563
  const nicheNow = vocabFor(audit, lang).niche;
525
564
  const AGENT_ONLY = new Set(['agent-card', 'api-catalog', 'agent-markdown']);
526
565
  const checks = source.filter((c) => (c.status === 'bad' || c.status === 'warn') && !(AGENT_ONLY.has(c.id) && nicheNow !== 'b2b'));
527
- const ordered = [...checks.filter((c) => c.status === 'bad'), ...checks.filter((c) => c.status === 'warn')];
566
+ // Сначала приоритеты отчёта в их порядке, потом остальное: план говорит «остальные задачи по порядку из файла задач» (cimes.ru, 14.10.2026).
567
+ const pri = (audit?.priorityIds || []).map((id) => checks.find((c) => c.id === id)).filter(Boolean);
568
+ const ordered = [...pri, ...checks.filter((c) => c.status === 'bad' && !pri.includes(c)), ...checks.filter((c) => c.status === 'warn' && !pri.includes(c))];
528
569
  const chosen = limit > 0 ? ordered.slice(0, limit) : ordered;
529
570
  const platform = opts.platform || detectPlatform(audit);
530
571
  return chosen.map((c) => ({ id: c.id, hasOwnText: Boolean(P[promptKey(c.id)] || PF[promptKey(c.id)]), text: agentPrompt(c, { lang, platform, audit }) }));
package/src/render.mjs CHANGED
@@ -24,9 +24,9 @@ const LABELS = {
24
24
  eyebrowAudit: 'Digital marketing audit', coverTitle: 'SEO, AEO and GEO<br>audit report',
25
25
  auditSubject: 'Audit subject', reportDate: 'Report date', auditType: 'Audit type', preparedBy: 'Prepared by',
26
26
  reproducible: 'Every status in this report was read from the public site and can be reproduced from it as it stood on the report date.',
27
- collectedBy: (tool, date) => `Public signals were collected by ${tool} on ${date}. Every status in this report can be reproduced from the site as it stood on that day.`,
27
+ collectedBy: (tool, date) => `Public signals were collected by ${String(tool).replace(/^@operstack\/audit\s*/, 'the OperStack checker, version ')} on ${date}. Every status in this report can be reproduced from the site as it stood on that day.`,
28
28
  secSummary: 'Executive summary', summaryEyebrow: '01 · Summary', keyTakeaway: 'Key takeaway:', threePriorities: 'Three priorities',
29
- scorecardFoot: 'These six scores are not a breakdown of the number above and will not add up to it: they count the checks in this report, which go wider than AI visibility. Each score counts the checks in this report: a check that passes scores one, a check that needs attention a half, a failing check nothing. An area marked <strong>not measured</strong> is an area this audit does not test, and is never scored on an impression. Every figure here can be recomputed from section 04 onwards.',
29
+ scorecardFoot: 'These six scores are not a breakdown of the number above and will not add up to it: they count the checks in this report, which go wider than AI visibility. Each score counts the checks in this report: a check that passes scores one, a check that needs attention a half, a failing check nothing. An area marked <strong>not measured</strong> is an area this audit does not test, and is never scored on an impression. Every figure here can be recomputed from the check tables below.',
30
30
  notMeasured: 'not measured',
31
31
  overallLabel: 'AI visibility score',
32
32
  grades: { A: 'Strong', B: 'Workable', C: 'Weak', D: 'Poor', E: 'Critical' },
@@ -38,7 +38,7 @@ const LABELS = {
38
38
  const read = o.basis ? `It was read from ${o.basis.pages} page${o.basis.pages === 1 ? '' : 's'} of the site${o.basis.sitemapUnchecked ? ', and the sitemap did not answer in time, which is not counted against the score either way' : o.basis.sitemapRead ? ' and its sitemap' : ''} for this score; the rest of the report counts the whole sample. ` : '';
39
39
  const where = o.source === 'visibility:reused'
40
40
  ? `This is the same figure you already saw on the free check${o.measuredAt ? ` on ${String(o.measuredAt).slice(0, 10)}` : ''}. It is not measured again here, so the page, the email and this report always carry one number. `
41
- : 'Measured here by the same code and the same settings as the free check at oper-stack.com/ai-visibility. ';
41
+ : 'Measured here by the same code and the same settings as the free check at oper‑stack.com/ai‑visibility. ';
42
42
  const areas = Array.isArray(o.areas) ? o.areas : [];
43
43
  const measured = areas.filter((a) => a.measured !== false && a.score !== null);
44
44
  const sumUp = areas.length && measured.length < areas.length
@@ -60,10 +60,10 @@ const LABELS = {
60
60
  secTechnical: 'Technical SEO', technicalEyebrow: '04 · Technical', technicalTitle: 'Technical and on-page checklist', colCheck: 'Check', colStatus: 'Status', colFinding: 'Finding',
61
61
  secContent: 'Content and on-page', contentEyebrow: '05 · Content', contentTitle: 'Content and on-page SEO', strengths: 'Strengths', weaknesses: 'Weaknesses', gaps: 'Structural gaps: pages that do not exist yet',
62
62
  secAeo: 'AEO and GEO', aeoEyebrow: '06 · AEO / GEO', aeoTitle: 'Answer engines: AEO', aeoLead: 'Whether the site\'s answers can be lifted into "People also ask", AI overviews, ChatGPT and Perplexity.', aeoWorks: 'What already works', aeoBlocks: 'What blocks the wins', recommendation: 'Recommendation:', geoTitle: 'Generative engines: GEO', colSignal: 'Signal', colDetail: 'Detail',
63
- secOffpage: 'Off-page, conversion, limitations', offpageEyebrow: '07 · Off-page', offpageTitle: 'Off-page and trust', conversionEyebrow: '08 · Conversion', conversionTitle: 'Conversion and UX', colElement: 'Element', limitationsEyebrow: '10 · Limitations', sourcesTitle: 'Where the data comes from', colSource: 'Source', colAccess: 'Access', colWhatRead: 'What was read',
63
+ secOffpage: 'Off-page and conversion', offpageEyebrow: '07 · Off-page', offpageTitle: 'Off-page and trust', conversionEyebrow: '08 · Conversion', conversionTitle: 'Conversion and UX', colElement: 'Element', limitationsEyebrow: '10 · Limitations', sourcesTitle: 'Where the data comes from', colSource: 'Source', colAccess: 'Access', colWhatRead: 'What was read',
64
64
  sourcesFoot: 'Every score in this report is computed from sources marked free. Nothing that costs money is counted in a score, so you can re-run this audit yourself and get the same or very close numbers.',
65
65
  limitations: 'Limitations',
66
- secRoadmap: 'Roadmap', roadmapEyebrow: '09 · Roadmap', demandEyebrow: '11 · Demand', demandTitle: 'Demand map', secDemand: 'Demand', roadmapTitle: 'What to do, in order', keyMessage: 'Key message:',
66
+ secRoadmap: 'Roadmap and limitations', roadmapEyebrow: '09 · Roadmap', demandEyebrow: '11 · Demand', demandTitle: 'Demand map', secDemand: 'Demand', roadmapTitle: 'What to do, in order', keyMessage: 'Key message:',
67
67
  runningHead: 'SEO, AEO and GEO audit',
68
68
  statusOk: '✓ OK', statusWarn: '△ Partial', statusBad: '✗ Problem', statusNa: '· Note',
69
69
  areas: null,
@@ -74,9 +74,9 @@ const LABELS = {
74
74
  eyebrowAudit: 'Аудит цифрового маркетинга', coverTitle: 'Аудит сайта:<br>SEO, AEO и GEO',
75
75
  auditSubject: 'Что проверяли', reportDate: 'Дата отчёта', auditType: 'Тип аудита', preparedBy: 'Кто готовил',
76
76
  reproducible: 'Каждый статус в этом отчёте прочитан с публичного сайта, и его можно перепроверить по сайту на дату отчёта.',
77
- collectedBy: (tool, date) => `Публичные сигналы собраны инструментом ${tool} ${date}. Любой статус в этом отчёте можно перепроверить по сайту в том виде, в каком он был в этот день.`,
77
+ collectedBy: (tool, date) => `Публичные сигналы собраны ${date ? `${date} ` : ''}инструментом ${String(tool).replace(/^@operstack\/audit\s*/, 'проверки OperStack, версия ')}. Любой статус в этом отчёте можно перепроверить по сайту в том виде, в каком он был в этот день.`,
78
78
  secSummary: 'Главное', summaryEyebrow: '01 · Итог', keyTakeaway: 'Главный вывод:', threePriorities: 'Три приоритета',
79
- scorecardFoot: 'Эти шесть оценок не разбивка балла выше и в сумме его не дают: они считают проверки самого отчёта, а он шире, чем видимость в ИИ. Каждая оценка считает проверки из этого же отчёта: пройденная проверка это балл, спорная половина балла, проваленная ноль. Область с пометкой <strong>не измерялось</strong> это область, которую аудит не проверяет, и она никогда не оценивается на глаз. Любую цифру отсюда можно пересчитать по разделам начиная с четвёртого.',
79
+ scorecardFoot: 'Эти шесть оценок не разбивка балла выше и в сумме его не дают: они считают проверки самого отчёта, а он шире, чем видимость в ИИ. Каждая оценка считает проверки из этого же отчёта: пройденная проверка даёт балл, частичная половину балла, проваленная ноль. Область с пометкой <strong>не измерялось</strong> это область, которую аудит не проверяет, и она никогда не оценивается на глаз. Любую цифру отсюда можно пересчитать по таблицам проверок ниже.',
80
80
  notMeasured: 'не измерялось',
81
81
  overallLabel: 'Балл видимости в ИИ',
82
82
  grades: { A: 'Сильно', B: 'Рабочее состояние', C: 'Слабо', D: 'Плохо', E: 'Критично' },
@@ -86,13 +86,13 @@ const LABELS = {
86
86
  const read = o.basis ? `Прочитано ${p} ${pl} сайта${o.basis.sitemapUnchecked ? ', а карта сайта не ответила вовремя, и это не зачтено ни в плюс, ни в минус' : o.basis.sitemapRead ? ' и его карта' : ''}: это для балла; остальные разделы отчёта считаются по всей выборке. ` : '';
87
87
  const where = o.source === 'visibility:reused'
88
88
  ? `Это ровно то число, которое вы уже видели в бесплатной проверке${o.measuredAt ? ` ${String(o.measuredAt).slice(0, 10)}` : ''}. Здесь оно не меряется заново, поэтому страница, письмо и этот отчёт всегда несут одно число. `
89
- : 'Измерено здесь тем же кодом и с теми же настройками, что у бесплатной проверки на oper-stack.ru/ai-visibility. ';
89
+ : 'Измерено здесь тем же кодом и с теми же настройками, что у бесплатной проверки на oper‑stack.ru/ai‑visibility. ';
90
90
  const areas = Array.isArray(o.areas) ? o.areas : [];
91
91
  const measured = areas.filter((a) => a.measured !== false && a.score !== null);
92
92
  const sumUp = areas.length && measured.length < areas.length
93
93
  ? `Из пяти областей ниже измерены ${measured.length}, они дают ${measured.reduce((t, a) => t + a.score, 0)} из ${measured.reduce((t, a) => t + a.max, 0)}, и балл это та же доля, перенесённая на сто. Область с пометкой «не измерялось» не зачтена ни в плюс, ни в минус. `
94
94
  : 'Пять областей ниже дают в сумме ровно этот балл, его можно сложить руками. ';
95
- return `${where}${read}${sumUp}Повторная проверка может дать на пункт-другой иначе: проверка, которая успела ответить в один прогон, может не успеть в следующий, а балл никогда не засчитывает сайту в минус то, что не удалось прочитать.`;
95
+ return `${where}${read}${sumUp}Повторная проверка может отличаться на пункт-другой: проверка, которая успела ответить в один прогон, может не успеть в следующий, а балл никогда не засчитывает сайту в минус то, что не удалось прочитать.`;
96
96
  },
97
97
  secondMeasure: 'Второе, отдельное измерение: как этот отчёт оценивает собственные проверки',
98
98
  ofHundred: 'из 100', ofHundredShort: 'ИЗ 100', aiVisibility: 'ИИ-видимость', seoBasics: 'Основы SEO',
@@ -106,12 +106,12 @@ const LABELS = {
106
106
  secOverview: 'О сайте', overviewEyebrow: '02 · Обзор', whatSiteIs: 'Что это за сайт', parameter: 'Параметр', value: 'Значение', pagesSampled: 'Проверенные страницы', colUrl: 'Адрес', colTitle: 'Заголовок', colWords: 'Слов',
107
107
  secCritical: 'Критичное', criticalEyebrow: '03 · Срочно', criticalTitle: 'Что чинить первым', whatItCosts: 'Чем это грозит', theFix: 'Как чинится', noBody: 'У этой проблемы нет описания в файле аудита.', noCritical: 'Критичных дефектов в публичных сигналах не найдено.',
108
108
  secTechnical: 'Техническое SEO', technicalEyebrow: '04 · Техника', technicalTitle: 'Техническая проверка и страницы', colCheck: 'Проверка', colStatus: 'Статус', colFinding: 'Что нашли',
109
- secContent: 'Контент и страницы', contentEyebrow: '05 · Контент', contentTitle: 'Контент и внутренняя оптимизация', strengths: 'Сильные стороны', weaknesses: 'Слабые места', gaps: 'Структурные дыры: страниц, которых пока нет',
110
- secAeo: 'AEO и GEO', aeoEyebrow: '06 · AEO / GEO', aeoTitle: 'Ответные системы: AEO', aeoLead: 'Может ли ответ с вашего сайта попасть в блок «Люди также спрашивают», в ответы ИИ, в ChatGPT и Perplexity.', aeoWorks: 'Что уже работает', aeoBlocks: 'Что мешает', recommendation: 'Рекомендация:', geoTitle: 'Генеративные системы: GEO', colSignal: 'Сигнал', colDetail: 'Подробности',
111
- secOffpage: 'Ссылки, конверсия, ограничения', offpageEyebrow: '07 · Ссылки', offpageTitle: 'Ссылки и доверие', conversionEyebrow: '08 · Конверсия', conversionTitle: 'Конверсия и удобство', colElement: 'Элемент', limitationsEyebrow: '10 · Ограничения', sourcesTitle: 'Откуда взяты данные', colSource: 'Источник', colAccess: 'Доступ', colWhatRead: 'Что прочитали',
109
+ secContent: 'Контент и страницы', contentEyebrow: '05 · Контент', contentTitle: 'Контент и внутренняя оптимизация', strengths: 'Сильные стороны', weaknesses: 'Слабые места', gaps: 'Структурные дыры: страницы, которых пока нет',
110
+ secAeo: 'AEO и GEO', aeoEyebrow: '06 · AEO / GEO', aeoTitle: 'Ответные системы: AEO', aeoLead: 'Здесь видно, может ли ответ с вашего сайта попасть в блок «Люди также спрашивают» и в ответы ИИ: ChatGPT, Perplexity, Алисы.', aeoWorks: 'Что уже работает', aeoBlocks: 'Что мешает', recommendation: 'Рекомендация:', geoTitle: 'Генеративные системы: GEO', colSignal: 'Сигнал', colDetail: 'Подробности',
111
+ secOffpage: 'Ссылки и конверсия', offpageEyebrow: '07 · Ссылки', offpageTitle: 'Ссылки и доверие', conversionEyebrow: '08 · Конверсия', conversionTitle: 'Конверсия и удобство', colElement: 'Элемент', limitationsEyebrow: '10 · Ограничения', sourcesTitle: 'Откуда взяты данные', colSource: 'Источник', colAccess: 'Доступ', colWhatRead: 'Что прочитали',
112
112
  sourcesFoot: 'Каждая оценка в этом отчёте посчитана из источников с пометкой «бесплатно». Ничего платного ни в одну оценку не входит, поэтому вы можете повторить этот аудит сами и получить те же или очень близкие цифры.',
113
113
  limitations: 'Ограничения',
114
- secRoadmap: 'План работ', roadmapEyebrow: '09 · План', demandEyebrow: '11 · Спрос', demandTitle: 'Карта спроса', secDemand: 'Спрос', roadmapTitle: 'Что делать и в каком порядке', keyMessage: 'Главное сообщение:',
114
+ secRoadmap: 'План работ и ограничения', roadmapEyebrow: '09 · План', demandEyebrow: '11 · Спрос', demandTitle: 'Карта спроса', secDemand: 'Спрос', roadmapTitle: 'Что делать и в каком порядке', keyMessage: 'Главное сообщение:',
115
115
  runningHead: 'Аудит SEO, AEO и GEO',
116
116
  statusOk: '✓ Норма', statusWarn: '△ Частично', statusBad: '✗ Проблема', statusNa: '· Заметка',
117
117
  areas: AREAS_RU,
@@ -314,7 +314,7 @@ function css() {
314
314
  table.pages.appendix td:nth-child(1), table.pages.appendix th:nth-child(1) { width: 33%; }
315
315
  table.pages.appendix td:nth-child(2), table.pages.appendix th:nth-child(2) { width: 35%; }
316
316
  table.pages.appendix td:nth-child(n+3), table.pages.appendix th:nth-child(n+3) { width: 8%; text-align: right; font-variant-numeric: tabular-nums; }
317
- td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; } .status-na { color: var(--muted); }
317
+ td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; } .status-na { color: var(--muted); white-space: nowrap; }
318
318
  .cards { display: grid; gap: 3mm; margin: 4mm 0; }
319
319
  .card { border-left: 3px solid var(--danger); background: #fbf1f0; padding: 3.5mm 4mm; border-radius: 0 4px 4px 0; }
320
320
  .card.warn { border-left-color: var(--warn); background: #fdf8ee; }
@@ -335,7 +335,7 @@ function css() {
335
335
 
336
336
  const header = (audit, section, L) => `<div class="page-header"><strong>${esc(audit.client.name)}</strong><span>${esc(L.runningHead)} · ${esc(section)}</span></div>`;
337
337
  const footer = (audit, n, by) => `<div class="page-footer"><span>${esc(by || audit.client.preparedBy || 'OperStack')} · ${esc(audit.client.reportDate)}</span><span>${n}</span></div>`;
338
- const list = (items) => `<ul>${(items || []).map((i) => `<li>${t(i)}</li>`).join('')}</ul>`;
338
+ const list = (items) => `<ul>${(items || []).filter((i) => String(i ?? '').trim()).map((i) => `<li>${t(i)}</li>`).join('')}</ul>`;
339
339
  const olist = (items) => `<ol>${(items || []).map((i) => `<li>${t(i)}</li>`).join('')}</ol>`;
340
340
  const statusCell = (s, L) => `<td class="${STATUS_CLASS[s] || STATUS_CLASS.na}">${L[STATUS_KEYS[s] || 'statusNa']}</td>`;
341
341
 
@@ -455,7 +455,10 @@ export function toHtml(audit, brand = null) {
455
455
  * второй про проверки самого отчёта и что делать. Оба полные.
456
456
  */
457
457
  pages.push(`<div class="page">${masthead}<div class="eyebrow">${L.summaryEyebrow}</div><h2>${L.secSummary}</h2><p class="lead">${t(a.summary.lead)}</p>${overallBlock}${footer(a, n++, preparedBy)}</div>`);
458
- pages.push(`<div class="page">${header(a, L.secSummary, L)}<div class="eyebrow">${L.summaryEyebrow}</div><h2>${L.secondMeasure}</h2><div class="scorecard">${scoreCards}</div><p class="scorecard-foot">${L.scorecardFoot}</p><div class="verdict"><p><strong>${L.keyTakeaway}</strong> ${t(a.summary.verdict)}</p></div><h3>${L.threePriorities}</h3>${olist(a.summary.priorities)}${footer(a, n++, preparedBy)}</div>`);
458
+ // Фраза про «не измерялось» только если такая область в отчёте есть: иначе владелец ищет пометку, которой нет (cimes.ru, 14.10.2026).
459
+ const anyUnmeasured = Object.values(a.scores || {}).some((v) => typeof v !== 'number');
460
+ const scoreFoot = anyUnmeasured ? L.scorecardFoot : L.scorecardFoot.replace(/(Область с пометкой|An area marked) <strong>[^<]+<\/strong>[^.]*\. ?/, '');
461
+ pages.push(`<div class="page">${header(a, L.secSummary, L)}<div class="eyebrow">${L.summaryEyebrow}</div><h2>${L.secondMeasure}</h2><div class="scorecard">${scoreCards}</div><p class="scorecard-foot">${scoreFoot}</p><div class="verdict"><p><strong>${L.keyTakeaway}</strong> ${t(a.summary.verdict)}</p></div><h3>${L.threePriorities}</h3>${olist(a.summary.priorities)}${footer(a, n++, preparedBy)}</div>`);
459
462
  /*
460
463
  * Обзор: таблица прочитанных страниц не влезала на лист и переливалась. Режем её по счёту
461
464
  * строк, как техническую. Первый лист несёт параметры сайта и первые строки, дальше только
@@ -496,7 +499,8 @@ export function toHtml(audit, brand = null) {
496
499
  pages.push(`<div class="page">${header(a, L.secOverview, L)}<div class="eyebrow">${L.overviewEyebrow}</div><h2>${L.pagesSampled}</h2><table class="pages">${pagesHead}${chunk.map(pageRow).join('')}</table>${footer(a, n++, preparedBy)}</div>`);
497
500
  }
498
501
  const cardBody = (c) => [
499
- c.text ? `<p>${t(c.text)}</p>` : '',
502
+ // Текст карточки это отдельное предложение под заголовком: с заглавной (cimes.ru, 14.10.2026).
503
+ c.text ? `<p>${t(`${String(c.text)[0].toUpperCase()}${String(c.text).slice(1)}`)}</p>` : '',
500
504
  c.cost ? `<p><span class="card-tag">${L.whatItCosts}</span>${t(c.cost)}</p>` : '',
501
505
  c.fix ? `<p><span class="card-tag">${L.theFix}</span>${t(c.fix)}</p>` : '',
502
506
  ].join('') || '<p class="card-empty">${L.noBody}</p>';
@@ -506,8 +510,11 @@ export function toHtml(audit, brand = null) {
506
510
  * он занимал целую страницу одной строкой «критичных дефектов не найдено», а это в отчёте за
507
511
  * деньги выглядит как пустой лист. Сам факт не пропадает: он сказан в сводке.
508
512
  */
513
+ let criticalInline = '';
509
514
  if ((a.critical || []).length) {
510
- pages.push(`<div class="page">${header(a, L.secCritical, L)}<div class="eyebrow">${L.criticalEyebrow}</div><h2>${L.criticalTitle}</h2><div class="cards">${cards}</div>${footer(a, n++, preparedBy)}</div>`);
515
+ // Один-два пункта на целом листе выглядят пустым листом (cimes.ru, 14.10.2026): тогда раздел встаёт в начало технической проверки.
516
+ if (a.critical.length <= 3) criticalInline = `<div class="eyebrow">${L.criticalEyebrow}</div><h2>${L.criticalTitle}</h2><div class="cards">${cards}</div>`;
517
+ else pages.push(`<div class="page">${header(a, L.secCritical, L)}<div class="eyebrow">${L.criticalEyebrow}</div><h2>${L.criticalTitle}</h2><div class="cards">${cards}</div>${footer(a, n++, preparedBy)}</div>`);
511
518
  }
512
519
  /*
513
520
  * Длинная таблица режется на листы по счёту строк, а не переливается сама.
@@ -524,15 +531,18 @@ export function toHtml(audit, brand = null) {
524
531
  const techPages = [];
525
532
  let bucket = [];
526
533
  let units = 0;
534
+ if (criticalInline) units = 3 * a.critical.length;
527
535
  for (const c of techChecks) {
528
536
  const cost = c.comment ? 1.5 : 1;
529
537
  if (units + cost > TECH_UNITS_PER_PAGE && bucket.length) { techPages.push(bucket); bucket = []; units = 0; }
530
538
  bucket.push(c); units += cost;
531
539
  }
532
540
  if (bucket.length) techPages.push(bucket);
541
+ // Хвост в одну-две строки не печатаем отдельным листом: он уходит на предыдущий, подгонка листа его ужмёт (cimes.ru, 14.10.2026).
542
+ if (techPages.length > 1 && techPages[techPages.length - 1].length <= 2) { const tail = techPages.pop(); techPages[techPages.length - 1].push(...tail); }
533
543
  techPages.forEach((chunk, i) => {
534
544
  const title = techPages.length > 1 ? `${L.technicalTitle} (${i + 1}/${techPages.length})` : L.technicalTitle;
535
- pages.push(`<div class="page">${header(a, L.secTechnical, L)}<div class="eyebrow">${L.technicalEyebrow}</div><h2>${esc(title)}</h2><table>${techHead}${chunk.map(rowHtml).join('')}</table>${footer(a, n++, preparedBy)}</div>`);
545
+ pages.push(`<div class="page">${header(a, i === 0 && criticalInline ? `${L.secCritical} · ${L.secTechnical}` : L.secTechnical, L)}${i === 0 ? criticalInline : ''}<div class="eyebrow"${i === 0 && criticalInline ? ' style="margin-top:7mm"' : ''}>${L.technicalEyebrow}</div><h2>${esc(title)}</h2><table>${techHead}${chunk.map(rowHtml).join('')}</table>${footer(a, n++, preparedBy)}</div>`);
536
546
  });
537
547
  pages.push(`<div class="page">${header(a, L.secContent, L)}<div class="eyebrow">${L.contentEyebrow}</div><h2>${L.contentTitle}</h2><div class="two-col"><div><h3>${L.strengths}</h3>${list(a.content.strengths)}</div><div><h3>${L.weaknesses}</h3>${list(a.content.weaknesses)}</div></div><h3>${L.gaps}</h3>${list(a.content.gaps)}${checksBy('content').length ? `<table><tr><th>${L.colCheck}</th><th>${L.colStatus}</th><th>${L.colFinding}</th></tr>${checksBy('content').map((c) => `<tr><td>${esc(c.label)}</td>${statusCell(c.status, L)}<td>${esc(c.value)}</td></tr>`).join('')}</table>` : ''}${footer(a, n++, preparedBy)}</div>`);
538
548
  const geoRows = [...checksBy('aeo'), ...checksBy('geo')].map((c) => `<tr><td>${esc(c.label)}</td>${statusCell(c.status, L)}<td>${esc(c.value)}${c.comment ? `. ${esc(c.comment.charAt(0).toUpperCase() + c.comment.slice(1))}` : ''}</td></tr>`).join('') + (a.geo.rows || []).map(([k, s, d]) => `<tr><td>${t(k)}</td><td>${t(s)}</td><td>${t(d)}</td></tr>`).join('');
@@ -542,7 +552,7 @@ export function toHtml(audit, brand = null) {
542
552
  * AEO и GEO стояли на одном листе: два заголовка, два списка, две врезки и таблица сигналов.
543
553
  * Лист переливал почти на восемьсот пикселей. Теперь по разделу на лист.
544
554
  */
545
- pages.push(`<div class="page">${header(a, L.secAeo, L)}<div class="eyebrow">${L.aeoEyebrow}</div><h2>${L.aeoTitle}</h2><p class="lead">${esc(L.aeoLead)}</p><div class="two-col"><div><h3>${L.aeoWorks}</h3>${list(a.aeo.works)}</div><div><h3>${L.aeoBlocks}</h3>${list(a.aeo.blocks)}</div></div><div class="callout"><p><strong>${L.recommendation}</strong> ${t(a.aeo.recommendation)}</p></div>${footer(a, n++, preparedBy)}</div>`);
555
+ pages.push(`<div class="page">${header(a, L.secAeo, L)}<div class="eyebrow">${L.aeoEyebrow}</div><h2>${L.aeoTitle}</h2><p class="lead">${esc(L.aeoLead)}</p><div class="two-col"><div><h3>${L.aeoWorks}</h3>${list(a.aeo.works)}</div><div><h3>${L.aeoBlocks}</h3>${list(a.aeo.blocks)}</div></div><div class="callout"><p><strong>${L.recommendation}</strong> ${t(a.aeo.recommendation)}</p></div>${checkTable('aeo')}${footer(a, n++, preparedBy)}</div>`);
546
556
  /*
547
557
  * Таблица сигналов GEO выросла до двадцати пяти строк и на лист не влезает. Режем её, как и
548
558
  * остальные длинные таблицы: по счёту строк, с продолжением под своим номером.
@@ -558,7 +568,9 @@ export function toHtml(audit, brand = null) {
558
568
  pages.push(`<div class="page">${header(a, L.secAeo, L)}<div class="eyebrow">${L.aeoEyebrow}</div><h2>${esc(title)}</h2><table>${geoHead}${chunk.join('')}</table>${tail}${footer(a, n++, preparedBy)}</div>`);
559
569
  });
560
570
  pages.push(`<div class="page">${header(a, L.secOffpage, L)}<div class="eyebrow">${L.offpageEyebrow}</div><h2>${L.offpageTitle}</h2>${checkTable('offpage')}${list(a.offpage.listed)}<p>${t(a.offpage.note)}</p>${footer(a, n++, preparedBy)}</div>`);
561
- pages.push(`<div class="page">${header(a, L.secOffpage, L)}<div class="eyebrow">${L.conversionEyebrow}</div><h2>${L.conversionTitle}</h2>${checkTable('conversion')}<table><tr><th>${L.colElement}</th><th>${L.colStatus}</th></tr>${(a.conversion.rows || []).map(([k, v]) => `<tr><td>${t(k)}</td><td>${t(v)}</td></tr>`).join('')}</table>${footer(a, n++, preparedBy)}</div>`);
571
+ // Строки, которые слово в слово повторяют таблицу проверок выше, не печатаем второй раз (cimes.ru, 14.10.2026).
572
+ const convRows = (a.conversion.rows || []).filter(([, v]) => !checksBy('conversion').some((c) => String(c.value || '').trim() === String(v || '').trim()));
573
+ pages.push(`<div class="page">${header(a, L.secOffpage, L)}<div class="eyebrow">${L.conversionEyebrow}</div><h2>${L.conversionTitle}</h2>${checkTable('conversion')}${convRows.length ? `<table><tr><th>${L.colElement}</th><th>${L.colFinding}</th></tr>${convRows.map(([k, v]) => `<tr><td>${t(k)}</td><td>${t(v)}</td></tr>`).join('')}</table>` : ''}${footer(a, n++, preparedBy)}</div>`);
562
574
 
563
575
  /*
564
576
  * Вы и ваши конкуренты. Балл видимости стоит первым, потому что он у всех посчитан по десяти
@@ -679,6 +691,10 @@ export function toHtml(audit, brand = null) {
679
691
  if (a.demand && Array.isArray(a.demand.queries)) {
680
692
  pages.push(`<div class="page">${header(a, L.secDemand, L)}<div class="eyebrow">${L.demandEyebrow}</div><h2>${L.demandTitle}</h2>${renderDemandHtml(a.demand, { lang: a.meta?.lang === 'ru' ? 'ru' : 'en' })}${footer(a, n++, preparedBy)}</div>`);
681
693
  }
694
+ // Номера разделов сквозные: без раздела «Что чинить первым» после 02 шёл 04 (cimes.ru, 14.10.2026).
695
+ { const order = []; for (const m of pages.join('').matchAll(/class="eyebrow">(\d{2}) ·/g)) if (!order.includes(m[1])) order.push(m[1]);
696
+ const map = Object.fromEntries(order.map((n, i) => [n, String(i + 1).padStart(2, '0')]));
697
+ for (let i = 0; i < pages.length; i++) pages[i] = pages[i].replace(/class="eyebrow">(\d{2}) ·/g, (m, n) => `class="eyebrow">${map[n] || n} ·`); }
682
698
  return `<!doctype html><html lang="${a.meta?.lang === 'ru' ? 'ru' : 'en'}"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>${esc(a.client.name)}: ${esc(L.docTitle)}</title><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono&display=swap"><style>${css()}${accentCss}</style></head><body>${pages.join('\n')}${FIT_SCRIPT}</body></html>`;
683
699
  }
684
700
 
@@ -691,12 +707,12 @@ export function toHtml(audit, brand = null) {
691
707
  * живёт в HTML, а не в печатающем коде. Проверка числа листов после печати: pdfPageCount.
692
708
  */
693
709
  export const FIT_SCRIPT = `<script>(document.fonts?document.fonts.ready:Promise.resolve()).then(function(){var H=297*96/25.4;function rowsOf(t){return Array.prototype.filter.call(t.querySelectorAll('tr'),function(r){return !r.querySelector('th')})}
694
- for(var g=0;g<30;g++){var did=false,pages=document.querySelectorAll('.page');for(var i=0;i<pages.length;i++){var el=pages[i];if(el.scrollHeight<=H+1)continue;var tbs=el.querySelectorAll('table');if(!tbs.length)continue;var tb=tbs[tbs.length-1],rows=rowsOf(tb);if(el.scrollHeight/H<1.06||rows.length<4)continue;
695
- var clone=el.cloneNode(true),ctbs=clone.querySelectorAll('table'),ctb=ctbs[ctbs.length-1],crows=rowsOf(ctb),k=rows.length;while(el.scrollHeight>H+1&&k>1){rows[--k].style.display='none'}if(k===rows.length)continue;
710
+ for(var g=0;g<30;g++){var did=false,pages=document.querySelectorAll('.page');for(var i=0;i<pages.length;i++){var el=pages[i],h0=el.scrollHeight;if(h0<=H+1)continue;var tbs=el.querySelectorAll('table');if(!tbs.length)continue;var tb=tbs[tbs.length-1],rows=rowsOf(tb);if(el.scrollHeight/H<1.06||rows.length<4)continue;
711
+ var clone=el.cloneNode(true),ctbs=clone.querySelectorAll('table'),ctb=ctbs[ctbs.length-1],crows=rowsOf(ctb),k=rows.length;while(el.scrollHeight>H+1&&k>1){rows[--k].style.display='none'}if(k===rows.length)continue;if(rows.length-k<=3&&h0*0.85<=H){for(var r3=k;r3<rows.length;r3++)rows[r3].style.display='';continue}
696
712
  for(var j=k;j<rows.length;j++)rows[j].parentNode.removeChild(rows[j]);for(var j2=0;j2<k;j2++)crows[j2].parentNode.removeChild(crows[j2]);
697
- var keep=[];for(var n=ctb;n&&n!==clone;n=n.parentNode)keep.push(n);Array.prototype.slice.call(clone.children).forEach(function(c){if(keep.indexOf(c)>=0)return;if(/page-footer|masthead|eyebrow/.test(c.className||''))return;if(/^H[1-3]$/.test(c.tagName))return;if(c.compareDocumentPosition(ctb)&4)c.parentNode.removeChild(c)});
713
+ var keep=[];for(var n=ctb;n&&n!==clone;n=n.parentNode)keep.push(n);Array.prototype.slice.call(clone.children).forEach(function(c){if(keep.indexOf(c)>=0)return;if(/page-footer|page-header|masthead|eyebrow/.test(c.className||''))return;if(/^H[1-3]$/.test(c.tagName))return;if(c.compareDocumentPosition(ctb)&4)c.parentNode.removeChild(c)});
698
714
  var top=tb;while(top.parentNode&&top.parentNode!==el)top=top.parentNode;var nx=top.nextElementSibling;while(nx){var after=nx.nextElementSibling;if(!/page-footer/.test(nx.className||''))nx.parentNode.removeChild(nx);nx=after}el.parentNode.insertBefore(clone,el.nextSibling);did=true;break}if(!did)break}
699
- Array.prototype.forEach.call(document.querySelectorAll('.page'),function(el){var h=el.scrollHeight;if(h>H+1){var z=Math.max(0.9,Math.floor((H-2)/h*1000)/1000);el.style.zoom=z;el.style.height=(H/z)+'px';el.style.minHeight=(H/z)+'px';el.style.overflow='hidden';if(z===0.9&&h*z>H+1)document.documentElement.setAttribute('data-overflow','1')}});
715
+ Array.prototype.forEach.call(document.querySelectorAll('.page'),function(el){var h=el.scrollHeight;if(h>H+1){var z=Math.max(0.85,Math.floor((H-2)/h*1000)/1000);el.style.zoom=z;el.style.height=(H/z)+'px';el.style.minHeight=(H/z)+'px';el.style.overflow='hidden';if(z===0.85&&h*z>H+1)document.documentElement.setAttribute('data-overflow','1')}});
700
716
  var no=0;Array.prototype.forEach.call(document.querySelectorAll('.page-footer span:last-child'),function(s){if(/^\\d+$/.test(s.textContent.trim()))s.textContent=String(++no)});
701
717
  document.documentElement.setAttribute('data-pages',String(document.querySelectorAll('.page').length))});</script>`;
702
718
 
package/src/rendered.mjs CHANGED
@@ -132,9 +132,11 @@ export function renderedDom(url, { chrome = null, timeoutMs = 45000, waitMs = 80
132
132
  });
133
133
  }
134
134
 
135
- const CHROME_STRIP = /<(nav|footer|aside|script|style|noscript|template)[\s\S]*?<\/\1>/gi;
135
+ const CHROME_STRIP = /<(nav|header|footer|aside|script|style|noscript|template)[\s\S]*?<\/\1>/gi;
136
136
  // Баннер cookie и согласия рисует скрипт, но это не текст страницы: у cimes.ru 14.10.2026 он один дал «скрыто 19 процентов».
137
- const COOKIE_BOX = /cookie|consent|gdpr|cmp-|onetrust|cookiebot/i;
137
+ // Меню и выпадающие списки, которые скрипт достраивает вне <nav>, тоже не текст страницы: у cimes.ru 14.10.2026 «скрыто 20 процентов»
138
+ // были пункты меню «Услуги» и «Готовые решения». Убираем одинаково из обеих версий страницы.
139
+ const COOKIE_BOX = /cookie|consent|gdpr|cmp-|onetrust|cookiebot|(^|[\s_-])(menu|submenu|mega-?menu|dropdown|navbar|burger|mobile-nav|offcanvas)([\s_-]|$)/i;
138
140
  const dropCookieBoxes = (html) => {
139
141
  try {
140
142
  const root = parseHtml(String(html));
@@ -190,7 +192,10 @@ export function jsBlindnessCheck(pages, lang = 'en') {
190
192
  const worst = measured.slice().sort((a, b) => b.hiddenShare - a.hiddenShare)[0];
191
193
  const median = measured.map((p) => p.hiddenShare).sort((a, b) => a - b)[Math.floor(measured.length / 2)];
192
194
  const status = measured.some((p) => p.verdict === 'bad') ? 'bad' : measured.some((p) => p.verdict === 'warn') ? 'warn' : 'ok';
193
- const value = lang === 'ru'
195
+ // Ничего не скрыто: так и пишем, без «видно всё, кроме 0 процентов» (cimes.ru, 14.10.2026).
196
+ const value = worst.hiddenShare === 0
197
+ ? (lang === 'ru' ? `без скриптов виден весь текст: проверено на ${measured.length} ${measured.length === 1 ? 'странице' : 'страницах'}` : `all the text is visible without JavaScript, checked on ${measured.length} page${measured.length === 1 ? '' : 's'}`)
198
+ : lang === 'ru'
194
199
  ? `без скриптов видно всё, кроме ${median} процентов текста (медиана по ${measured.length} ${measured.length === 1 ? 'странице' : 'страницам'}), хуже всего ${worst.url}: там скрыто ${worst.hiddenShare} процентов, ${WORD.ru(worst.raw)} без скриптов против ${WORD.ru(worst.rendered)} в браузере`
195
200
  : `${median}% of the text is invisible without JavaScript (median over ${measured.length} page${measured.length === 1 ? '' : 's'}); worst is ${worst.url} at ${worst.hiddenShare}%, ${worst.raw} words without scripts against ${worst.rendered} in a browser`;
196
201
  // Слова по размеру беды: на четырнадцати процентах писать «страница почти пустая» это враньё
package/src/tasks-pdf.mjs CHANGED
@@ -20,7 +20,7 @@ export function renderTasksHtml(audit, { lang = audit.meta?.lang || 'en' } = {})
20
20
  const host = audit.meta?.host || '';
21
21
  const L = ru
22
22
  ? { eb: 'OperStack · задачи для исполнителя', h1: `${host}: что поправить на сайте`, now: 'Сейчас', task: 'Что сделать', verify: 'Как проверить',
23
- intro: ['Ниже список задач, по одной на каждую найденную проблему. Каждая написана обычными словами, и её можно отдать тому, кто ведёт ваш сайт, или помощнику вроде ChatGPT.', 'Отдавайте по одной задаче, вместе со строками «Сейчас» и «Как проверить»: так исполнитель поймёт, откуда начинать и когда работа сделана.', 'Этот файл можно целиком переслать тому, кто ведёт ваш сайт.'],
23
+ intro: ['Ниже список задач, по одной на каждую найденную проблему. Каждая написана обычными словами, её поймёт и разработчик, и помощник вроде ChatGPT.', 'Файл можно переслать исполнителю целиком. Каждая задача идёт вместе со строками «Сейчас» и «Как проверить»: по ним видно, откуда начинать и когда работа сделана.'],
24
24
  rule: 'Правило для исполнителя: не выдумывай факты о бизнесе. Всё, чего нет на сайте и чего тебе не сказали, спрашивай у владельца.', foot: 'задачи' }
25
25
  : { eb: 'OperStack · tasks for your developer', h1: `${host}: what to fix on the site`, now: 'Now', task: 'What to do', verify: 'How to check',
26
26
  intro: ['Below is one task for every problem found, each in plain words, ready to hand to whoever runs your site or to an assistant like ChatGPT.', 'Hand over one task at a time, with its "Now" and "How to check" lines: that is how the developer knows where to start and when it is done.', 'You can forward this whole file to whoever runs your site.'],
package/src/verify.mjs CHANGED
@@ -13,6 +13,7 @@ import { __readSitemap as readSitemap, policyKinds, computeScores, computeOveral
13
13
  import { localiseChecks } from './i18n.mjs';
14
14
  import { detectNiche } from './niche.mjs';
15
15
  import { MECHANICAL_IDS } from './narrative.mjs';
16
+ import { profileLine } from './i18n.mjs';
16
17
  import { request as httpsRequest } from 'node:https';
17
18
  import { request as httpRequest } from 'node:http';
18
19
 
@@ -87,15 +88,19 @@ export function rebuildCritical(audit) {
87
88
  const ru = audit.meta?.lang === 'ru';
88
89
  const shown = ru ? localiseChecks(audit.checks || [], 'ru') : (audit.checks || []);
89
90
  const bad = shown.filter((c) => c.status === 'bad');
90
- audit.critical = bad.map((c) => ({ title: c.label, text: joinValueComment(c.value, c.comment), level: 'bad' }));
91
+ // После черновика первым идёт ровно список приоритетов (priorityIds): пересчёт по ходу проверки не должен его менять (cimes.ru, 14.10.2026).
92
+ const pri = (audit.priorityIds || []).map((id) => shown.find((c) => c.id === id)).filter((c) => c && (c.status === 'bad' || c.status === 'warn'));
93
+ audit.critical = (pri.length ? pri : bad).map((c) => ({ title: c.label, text: joinValueComment(c.value, c.comment), level: c.status === 'warn' ? 'warn' : 'bad' }));
91
94
  const fix = ru ? 'Исправить' : 'Fix';
92
95
  const week1 = (audit.roadmap || [])[0]; const week2 = (audit.roadmap || [])[1];
93
- if (week1 && Array.isArray(week1.items)) {
94
- // В «быстрые победы» только техническое: то, что требует фактов владельца или юриста, уходит во вторую очередь (14.10.2026).
95
- const quick = bad.filter((c) => MECHANICAL_IDS.has(c.id) && c.id !== 'trust-policies');
96
- let slow = bad.filter((c) => !quick.includes(c));
97
- // Пустая первая неделя при красной строке выглядит как «срочного нет», хотя приоритет 1 есть (14.10.2026, neronov.pro).
98
- if (!quick.length && slow.length) { quick.push(slow[0]); slow = slow.slice(1); }
96
+ // После черновика план уже собран из приоритетов и переведён в действия: пересчёт по ходу проверки его не трогает.
97
+ if (week1 && Array.isArray(week1.items) && !pri.length) {
98
+ // Первая неделя = раздел «Что чинить первым» (все красные строки, технические впереди) плюс до двух быстрых
99
+ // технических частичных. Раньше план уносил красные строки с фактами владельца на недели 2-4, а раздел «Срочно»
100
+ // ставил их первыми: отчёт спорил сам с собой (cimes.ru, 14.10.2026).
101
+ const quick = pri.length ? [...pri] : [...bad.filter((c) => MECHANICAL_IDS.has(c.id)), ...bad.filter((c) => !MECHANICAL_IDS.has(c.id))];
102
+ if (!pri.length) quick.push(...shown.filter((c) => c.status === 'warn' && MECHANICAL_IDS.has(c.id) && c.id !== 'trust-policies').slice(0, Math.max(0, 3 - quick.length) || (quick.length ? 0 : 2)));
103
+ const slow = [];
99
104
  const other = week1.items.filter((i) => !String(i).startsWith(`${fix}:`) && !String(i).includes('{{'));
100
105
  week1.items = [...quick.map((c) => `${fix}: ${c.label}`), ...other];
101
106
  if (week2 && Array.isArray(week2.items)) {
@@ -103,6 +108,7 @@ export function rebuildCritical(audit) {
103
108
  week2.items = [...slow.map((c) => `${fix}: ${c.label}`), ...keep, ru ? 'Остальные задачи по порядку из файла задач' : 'The rest of the tasks, in order, from the tasks file'];
104
109
  week2.items = [...new Set(week2.items)];
105
110
  }
111
+ if (!week1.items.length) audit.roadmap = audit.roadmap.filter((st) => st !== week1);
106
112
  }
107
113
  return audit;
108
114
  }
@@ -184,7 +190,7 @@ export async function secondLook(audit, { maxPages = 150, concurrency = 4, fetch
184
190
  const ownHref = (h, base) => { try { return new URL(h, base).host.replace(/^www\./, '') === new URL(base).host.replace(/^www\./, ''); } catch { return false; } };
185
191
  const hit = pages.find((p) => hrefs(p.html).some((h) => ownHref(h, p.url) && ABOUT_HREF.test(h)) || ABOUT_HREF.test(new URL(p.url).pathname) || /"@type"\s*:\s*"AboutPage"/.test(p.html) || ABOUT_TITLE.test(titleOf(p.html)) || h1sOf(p.html).some((h) => ABOUT_TITLE.test(h)));
186
192
  if (hit) change('trust-about', { status: 'ok', value: ru ? `есть: найдено на ${path(hit.url)}` : `present: found via ${path(hit.url)}` }, { url: hit.url });
187
- else change('trust-about', { value: ru ? `страницы о компании нет ни на одной из ${pages.length} прочитанных страниц` : `no about or team page on any of the ${pages.length} pages read` }, { pagesRead: pages.length });
193
+ else change('trust-about', { status: 'bad', value: ru ? `страницы о компании нет ни на одной из ${pages.length} прочитанных страниц` : `no about or team page on any of the ${pages.length} pages read` }, { pagesRead: pages.length });
188
194
  }
189
195
 
190
196
  // 3. Мессенджеры.
@@ -204,7 +210,8 @@ export async function secondLook(audit, { maxPages = 150, concurrency = 4, fetch
204
210
 
205
211
  // 4. Профили: sameAs с разэкранированными слешами, плюс ссылки на соцсети в самих страницах.
206
212
  const prof = byId('trust-profiles');
207
- if (prof && prof.status !== 'ok') {
213
+ // В разметке только мессенджеры: это уже точный ответ сбора, ссылки t.me на страницах его не меняют (cimes.ru, 15.10.2026).
214
+ if (prof && prof.status !== 'ok' && !prof.messengersOnly && !prof.listings) {
208
215
  const own = audit.meta.host.replace(/^www\./, '');
209
216
  const inSchema = new Set(); const inLinks = new Set();
210
217
  for (const p of pages) {
@@ -212,7 +219,7 @@ export async function secondLook(audit, { maxPages = 150, concurrency = 4, fetch
212
219
  for (const m of ld.matchAll(/"sameAs"\s*:\s*(\[[^\]]*\]|"[^"]+")/g)) for (const u of m[1].match(/https?:\/\/[^"\s,\]]+/g) || []) { try { const h = new URL(u).host.replace(/^www\./, ''); if (h !== own && !/^(wa\.me|api\.whatsapp\.com|whatsapp\.com|chat\.whatsapp\.com|viber\.com|invite\.viber\.com)$/i.test(h)) inSchema.add(h); } catch { /* мусор */ } }
213
220
  for (const m of String(p.html).matchAll(SOCIAL)) inLinks.add(m[1].toLowerCase());
214
221
  }
215
- if (inSchema.size) change('trust-profiles', { status: inSchema.size >= 2 ? 'ok' : 'warn', value: `${inSchema.size}: ${[...inSchema].slice(0, 5).join(', ')}` }, { inSchema: [...inSchema] });
222
+ if (inSchema.size) change('trust-profiles', { status: inSchema.size >= 2 ? 'ok' : 'warn', value: profileLine([...inSchema].slice(0, 5), ru ? 'ru' : 'en', inSchema.size) }, { inSchema: [...inSchema] });
216
223
  else if (inLinks.size) change('trust-profiles', { status: 'warn', value: ru ? `в разметке не заявлены, но ссылки на сайте есть: ${[...inLinks].join(', ')}` : `not declared in the markup, though the pages link to: ${[...inLinks].join(', ')}` }, { inLinks: [...inLinks] });
217
224
  else change('trust-profiles', { value: ru ? `ни в разметке, ни ссылками ни на одной из ${pages.length} прочитанных страниц профилей нет` : `no profile in the markup or as a link on any of the ${pages.length} pages read` }, { pagesRead: pages.length });
218
225
  }
@@ -242,7 +249,7 @@ export async function secondLook(audit, { maxPages = 150, concurrency = 4, fetch
242
249
  const fmt = (x) => (ru ? `${(x / 1000).toFixed(1).replace('.', ',')} с` : `${(x / 1000).toFixed(1)} s`);
243
250
  // Пороги web.dev: до 0,8 с хорошо, до 1,8 с терпимо, дальше плохо.
244
251
  const status = mid <= 800 ? 'ok' : mid <= 1800 ? 'warn' : 'bad';
245
- change('ttfb', { status, value: ru ? `середина ${fmt(mid)} по ${runs.length} замерам (от ${fmt(lo)} до ${fmt(hi)}), замер с сервера в Германии` : `median ${fmt(mid)} over ${runs.length} requests (${fmt(lo)} to ${fmt(hi)}), measured from a server in Germany`, comment: ru ? 'хорошим Google считает ответ до 0,8 секунды; посетители из другой страны могут видеть другое время' : 'Google calls 0.8 seconds or less good; visitors elsewhere may see a different time' }, { runs });
252
+ change('ttfb', { status, value: ru ? (fmt(lo) === fmt(hi) ? `${fmt(mid)} во всех ${runs.length} замерах с сервера в Германии` : `медиана ${fmt(mid)} по ${runs.length} замерам (от ${fmt(lo)} до ${fmt(hi)}), замер с сервера в Германии`) : (fmt(lo) === fmt(hi) ? `${fmt(mid)} in all ${runs.length} requests from a server in Germany` : `median ${fmt(mid)} over ${runs.length} requests (${fmt(lo)} to ${fmt(hi)}), measured from a server in Germany`), comment: ru ? 'хорошим Google считает ответ до 0,8 секунды; посетители из другой страны могут видеть другое время' : 'Google calls 0.8 seconds or less good; visitors elsewhere may see a different time' }, { runs });
246
253
  }
247
254
  }
248
255
  }
@@ -268,7 +275,7 @@ export async function secondLook(audit, { maxPages = 150, concurrency = 4, fetch
268
275
  audit.niche = audit.niche || detectNiche(audit);
269
276
  if (audit.niche.niche !== 'b2b') for (const id of ['agent-card', 'api-catalog', 'agent-markdown']) {
270
277
  const c = byId(id);
271
- if (c && c.status === 'warn') change(id, { status: 'na', comment: ru ? 'необязательно для этого сайта: нужно, только если у компании есть свой ИИ-сервис или API' : 'optional for this site: needed only when the business runs its own AI service or API' }, { niche: audit.niche.niche });
278
+ if (c && c.status === 'warn') change(id, { status: 'na', comment: id === 'agent-markdown' ? (ru ? 'необязательно для этого сайта: текстовые копии страниц нужны тем, кого агенты читают как документацию' : 'optional for this site: text copies of pages matter to sites that agents read as documentation') : (ru ? 'необязательно для этого сайта: нужно, только если у компании есть свой ИИ-сервис или API' : 'optional for this site: needed only when the business runs its own AI service or API') }, { niche: audit.niche.niche });
272
279
  }
273
280
  // Роботы ИИ по-настоящему: robots.txt может их пускать, а сервер обрывать соединение (14.10.2026, medeq-mc.ru).
274
281
  const robotsUrl = `${new URL(audit.meta.site).origin}/robots.txt`;