跳到正文
DEV Community· Steve·· 2 小時前AI 評分59

編碼智能體不應自行關閉工單(第二篇:留言帶來的改變)

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

AI 導讀

Arbituro 更新編碼智能體工單核驗流程,將完成聲明綁定至 GitHub 記錄的 commit,並加入唯讀第二智能體複核。新 commit 推送後,已通過的 CI 檢查會回到未決;若 pull request 修改 .github/ 或 CODEOWNERS,檢查通過時會顯示警告。

正文

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 better question than anything I'd asked in the post itself. 🙌

Quick recap if you missed it. Part one argued that a coding agent should be able to claim a ticket is done, with evidence, but never decide it. A CI check or a named person decides. The agent keeps all its speed; it just doesn't mark its own work.

The comments agreed with the split, and then politely took it apart at the edges. This post is about those edges, and what got built because of them.

🙏 First, the People Who Did the Thinking

Two commenters shaped this post, so they go first.

Glenn left three comments, and each one turned into a change. The first: tie every completion claim to the exact commit it was made against, or the approval ends up attached to stale evidence. The last: the same permission boundary should cover the checks, because an agent that can edit the CI config can weaken the very thing that judges it.

Gautam K put the principle more sharply than I did: the ticket can only close when something the agent can't edit confirms it. The agent can propose Done. Only that check, or a person, can move it.

Thank you both. Most of what's below exists because you wrote it down. 🙇

📌 Problem One: The Claim Goes Stale

Here's the scenario Glenn described. The agent claims a criterion is met:

Implemented and verified. ✅

(OK, a better agent writes what it actually checked. Stay with me.)

Then it keeps going. It pushes a refactor. Then a "small fix". By the time a person reads the claim, it's about code that no longer exists. The evidence was real. It's just evidence about a different commit. 😬

So now every claim is pinned to a commit. When a coding agent claims a criterion, Arbituro records the commit the job's branch or pull request stood at right then.

The important part: the agent doesn't send that commit. Arbituro reads it from the job's link, which only GitHub's own events move. An agent can't leave it out, and it can't name a convenient one. A commit the agent reports would just be more testimony. A commit GitHub reports is a fact. 🔒

When more code lands after the claim, the person deciding sees it right next to the claim, in plain words: "2 commits pushed since". After a force push it says "The branch was rewritten since the claim" instead.

And opening the claim shows what GitHub recorded after it, oldest first: each check that reported and the commit it ran on, each commit pushed with its subject and the first files it touched, and the merge. You don't have to go and dig through GitHub to find out what "2 commits" means.

🤔 Warn or Withdraw?

This was the real design question, and I went back and forth on it.

Withdrawing the claim automatically sounds safer. But agents push constantly, and plenty of pushes don't touch what was claimed. A fix to a typo in the README shouldn't throw away a claim about checkout. Auto-withdrawing would mean the person deciding never sees most claims at all.

So a moved head warns and never withdraws. The claim stays there to decide. The person can still press Met, or press "Ask it to check again", which leaves a note on the job for the agent, under their own name. The agent reads it the next time it opens the job:

Check "A four-pack can be bought on a phone" again before it is decided. 2 commits were pushed after your claim at `a41c9e2`.

Short, specific, and it names the commit. No "please re-verify everything". 🎯

One more honesty detail I care about: the wording always says "since the claim", never "since the agent checked". Arbituro knows where the branch stood when the claim arrived. It doesn't know exactly what the agent looked at. The screen shouldn't pretend it does. 🧐

🔁 Problem Two: The Check Goes Stale Too

The same logic applies to CI, and this one is stricter.

A check's pass is only true of the commit it ran on. So when a new commit lands on the pull request, any criterion a named check had already passed goes back to undecided until that check reports again on the new commit.

