docs: honeypot is a hard override on label=spam

Previous plan/spec made honeypot a -5 weighted signal only. That is
insufficient to force 'spam' when the submission also has a RU phone
(+3), cyrillic name (+1), and meaningful text (+1) — a clean +5 cancels
-5, yielding 'unclear'. The honeypot test (test_honeypot_forces_spam_
even_with_phone) caught this.

Honeypot semantics: a filled hidden field is a bot by definition.
No combination of positive signals can make it a legitimate client.
Keeping the -5 weight on 'reasons' list for transparency, but adding
a hard override that sets label='spam' at the end of classify().

Caught by TDD on Task 7.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vladimir Bryzgalov
2026-04-17 22:21:51 +05:00
parent 90940dd928
commit a7b796d381
2 changed files with 12 additions and 5 deletions
@@ -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-фильтры: