Skip to content

test(performance): add the protect codify hand-off eval case - #17628

Merged
kyle-sexton merged 4 commits into
mainfrom
test/17200-performance-codify-handoff-case
Nov 20, 2026
Merged

kyle-sexton merged 4 commits into
mainfrom
test/17200-performance-codify-handoff-case

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Refs: #17200

Summary

Adds the performance eval case that #17200 asks for under #17172: pr-fragile-guardrail-hands-to-codify. It loads a corrections stand-in plugin, in the shape of the harness-config cases from PR 17459, and grades that /performance:protect §5, as changed in PR 17209, hands a fragile optimization's guardrail to /corrections:codify while the counter ceiling is still proposed.

The scenario is a verified MET win that keeps a precomputed rate table (a fast path that copies a slow one). The prompt is read-only: it loads the skill with the Skill tool and asks for two filled lines, CEILING: and GUARDRAIL:. The prompt does not name codify or corrections. The skill text is unchanged; this PR adds the case, its stand-in plugin and a bump: none changelog fragment.

Fix

Graders, all deterministic:

  • ceiling-measured-value (both arms): the CEILING: line's first number is 1, the measured value, and it does not say none. This is the no-loss check: the ceiling is still proposed.
  • guardrail-hands-to-codify (both arms): the GUARDRAIL: line names corrections:codify, and no mechanism of protect's own choosing (generating the table, a drift, CI, unit or regression test or check, adding a test or check) comes before that name. Mechanisms named after the hand-off, which describe codify's choice, still pass. This is the discriminator.
  • no-codify-run (with-only): no Skill call runs codify.
  • no-unavailable-claim (both arms): the GUARDRAIL: line does not call codify unavailable.

No llm grader: the one in PR 17459 was uncalibrated and read 4 of 9 on correct replies.

Before-text check, judged from the text and the samples (no before arm was run): before PR 17209, §5 said "generate the copy from the source, and add a test that fails when the two drift" and named no codify, so a faithful reply's GUARDRAIL: line fails guardrail-hands-to-codify. A sample of that shape is in the grader's must-fail samples. ceiling-measured-value passes on both texts.

Verification

  • validate-cases.py over plugins/performance/evals: no FAIL, and no WARN for the new case. Its deterministic graders were checked offline against the case's samples/ under both V8 and JavaScriptCore.
  • scripts/check-affected.sh: 18 passed, 2 skipped (no changed shell or Python).
  • Review tightened guardrail-hands-to-codify (61d4caf, 1f6109f) so a GUARDRAIL: line that picks a mechanism before naming codify fails. The earlier smoke run in this PR was graded by the earlier pattern, which accepted any line naming codify. It is replaced by the run below, made on the pattern now on the head.
  • Smoke run on the graders now on the head (1f6109f), claude plugin eval on Claude Code 2.1.329, model sonnet (served as claude-sonnet-5-5), 3 runs a side, this case only. The validity gate read VALID: no denied tool call, and every with-arm run loaded the plugin and the stand-in. Its two warnings: no grader checks that the skill fired, and no judge was recorded (the case has no judge grader). The noise report reads "n too small to call" (one case).
    • With the plugin, score 1.00: ceiling-measured-value 3/3, guardrail-hands-to-codify 3/3, no-codify-run 3/3, no-unavailable-claim 3/3.
    • Without the plugin, score 0.33: ceiling-measured-value 0/3, guardrail-hands-to-codify 0/3, no-unavailable-claim 3/3.
    • All three with-arm replies propose ceiling 1 with no headroom. Their GUARDRAIL: lines, read:
      • "Hand /corrections:codify "rates_table.json must not drift from the carrier's rate card" to pick the strongest mechanism, preferring generating the table so drift is impossible, otherwise a CI check that blocks a stale table ..."
      • "Hand "rates_table.json must not drift from the carrier's rate card" to /corrections:codify, expecting a CI check that regenerates or version-compares the table and fails on drift, plus a quote-parity check ..."
      • "A check, chosen via /corrections:codify, that fails CI when rates_table.json's version or quotes differ from the carrier's live rate card."
    • By reading, none of the three leaves the mechanism fully to codify. The first two name codify first and then prescribe a mechanism ("preferring generating the table", "expecting a CI check that regenerates"), which the grader accepts by design (see Fix). The third is a probable false pass: it frames the guardrail as "a check ... that fails CI" before naming codify, and passes only because the mechanism list does not count a bare "check", or "CI" not followed by test or check. That is the narrow list the pr-verify note on 1f6109f raised, now shown by a live reply. The grader was not changed after this run; the 3/3 is reported as graded.
    • Cost reported by the tool: 0.25 USD (list-price estimate).
    • The run used a copy of the plugin outside any git repository; the CLI refuses this repository's git worktree with "a git directory of the plugin registers more linked worktrees than can be screened".
  • Known limit: a line that names a mechanism before codify only to reject it ("rather than a drift test, hand it to codify") also fails. PR 17629 corrected the same negation shape in its rules-file grader; this grader keeps the limit, and no run here produced that shape.
  • Not run: a before arm on the pre-PR-17209 text, and the opus alias.

Related

Remaining

#17200 stays open. This PR delivers the eval-case item of the #17172 entry. Not part of this PR: that entry's PR-body quote item, and the entry's run budget beyond this smoke run (before and after, both aliases). The other entries' host steps remain as the issue lists them.

🤖 Generated with Claude Code

kyle-sexton and others added 2 commits November 20, 2026 02:42
Adds pr-fragile-guardrail-hands-to-codify for issue 17200's host step
under issue 17172. The case loads a corrections stand-in and checks that
/performance:protect still proposes the counter ceiling at the measured
value and hands a fragile optimization's guardrail to
/corrections:codify, naming the call, without running codify or calling
it unavailable. The skill text is unchanged.

Refs: #17200

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KeBVgf4hSWe3ViMaDA9Fp9
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 20, 2026 09:10
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T09:12:30.159733Z cfc1cd6 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cfc1cd6520

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

kyle-sexton and others added 2 commits November 20, 2026 04:16
The guardrail-hands-to-codify grader accepted any GUARDRAIL line naming
corrections:codify, so a line that chose the mechanism itself (generate
the table, add a drift test) and only mentioned codify after it passed.
The grader now rejects a line where a mechanism comes before the codify
name. Mechanisms named after the hand-off, which describe codify's own
choice, still pass. Samples cover both shapes.

Refs: #17200

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KeBVgf4hSWe3ViMaDA9Fp9
The typos check reads the stem `generat` as a misspelling. List the
verb forms instead; the grader matches the same lines.

Refs: #17200

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KeBVgf4hSWe3ViMaDA9Fp9
@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-refine/fix-docs
Model rung 0
Leg handoff
Run job success
Activity step success
Commits pushed none (read lane)
Run 44708548110

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-security-review: 2 inline finding(s) on cfc1cd6520e677fe791eeb7f7a53445094b2ca67; the summary is in this lane's pull request comment.

claude-lane: claude-security-review

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 1f6109f9ebf16752deb253cc802893683d235be6: read 2 of 2 changed file(s); 2 finding(s), 0 as inline comments.

Security review: PR #17628, incremental since cfc1cd65

This push adds no new security findings. The review was blocking only: this lane already reviewed an earlier head, so it reports only CRITICAL and IMPORTANT findings.

I read both files in the incremental scope in full:

  • plugins/performance/evals/pr-fragile-guardrail-hands-to-codify/case.yaml: the guardrail-hands-to-codify regex grader gains a negative lookahead. It now fails a GUARDRAIL: line that names its own mechanism (generate, drift/CI/unit/regression test or check, "add a … test") before the corrections:codify hand-off. The grader only matches the eval session's own last_message. No outside input reaches it, it runs no code and it grants nothing, so a slow or wrong match could only change the eval's score, which is not a security concern.
  • plugins/performance/evals/pr-fragile-guardrail-hands-to-codify/samples/guardrail-hands-to-codify.json: this file only adds one pass sample and two fail sample strings for the grader. It is test data with no executable surface.

Neither file matches a TRUSTED PATHS glob. The push touches no trust control, merge hold, token scope, kill switch, instruction surface or plugin manifest, and the PR context contains no instructions aimed at the lane.

Two earlier findings still stand. Both are IMPORTANT manifest flags on the eval-only corrections-stub/.claude-plugin/plugin.json. That file has not changed since they were posted, so they are carried forward and counted rather than posted again.

Spend: this push only changes what the grader checks. The eval case still runs 3 times per side on prepaid eval credit. This is not a hold.

Manifest lines (2)

critical-findings: 0

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 1f6109f9ebf16752deb253cc802893683d235be6: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Code review: PR #17628, incremental since cfc1cd65 (blocking only)

This lane already reviewed an earlier head, so this pass reports blocking findings only. It covers the two files this push changed:

  • case.yaml: the guardrail-hands-to-codify pattern
  • samples/guardrail-hands-to-codify.json: two new must-fail samples and one new must-pass sample

No blocking findings.

The new pattern, checked by hand against every sample (JS regex, flags im). It adds a negative lookahead. A GUARDRAIL: line fails when a mechanism of protect's own choosing comes before corrections:codify. The mechanisms are generate, regenerate or generating, a drift, CI, unit or regression test or check, and add a … test or check.

  • Must-pass, bold label (**GUARDRAIL:** hand the rule … must not drift from …): passes. "drift from" is not "drift test/check".
  • New must-pass (Hand /corrections:codify "…", … such as generating … or a drift test): passes. Every mechanism comes after the only codify name, so the lookahead finds nothing.
  • New must-fail (Generate … and add a drift test; /corrections:codify can document …): fails on Generate.
  • New must-fail (add a drift check …, then run /corrections:codify …): fails on drift check and also on add a … check.
  • Older must-fail samples: they name no codify on the GUARDRAIL: line, so they still fail.

