Repository navigation
test(source-control): add a plugin eval suite for resolve-conflicts #6293
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
30122a9
test(source-control): add a plugin eval suite for resolve-conflicts
kyle-sexton fd78214
test(source-control): order history reads before staging the resolution
kyle-sexton f20bef5
Merge origin/main into test/resolve-conflicts-plugin-eval-suite
cursoragent 51db27f
test(source-control): give the nothing-invented judge the full expect…
cursoragent 8495e24
test(source-control): grade up-quotes-history on assistant text acros…
cursoragent f3bef9a
test(source-control): word two prompts as an unresolved conflict so t…
cursoragent 9a21543
test(source-control): label every branch of the justified-per-file ru…
cursoragent 36f4251
test(source-control): clear the two typos findings in the resolve-con…
cursoragent e30d897
docs(source-control): say the fragment's history grader orders reads …
cursoragent bdf81d7
test(source-control): mark the rebase scaffold's literal backticks fo…
cursoragent d02533f
test(source-control): catch wildcard staging after -- or git -C
cursoragent 9efa004
test(source-control): require a history read of the pseudoref, not a …
cursoragent 465f7cc
test(source-control): order history reads before the first edit, not …
cursoragent bf27842
docs(source-control): say the fragment's history grader orders reads …
cursoragent afb5d0a
chore: merge main
kyle-sexton 63b7242
test(source-control): catch redirect and cp/mv rewrites in history-be…
kyle-sexton 6fcdb8b
test(source-control): exempt /tmp redirects in history-before-edit gr…
kyle-sexton a51dd01
test(source-control): scope history-before-edit writes to the conflic…
kyle-sexton fa7f23a
test(source-control): keep history-before-edit write match within one…
kyle-sexton 2b61643
test(source-control): anchor history-before-edit history read at a co…
kyle-sexton b0ed42d
chore: merge main
kyle-sexton 1a49eb4
fix(source-control): avoid piped grep -q in resolve-conflicts eval sc…
kyle-sexton 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
7 changes: 7 additions & 0 deletions
7
.changes/source-control/test-resolve-conflicts-plugin-eval-suite-ee7a239e.md
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,7 @@ | ||
| --- | ||
| bump: patch | ||
| --- | ||
|
|
||
| ### Added | ||
|
|
||
| - **A `claude plugin eval` suite for `/source-control:resolve-conflicts`.** Seven cases tagged `row22`, each scaffolding a git repository that is stopped in a real conflict: a two-stop rebase, a six-file merge where the prompt asks for `--ours` or abort, a merge with a conflict that has no markers, a cherry-pick, a merge whose incoming tip never touched the file, a revert, and a merge with only "sort it out" as the prompt. Most graders are deterministic: the resolved file contents, history read before the first edit, tests run before the operation concludes, and the concluding reflog line. They also cover the "It's working if" checks from the archived upstream skill page. Three cases add one model-judged grader each, and every grader carries pass and fail samples. The skill body is unchanged. |
4 changes: 4 additions & 0 deletions
4
...source-control/evals/resolve-conflicts-bare-prompt-recovers-intent-from-history/case.yaml
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,4 @@ | ||
| schema_version: "1.1" | ||
| name: resolve-conflicts-bare-prompt-recovers-intent-from-history | ||
| context: | ||
| scaffold_script: scaffold.sh |
5 changes: 5 additions & 0 deletions
5
...nflicts-bare-prompt-recovers-intent-from-history/graders/history-before-edit.md
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,5 @@ | ||
| --- | ||
| type: regex | ||
| pattern: '^(?:(?!"name":"(?:Edit|Write|MultiEdit|NotebookEdit)"|"command":")[\s\S]|"command":"(?:(?!(?:\bsed\s+-i|\bperl\s+-\w*i|(?<![\d&])>(?!&)|\b(?:cp|mv|tee)\s)(?:[^"\\;&|]|\\(?!n).)*?(?<!\w)client\.py\b|\b(?:checkout|restore)\s+(?:\S+\s+)*?--(?:ours|theirs)\b)(?:[^"\\]|\\.))*")*?"command":"(?:(?:(?!(?:\bsed\s+-i|\bperl\s+-\w*i|(?<![\d&])>(?!&)|\b(?:cp|mv|tee)\s)(?:[^"\\;&|]|\\(?!n).)*?(?<!\w)client\.py\b|\b(?:checkout|restore)\s+(?:\S+\s+)*?--(?:ours|theirs)\b)(?:[^"\\]|\\.))*?(?:[;&|]|\\n))?\s*git\s+(?:-C\s+\S+\s+)?(?:--no-pager\s+)?(?:log|show)\b' | ||
| target: trace | ||
| --- |
5 changes: 5 additions & 0 deletions
5
...e-conflicts-bare-prompt-recovers-intent-from-history/graders/intent-composed.md
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,5 @@ | ||
| --- | ||
| type: regex | ||
| pattern: '^(?![\s\S]*legacy_token)(?=[\s\S]*region)' | ||
| target: { source: file, path: api/client.py } | ||
| --- |
8 changes: 8 additions & 0 deletions
8
.../resolve-conflicts-bare-prompt-recovers-intent-from-history/graders/no-abort.md
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,8 @@ | ||
| --- | ||
| type: tool_used | ||
| tool: Bash | ||
| input_match: '--abort\b' | ||
| min: 0 | ||
| max: 0 | ||
| arm: both | ||
| --- |
7 changes: 7 additions & 0 deletions
7
...conflicts-bare-prompt-recovers-intent-from-history/graders/no-markers-client.md
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,7 @@ | ||
| --- | ||
| type: regex | ||
| pattern: '^(?:<{7}|={7}|>{7})' | ||
| flags: m | ||
| match: not_contains | ||
| target: { source: file, path: api/client.py } | ||
| --- |
5 changes: 5 additions & 0 deletions
5
...solve-conflicts-bare-prompt-recovers-intent-from-history/graders/skill-fired.md
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,5 @@ | ||
| --- | ||
| type: tool_used | ||
| tool: Skill | ||
| input_match: '"skill"\s*:\s*"(?:source-control:)?resolve-conflicts"' | ||
| --- |
5 changes: 5 additions & 0 deletions
5
...s-bare-prompt-recovers-intent-from-history/graders/up-checks-before-conclude.md
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,5 @@ | ||
| --- | ||
| type: tool_order | ||
| before: { tool: Bash, input_match: 'unittest|pytest|python3?\s+\S*test_\w+\.py' } | ||
| after: { tool: Bash, input_match: 'merge\s+--continue|git\s+commit\b' } | ||
| --- |
9 changes: 9 additions & 0 deletions
9
...-bare-prompt-recovers-intent-from-history/graders/up-intents-and-drops-named.md
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,9 @@ | ||
| --- | ||
| type: llm | ||
| --- | ||
|
|
||
| Main's commit removed `legacy_token` from `fetch_orders` because the /orders endpoint rejects token query auth with a 400 (SEC-12). The feature commit added a `region` filter for the EU dashboard (ORD-5). | ||
|
|
||
| PASS if the reply states each side's intent as the commit history gives it (the removal and its reason; the region filter and its purpose) and says that `legacy_token` is gone from the result because main removed it on purpose. | ||
|
|
||
| FAIL if the reply describes the resolution only in terms of the diff or the conflict markers, keeps `legacy_token` alongside `region`, or drops `region`. |
5 changes: 5 additions & 0 deletions
5
...licts-bare-prompt-recovers-intent-from-history/graders/up-operation-complete.md
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,5 @@ | ||
| --- | ||
| type: regex | ||
| pattern: 'commit \(merge\)' | ||
| target: { source: file, path: .git/logs/HEAD } | ||
| --- |
6 changes: 6 additions & 0 deletions
6
...conflicts-bare-prompt-recovers-intent-from-history/graders/up-quotes-history.md
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,6 @@ | ||
| --- | ||
| type: regex | ||
| pattern: '^\{"type":"assistant".*"type":"text","text":"(?:[^"\\]|\\.)*?(?:SEC-12|\b400\b|stopped accepting|token query auth)' | ||
| flags: mi | ||
| target: trace | ||
| --- |
11 changes: 11 additions & 0 deletions
11
...trol/evals/resolve-conflicts-bare-prompt-recovers-intent-from-history/prompt.md
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,11 @@ | ||
| --- | ||
| description: "Bare 'sort it out' merge prompt: only the commit message says legacy_token was removed on purpose; keep region, drop legacy_token, say why, run tests, conclude" | ||
| tags: [resolve-conflicts, source-control, row22, upstream-working-if] | ||
| runs: 3 | ||
| max_turns: 40 | ||
| timeout_seconds: 900 | ||
| allowed_tools: [Read, Glob, Grep, Skill, Bash, Edit] | ||
| expected_outcome: "api/client.py keeps region and has no legacy_token, no markers, history was read before the edit, the reply cites SEC-12 or the 400, tests ran before the merge was concluded, and the merge commit exists" | ||
| --- | ||
|
|
||
| git merge main stopped with conflicts. Sort it out and finish the merge. |
75 changes: 75 additions & 0 deletions
75
...solve-conflicts-bare-prompt-recovers-intent-from-history/samples/history-before-edit.json
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,75 @@ | ||
| { | ||
| "pass": [ | ||
| { | ||
| "answer": "{\"type\":\"system\",\"subtype\":\"init\",\"model\":\"m\"}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_0\",\"name\":\"Bash\",\"input\":{\"command\":\"BASE=$(git merge-base HEAD MERGE_HEAD); git log -p \\\"$BASE\\\"..MERGE_HEAD -- client.py\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_0\",\"content\":\"ok\"}]}}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_1\",\"name\":\"Write\",\"input\":{\"file_path\":\"/w/client.py\",\"content\":\"y\\n\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_1\",\"content\":\"ok\"}]}}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_2\",\"name\":\"Bash\",\"input\":{\"command\":\"git add client.py\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_2\",\"content\":\"ok\"}]}}" | ||
| }, | ||
| { | ||
| "answer": "{\"type\":\"system\",\"subtype\":\"init\",\"model\":\"m\"}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_0\",\"name\":\"Bash\",\"input\":{\"command\":\"git status\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_0\",\"content\":\"ok\"}]}}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_1\",\"name\":\"Bash\",\"input\":{\"command\":\"git show abc123\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_1\",\"content\":\"ok\"}]}}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_2\",\"name\":\"Edit\",\"input\":{\"file_path\":\"/w/client.py\",\"old_string\":\"x\",\"new_string\":\"y\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_2\",\"content\":\"ok\"}]}}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_3\",\"name\":\"Bash\",\"input\":{\"command\":\"git -C /w add client.py\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_3\",\"content\":\"ok\"}]}}" | ||
| }, | ||
| { | ||
| "answer": "{\"type\":\"system\",\"subtype\":\"init\",\"model\":\"m\"}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_0\",\"name\":\"Bash\",\"input\":{\"command\":\"git --no-pager log --oneline -5 -- client.py\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_0\",\"content\":\"ok\"}]}}", | ||
| "why": "history read; nothing edited yet" | ||
| }, | ||
| { | ||
| "answer": "{\"type\":\"system\",\"subtype\":\"init\",\"model\":\"m\"}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_0\",\"name\":\"Bash\",\"input\":{\"command\":\"python3 -m unittest > test-output.log 2>&1\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_0\",\"content\":\"ok\"}]}}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_1\",\"name\":\"Bash\",\"input\":{\"command\":\"git log --oneline\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_1\",\"content\":\"ok\"}]}}", | ||
| "why": "redirect to an unrelated file is not an edit of the conflicted file" | ||
| }, | ||
| { | ||
| "answer": "{\"type\":\"system\",\"subtype\":\"init\",\"model\":\"m\"}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_0\",\"name\":\"Bash\",\"input\":{\"command\":\"git status 2>&1 >/dev/null\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_0\",\"content\":\"ok\"}]}}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_1\",\"name\":\"Bash\",\"input\":{\"command\":\"git log --oneline 2>&1\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_1\",\"content\":\"ok\"}]}}", | ||
| "why": "stderr and null redirects are not file writes" | ||
| }, | ||
| { | ||
| "answer": "{\"type\":\"system\",\"subtype\":\"init\",\"model\":\"m\"}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_0\",\"name\":\"Bash\",\"input\":{\"command\":\"cp notes.txt backup.txt && git log --oneline -- client.py\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_0\",\"content\":\"ok\"}]}}", | ||
| "why": "unrelated write chained with a history read of the conflicted file" | ||
| }, | ||
| { | ||
| "answer": "{\"type\":\"system\",\"subtype\":\"init\",\"model\":\"m\"}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_0\",\"name\":\"Bash\",\"input\":{\"command\":\"git log -- client.py && cat theirs > client.py\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_0\",\"content\":\"ok\"}]}}", | ||
| "why": "history read first; the rewrite comes after it in the same call" | ||
| } | ||
| ], | ||
| "fail": [ | ||
| { | ||
| "answer": "" | ||
| }, | ||
| { | ||
| "answer": "{\"type\":\"system\",\"subtype\":\"init\",\"model\":\"m\"}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_0\",\"name\":\"Write\",\"input\":{\"file_path\":\"/w/client.py\",\"content\":\"y\\n\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_0\",\"content\":\"ok\"}]}}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_1\",\"name\":\"Bash\",\"input\":{\"command\":\"git log --oneline\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_1\",\"content\":\"ok\"}]}}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_2\",\"name\":\"Bash\",\"input\":{\"command\":\"git add client.py\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_2\",\"content\":\"ok\"}]}}", | ||
| "why": "rewrote the file before reading history" | ||
| }, | ||
| { | ||
| "answer": "{\"type\":\"system\",\"subtype\":\"init\",\"model\":\"m\"}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_0\",\"name\":\"Edit\",\"input\":{\"file_path\":\"/w/client.py\",\"old_string\":\"x\",\"new_string\":\"y\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_0\",\"content\":\"ok\"}]}}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_1\",\"name\":\"Bash\",\"input\":{\"command\":\"git show abc123\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_1\",\"content\":\"ok\"}]}}", | ||
| "why": "edited before reading history" | ||
| }, | ||
| { | ||
| "answer": "{\"type\":\"system\",\"subtype\":\"init\",\"model\":\"m\"}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_0\",\"name\":\"Bash\",\"input\":{\"command\":\"sed -i s/x/y/ client.py\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_0\",\"content\":\"ok\"}]}}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_1\",\"name\":\"Bash\",\"input\":{\"command\":\"git log -p -- client.py\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_1\",\"content\":\"ok\"}]}}", | ||
| "why": "rewrote the file with Bash before reading history" | ||
| }, | ||
| { | ||
| "answer": "{\"type\":\"system\",\"subtype\":\"init\",\"model\":\"m\"}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_0\",\"name\":\"Bash\",\"input\":{\"command\":\"git checkout --theirs client.py\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_0\",\"content\":\"ok\"}]}}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_1\",\"name\":\"Bash\",\"input\":{\"command\":\"git log --oneline\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_1\",\"content\":\"ok\"}]}}", | ||
| "why": "took a side before reading history" | ||
| }, | ||
| { | ||
| "answer": "{\"type\":\"system\",\"subtype\":\"init\",\"model\":\"m\"}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_0\",\"name\":\"Bash\",\"input\":{\"command\":\"git diff\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_0\",\"content\":\"ok\"}]}}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_1\",\"name\":\"Write\",\"input\":{\"file_path\":\"/w/client.py\",\"content\":\"y\\n\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_1\",\"content\":\"ok\"}]}}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_2\",\"name\":\"Bash\",\"input\":{\"command\":\"git add client.py\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_2\",\"content\":\"ok\"}]}}", | ||
| "why": "diff only, no history" | ||
| }, | ||
| { | ||
| "answer": "{\"type\":\"system\",\"subtype\":\"init\",\"model\":\"m\"}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_0\",\"name\":\"Bash\",\"input\":{\"command\":\"git status\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_0\",\"content\":\"ok\"}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_9\",\"content\":\"try git log next\"}]}}", | ||
| "why": "git log only in tool output" | ||
| }, | ||
| { | ||
| "answer": "{\"type\":\"system\",\"subtype\":\"init\",\"model\":\"m\"}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_0\",\"name\":\"Bash\",\"input\":{\"command\":\"cat theirs.py > client.py\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_0\",\"content\":\"ok\"}]}}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_1\",\"name\":\"Bash\",\"input\":{\"command\":\"git log --oneline\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_1\",\"content\":\"ok\"}]}}", | ||
| "why": "overwrote the file with a redirect before reading history" | ||
| }, | ||
| { | ||
| "answer": "{\"type\":\"system\",\"subtype\":\"init\",\"model\":\"m\"}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_0\",\"name\":\"Bash\",\"input\":{\"command\":\"cp theirs.py client.py\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_0\",\"content\":\"ok\"}]}}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_1\",\"name\":\"Bash\",\"input\":{\"command\":\"git log --oneline\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_1\",\"content\":\"ok\"}]}}", | ||
| "why": "copied over the file before reading history" | ||
| }, | ||
| { | ||
| "answer": "{\"type\":\"system\",\"subtype\":\"init\",\"model\":\"m\"}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_0\",\"name\":\"Bash\",\"input\":{\"command\":\"cat theirs > client.py && git log -- client.py\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_0\",\"content\":\"ok\"}]}}", | ||
| "why": "rewrote the file earlier in the same call as the history read" | ||
| }, | ||
| { | ||
| "answer": "{\"type\":\"system\",\"subtype\":\"init\",\"model\":\"m\"}\n{\"type\":\"assistant\",\"message\":{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_0\",\"name\":\"Bash\",\"input\":{\"command\":\"sed -i s/x/y/ client.py; git log --oneline\",\"description\":\"run\"}}]}}\n{\"type\":\"user\",\"message\":{\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_0\",\"content\":\"ok\"}]}}", | ||
| "why": "edited with sed earlier in the same call as the history read" | ||
| } | ||
| ] | ||
| } | ||
15 changes: 15 additions & 0 deletions
15
...s/resolve-conflicts-bare-prompt-recovers-intent-from-history/samples/intent-composed.json
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,15 @@ | ||
| { | ||
| "pass": [ | ||
| { | ||
| "answer": "def fetch_orders(session, customer_id, region=None):\n params = {\"customer\": customer_id}\n if region:\n params[\"region\"] = region\n return session.get(\"/orders\", params=params)\n" | ||
| } | ||
| ], | ||
| "fail": [ | ||
| { | ||
| "answer": "def fetch_orders(session, customer_id, legacy_token=None, region=None):\n params = {\"customer\": customer_id}\n if region:\n params[\"region\"] = region\n if legacy_token:\n params[\"token\"] = legacy_token\n" | ||
| }, | ||
| { | ||
| "answer": "def fetch_orders(session, customer_id):\n params = {\"customer\": customer_id}\n" | ||
| } | ||
| ] | ||
| } |
39 changes: 39 additions & 0 deletions
39
...ol/evals/resolve-conflicts-bare-prompt-recovers-intent-from-history/samples/no-abort.json
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,39 @@ | ||
| { | ||
| "pass": [ | ||
| { | ||
| "answer": [] | ||
| }, | ||
| { | ||
| "answer": [ | ||
| { | ||
| "tool": "Bash", | ||
| "input": { | ||
| "command": "git status | head -4" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "fail": [ | ||
| { | ||
| "answer": [ | ||
| { | ||
| "tool": "Bash", | ||
| "input": { | ||
| "command": "git merge --abort" | ||
| } | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "answer": [ | ||
| { | ||
| "tool": "Bash", | ||
| "input": { | ||
| "command": "git rebase --abort && git status" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
19 changes: 19 additions & 0 deletions
19
...resolve-conflicts-bare-prompt-recovers-intent-from-history/samples/no-markers-client.json
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,19 @@ | ||
| { | ||
| "pass": [ | ||
| { | ||
| "answer": "x = 1\ny = 2\n" | ||
| }, | ||
| { | ||
| "answer": "# a ======= rule in a comment is fine mid-line ======= \n" | ||
| } | ||
| ], | ||
| "fail": [ | ||
| { | ||
| "answer": "<<<<<<< HEAD\nx = 1\n=======\nx = 2\n>>>>>>> main\n" | ||
| }, | ||
| { | ||
| "answer": "x = 1\n=======\n", | ||
| "why": "a leftover separator" | ||
| } | ||
| ] | ||
| } |
46 changes: 46 additions & 0 deletions
46
...evals/resolve-conflicts-bare-prompt-recovers-intent-from-history/samples/skill-fired.json
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,46 @@ | ||
| { | ||
| "pass": [ | ||
| { | ||
| "answer": [ | ||
| { | ||
| "tool": "Skill", | ||
| "input": { | ||
| "skill": "source-control:resolve-conflicts" | ||
| } | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "answer": [ | ||
| { | ||
| "tool": "Bash", | ||
| "input": { | ||
| "command": "git status" | ||
| } | ||
| }, | ||
| { | ||
| "tool": "Skill", | ||
| "input": { | ||
| "skill": "resolve-conflicts" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "fail": [ | ||
| { | ||
| "answer": [] | ||
| }, | ||
| { | ||
| "answer": [ | ||
| { | ||
| "tool": "Skill", | ||
| "input": { | ||
| "skill": "source-control:commit" | ||
| } | ||
| } | ||
| ], | ||
| "why": "wrong skill" | ||
| } | ||
| ] | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.