Skip to content

feat(evaluators): add starts_with/ends_with mode to list evaluator#154

Merged
lan17 merged 4 commits intomainfrom
lev/list_starts_with
Mar 30, 2026
Merged

feat(evaluators): add starts_with/ends_with mode to list evaluator#154
lan17 merged 4 commits intomainfrom
lev/list_starts_with

Conversation

@lan17
Copy link
Copy Markdown
Contributor

@lan17 lan17 commented Mar 30, 2026

Summary

  • add starts_with and ends_with match modes to the built-in list evaluator so policies can be expressed as plain prefix and suffix lists instead of synthesized regexes
  • expose the new modes in the UI evaluator form and update the shared UI types
  • expand evaluator coverage for prefix and suffix matching, allowlist-style no_match usage, path-like inputs, ordinary strings, escaping, and list-input semantics
  • document the new list evaluator modes in the evaluator overview README

Scope

  • User-facing/API changes: list evaluator configs now accept match_mode: "starts_with" and match_mode: "ends_with"; the UI exposes both as selectable options
  • Internal changes: compile the new match modes into anchored prefix/suffix regexes in the evaluator implementation and add targeted evaluator tests
  • Out of scope: changing prefix or suffix semantics to be path-boundary-aware; this PR preserves generic string-prefix and string-suffix behavior

Risk and Rollout

  • Risk level: low
  • Rollback plan: revert commits 5d29b8a, 4ddef38, 567f25f, and ef694b2, which removes the new match modes, coverage, and docs updates

Testing

  • Added or updated automated tests
  • Ran make check (or explained why not)
  • Manually verified behavior

Checklist

  • Linked issue/spec (if applicable)
  • Updated docs/examples for user-facing changes
  • Included any required follow-up tasks

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@lan17 lan17 enabled auto-merge (squash) March 30, 2026 18:15
@lan17 lan17 changed the title feat(evaluators): add starts_with mode to list evaluator feat(evaluators): add starts_with/ends_with mode to list evaluator Mar 30, 2026
@lan17 lan17 disabled auto-merge March 30, 2026 23:35
@lan17 lan17 merged commit bf1f7d7 into main Mar 30, 2026
8 checks passed
@lan17 lan17 deleted the lev/list_starts_with branch March 30, 2026 23:35
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