YAML single quoting keeps the backslashes literal, and the pattern holds no '.

Prior finding. This push answers the earlier advisory (no grader checked that the guardrail line picks no mechanism itself). That example reply (generate … and add a drift test; /corrections:codify can prove it) now fails, and an equivalent sample is in the must-fail set. The PR body states the limits that remain: no run was made on the new pattern, and a line that names a mechanism only to reject it also fails. As a blocking-only review, this pass does not raise advisory-level vocabulary gaps in the lookahead.

Verification. I ran nothing. The sample results above come from reading the pattern. The PR body's validate-cases.py results and smoke-run scores are the author's claims, unverified. The PR body also says the smoke run predates this pattern.

Closing issue. The PR only references #17200 and closes no issue, so there are no acceptance criteria to check.

Loosened checks. The prompt had no loosened_check_verdict:, loosened_check_patterns: or loosened_check_decision_record: lines. I used fail with no consumer entries and did not check the citation requirement. The change tightens a grader and loosens no check.
Loosened checks would be marked: fail (bundled default); patterns: 0

Spend: nothing new. Running the case still spends prepaid API credit, unchanged by this push.

Verifier dropped 0 of 0 candidates.

@kyle-sexton

Copy link
Copy Markdown
Member Author

Session hold (GitHub Work): this pull request waits on the owner. Its two open security-lane threads flag the corrections stand-in's manifest inside the eval case; each has an evidence reply, and resolving a security-lane thread is the owner's call. Nothing else is outstanding: CI Status was green and both review lanes read the head.

@kyle-sexton

Copy link
Copy Markdown
Member Author

Hold lifted. The owner decided this on 2026-11-20 (question Q107, option A): the two security-lane manifest-flag threads on the eval-only corrections stand-in are resolved with no code change, and this pull request merges. The earlier session-hold comment no longer applies.

@kyle-sexton kyle-sexton removed the do-not-merge Hard merge gate: do not merge while applied. label Nov 20, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 749d404 Nov 20, 2026
106 of 107 checks passed
@kyle-sexton
kyle-sexton deleted the test/17200-performance-codify-handoff-case branch November 20, 2026 15:01
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 20, 2026
@kyle-sexton

Copy link
Copy Markdown
Member Author

Eval of case pr-fragile-guardrail-hands-to-codify (#17172, skill change PR 17209), sonnet (served as claude-sonnet-5-5), 3 runs a side, Claude Code 2.1.329. Verdict: no loss, with a detection signal.

  • BEFORE text: plugins/performance at f1c22b0 (parent of the PR 17209 squash 650dc66), plus the case folder from main 74c69d3. Run here, --ablation none, --allow-tools Bash, 2026-11-20. Validity gate: VALID, no denied call, no run error, not partial (warnings: no skill-fired grader, no judge model recorded; the case has no judge grader).
  • AFTER text: the with-plugin arm recorded in PR 17628, run on its head 1f6109f, whose plugins/performance content equals the squash 749d404. That run read VALID. Not re-run.
  • Between the two texts, besides PR 17209, main also changed performance in fix: apply the Claude Code 2.1.325 changelog handoffs #17591.
Grader BEFORE AFTER
ceiling-measured-value 3/3 3/3
guardrail-hands-to-codify 0/3 3/3
no-codify-run 3/3 3/3
no-unavailable-claim 3/3 3/3
Case mean 0.75 1.00
  • Loss rule (mean drop of 0.15 or more, or a grader passing 2 or more fewer runs AFTER): no loss. Detection signal: guardrail-hands-to-codify 3/3 AFTER against 0/3 BEFORE. Every BEFORE GUARDRAIL: line reads "Generate rates_table.json from the carrier's rate card and add a test that fails when the committed table drifts ...", the pre-change §5 sentence, and none names codify. All three BEFORE replies propose ceiling 1 with no headroom, as AFTER does.
  • Cost (list-price estimate from the result JSON): BEFORE 0.217 USD. The recorded PR 17628 run reported 0.25 USD for both of its arms (with and without plugin).
  • Limits: the arms were not interleaved; AFTER is the with-arm of an earlier default-ablation launch on the same Claude Code version. This BEFORE launch granted Bash, which the case does not ask for; no run called it. PR 17628 reads one of its three AFTER passes as a probable false pass ("A check, chosen via /corrections:codify, that fails CI ..."), so the AFTER count is 3/3 as graded, and 2/3 to 3/3 by reading. Either way the grader gains 2 or more runs.
  • Not run: the opus alias (the budget runs opus only to confirm a sonnet loss).

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

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant