Repository navigation
Accept paraphrased upstream change in remote pins grader #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jongio
wants to merge
15
commits into
main
Choose a base branch
from
jongio-stabilize-remote-pins-grader
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+194
−4
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
7377eec
Accept paraphrased upstream change in remote pins grader
jongio 45cb3b0
Keep model output out of grader failure evidence
jongio ad05bfd
Reject negated and whitespace-split release-notes claims in remote pi…
jongio e33cf89
Allow only short condition labels as grader failure details
jongio 306e541
Limit grader negation check to denials of the upstream change
jongio 2d01489
Handle historical negation, curly apostrophes and missing evals in re…
jongio 0512bd5
Reject passive 'not handled' denials in remote pins grader
jongio 68f6f80
Accept historical contrast with an explicit now-supported affirmation
jongio b831c7e
Score empty-note-list support per clause
jongio 5f16511
Split clauses linearly and limit fallback denials to subjectless clauses
jongio b910e15
Accept 'no longer rejects' and undenied pronoun affirmations
jongio 9ff2b52
Join soft-wrapped lines and accept passive pronoun affirmations
jongio 6ccce57
Accept affirmed changes with historical denials in remote pins grader
jongio d92c02c
Bind historical denial exemptions to each denial in remote pins grader
jongio 26958a1
Treat past adverbs inside denials as historical in remote pins grader
jongio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,129 @@ | ||
| import test from "node:test"; | ||
| import assert from "node:assert/strict"; | ||
| import { randomUUID } from "node:crypto"; | ||
| import { cpSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs"; | ||
| import { resolve } from "node:path"; | ||
| import { fileURLToPath, pathToFileURL } from "node:url"; | ||
| import { parse } from "yaml"; | ||
|
|
||
| const root = fileURLToPath(new URL("../../", import.meta.url)); | ||
| const evalDirectory = resolve(root, "evals/marketplace-maintainer/skills/update-remote-pins"); | ||
| const pinsTest = existsSync(evalDirectory) ? test : test.skip; | ||
| const label = "Reported the upstream change and offline limit"; | ||
|
|
||
| async function fixture(t) { | ||
| const spec = parse(readFileSync(resolve(evalDirectory, "eval.yaml"), "utf8")); | ||
| const stimulus = spec.stimuli.find((item) => item.name === "update-remote-pins-uses-reviewed-release"); | ||
| const directory = resolve(root, ".github/scripts", `.remote-pins-test-${randomUUID()}`); | ||
| const workspace = resolve(directory, "workspace"); | ||
| mkdirSync(workspace, { recursive: true }); | ||
| t.after(() => rmSync(directory, { recursive: true, force: true })); | ||
| for (const file of stimulus.agent_environment.files) { | ||
| cpSync(resolve(evalDirectory, file.src), resolve(workspace, file.dest), { recursive: true }); | ||
| } | ||
| for (const file of spec.grading_environment.files) { | ||
| const destination = resolve(directory, file.dest); | ||
| mkdirSync(resolve(destination, ".."), { recursive: true }); | ||
| cpSync(resolve(evalDirectory, file.src), destination); | ||
| } | ||
| const { evaluate } = await import(pathToFileURL(resolve(directory, ".grading/grader.mjs"))); | ||
| const { score } = await import(pathToFileURL(resolve(directory, ".grading/common.mjs"))); | ||
| const catalog = JSON.parse(readFileSync(resolve(workspace, "marketplace.json"), "utf8")); | ||
| const entry = catalog.plugins.find((item) => item.name === "outside-notes"); | ||
| Object.assign(entry, { version: "1.1.0" }); | ||
| Object.assign(entry.source, { sha: "b".repeat(40), ref: "v1.1.0" }); | ||
| writeFileSync(resolve(workspace, "marketplace.json"), JSON.stringify(catalog, null, 2)); | ||
| return (output) => score("marketplace-maintainer-remote", evaluate({ output, events: [] }, workspace)); | ||
| } | ||
|
|
||
| const offline = "This used the recorded offline snapshot, not live GitHub verification."; | ||
|
|
||
| pinsTest("update-remote-pins accepts the fixture's upstream change in exact and paraphrased wording", async (t) => { | ||
| const grade = await fixture(t); | ||
| for (const summary of [ | ||
| "Upstream change: Add support for empty note lists.", | ||
| "v1.1.0 now handles an empty notes list without errors.", | ||
| "The only change: the notes list can now be empty.", | ||
| "It adds support for empty lists of notes.", | ||
| "Note lists that are empty are now supported.", | ||
| "Lists with no notes are now handled.", | ||
| "- v1.1.0 adds support for **empty** note lists.", | ||
| "v1.1.0 adds empty-note-list support.", | ||
| "Empty note lists no longer cause errors.", | ||
| "Added support for empty note lists; verified offline, not against live GitHub.", | ||
| "Added support for previously unsupported empty note lists.", | ||
| "Empty note lists are now supported, so callers don't need to handle them specially.", | ||
| "Empty note lists weren't supported before; v1.1.0 now supports them.", | ||
| "Previously not supported, empty note lists are now supported.", | ||
| "Added support for empty note lists, which were not supported in v1.0.0.", | ||
| "Added support for empty note lists, but nested lists are not supported.", | ||
| "Added support for empty note lists, but it does not support nested lists.", | ||
| "Added support for empty note lists, but notes with attachments are not supported.", | ||
| "v1.1.0 no longer rejects empty note lists.", | ||
| "Empty note lists weren't supported in v1.0.0; v1.1.0 supports them.", | ||
| "Added support for empty\nnote lists.", | ||
| "Empty note lists weren't supported before; now they are supported.", | ||
| "Adds support for empty note lists (previously not supported).", | ||
| "Adds support for empty note lists (not supported before).", | ||
| "Adds support for empty note lists that were not supported in v1.0.0.", | ||
| "Empty note lists (not allowed in v1.0.0) are now accepted.", | ||
| "Now supports empty note lists that previously weren't handled.", | ||
| "Added support for empty note lists that were not previously supported.", | ||
| ]) { | ||
| const result = grade(`${summary} No new hooks or dependencies. ${offline}`); | ||
| assert.equal(result.passed, true, `${summary}: ${result.evidence}`); | ||
| } | ||
| }); | ||
|
|
||
| pinsTest("update-remote-pins rejects missing or unrelated upstream changes and a missing offline limit", async (t) => { | ||
| const grade = await fixture(t); | ||
| for (const [output, reason] of [ | ||
| [`Pinned outside-notes to v1.1.0. No new hooks or dependencies. ${offline}`, /no empty-note-list change/], | ||
| [`Updated the synthetic outside notes plugin; see the release notes list. Nothing is empty. ${offline}`, /no empty-note-list change/], | ||
| [`The release notes list is empty. ${offline}`, /no empty-note-list change/], | ||
| [`The release-notes list is empty. ${offline}`, /no empty-note-list change/], | ||
| [`Note lists must not be empty. ${offline}`, /no empty-note-list change/], | ||
| [`Lists with no notes are not supported. ${offline}`, /no empty-note-list change/], | ||
| [`v1.1.0 doesn't support empty note lists. ${offline}`, /no empty-note-list change/], | ||
| [`Lists with no notes aren\u2019t supported. ${offline}`, /no empty-note-list change/], | ||
| [`Lists with no notes aren't handled. ${offline}`, /no empty-note-list change/], | ||
| [`Empty note lists were supported before but are not supported now. ${offline}`, /no empty-note-list change/], | ||
| [`Note lists that are empty are no longer supported. ${offline}`, /no empty-note-list change/], | ||
| [`v1.1.0 now does not support empty note lists. ${offline}`, /no empty-note-list change/], | ||
| [`Empty note lists are not supported; v1.1.0 now supports headings. ${offline}`, /no empty-note-list change/], | ||
| [`Empty note lists weren't supported before; v1.1.0 now supports headings. ${offline}`, /no empty-note-list change/], | ||
| [`Empty note lists weren't supported in v1.0.0; v1.1.0 still doesn't support them. ${offline}`, /no empty-note-list change/], | ||
| [`Empty note lists weren't supported before; they are still not supported. ${offline}`, /no empty-note-list change/], | ||
| [`Empty note lists are still not supported. ${offline}`, /no empty-note-list change/], | ||
| [`Release notes were updated. ${offline}`, /no empty-note-list change/], | ||
| [`v1.1.0 adds support for empty note lists, but they are not supported on Windows. ${offline}`, /no empty-note-list change/], | ||
| [`Empty note lists were previously not supported. ${offline}`, /no empty-note-list change/], | ||
| [`v1.1.0 no longer supports empty note lists that were supported in v1.0.0. ${offline}`, /no empty-note-list change/], | ||
| [`Empty note lists are not supported now or before. ${offline}`, /no empty-note-list change/], | ||
| [`Empty note lists were previously not supported and headings are now supported. ${offline}`, /no empty-note-list change/], | ||
| [`The release notes list is empty. ${offline}`, /no empty-note-list change/], | ||
| [`The release\nnotes list is empty. ${offline}`, /no empty-note-list change/], | ||
| ["Upstream change: Add support for empty note lists. Verified on GitHub.", /no offline limit/], | ||
| ]) { | ||
| const result = grade(output); | ||
| assert.equal(result.passed, false, output); | ||
| assert.ok(result.evidence.includes(label), result.evidence); | ||
| assert.match(result.evidence, reason); | ||
| } | ||
| }); | ||
|
|
||
| pinsTest("update-remote-pins failure evidence names missing conditions without echoing model output", async (t) => { | ||
| const grade = await fixture(t); | ||
| const token = `ghp_${"A".repeat(36)}`; | ||
| const result = grade(`Pinned it with ${token}. {"token": "synthetic-opaque-value"}`); | ||
| assert.equal(result.passed, false); | ||
| assert.match(result.evidence, /\(no empty-note-list change, no offline limit\)/); | ||
| assert.ok(!result.evidence.includes(token) && !result.evidence.includes("synthetic-opaque-value"), result.evidence); | ||
| }); | ||
|
|
||
| pinsTest("shared check() drops failure details that aren't short condition labels", async () => { | ||
| const { check, score } = await import(pathToFileURL(resolve(root, "evals/_shared/graders/common.mjs")).href); | ||
| const token = `ghp_${"A".repeat(36)}`; | ||
| const evidence = score("synthetic", [check("Kept", false, `saw ${token}`), check("Named", false, "no offline limit")]).evidence; | ||
| assert.equal(evidence, "Kept; Named (no offline limit)"); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 58 additions & 2 deletions
60
evals/marketplace-maintainer/skills/update-remote-pins/grader.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.