feat(classifiers): Phase 2 — PII detection and LlmClassifier for feedback (#2200)#2251
Merged
feat(classifiers): Phase 2 — PII detection and LlmClassifier for feedback (#2200)#2251
Conversation
562448f to
c31ecf6
Compare
c31ecf6 to
2280e22
Compare
2280e22 to
bef382e
Compare
…back (#2200) Add two new classifier backends: - CandlePiiClassifier: DeBERTa-v2 NER (piiranha-v1) for 17 PII types across 6 languages, with hybrid regex+NER union merge, 448-token chunked inference, special-token masking in BIO span extraction, max-confidence overlap merge, and optional SHA-256 model hash verification - LlmClassifier: zero-shot feedback detection via [[llm.providers]] registry, returns FeedbackVerdict directly (preserving kind/confidence/reasoning for skill learning), with regex fallback when feedback_provider is unset Config additions: pii_model, pii_threshold (0.75), pii_enabled, injection_model_sha256, pii_model_sha256, feedback_provider, DetectorMode::Model Also adds --model flag to `zeph classifiers download`, --init wizard entries, and tracing-based latency logging per task type.
bef382e to
1b0fb44
Compare
bug-ops
added a commit
that referenced
this pull request
Mar 27, 2026
…n config field Restores items dropped during auto-merge with origin/main: - pub mod ner declaration in classifier/mod.rs - NerSpan struct definition in classifier/mod.rs - spans field on ClassificationResult (with vec![] default for sequence classifiers) - Aligns apply_pii_ner_classifier to use classifiers.pii_model (ner_model was unified into pii_model in Phase 2 PR #2251) - Preserves both apply_pii_classifier and apply_pii_ner_classifier calls in runner.rs - Keeps with_pii_detector and with_pii_ner_classifier builder methods in agent/builder.rs
bug-ops
added a commit
that referenced
this pull request
Mar 27, 2026
…n config field Restores items dropped during auto-merge with origin/main: - pub mod ner declaration in classifier/mod.rs - NerSpan struct definition in classifier/mod.rs - spans field on ClassificationResult (with vec![] default for sequence classifiers) - Aligns apply_pii_ner_classifier to use classifiers.pii_model (ner_model was unified into pii_model in Phase 2 PR #2251) - Preserves both apply_pii_classifier and apply_pii_ner_classifier calls in runner.rs - Keeps with_pii_detector and with_pii_ner_classifier builder methods in agent/builder.rs
bug-ops
added a commit
that referenced
this pull request
Mar 27, 2026
…n config field Restores items dropped during auto-merge with origin/main: - pub mod ner declaration in classifier/mod.rs - NerSpan struct definition in classifier/mod.rs - spans field on ClassificationResult (with vec![] default for sequence classifiers) - Aligns apply_pii_ner_classifier to use classifiers.pii_model (ner_model was unified into pii_model in Phase 2 PR #2251) - Preserves both apply_pii_classifier and apply_pii_ner_classifier calls in runner.rs - Keeps with_pii_detector and with_pii_ner_classifier builder methods in agent/builder.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CandlePiiClassifier— DeBERTa-v2 NER backend (piiranha-v1) for detecting 17 PII types across 6 languages with hybrid regex+NER union merge, 448-token chunked inference, BIO span extraction with special-token masking, max-confidence chunk-overlap merge, and optional SHA-256 model hash verificationLlmClassifier— zero-shot feedback detection via[[llm.providers]]registry, returnsFeedbackVerdictdirectly (preservingkind/confidence/reasoningfor skill learning), graceful fallback to regex whenfeedback_provideris unsetDetectorMode::Modelvariant alongside existingRegexandJudgepii_model,pii_threshold(0.75 default),pii_enabled(false by default),injection_model_sha256,pii_model_sha256,feedback_provider--model injection|pii|allflag onzeph classifiers download--initwizard entries for new classifier fieldsTest plan
cargo +nightly fmt --check— cleancargo clippy --features full --workspace -- -D warnings— cleancargo nextest run --workspace --features full --lib --bins— 6711/6711 pass (+36 new tests vs main)FeedbackDetectorwithdetector_mode = "model"falls back to regex whenfeedback_provider = ""Follow-up issues
Closes #2200