Skip to content

New scorer json-nonempty: fail schema-valid-but-empty outputs #37

Description

@royalpinto007

Problem

Models game structured-output evals with vacuous {} / {"answer": ""} / all-null payloads that still validate against the schema.

Pattern

Add src/scorers/json-nonempty.ts exporting a Scorer (sibling: json-schema.ts), register in registry.ts builtinScorers; test in tests/scorers.test.ts via ctx()/run() helpers. Wrap schema validation with emptiness checks (minKeys, rejectBlankStrings, rejectNulls, defaults 1/true/true); fail outputs with zero non-empty leaf values.

Acceptance

New type json-nonempty. ctx('{}') with minKeys: 1 fails-before; ctx('{"answer": "Paris"}') passes-after.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions