Skip to content

Praise: EvalScore.to_dict correctly preserves None for skipped dimensions #147

Open

Description

@rileyr78

Tiny detail, big quality-of-life win.

backend/app/code/eval/scoring.py:170:

dimensions={k: round(v, 1) if v is not None else None for k, v in dimensions.items()},

The list-comprehension special-cases None instead of either:

  • coercing to 0.0 (which would tell a downstream consumer "you scored a zero on tests" when actually tests were skipped), or
  • omitting the key entirely (which would make schema-strict consumers crash).

Combined with the upstream check at EvalScorer._score_dynamic line 68-70 that explicitly returns scores["tests"] = None # Not applicable, this is a coherent treatment of "missing data vs zero data" — a distinction most evaluation frameworks get wrong.

The EvalResponse TypeScript type at frontend/src/lib/api/jobs.ts:68-78 also marks testPassed?: boolean and scores?: Record<string, number> as optional, so the contract is consistent on both sides.

Not many codebases bother with this. Glad you do.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions