Skip to content

Goal evaluator coerces non-boolean flags into valid judgments #4736

Description

@Totoro-qaq

What happened

parseGoalEvaluation() uses Boolean(...) for the judge's met, impossible, progress, and waiting fields. A JSON string such as "false" is truthy, so {"met":"false"} is accepted as met: true with evaluatorFailed: false.

The continuation coordinator uses that verdict to mark the Goal as achieved. The same coercion can produce an impossible or waiting transition, or incorrectly reset the no-progress counter.

Expected: a supplied flag must be a JSON boolean. An invalid flag should make the whole evaluation fail neutrally through the existing evaluator-failure path, rather than produce a terminal verdict, waiting state, or progress judgment. Omitted flags can retain their existing false defaults.

How to reproduce

On source commit e25f2cb7c3f5c8011aa6ea98d6c51360c158ce7f, install dependencies and run npm run build from the repository root, then:

node --input-type=module -e '
import { parseGoalEvaluation } from "./packages/runtime/dist/goal-evaluator.js";
for (const met of [false, "false"]) {
  const input = { met, impossible: false, progress: false, waiting: false };
  const { met: parsedMet, evaluatorFailed } = parseGoalEvaluation(JSON.stringify(input));
  console.log(JSON.stringify({ input, parsedMet, evaluatorFailed }));
}'

Actual output:

{"input":{"met":false,"impossible":false,"progress":false,"waiting":false},"parsedMet":false,"evaluatorFailed":false}
{"input":{"met":"false","impossible":false,"progress":false,"waiting":false},"parsedMet":true,"evaluatorFailed":false}

The second result should instead have parsedMet: false and evaluatorFailed: true.

Environment

  • Source: main at e25f2cb7c3f5c8011aa6ea98d6c51360c158ce7f
  • macOS 26.6.2; Node.js 22.23.1; npm 11.19.0
  • Surface: runtime Goal evaluation/continuation
  • Deterministic synthetic evaluator output; no provider account or API key required

Logs, screenshots, or additional context

This is a source-level reproduction, not a claim about how frequently a live model produces these values. A local fix and regression tests are ready; I will link the PR here.

Prepared with Codex, including source investigation and the deterministic reproduction.

Activity

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

Metadata

Metadata

Assignees

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