Flair_Helper2 // Devvit Port

deterministic flair-driven moderation — origin: quentinwolf/flair_helper2 (GPL-3.0, PRAW)
RULE-BASED PURE FUNCTION NO LLM AT RUNTIME NO OUTBOUND NET DEVVIT-NATIVE
CERTIFIED
NO AI
RUNTIME · r/AskHistorians
build 2026.05.08-a1
EVENT PostFlairUpdate post_id t3_1abcd9z flair_template_id "sources-required" matched flair_helper.yaml:14

flair_helper.yaml — line-numbered source of truth

  1. # flair_helper.yaml :: r/AskHistorians :: rev 2026-04-22
  2. version: 2
  3. subreddit: "AskHistorians"
  4. flairs:
  5. - id: "off-topic"
  6. actions:
  7. - remove: true
  8. - lock: true
  9. - comment: "Off-topic per Rule 2."
  10. - sticky: true
  11. - usernote: "off-topic-removal"
  12. - id: "sources-required"
  13. actions: # <-- MATCHED
  14. - remove: true
  15. - comment: "Top-level answers must cite sources."
  16. - sticky: true
  17. - usernote: "sources-removal"
  18. - id: "rule-1-ban"
  19. actions:
  20. - remove: true
  21. - ban: { days: 7, reason: "Rule 1" }
  22. - usernote: "rule-1-ban-7d"

decision tree — flair_template_id → action set

flair_template_id == "off-topic" == "sources-required" == "rule-1-ban" yaml:05 yaml:13 yaml:20 remove + lock + sticky comment + usernote yaml:07-11 remove + sticky comment + usernote yaml:14-17 remove + ban (7d) + usernote yaml:21-23
6 actions total 0 model calls switch/case TS

action ledger — pure rule trace

tpostactioncite
17:42:01.118 t3_1abcd9z removePost() flair_helper.yaml:14
17:42:01.121 t3_1abcd9z submitComment(sticky=true) flair_helper.yaml:15
17:42:01.122 t3_1abcd9z distinguish(sticky=true) flair_helper.yaml:16
17:42:01.124 u/example_user addUsernote("sources-removal") flair_helper.yaml:17
17:39:54.802 t3_1abcabc banUser(7d, "Rule 1") flair_helper.yaml:22
17:36:12.471 t3_1abc456 lockPost() flair_helper.yaml:08
100% cited

provenance & runtime guarantees

originquentinwolf/flair_helper2
licenseGPL-3.0
consentwritten, on file
host sub WAU~12,400 (≥500 OK)
compiled bundle SHA2569f3c…e1a7
opus 4.7 usagebuild-time only
runtime model calls0
outbound net (non-Devvit)0
test fixtures312 / 312 passing
flair coverage100% (3 / 3 flairs)
p50 trigger latency412 ms
queue dwell Δ-37% vs PRAW baseline