feat(filters): export AI filter registration API - #612
Conversation
Move in-tree filter registration out of the proxy crate so ExtProc and other hosts can use praxis-ai-filters without pulling praxis-protocol or Pingora. Signed-off-by: Aslak Knutsen <aslak@4fs.no>
6d24e1c to
783af60
Compare
praxis-bot
left a comment
There was a problem hiding this comment.
PR Review
Summary: Moves AI filter registration from the proxy crate to the filters crate so ExtProc and other hosts can depend on praxis-ai-filters without pulling Pingora.
Overall: Clean refactoring. The 27 filter registrations are a faithful 1:1 move from server/src/lib.rs to filters/src/register.rs with no functional changes. The new build_ai_registry() convenience function and documentation updates are well done. Two medium-severity items below.
| Severity | Count |
|---|---|
| Critical | 0 |
| Large | 0 |
| Medium | 2 |
| fn build_ai_registry_includes_ai_and_builtin_filters() { | ||
| let registry = build_ai_registry(); | ||
| let names = registry.available_filters(); | ||
| assert!(names.contains(&"ai_guardrails"), "expected ai_guardrails in registry"); |
There was a problem hiding this comment.
[Medium] The test verifies filters from 2 of the 4 registration groups (general via ai_guardrails, OpenAI via openai_responses_validate) but has zero assertions for the Anthropic and agentic groups. If register_anthropic_filters or register_agentic_filters is accidentally removed from register_ai_filters, this test will not detect it.
Add assertions for at least one filter from each uncovered group:
assert!(names.contains(&"a2a"), "expected agentic filter a2a in registry");
assert!(names.contains(&"anthropic_validate"), "expected anthropic filter in registry");| ); | ||
| } | ||
|
|
||
| #[cfg(test)] |
There was a problem hiding this comment.
[Medium] Missing // Tests separator comment before the #[cfg(test)] block. Convention requires a full-width separator:
// ---------------------------------------------------------------------------
// Tests
// ---------------------------------------------------------------------------
#[cfg(test)]
Summary
Move in-tree filter registration out of the proxy crate so ExtProc and other hosts can use praxis-ai-filters without pulling praxis-protocol or Pingora.
Validation
Checklist
Signed-off-bytrailer.