Skip to content

fix(sanitizer): non-exhaustive InjectionEnforcementMode breaks build with --features classifiers #4557

@bug-ops

Description

@bug-ops

Description

After PR #4545 added #[non_exhaustive] to InjectionEnforcementMode in zeph-config, the match expressions in zeph-sanitizer/src/sanitizer.rs no longer compile when the classifiers feature is enabled. The _ wildcard is now required for cross-crate non-exhaustive enums, but both match arms only cover Block and Warn.

Reproduction Steps

  1. cargo build --features full — fails with E0004 in crates/zeph-sanitizer/src/sanitizer.rs at lines 545 and 585
  2. cargo build or cargo nextest run --workspace --lib --bins — succeeds (classifiers feature disabled by default)

Expected Behavior

cargo build --features full completes without errors.

Actual Behavior

error[E0004]: non-exhaustive patterns: `_` not covered
   --> crates/zeph-sanitizer/src/sanitizer.rs:545:15
    |
545 |         match self.enforcement_mode {
    |               ^^^^^^^^^^^^^^^^^^^^^ pattern `_` not covered

error[E0004]: non-exhaustive patterns: `_` not covered
   --> crates/zeph-sanitizer/src/sanitizer.rs:585:19

Two match arms in #[cfg(feature = "classifiers")] blocks — regex_verdict() and binary_score_to_verdict() — need a _ => InjectionVerdict::Suspicious wildcard arm added.

Fix

In crates/zeph-sanitizer/src/sanitizer.rs, add _ => InjectionVerdict::Suspicious to both match expressions at lines 545–548 and 585–588.

Environment

  • Version: 53f8f05 (HEAD)
  • Features: classifiers (via --features full)

Logs / Evidence

Detected by CI-888 live-tester during cargo build --features full after PR #4545 (#4533 batch).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High ROI, low complexity — do next sprintbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions