Skip to content

feat(filters): export AI filter registration API - #612

Open
aslakknutsen wants to merge 1 commit into
praxis-proxy:mainfrom
aslakknutsen:filter_reg_api
Open

feat(filters): export AI filter registration API#612
aslakknutsen wants to merge 1 commit into
praxis-proxy:mainfrom
aslakknutsen:filter_reg_api

Conversation

@aslakknutsen

Copy link
Copy Markdown
Contributor

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

  • I reviewed every changed line and can explain the change.
  • Tests are added or updated when behavior changes.
  • New capabilities include an example config and functional example test.
  • User-facing behavior and generated documentation are updated.
  • Performance-sensitive changes include appropriate benchmark or load-test evidence.
  • Commits are signed and include a Signed-off-by trailer.

@aslakknutsen
aslakknutsen requested review from a team, alexsnaps and leseb July 29, 2026 22:49
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>

@praxis-bot praxis-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread filters/src/register.rs
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");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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");

Comment thread filters/src/register.rs
);
}

#[cfg(test)]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Medium] Missing // Tests separator comment before the #[cfg(test)] block. Convention requires a full-width separator:

// ---------------------------------------------------------------------------
// Tests
// ---------------------------------------------------------------------------

#[cfg(test)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants