DEV Community

Cover image for Your Coding Agent Shouldn't Be Able to Close Its Own Ticket, Part 2: What the Comments Changed

Your Coding Agent Shouldn't Be Able to Close Its Own Ticket, Part 2: What the Comments Changed

Steve on November 26, 2026

What's a claim worth if the code has moved on since it was made? That's not my question. It came from the comments on part one, and it was a bette...
Collapse
 
userxnom profile image
Abdullah Naseer •

The asymmetry you landed on is the part I keep coming back to: a stale claim warns, but a stale CI check resets. That distinction is doing a lot of work — a person's judgement might survive a small push, but a pass is only ever true of the commit it ran on, so treating the two the same would be wrong in opposite directions.

And the 1,284-tests example is the whole argument in one screenshot. The agent claimed the full suite passed, GitHub said the check failed on a41c9e2, the exact commit the claim was made at — and nobody had put those two facts next to each other until the second reader did. That's not an agent problem, it's a presentation problem, and your fix is honest about that.

One edge I'm still turning over: you deliberately don't flag test-file changes the way you flag .github changes, and you note the classic failure is a test changed to pass. If an agent quietly weakens a test instead of the workflow, does the second reader catch that, or is that the one hole you'd still want a separate rule for?

Collapse
 
steve-o profile image
Steve •

You've found the actual hole, so honestly: mostly no, not today.

The second reader sees what GitHub recorded: which checks ran on which commit, and which files each commit touched. It doesn't see the diff itself. So if a commit after the claim touched checkout.test.ts, it can say "this file changed after the claim". It can't tell whether an assertion got weaker or a new test got added. And if the test was weakened before the claim, in the same commit, there's nothing in the record to flag at all.

I left test files out of the .github warning because nearly every good PR edits tests, and a warning that's always on gets ignored. But that leaves weakened tests to whoever reads the diff.

Would you want that as a separate rule (say, flag any PR that deletes assertions), or as something the reader looks for when it's judging a claim like "tests pass"?

Collapse
 
userxnom profile image
Abdullah Naseer •

I'd go with the separate rule, but a narrow one: flag only deleted or weakened assertions, not any test edit. That keeps your always-on warning problem away, since most good PRs add tests rather than strip assertions, and it gives the second reader something concrete instead of asking them to spot a weakened test while judging a claim. Would you scope it to assertions in files the PR itself touches, or to the whole test suite?

Thread Thread
 
steve-o profile image
Steve •

Files the PR touches, I think. A PR can only weaken a test it changes, so scanning the whole suite would mostly re-check code nobody touched.

But "files the PR touches" probably has to mean more than test files. The sneaky versions I can think of aren't in the assertion at all:

a .skip or xit added to a test
a whole test file deleted
the test runner's config changed to ignore a path, or a threshold loosened

So I'd scope it to the PR's diff, and count three kinds of change as weakening: assertions removed or loosened, tests skipped or deleted, and test config changed. Assertions added never count.

Does that miss anything you've seen in practice? I'm also curious whether you'd treat a test that got rewritten (same name, different body) as weakened by default, or only when the assertion count drops.

Thread Thread
 
userxnom profile image
Abdullah Naseer •

Your three categories cover most of it — the one I'd add is the test data and mocks getting easier: same assertions, but a stub that now returns the happy path, or fixtures swapped for simpler ones. That weakens the test without touching a single assertion.

On a rewritten test, I wouldn't call it weakened by default. I'd flag it as "needs a human look" and then judge it on assertion count plus what those assertions actually check — a rewrite that keeps the same checks but reads better is fine, one that drops an edge-case assertion is not.

Thread Thread
 
userxnom profile image
Abdullah Naseer •

That three-part scope feels right, and I like that assertions added never count — that keeps it from punishing good refactors. The one gap I'd add is a real check quietly swapped for a mock or a looser timeout, which reads as a rewrite but weakens what the test actually proves.

On your second question, I'd only flag a rewritten test when the assertion count drops or the check gets looser, not by default. A same-name rewrite that keeps the same assertions is usually just cleanup. Would you want that loosening check to compare against the previous version of the test, or just the current diff?

Collapse
 
ayushdhanani369 profile image
Ayush Dhanani •

My answer to your closing question is to keep the judge out of the claimant's reach, and to make can't tell a real verdict. I build Aladdin, a job agent. The main agent holds the application, and a fresh worker reads the actual page and form for each application. It grades fit from 0 to 100 with reasons. If a form cannot be read or an answer is not clearly covered by the user's own facts, it asks the user instead of guessing. That is the same shape as your second reader agent. It never trusts the first agent's summary of its own work. Your a41c9e2 example shows why the pin matters. The checkout check failed on that exact commit, not on a later fix. Warn, not withdraw, is right for the same reason. Withdrawing a claim would hide the miss. A can't tell that goes to a person keeps the miss visible.

Collapse
 
steve-o profile image
Steve •

"Withdrawing a claim would hide the miss" is a better argument for warn-not-withdraw than the one I wrote. I was thinking about noise from harmless pushes, but you're right that the bigger cost is losing the record that the agent claimed something that wasn't true. That's exactly the thing you want to see again later.

The fresh worker reading the actual page and form is the same instinct as reading GitHub's record instead of the agent's summary. Go back to the source, not the report about it.

Two things I'm curious about from your side:

When the worker and the main agent disagree, who wins? Does the user see both views, or just the worker's?
How often does "can't tell" actually reach the user? I made it a real verdict too, but I worry that if it shows up on every other claim, people start skipping past it the same way they skip an always-on warning.

Collapse
 
reidmarlow profile image
Reid Marlow •

I'd keep the no-warning rule for ordinary test additions, but have a reviewer inspect deleted or weakened assertions against the acceptance criterion. A green check on the new commit can be genuine while the test no longer checks the behavior the ticket asked for. Running a separately maintained acceptance suite helps, though it still depends on that suite covering the criterion.

Collapse
 
steve-o profile image
Steve •

I like this split a lot: new tests are normal, deleted or weakened assertions are the signal. That's much narrower than flagging every test change, so it shouldn't turn into noise.

The part I'm unsure about is how to judge "weakened" mechanically. A deleted assertion is easy to spot. An expect(x).toBe(3) that became expect(x).toBeTruthy() is harder. Would you trust a reviewer agent to judge that against the criterion, or would you want something more deterministic, like assertion counts per test file before and after?

And on the acceptance suite: do you keep yours where the agent can't edit it, like a separate repo or a protected path?

Collapse
 
analista_83 profile image
Sammi De Blas •

The staleness point is the real failure mode. A claim attached to a commit is only valid while that commit is still the head of the branch. In our tracker we bind the evidence to the SHA and CI re-runs it at merge, so a claim that no longer reproduces fails the check instead of staying closed.