Skip to content

feat: add word-count scorer - #57

Merged
royalpinto007 merged 3 commits into
AgentPostmortem:mainfrom
sharadvc:feat/word-count-scorer
Sep 17, 2026
Merged

royalpinto007 merged 3 commits into
AgentPostmortem:mainfrom
sharadvc:feat/word-count-scorer

Conversation

@sharadvc

Copy link
Copy Markdown
Contributor

Fixes #38

Verbosity control is a core eval need: one-word answers slip through contains, rambling breaks UX budgets. No scorer covered length.

Change

  • New src/scorers/word-count.ts (sibling to latency.ts's budget + linear-falloff pattern).
  • Registers the new word-count type in registry.ts builtinScorers.
  • Takes minWords/maxWords (and/or minChars/maxChars); full credit inside the bounds, linear falloff outside, mirroring the latency scorer's curve.
  • Documented in README scorer table + CHANGELOG [Unreleased].

Acceptance

  • ctx("Paris") with minWords: 5 scores <1 and fails.
  • A 50-word answer with minWords: 5, maxWords: 100 passes with score 1.

Full suite: 112/112 pass (npm test — 107 baseline + 5 new); tsc --noEmit and eslint clean.

This contribution was made with AI assistance (Claude).

MapleTheBot and others added 3 commits September 17, 2026 08:56
Scores output length against minWords/maxWords (and/or chars)
bounds: full credit inside, linear falloff outside, mirroring
the latency scorer's curve so one-word answers and rambling
output both get caught.

Closes AgentPostmortem#38
@royalpinto007
royalpinto007 merged commit 475b648 into AgentPostmortem:main Sep 17, 2026
3 checks passed
@github-actions

Copy link
Copy Markdown

Nice work @sharadvc, this is merged.

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.

New scorer word-count: output length bounds

2 participants