No warning this time, a reset. Why the difference? A person's judgement might survive a small push; they can look and decide. A check's pass is a statement about one exact commit, and nothing else. What happened (the job's history) records which criterion was reopened, by which check, and both commits.

Claims can also carry screenshots now, for anything a screen proves. "Works on mobile" with an actual phone-sized screenshot beats "works on mobile" with a ✅. 📱

🛡️ Problem Three: Who Checks the Checks?

Glenn's last comment is the one I keep thinking about.

Taking "close the ticket" away from the agent doesn't help much if the same pull request can quietly change what "passing" means. Edit the workflow so the test job skips the slow suite. Loosen CODEOWNERS. The check goes green, the criterion ticks, and everything looks verified. ✅ 🙃

Two things are true in Arbituro now.

Agents running inside Arbituro can't write under .github at all. That covers workflows, the actions they call, and CODEOWNERS. It's enforced in code, on the files about to be pushed, not in a prompt. And a person still approves the change after that.

A coding agent in your own repo is different. Claude Code, Cursor and friends work in your checkout with your permissions. Arbituro can't stop them editing a workflow, and it shouldn't pretend to. That's what branch protection, required reviews and CODEOWNERS are for.

What Arbituro can do is make sure a weakened check never passes quietly. So before a named check ticks a criterion, Arbituro reads the pull request's changed files from GitHub. If any of them are under .github/, or a CODEOWNERS file, the criterion still ticks, but its line says so, in warning colour. Roughly:

✓ Every existing billing test still passes  (decided by the `test` check)
  ⚠ Passed on a pull request that also changed .github/workflows/ci.yml

The path links straight to the pull request's changed files on GitHub. The person signing the job off sees it at exactly the moment it matters.

A couple of choices I made deliberately:

  • No read, no pass. If GitHub doesn't answer the files request, the check decides nothing, and the delivery is retried. A pass is never written without looking first.
  • Test files don't trigger it. I considered it, and Glenn's comment mentioned the test suite too. But a pull request that does its job adds and edits tests, so the warning would sit beside almost every pass, and a warning that's always there is one nobody reads. For tests, the decider still reads the diff. (Tell me if you think I got this one wrong. 👇)

🕵️ Problem Four: The Person Still Reads It Alone

All of that made the evidence better. But look at what the person deciding still had in front of them: the agent's own account of its own work, plus a pile of GitHub facts to cross-check by hand.

I got bitten by exactly this on my own backlog. A coding agent claimed the suite passed. Two minutes later, the Frontend check failed on the very commit it had claimed. The only place that said so was a log I wasn't looking at. 🤦

The facts were all there. Nobody had put them next to the claim.

So now every claim gets read by a second agent before its person decides. Think of it as a verification agent:

  • It's never the claimant. The claim comes from your coding agent, outside. The reader is an agent in your Arbituro workspace, running a read-only reading. It has no tools that change anything.
  • It holds the claim against two things: the criterion it claims, and what Arbituro recorded from GitHub's signed events. That's the checks that reported and the commit each ran on, the commits pushed with the files each touched, and the merge. The claimant couldn't write any of that.
  • It says one of three things: holds up, doesn't hold up (and why), or can't tell.
  • A claim that only asserts is "can't tell". "Implemented and verified. ✅" on its own will never read as "holds up". 😏
  • It decides nothing. Met and Not met stay with the person. A reading that fails, or says nothing useful, counts as "can't tell", never as a pass.

Here's how that looks on a job's Done when. (A sample job, but the real screen.) The coding agent claimed three criteria at the same commit, and the reader went through all three:

Done when with three claimed criteria. A line at the top says Sam Taylor's coding agent claims 3 clauses at a41c9e2, and Ledger read them: 2 hold up, 1 doesn't. Two claims are marked Holds up, with one line from the reader each. The third is marked Doesn't hold up, with the reader's reason in full. Below them, The checkout tests pass is ticked by the checkout check, with a warning: Passed on a pull request that also changed .github/workflows/ci.yml.

The verdict leads each claim, so you can see which one needs you before reading anything. When a claim holds up, the reader's reason is one quiet line. When it doesn't, you get the whole reason.

And the bottom row is Problem Three doing its job: the check passed, on a pull request that also touched the CI workflow.

Open the claim that doesn't hold up, and everything is in one place: the agent's word, what GitHub recorded after it, and the reading.

The opened claim. Sam Taylor's coding agent claimed "Implemented and verified. Full suite: 1,284 tests pass." with the branch at a41c9e2. Under On GitHub since the claim: checkout failed on a41c9e2, the commit the claim was made at; then 80f97d9 was pushed, touching src/checkout/Postcode.ts, its test and .github/workflows/ci.yml; then checkout passed on 80f97d9. The reading says Doesn't hold up: the checkout check failed on the commit the claim was made at, and nothing in the claim shows a postcode being refused. An Ask it to check again button sits below.

The agent said the suite passed. GitHub says the check failed on that exact commit. The reader put the two side by side, so I didn't have to. And it caught the second problem too: "tests pass" isn't evidence that a postcode gets refused. 🎯

A few details I care about:

  • The reader can't see screenshots. It's told which ones arrived, and that a caption is the claimant's word for what the picture shows.
  • Claims made together get one reading. It starts two minutes after the newest claim, so a burst of three claims at one commit costs one run, not three.
  • It's a project setting, the same one that turns on reading an agent's delivered work. It runs on the job's credits, so a project can switch it off.

Is an agent checking an agent just turtles all the way down? 🐢 A bit. But this reader can't edit the claim, can't edit GitHub's record, and can't tick anything. Its only power is to put the contradiction in front of the person who decides. That's a power I'm happy to hand out.

🧭 What I Took From This

Part one said: whoever wrote the change doesn't approve it.

This round added three things, and they're all versions of the same idea:

  1. Evidence has a timestamp, and it's a commit. A claim or a pass is only true of the code it saw. Pin it, and show when the code moves.
  2. The judge has to be out of the defendant's reach. If the agent can edit the check, the check isn't independent. Where you can't stop the edit, at least make it impossible to miss.
  3. Put the contradiction next to the claim. The facts are usually already recorded somewhere. A second reader that can't change anything is cheap, and it saves the person from cross-checking by hand.

The first two weren't on my list before the comments. That's the best argument I know for writing in public. 😄

🛠️ If You're Not Using Arbituro

You can get most of this in any setup:

  1. Ask the agent to quote the commit in every claim (git rev-parse HEAD), and check it against the pull request's head before you accept it.
  2. Make CI required on the latest commit, so a pass on an older commit can't merge.
  3. Put .github/ and CODEOWNERS behind code-owner review, with a human owner, so a workflow change always needs a person.
  4. Read the diff for test changes whenever the agent claims "tests pass". The classic failure is still the test that got changed to pass.
  5. Have a second, read-only agent review each claim against the criterion and the CI results for that commit, before you do. Tell it that a claim which only asserts is "can't tell", never "done".

Arbituro is free for up to three people at arbituro.com.

💬 What About You?

How do you keep the checks independent of the agent being checked? Code owners on CI, checks that run from outside the repo, or mostly trust and a careful eye on the diff?

And if you think warn-not-withdraw is the wrong call for a stale claim, I want to hear that one too. Part three might be yours. 👇

來源:DEV Community · dev.to