feat(ocr): per-sender specialized Kurrent models with automatic active-learning retraining #263

Merged
marcel merged 32 commits from feat/issue-253-sender-models into main 2026-04-18 12:30:57 +02:00
Showing only changes of commit eab37b9ac9 - Show all commits

View File

@@ -63,3 +63,13 @@ def test_path_outside_models_dir_raises():
registry = _make_registry()
with pytest.raises(ValueError, match="not allowed"):
registry.get_model("/etc/passwd")
def test_load_failure_does_not_cache_broken_entry():
"""A failed load must not leave a broken entry in the cache."""
registry = _make_registry()
with patch("engines.kraken._load_sender_model", side_effect=RuntimeError("corrupt model")):
with pytest.raises(RuntimeError, match="corrupt model"):
registry.get_model("/app/models/sender_bad.mlmodel")
assert registry.size() == 0