drupal / ai_recipe_comment_spam_eca
Deterministic ECA-based auto-unpublishing of high-scoring spam comments, on top of the AI Comment Spam Moderation recipe.
Package info
git.drupalcode.org/project/ai_recipe_comment_spam_eca.git
Type:drupal-recipe
pkg:composer/drupal/ai_recipe_comment_spam_eca
Requires
- drupal/ai_recipe_comment_spam: ^1.0
- drupal/core: ^11.2
- drupal/eca: ^2.1 || ^3.0
This package is not auto-updated.
Last update: 2026-07-09 04:04:54 UTC
README
What it does
AI Comment Spam Moderation scores each incoming comment for spam risk and saves a score and one-sentence reasoning. This companion recipe replaces the base recipe's LLM-based publish decision with a deterministic ECA rule that unpublishes any comment scoring 8 or higher.
Why it matters
The unpublish threshold is a simple numeric comparison, so it should be deterministic, free and instant rather than a second AI round-trip. Using ECA removes the extra provider call, makes the decision 100% reproducible, and avoids the occasional malformed-JSON responses that a boolean LLM call can produce.
How it works
When applied, the recipe:
- applies its base recipe (AI Comment Spam Moderation),
- switches the base recipe's LLM boolean status automator to an action worker so it no longer runs on comment save,
- creates an ECA workflow on comment save that reads the AI-generated
spam_score, - unpublishes any comment whose
spam_scoreis 8 or higher.
The base recipe's scoring automator runs before the ECA workflow, so the score is always written before the threshold is evaluated.
Requirements & compatibility
- Recipe: AI Comment Spam Moderation
- Drupal core: ^11.2
- AI module: ^1.4
- Custom Field: ^4.0
- Token: ^1.15
- ECA: ^2.1 || ^3.0
How to get started
- Install module dependencies (including AI and AI Automators).
- Configure an AI provider/model and set a default for chat_with_complex_json.
- Apply the recipe.
- Post comments on an Article and verify high-scoring comments are unpublished automatically.
- Use /admin/content/ai-comment-spam for moderation triage.