Skip to content

fix(guardrails): Align inline validator types - #1269

Merged
AkhileshNegi merged 9 commits into
mainfrom
fix/guardrails-inline-validator-types
Oct 16, 2026
Merged

AkhileshNegi merged 9 commits into
mainfrom
fix/guardrails-inline-validator-types

Conversation

@AkhileshNegi

@AkhileshNegi AkhileshNegi commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Closes #1270

  • InlineValidatorTypeEnum: remove profanity_free, add uli_slur_match — matches what GET /guardrails returns on staging (gender_assumption_bias, uli_slur_match, pii_remover, topic_relevance_llm).
  • EXPOSED_VALIDATOR_TYPES now derived from the enum so the inline-spec allowlist and the catalogue filter are one source of truth.
  • Test + wiki updated.

Test plan

  • uv run pytest app/tests/services/llm/test_guardrails.py app/tests/api/routes/test_guardrails.py — 114 passed
  • pre-commit clean

🤖 Generated with Claude Code

Prajna1999 and others added 8 commits September 30, 2026 15:57
Takes app/api/openapi_docs.py from untested to 100% statement coverage:
schema inference for every value kind, the component registry, and each
branch of doc().

Two of the cases pin behaviour that is easy to regress:

- infer_schema() checks bool before int, since bool subclasses int. Without
  that order every boolean example would be documented as an integer.
- inject_component_schemas() lets a generated component win a name clash. A
  real Pydantic model always describes a route better than a hand-written
  stand-in.

Also fixes doc(): called with request_examples and no request_schema, it
inferred the body schema from the absent `request` and documented the body
as nullable. It now infers from the first example instead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Upstream dropped profanity_free from the tenant catalogue and uli_slur_match
is the primary slur check, so InlineValidatorTypeEnum now matches
GET /guardrails. EXPOSED_VALIDATOR_TYPES is derived from the enum so the two
lists cannot drift again.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one): 1
  • ready-for-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: ProjectTech4DevAI/kaapi-backend/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f1b5097d-0cbf-436b-bb25-7c992340778e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot changed the title fix(guardrails): Align inline validator types with exposed catalogue fix(guardrails): Align inline validator types Oct 16, 2026
@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

OpenAPI changes   ⚪ No API surface changes

Note

This PR does not modify the API contract.

main ↔ c3374176 · generated by oasdiff

@codecov

codecov Bot commented Oct 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@AkhileshNegi AkhileshNegi self-assigned this Oct 16, 2026
@AkhileshNegi AkhileshNegi added the enhancement New feature or request label Oct 16, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@AkhileshNegi AkhileshNegi added the breaking-change-approved Reviewer-acknowledged API breaking change label Oct 16, 2026
@AkhileshNegi
AkhileshNegi merged commit a1ed756 into main Oct 16, 2026
6 of 7 checks passed
@AkhileshNegi
AkhileshNegi deleted the fix/guardrails-inline-validator-types branch October 16, 2026 09:54
@github-project-automation github-project-automation Bot moved this from To Do to Closed in Kaapi-dev Oct 16, 2026
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.8.0-main.11 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

breaking-change-approved Reviewer-acknowledged API breaking change enhancement New feature or request released on @main

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

Validation: Update InlineValidatorTypeEnum

3 participants