Repository navigation
Commit bf1f7d7
authored
feat(evaluators): add starts_with/ends_with mode to list evaluator (#154)
## 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
- [x] Added or updated automated tests
- [x] Ran `make check` (or explained why not)
- [ ] Manually verified behavior
## Checklist
- [ ] Linked issue/spec (if applicable)
- [x] Updated docs/examples for user-facing changes
- [ ] Included any required follow-up tasks1 parent 90265ba commit bf1f7d7
6 files changed
Lines changed: 457 additions & 8 deletions
File tree
- evaluators
- builtin
- src/agent_control_evaluators/list
- tests/list
- ui/src/core/evaluators/list
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
| |||
0 commit comments