diff --git a/docs/superpowers/plans/2026-04-17-cf7-spam-to-telegram.md b/docs/superpowers/plans/2026-04-17-cf7-spam-to-telegram.md index 6b8cce0..39c4214 100644 --- a/docs/superpowers/plans/2026-04-17-cf7-spam-to-telegram.md +++ b/docs/superpowers/plans/2026-04-17-cf7-spam-to-telegram.md @@ -813,8 +813,9 @@ final class Classifier $reasons[] = ['sign' => '-', 'weight' => abs((int)$weights['latin_only']), 'text' => 'только латиница']; } - // -5 honeypot - if (($meta['reason'] ?? '') === 'Honeypot') { + // -5 honeypot (weighted sign AND hard override) + $honeypot_tripped = (($meta['reason'] ?? '') === 'Honeypot'); + if ($honeypot_tripped) { $score += (int)$weights['honeypot']; $reasons[] = ['sign' => '-', 'weight' => abs((int)$weights['honeypot']), 'text' => 'сработал honeypot']; } @@ -825,6 +826,11 @@ final class Classifier } elseif ($score <= (int)$thresholds['spam']) { $label = 'spam'; } + // Honeypot is a hard override: a filled honeypot field means a bot, + // regardless of how "human" the other fields look. + if ($honeypot_tripped) { + $label = 'spam'; + } return ['score' => $score, 'label' => $label, 'reasons' => $reasons]; } diff --git a/docs/superpowers/specs/2026-04-17-cf7-spam-to-telegram-design.md b/docs/superpowers/specs/2026-04-17-cf7-spam-to-telegram-design.md index ba06255..042c865 100644 --- a/docs/superpowers/specs/2026-04-17-cf7-spam-to-telegram-design.md +++ b/docs/superpowers/specs/2026-04-17-cf7-spam-to-telegram-design.md @@ -197,7 +197,7 @@ Fallback — `action wpcf7_submission, priority 20`: если `$submission->get_ | URL в любом поле (`http://`, `https://`, `www.`) | **−3** | | Ключевое слово (см. список) — `−2` за вхождение, капается на **−6** | −2 × min(n, 3) | | Имя или текст — только латиница | −1 | -| Honeypot сработал (reason='Honeypot') | **−5** | +| Honeypot сработал (reason='Honeypot') | **−5** *(и hard override: label=spam)* | **Ключевые слова (дефолт, матчинг по подстрокам через `mb_stripos`, регистронезависимо):** @@ -209,8 +209,9 @@ Fallback — `action wpcf7_submission, priority 20`: если `$submission->get_ - Порно/эскорт: `porn`, `xxx`, `adult`, `porno`, `порно`, `эскорт`, `проститу`, `секс-знакомств`, `интим-услуг` **Пороги:** -- `score >= 3` → `label = 'client'` (🟢 похоже клиент) -- `score <= -2` → `label = 'spam'` (🔴 похоже спам) +- если `reason === 'Honeypot'` → `label = 'spam'` **(hard override, всегда)** +- иначе, если `score >= 3` → `label = 'client'` (🟢 похоже клиент) +- иначе, если `score <= -2` → `label = 'spam'` (🔴 похоже спам) - иначе → `label = 'unclear'` (🟡 неясно) **Кастомизация** — через WP-фильтры: