]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Feature] neural: forced-learn fast path and first-class freeze
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 20 Jun 2026 19:20:19 +0000 (20:20 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 20 Jun 2026 19:20:19 +0000 (20:20 +0100)
commitfa03089b72c8017ff554d641247082a8241f06cd
tree4fac258e71e273d79f5ed98e7394b81a761e02fa
parentbb2375601150d0c0b65369a23280738366cdce87
[Feature] neural: forced-learn fast path and first-class freeze

Two training controls plus a supporting task primitive:

* train.forced_learn_minimal_scan (default on when disable_symbols_input):
  a high-priority neural prefilter disables every non-neural symbol on an
  ANN-Train scan, so a symbols-independent training vector is built without
  issuing RBL/DNS, fuzzy, bayes, ClickHouse or capture/cluster work. The
  stored vector and the profile key are byte-for-byte identical to the live
  full-scan path (asserted in tests). For symbol-dependent rules it stays off,
  and if any applicable neural rule needs symbols the whole task falls back to
  a full scan.

* train.frozen: stops automatic training and auto-storing of live vectors so a
  frozen model's pools cannot drift into an imbalanced live set, while
  inference keeps serving the current ANN unchanged. An explicit ANN-Train
  still stores and retrains on demand (gated by a per-profile retrain marker).
  Supersedes the auto-learn side of store_set_only/store_pool_only; both keep
  working when frozen is unset.

* task:disable_all_symbols([skip_mask]): Lua binding over the existing
  rspamd_symcache_disable_all_symbols "process only these" primitive (defaults
  to keeping explicit_disable symbols), used by the prefilter.

Functional coverage in test/functional/cases/330_neural/006_forced_learn_minimal
and 007_frozen.
lualib/plugins/neural.lua
src/lua/lua_task.c
src/plugins/lua/neural.lua
test/functional/cases/330_neural/006_forced_learn_minimal.robot [new file with mode: 0644]
test/functional/cases/330_neural/007_frozen.robot [new file with mode: 0644]
test/functional/configs/neural_forced_learn.conf [new file with mode: 0644]
test/functional/configs/neural_frozen.conf [new file with mode: 0644]