Repository navigation
fix(agent): call out a line an edit removed when told to change nothing else - #6885
Conversation
…ng else On rc16, Gemma 4 E4B was asked to change milk to oat milk, add apples, and change nothing else. It replaced '- eggs' with '- apples' and answered that it had appended. When the request limits the edit, GAIA now keeps the lines each edit removed that the request never mentions, and adds a one-line note naming them unless the answer already does.
|
Verdict: Request changes When a user says "change nothing else", this PR has GAIA add a note to its answer naming any line an edit removed that the request didn't mention. That would have caught the rc16 case where "- eggs" was silently replaced. The idea is sound and the hook is in the right place, but the matching is loose in three ways a user would notice:
Real-world evidenceN/A. No evidence bundle was produced for this run, and the PR marks the Gemma NPU replay of the todo.txt edit as pending. The verdict rests on static review and the unit tests. The new note changes chat answers that users see, so the replay (or a CLI 🔍 Technical details🟡 Shared words hide removed lines ( 🟡 A later re-add is not reconciled ( 🟡 The bare Keep the bare form only if "…and nothing else." is a common ending in real requests. If you do keep it, add a negative test. 🟡 No live evidence yet 🟢 Note text is English-only. This matches the planted-instructions note next to it, so it's not a blocker. Worth remembering if these notes ever go through the UI's translation function. Checked and fine: both Strengths
|
|
Verdict: Request changes All three matching problems from the last review are fixed, and each has a test. Common words no longer hide a removed line, a line a later edit puts back is no longer reported, and a bare "nothing else" no longer counts as a limit. Nothing new turned up in this push. One finding from that review is still open:
🔍 Technical details
|
With "change nothing else" in the request, fixing a typo, capitalizing a heading, updating a date, fixing grammar or translating a line all got a note saying the line was removed. A removed line now counts as edited in place when an added line closely matches it, when its replacement keeps one of its words, or when the replacement is text the request never spelled out. A line swapped for text the request asked to add elsewhere, the rc16 "- eggs" case, is still called out.
|
Fixed the verifier's blocker: an in-place edit the user asked for is no longer reported as a removed line. With "change nothing else" in the request, fixing a typo, capitalizing a heading, updating a date, fixing grammar and translating a line all get no note now. The rc16 case, where 🔍 Technical details
|
A "change nothing else" edit that swapped an untouched line for new text (a ticked-off chore, a flipped ssl_verify, a rewritten deploy rule) went unreported, because any replacement the request never spelled out was treated as a requested rewrite. Now that only holds when the request asks for a rewrite (translate, rephrase, convert...) and the line keeps its numbers; otherwise a line counts as edited in place only when the change is a typo/case fix or a value the request gave. Adds a 27-case correct-edit corpus and a 27-case unasked-change corpus.
|
Lines swapped for text nobody asked for are now called out. On two new test corpora, 26 of 27 unasked changes get the note (the previous head caught 3), and all 27 correct edits stay quiet (previously 25). Merged main in too. Thanks for the feature, Kalin. 🔍 Technical details
|
…und the check A deep review found the unasked-removal note firing on edits the user asked for and missing its own purpose in places: - A deletion asked for by position or kind (delete line 3, remove the last item) was reported as unasked. A request that asks for a deletion and names no removed line no longer reports lines that were simply taken out. - Joining, splitting or wrapping lines, and a one-line in-place fix, were reported as removals. A line whose words all survive in the added text is not lost. - Comparing every removed line with every added one took 46 s on a 2,000-line edit. Edits with more than 200 changed lines are skipped. - The answer could silence the note by mentioning the word (eggs is still there). It now counts only when a sentence owns up to the removal. - Removals were keyed by file name, so two files with one name mixed. They are keyed by full path, and the note tells such files apart. - More phrasings limit an edit (curly apostrophe, keep everything else the same, nothing else should change). - The note shortens long lines, survives backticks, groups by file and says how many lines it left out.
On rc16, Gemma 4 E4B was asked to change "milk" to "oat milk", add "- apples" at the end, and change nothing else. It replaced "- eggs" with "- apples", then told the user it had appended. The user lost a line and was told otherwise. When a request limits the edit ("change nothing else", "don't touch anything else", "leave the rest"), GAIA now keeps the lines each edit removed that the request never mentions, and adds a one-line note naming them, unless the answer already does.
Eval categories to watch on the next RC:
gaia_files,gaia_honesty.Test plan
tests/unit/agents/test_unasked_edits.pycover the exact rc16 edit, a line the request names, an append, the answer already naming the line, and the agent hook for limited, open-ended and failed edits.tests/unit/agents: 6,161 passed.gaia -preplay of the rc16 turn: a scripted model makes the asked edit and the unasked replacement, then claims it only appended. The answer now ends with the note: