Skip to content

fix(prototype): stop two handover eval graders failing correct runs - #16208

Merged
kyle-sexton merged 3 commits into
mainfrom
fix/prototype-eval-graders-script-assembled
Nov 14, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
fix/prototype-eval-graders-script-assembled

Conversation

@kyle-sexton

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

Copy link
Copy Markdown
Member

Refs: #16088

Summary

Two graders in the prototype plugin's ed-offline-mockup-handover eval case failed runs whose behaviour was correct, or judged one form both ways. This PR changes only files under plugins/prototype/evals/ed-offline-mockup-handover/ and the plugin's bump: none changelog fragment. No skill text, SKILL.md, reference/ file or library changes. The ed-shared-interview-staging case is unchanged.

This changes what the case accepts. Results taken with the old graders are not comparable with results taken after this merges: switcher-inlined now passes runs it used to fail, and handover-shape now fails a form it sometimes passed.

Fix

graders/switcher-inlined.md (trace regex)

  • Missed: the old regex passed only when vs-highlight appeared inside a Write input or a Bash heredoc/printf/tee/redirect line. Runs often write the page with a placeholder and then splice the bundled assets/variant-switcher.html in from disk: with node -e (readFileSync, then writeFileSync), with Python, with cat asset >> page, or with { cat part; cat asset; ...; } > page. These runs inlined the whole switcher and still failed.
  • Fix: one more alternative. A Bash call passes when it names variant-switcher.html and also writes, in either order. A write is writeFileSync, a .write( not on stdout/stderr, write_text(, sed -i, tee, or a >/>> redirect after whitespace or } that targets neither /dev/null nor a digit.
  • Still rejected: a page with no marker and no splice, and read-only uses of the asset. These include cat ... | head, grep ... 2>/dev/null, a node read with => or s.length > 0, and process.stdout.write(readFileSync(asset)).
  • Known limits:
    • A > comparison against a non-digit on the same line as the asset path passes.
    • cat asset > separate-file passes.
    • A partial inline through head -n passes.
    • A Write of a build script followed by node build.mjs, where no Bash line names the asset, still fails.

graders/handover-shape.md (llm, last message)

  • Missed: condition (2) "lists every variant on its own line with its key, a name ... and its states" was judged both ways on a handover that gives the states once for all variants ("Every variant has the same five states: ..."). SKILL.md step 4 "Hand it over" asks for "under each one line per variant: its key, its name, its states".
  • Fix: (2) now requires the states on each variant's own line. They can be named there, or referred to by naming the variant whose line named them ("same five states as A"). A sub-bullet directly under a variant's line counts as that variant's line. "Same states" with no source variant fails unless an earlier variant's line named the states. A states list given only once, outside the variant lines, fails (2). The other five conditions are unchanged word for word.
  • The sub-bullet rule is my reading. SKILL.md says "one line per variant" and does not say whether a nested line under it counts. I count it because it places the states with one variant and no other.

Both samples files gain invented samples:

  • handover-shape: a pass with states named on the first line and referenced on later lines, a pass with states in a sub-bullet, two fails with a shared states line, and a fail with an unsourced "same states".
  • switcher-inlined: the splice forms, sed -i, write_text, and the read-only forms it must still reject.

Verification

Old and new switcher-inlined patterns were applied offline to the traces of 48 kept runs of this case from earlier registered runs. The old pattern reproduces every recorded verdict (0 mismatches).

Grader Runs Old pass New pass
switcher-inlined 48 36 48
  • All 12 runs that flipped carry a splice from the bundled asset (7 node, 1 python, 4 cat). The run directories were not kept, so the final pages could not be read on disk.
  • handover-shape: in 2 of the 48 final messages the states sit on each variant line, and the old judge passed both. The other 46 give the states once or leave them off the variant lines, and the old judge passed 24 of those 46. Under the new wording those 46 fail (2). These counts come from reading the messages, not from rerunning the judge.

Checks:

  • validate-cases.py plugins/prototype/evals: exit 0, 0 FAIL. Every regex sample sorts correctly under JavaScript RegExp.
  • scripts/check-changelog-fragments.sh --check: all fragments valid.
  • Judge calibration, calibrate-judge.py (judge claude-opus-5-5, 3 runs per sample):
grader ed-offline-mockup-handover/handover-shape: agreement 22/22 runs (100.0%) over 8 samples
  not reproduced, left out: ed-offline-mockup-handover--handover-shape--01 with-arm run 2: reply begins "I didn't build the mockup. `/prototype:explore-directions` isn't installed in..." (trace)
  not reproduced, left out: ed-offline-mockup-handover--handover-shape--07 with-arm run 3: reply begins "(empty)" (trace)
  reproduction: 24 checked against traces, 0 against judge evidence, 0 unchecked
  samples with no reproduced run: 0 of 8
verdict: PASS (every grader at or above 90%)

Related

🤖 Generated with Claude Code

kyle-sexton and others added 2 commits November 14, 2026 13:26
switcher-inlined and snapshot-doctype now also accept a page assembled
by a script: a Bash call that reads the bundled variant-switcher asset
and writes (node writeFileSync, python write, cat into a redirect), and
a doctype page or build-script template later run or copied into
staging/. A page with no switcher or no doctype still fails.

no-mktemp becomes a trace regex that fails only when output is staged in
a temp location: a mktemp whose template names staging, the manifest or
the data dir, or a manifest.json written outside
interview-data/staging/. A scratch build directory from mktemp, the form
SKILL.md gives, no longer fails the case.

handover-shape condition (2) now says states sit on each variant's own
line, as SKILL.md step 4 requires; one shared states line fails it.

Refs: #16088

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton kyle-sexton added the do-not-merge Hard merge gate: do not merge while applied. label Nov 14, 2026
Revert the ed-shared-interview-staging changes: shared-interview.md
Placement says to write everything under the data dir's staging folder,
so whether a scratch build directory outside it is allowed is the
owner's decision, and the new patterns also passed a run whose snapshot
never reached staging.

switcher-inlined: a stdout/stderr .write( and a redirect to a digit no
longer count as writes; write_text( and sed -i now do. Samples cover
all four forms.

handover-shape: a sub-bullet under a variant's line counts as that
line, and a "same states" that names no source variant fails unless an
earlier variant line named the states.

Refs: #16088

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton kyle-sexton changed the title fix(prototype): stop four eval graders failing correct runs fix(prototype): stop two handover eval graders failing correct runs Nov 14, 2026
@kyle-sexton kyle-sexton removed the do-not-merge Hard merge gate: do not merge while applied. label Nov 14, 2026
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 14, 2026 18:51
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 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-14T18:52:20.596595Z 41bc1a1 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.

@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 43628906008

Failed GitHub API calls

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

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 41bc1a1ba42b94ed8fb24daef61925f74b21baaa: read 5 of 5 changed file(s); 0 finding(s), 0 as inline comments.

Security review: no security issues found

I read the whole change in all 5 files. Every change is eval-case data for the prototype plugin, plus a bump: none changelog fragment:

  • graders/switcher-inlined.md: the trace-regex grader gains a third alternative. It passes a Bash call that names variant-switcher.html and also writes. This regex only grades eval traces offline. It does not gate a merge, a token, a trust check, or what reaches a lane that holds credentials. The lookaheads use only lazy [^\n]*? scans, bounded to one line, with no nested quantifiers. At worst this is a polynomial cost on the eval's own traces, and no attacker controls those traces in a way that reaches an owner impact.
  • graders/handover-shape.md: an LLM-judge rubric that tightens condition (2). It is prose that grades the eval's final message. It is not a standing instruction to an agent and removes no guardrail.
  • samples/*.json: invented pass and fail samples for grader calibration.
  • .changes/prototype/...md: a changelog fragment with bump: none.

What I checked:

  • None of the changed files matches a TRUSTED PATHS glob.
  • No plugin manifest, userConfig key, hook, MCP server, workflow, or trust control is touched.
  • No shipped skill text changes.
  • The PR context contains no embedded instructions aimed at this lane.

This was the first review of this pull request (blocking only: no).

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 41bc1a1ba42b94ed8fb24daef61925f74b21baaa: read 5 of 5 changed file(s); 0 finding(s), 0 as inline comments.

Code review: PR #16208, fix(prototype): stop two handover eval graders failing correct runs

Scope: I read all 5 changed files in full. The PR changes only the ed-offline-mockup-handover eval case (two graders and their sample files) and adds a bump: none changelog fragment. It changes no skill text, manifest or library code.

graders/switcher-inlined.md

  • I traced the new third alternative by hand against every new sample. These are reasoning checks; I ran nothing.
  • Pass samples: each one matches.
    • The writeFileSync splices with the asset path inside the script and after it.
    • The Python open(p,'w').write(. The lookbehind sees p,'w'), not stdout.
    • The { ...; } > page concatenation. The > comes after a space.
    • The >> \"$f\" append, matched through (?:\\")?.
    • sed -i and write_text(.
  • Fail samples: each one is rejected.
    • 2>/dev/null and 2>&1: the > comes after a digit, so the lookbehind blocks it.
    • x=>x: the > comes after =.
    • s.length > 0: the negative lookahead rejects the digit.
    • process.stdout.write(: the lookbehind excludes it.
    • cat ... | head: it has no write token.
    • The empty trace.
  • Both lookbehinds are fixed-width, so the pattern also compiles outside JS. Single-quoted YAML keeps the backslashes literal.
  • The PR lists its known false passes: a > comparison against a non-digit, cat asset > other-file, and a partial head -n inline. These are stated tradeoffs, not hidden defects.

graders/handover-shape.md

  • The new wording for condition (2) matches the SKILL.md step 4 text the PR quotes ("one line per variant: its key, its name, its states"). The other conditions are unchanged.
  • The new samples cover each rule:
    • a states reference that names its source variant (pass)
    • a sub-bullet under each variant line (pass)
    • a shared "Every variant has the same states" line (fail)
    • a shared States bullet (fail)
    • an unsourced "same states" (fail)
  • The judge calibration in the PR body (22/22 agreement) is the author's claim; I did not verify it. The same goes for the 48-run offline replay.

Path-scoped rules: .claude/rules/eval-case-transcripts.md matches these files. The new samples are invented. They use /tmp/explore-directions-a1B2c3 and $RUN/$PLUGIN placeholders, with no machine-specific paths or identifying details, so they meet the rule.

Closing issue: the PR only says Refs: #16088 and closes no issue, so I had no acceptance criteria to check.

Changelog: bump: none fits a change that touches only an eval case and ships no skill change. No plugin manifest changed, so the manifest checks do not apply.

Spend: the changed graders will flip pass/fail verdicts for this case. Re-baselining it spends only eval-run and judge usage (prepaid). Nothing is billed.

The diff contains no embedded instructions aimed at the review lane.

Verifier dropped 0 of 0 candidates.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit e44b8f5 Nov 14, 2026
124 of 126 checks passed
@kyle-sexton
kyle-sexton deleted the fix/prototype-eval-graders-script-assembled branch November 14, 2026 19:14
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 14, 2026
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