Skip to content

refactor(epic-1973): Extract zeph-sanitizer crate from zeph-core (Phase 1e #1981)#2009

Merged
bug-ops merged 4 commits intomainfrom
phase-1e-sanitizer
Mar 19, 2026
Merged

refactor(epic-1973): Extract zeph-sanitizer crate from zeph-core (Phase 1e #1981)#2009
bug-ops merged 4 commits intomainfrom
phase-1e-sanitizer

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Mar 19, 2026

Summary

Extract content sanitization, PII filtering, exfiltration guard, and quarantine logic from zeph-core (4,337 LOC) into new zeph-sanitizer crate.

Follows Phase 1d (vault extraction) pattern but uses clean direct imports instead of re-export shim (as per requirement for pre-v1.0.0 code).

Changes

  • Create crates/zeph-sanitizer/ with 6 core modules: exfiltration, guardrail, memory_validation, pii, quarantine
  • Move guardrail feature flag to new crate (zeph-core propagates it)
  • Update all imports in zeph-core and binary to use zeph_sanitizer::* directly
  • Add zeph-sanitizer to workspace members and root dependencies
  • Update CHANGELOG.md

Test Plan

  • cargo check --workspace — all dependencies resolve correctly
  • cargo +nightly fmt --check — formatting passes
  • cargo clippy --workspace -- -D warnings — zero warnings
  • cargo nextest run --config-file .github/nextest.toml --workspace --lib --bins — 5412 tests pass

Acceptance Criteria

  • zeph-sanitizer compiles independently
  • zeph-core re-exports all public types
  • Feature flags working (guardrail)
  • All tests pass
  • CI checks: format, clippy pass

bug-ops added 2 commits March 19, 2026 02:13
…se 1e)

Extract content sanitization, PII filtering, exfiltration guard, and quarantine
logic from zeph-core (4,337 LOC) into new zeph-sanitizer crate with direct imports.

Changes:
- Create crates/zeph-sanitizer with 6 core modules: exfiltration, guardrail,
  memory_validation, pii, quarantine, and lib.rs
- Move guardrail feature flag to zeph-sanitizer (zeph-core propagates it)
- Update all imports in zeph-core and binary to use zeph_sanitizer::* directly
  (no re-export shim, following user's clean code principle)
- Add zeph-sanitizer to workspace members and root dependencies
- All 5412 tests pass

Acceptance criteria met:
- zeph-sanitizer compiles independently
- zeph-core re-exports all public types
- Feature flags working (guardrail)
- All tests pass
- CI checks: format, clippy pass
@github-actions github-actions bot added documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate dependencies Dependency updates refactor Code refactoring without functional changes size/L Large PR (201-500 lines) labels Mar 19, 2026
Merged latest changes from main including Phase 1d (zeph-experiments extraction).

Resolved conflicts:
- CHANGELOG.md: both Phase 1e and Phase 1d entries preserved
- crates/zeph-core/Cargo.toml: both zeph-sanitizer and zeph-experiments dependencies included
  - experiments feature now includes zeph-experiments/experiments flag
  - guardrail feature includes zeph-sanitizer/guardrail flag

All checks pass: cargo check, clippy, format
@bug-ops bug-ops enabled auto-merge (squash) March 19, 2026 01:20
@bug-ops bug-ops linked an issue Mar 19, 2026 that may be closed by this pull request
3 tasks
guardrail.rs uses tokio::time::timeout() for LLM call timeouts.
Add tokio with 'time' feature to regular dependencies (was only in dev-deps).
@bug-ops bug-ops merged commit 339477b into main Mar 19, 2026
20 checks passed
@bug-ops bug-ops deleted the phase-1e-sanitizer branch March 19, 2026 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate dependencies Dependency updates documentation Improvements or additions to documentation refactor Code refactoring without functional changes rust Rust code changes size/L Large PR (201-500 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: extract zeph-sanitizer crate from zeph-core

1 participant