Skip to content

fix: empty contains needle should fail, not always pass - #41

Merged
royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
sharadvc:cursor/fix-contains-empty-needle-fe1c
Sep 12, 2026
Merged

royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
sharadvc:cursor/fix-contains-empty-needle-fe1c

Conversation

@sharadvc

Copy link
Copy Markdown
Contributor

Summary

The contains / not-contains scorers no longer treat an empty value as a match (\"\".includes(\"\")). Empty needles are filtered out; if none remain, the scorer fails with no value(s) provided.

Test plan

  • npm test

Fixes #28

Reject empty substrings so misconfigured value: "" does not trivially pass.

Fixes AgentPostmortem#28

Co-authored-by: Sharad. <sharadvc@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Welcome, @sharadvc, and thanks for your first pull request to Evalgate.

A quick look at CONTRIBUTING.md covers how things are set up and run here.

I'll review this shortly. Ask anything in the thread if something is unclear.

@royalpinto007
royalpinto007 merged commit db7d171 into AgentPostmortem:main Sep 12, 2026
9 checks passed
@github-actions

Copy link
Copy Markdown

This is in, @sharadvc. Really appreciate it.

Genuinely helpful change for Evalgate.

If this project helps you out, a star helps others find it too.

Happy to see more from you whenever you have the time.

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.

contains scorer with empty-string needle always passes

2 participants