Context
The eval engine (pulser eval) supports 5 assertion types: contains, not-contains, min-length, max-length, matches.
Missing: starts-with and ends-with — the most natural string checks after contains.
Use case
# eval.yaml
tests:
- name: "output starts with summary"
input: "Review this code"
assert:
- starts-with: "## Summary"
- ends-with: "recommendation"
Currently requires a regex via matches, which is cumbersome and error-prone.
What to do
- Add
starts-with and ends-with to the assertion type in src/eval/types.ts
- Add the two cases in
src/eval/assertions.ts — follow the existing pattern
The existing assertions are just if branches. This is two more.
Files to modify
src/eval/types.ts — add to AssertionDef type
src/eval/assertions.ts — add two cases
Difficulty: Easy
~15 minutes for someone familiar with TypeScript.
Context
The eval engine (
pulser eval) supports 5 assertion types:contains,not-contains,min-length,max-length,matches.Missing:
starts-withandends-with— the most natural string checks aftercontains.Use case
Currently requires a regex via
matches, which is cumbersome and error-prone.What to do
starts-withandends-withto the assertion type insrc/eval/types.tssrc/eval/assertions.ts— follow the existing patternThe existing assertions are just
ifbranches. This is two more.Files to modify
src/eval/types.ts— add toAssertionDeftypesrc/eval/assertions.ts— add two casesDifficulty: Easy
~15 minutes for someone familiar with TypeScript.