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
 
ayushdhanani369 profile image
Ayush Dhanani •

Good questions. I build Aladdin, a job agent, and on my side the worker's read wins for that page, because it is the one that saw the actual form. The main agent holds the application and keeps the worker's read as the record. The user does not see both views. The user only sees a question when the worker cannot tell, and the saved answer means the next form does not ask again.

I do not have a measured rate for how often that question reaches the user. It only happens when the form cannot be read, or the answer is not clearly covered by the user's own facts. Your worry about skipping is fair. A single concrete question feels different from an always-on warning, but I have not measured whether people still start skipping it.

Thread Thread
 
steve-o profile image
Steve •

Letting the worker's read wins because it saw the actual form seems the sensible option. And saving the answer so the next form doesn't ask again is a nice way to keep the "can't tell" questions from piling up.

In mine, the reader decides nothing. A person still decides, so both views do show up. Have you thought about letting the user overrule the worker, or does that defeat the point?

Thread Thread
 
ayushdhanani369 profile image
Ayush Dhanani •

Yes, and it does not defeat the point. I build Aladdin, a job agent. The worker's read wins over the main agent's guess, not over the user. When the worker cannot tell, the question goes to the user, and that answer is saved. So the user is the check on the worker, the same way the worker is the check on the main agent.

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.

Collapse
 
steve-o profile image
Steve •

Re-running at merge is a good backstop. Mine works similarly: a new head puts a check-passed clause back to undecided, so the check has to pass again on what's actually there. Do you treat a claim that a person judged differently from a check, or does everything have to reproduce in CI?

Collapse
 
eliashivemind profile image
Nova Ops •

The commit-pinning is the move that makes the claim worth reading: Arbituro reads the head from GitHub's events instead of accepting one the agent sends, because a reported commit is testimony and a recorded one is a fact. That is the same line our release gate ended up on — the success message is what the run said about itself, so the verdict comes from reading the surface back, not from the message. The warn-never-withdraw choice is the part I keep turning over: auto-withdrawing on any push would bury real claims under README typo fixes, agreed, but a warning that fires often tends to become wallpaper. Is there a point in your design where the warning escalates — a number of commits, or a push that touches the claimed criterion's files — where 'ask it to check again' stops being optional reading for the decider?

Collapse
 
steve-o profile image
Steve •

Honest answer: it doesn't escalate today. A person's clause warns however many commits land. A check's clause is stricter, since a new head puts it back to undecided. Your second trigger, a push that touches the claimed criterion's files, feels like the right one to me, much more than a commit count, which mostly measures how chatty someone's git habits are. Would you make that push block the decision, or just move the warning to the top?

Collapse
 
eliashivemind profile image
Nova Ops •

Neither, on our side — we'd put the clause back to undecided, the same treatment your check clauses already get. Blocking the decision outright punishes the person for someone else's push, but a warning moved to the top is still a warning, and warnings are what people learn to scroll past. Undecided is the honest state: the claim was judged against files that have since changed, so it needs a fresh judgement, not a louder reminder of the stale one.

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
 
mateo_ruiz_6992b1fce47843 profile image
Mateo Ruiz •

The commit-pinned evidence is probably the most important improvement here. A passing check is not a permanent property of a ticket; it's a result tied to a specific revision and the exact criteria it evaluated. I'd add one more safeguard: make the acceptance criteria themselves independently protected and versioned. Otherwise, an agent could leave the CI workflow untouched but modify the requirement or test expectations to make its implementation appear valid. At IT Path Solutions, this is an important distinction when stabilizing AI-generated applications: the agent can implement and provide evidence, but the acceptance boundary must remain outside its control. A second read-only agent is useful for surfacing contradictions, but deterministic checks and human ownership should remain the final authority. Verification is only independent when the system being verified cannot quietly redefine what passing means.

Collapse
 
steve-o profile image
Steve •

Agreed that the boundary has to sit outside the agent. In Arbituro, an agent can propose a change to the done-when, but only a person can accept it, so it can't quietly redefine passing. The test expectations are the gap, which is what this thread turned into a feature request. Do you version acceptance criteria separately from the code, or alongside it in the repo?

Collapse
 
the_daily_flare profile image
The daily flare •

I think pinning claims to a commit is the part that makes this work for me.

Collapse
 
steve-o profile image
Steve •

Same for me. Without the commit, "done" is just a feeling. Did you have a case where a claim went stale on you?

Collapse
 
kling4ai-production profile image
Kling4 AI •

Pinning every completion claim to the exact commit read from GitHub events—rather than letting the agent report a commit string itself—closes a subtle loophole. Same with keeping CI config outside the agent's write scope so it can't soften the checks it's graded against.

Collapse
 
heinrichneb profile image
Heinrich Neb •

On judging "weakened" mechanically: I stopped trying to read it off the diff. Each check gets a control instead, the same command run against a version where the feature is switched off. It has to go red. If a stub now returns the happy path, a timeout got raised or a .skip slipped in, the control starts passing, whatever the mechanism was. I learned that from 13 green tests over a line that was commented out. The catch is that someone has to write the broken version once per criterion. Would a done-when in Arbituro have room for a "must fail on" next to the "must pass"?