Skip to content

Bench: answer keys and a deterministic scorer for four stalled rival rows - #1983

Merged
remigiusz-antczak merged 2 commits into
mainfrom
land/1966c
Oct 24, 2026
Merged

remigiusz-antczak merged 2 commits into
mainfrom
land/1966c

Conversation

@remigiusz-antczak

Copy link
Copy Markdown
Collaborator

Supersedes #1966. The same change, rebuilt as one commit on current main (after #1981), with six fixes from an independent review.

Four rival-bench rows (business-ops, growth-analytics, idea-critic, contribution) had no outcome score a cost check could pair with. This adds deterministic answer keys, so those rows can be scored without a judge model and without a paid call.

  • keys.json for the 40 held-out scenarios of the four skills: 3-6 must-hit and 1-3 must-not regex items per scenario. Keys test what an answer adds beyond its prompt (echo baseline at most 0.25), accept number forms and paraphrases, and carry no Perun verdict tokens.
  • scripts/rival_eval_keys.py wraps the cost-capture wrapper from Record per-arm bench cost and apply the cost check #1981; rival_eval.py stays unchanged and hash-pinned. It adds key_score (per-arm hit rate and violation rate), an answer_key block in results.json, a keys subcommand that rescores cached outputs offline, and key hygiene in check. rival-eval-premerge.sh now runs it.

Fixes from the review of the rebuilt branch:

  • A missing keys.json for a skill that ships keys now fails closed instead of silently skipping scoring.
  • check validates every key entry's shape, so a malformed key fails before a paid run rather than at score time.
  • Must-not matching no longer blanks bracketed or angle-bracketed spans, which could hide a violation. Negation only counts when it sits in the few words right before the match in the same clause, so "No, you should definitely form an LLC now" is now a violation. A generic placeholder such as [Company] is still fine.
  • A scenario missing for one arm now counts as a miss for that arm instead of being dropped for every arm.
  • The draft check now needs a non-trivial drafted message, not one quoted line or an empty fence.
  • The offline keys rescore picks each output by the current prompt hash, so stale outputs from an older prompt no longer make it depend on file order.

Tests: 19/19 in scripts/test_rival_answer_keys.py, and 47/47 in test_rival_eval. Local CI repro on this commit: size-ratchet ok against main, mustload ok, and the rival-answer-keys and bench-cost-capture hooks pass. The full scripts/ci-tests.d loop and test-ci-gates.sh ran on the pre-fix rebuild with only the 9 known sandbox-only failures.

🤖 Generated with Claude Code

https://claude.ai/code/session_014QNFFPWVcPUbeuvwM5fk2Z

…rows

Add keys.json (3-6 must-hit and 1-3 must-not regex items per scenario) for the 40 held-out scenarios of business-ops, growth-analytics, idea-critic and contribution. Keys test what an answer adds beyond its prompt (echo baseline max 0.25), accept number forms and paraphrases, and carry no Perun verdict tokens.

rival_eval_keys.py (a wrapper around the unchanged, hash-pinned rival_eval.py, stacked on the cost-capture wrapper; rival-eval-premerge.sh now runs it) gains key_score (per-arm hit rate and violation rate, no judge), an answer_key block in results.json, a keys subcommand that rescores cached outputs offline and fails closed on a missing keys.json or arm directory, and key hygiene in check. Must-nots are heuristically negation-aware and skip placeholders; contribution leak and force-push checks scan only the drafted message, and a missing draft is flagged no_draft. No paid call.

Tests: 19/19 (test_rival_answer_keys) + test_rival_eval 47/47

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014QNFFPWVcPUbeuvwM5fk2Z
@remigiusz-antczak
remigiusz-antczak merged commit ee905a2 into main Oct 24, 2026
1 check passed
@remigiusz-antczak
remigiusz-antczak deleted the land/1966c branch October 24, 2026 14:03
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