Skip to content

fix: regression on artifact rate; grader files that print while loading - #47

Merged
queso merged 2 commits into
mainfrom
fix/regression-no-artifact
Sep 30, 2026
Merged

queso merged 2 commits into
mainfrom
fix/regression-no-artifact

Conversation

@queso

@queso queso commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to #45. Two fixes.

Regression check counts runs that produced no artifact

This resolves the open question from #45. Pass rates exclude no-artifact runs, so a skill change that stops the agent writing the artifact could pass a regression assertion. For example, proposed at 1/1 pass, 1 no-artifact did not count as a regression from baseline 2/2.

A regression assertion now also fails when proposed produces the artifact in a smaller share of its runs than baseline:

proposed produced the artifact in 1/2 runs, less often than baseline (2/2)

Target assertions are unchanged.

Grader files that print while loading

This addresses the nitpick bot's late finding on #45. At scenario load, the whole stdout of promptdiff grade --list was parsed as JSON. A grader file with a top-level console.log therefore failed to load with a bare SyntaxError. Scenario load now parses only the last line, where the listing always lands. If that line is not valid JSON, the error includes an excerpt of the output.

Testing

  • bun run check: 163 tests pass, typecheck clean.
  • The compare no-artifact test now expects the regression failure. A new case checks that proposed producing the artifact more often (2/2 vs 1/2) does not fail.
  • New test: a grader file that logs at the top level loads, and an unknown grader name still gets the "has no grader named" error.

🤖 Generated with Claude Code

Pass rates exclude no-artifact runs, so a skill change that stops the
agent writing the artifact could pass a regression assertion: proposed
at 1/1 plus 1 no-artifact did not count as a regression from 2/2. A
regression assertion now also fails when proposed's share of runs that
produced the artifact is below baseline's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick review — approve

The change adds compare-mode artifact-rate gating with accompanying tests covering both the failing and safe directions, plus docs and CLI wiring. The logic is bounded and well-covered; no correctness, security, or supply-chain concerns remain. Approving.

0 inline comment(s).

Verdict was approve, posted as a comment — this repo does not allow GitHub Actions to approve PRs.

Scenario load parsed all of `promptdiff grade --list` stdout as JSON, so
a grader file with a top-level console.log failed to load with a bare
SyntaxError. Parse the last line, where the listing always lands, and
report unparseable output with an excerpt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@queso queso changed the title fix: fail regression when proposed produces the artifact less often fix: regression on artifact rate; grader files that print while loading Sep 30, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick review — approve

The change adds grader-listing validation to the grading pipeline, with the new unparseable-listing error path in grader-file.ts failing loudly with a truncated stdout excerpt for debugging. The logic is straightforward and bounded, and the accompanying test covers the primary success path. No blocking issues; approved.

0 inline comment(s).

Verdict was approve, posted as a comment — this repo does not allow GitHub Actions to approve PRs.

@queso
queso merged commit a5d0454 into main Sep 30, 2026
2 checks passed
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.

1 participant