Skip to content

Rubric criterion with invalid pattern regex throws and kills the whole run #33

Description

@royalpinto007

Problem

A rubric criterion with pattern: "([" throws SyntaxError: Unterminated character class out of the scorer and kills the whole run. Sibling scorers (regex, json-schema) try/catch this; rubric does not.

Where

src/scorers/rubric.ts (new RegExp(c.pattern, "i"), no guard) + src/runner.ts (awaits scorer with no guard).

Acceptance

Add a failing test first scoring {criteria: [{description: "x", pattern: "(["}]}, expecting a fail-result not a throw. Then fix.

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