Proving each acceptance criterion was checked took 23 review rounds
Between November 21 and 22, 2026 we built a command that shows, for each acceptance criterion of an Issue, what it was checked with. It took 8 pull requests and 23 Codex review rounds. Most findings asked one question: can we trust this evidence? The design bent twice along the way. This log records what we built, what happened, what we learned, and what we have not checked. The references at the end name the records the facts and numbers come from.
Background
Our factory (the repository ziv-labs/agentic-factory-vnext) turns Issues into pull requests. Issue #491 was opened at 08:24 UTC on November 21, 2026 and closed at 23:35 UTC the same day. Its starting point: green CI and an approving review do not prove that every acceptance criterion of the Issue was checked. The goal was to connect each criterion to its evidence, to show a result of Verified, Failed or Unknown by machine, and never to count Unknown as success.
Three things were out of scope: marking an AI's own claim as Verified, adding a new database, a resident process or a paid API, and silently changing the review gates or automatic merging. The name for this work is Verification Traceability.
We first looked at what existed. The script outcome.py already had five kinds of check, but its result was only an ok or NG line in a log. It had no JSON, did not print the head commit, and had no ID that connects a criterion to evidence or a three-valued result. We built only what was missing.
What we built
Work was split into four parts, and the third was split again into three:
- A:
outcome.pyreads a line-leadingACn:label and, with--json, writes a result per line and the head commit. - B: the outcome workflow keeps that JSON as an artifact.
- C:
make trace ISSUE= PR=prints Verified, Failed or Unknown with a reason for each criterion. It only prints and stores nothing. - D: the rules and the Issue-writing agent say how to write the labels.
Evidence is read from the Actions artifact. The code of the pull request is never run on the owner's computer.
Unknown is a result, not a failure to report. When the evidence itself cannot be trusted, every criterion is Unknown. That covers a mismatch in the artifact ID, the run, the base, the head, the Issue number or the SHA-256 of the body; an edit of the Issue body after the check; and a pull request that changes .github/workflows/. Whether CI is all green is not looked at. If the Issue has no criterion ID at all, the whole result is Unknown.
What happened
The pull requests, with their merge times in UTC on November 21 and the number of Codex rounds each took:
- #494 (A): 11:58, 4 rounds.
- #496 (B): 13:31, 4 rounds.
- #499 (C1): 14:42, 1 round.
- #500 (C2): 14:57, 3 rounds.
- #502 (C3): 16:11, 5 rounds.
- #505 (D): 16:24, 1 round.
- #508 (#503): 23:34, 4 rounds.
- #507 (#506): 23:35, 1 round.
That is 23 rounds in total. Four of the pull requests ended with an approval: #499, #500, #505 and #507. #494, #496 and #508 were still asked for changes after the 4th round. #502 was merged by the owner's decision after a 5th round that the owner allowed.
1. Records written before the pull request's code runs
In #494 and #496, Codex repeatedly pointed out that a check which runs the pull request's code (run) shares a job and a run with the steps that write the record. The pull request could replace the record or the checker. So the record job now writes its JSON before the pull request's code runs, with --skip-run, which does not run the run checks. The result of each run line is taken only from the conclusion of the outcome / outcome check.
2. Reading the rendered HTML instead of Markdown
When trace read the Issue's Markdown itself, #502 got findings on all 5 rounds. A criterion inside a code block, a <!-- inside code, or a section hidden in an HTML comment could make a visible criterion drop out, or a hidden ## 検証 section could produce "all criteria verified". In #503 and #508 we changed it to read the HTML that GitHub renders for display (the bodyHTML field), where comments are gone. If a section contains a form that cannot be read, the result is Unknown.
What we learned
- The findings were mostly about whether the evidence can be trusted, not about whether the code did what it said.
- In #502 the code grew from 450 lines at the 1st round to 617 lines at the 5th. We stopped there and looked for the smallest form. It was to stop parsing Markdown and read the HTML that GitHub already renders.
- With the real
make trace, every criterion was Verified at the heads of #502 and #508 (from the comment that closed #491). We read that as a good sign for those two pull requests, not as proof for others. - For size:
scripts/trace.pyhas 642 lines andscripts/outcome.pyhas 296 lines (main at 369008f).
Rules we keep now
- Unknown is never counted as success.
- Evidence is read from an Actions artifact; the pull request's code is not run on the owner's computer.
- The record is written before the pull request's code runs, and the result of
runchecks comes only from theoutcome / outcomecheck. - Only a pull request whose base is the default branch is trusted.
tracegives advice only. It is not used for automatic merging or for deciding a check, and it stops nothing.
What we have not checked
- The evaluation plan in #491, which looks at the share of Unknown over 10 pull requests, has not been done yet. We do not know how often Unknown appears in everyday work.
- Because
tracestops nothing, we have not looked at whether it changes how pull requests are merged. - We have not shown that more review rounds would have been needed or avoidable. The count is a record, not a measure of cost.
References
Our own records (private repositories, named here so the claims above can be traced):
- ziv-labs/agentic-factory-vnext #491 — the goal, the scope, the split into A to D, and the comment that closed it
- ziv-labs/agentic-factory-vnext PRs #494, #496 — the first turn: the record written before the pull request's code runs
- ziv-labs/agentic-factory-vnext PRs #502, #508 — the second turn: reading the rendered HTML, and the growth of the code
- ziv-labs/agentic-factory-vnext docs/operations/outcome-checks.md — the rules for Unknown and which pull requests are trusted
Related notes
- Checking pull requests an AI coding agent wrote: four layers before a person merges — Machine checks that compare against the base branch and run the issue's own done criteria, a review by a different model with weighted findings, a final advisory review, and fail-closed rules for merging without a person: why each layer was added and what 480 reviews on 303 pull requests showed.
- Where we stop reviewing an AI agent's pull request, and three times our auto-revert was wrong — Review rounds stopped by the weight of a finding, three pull requests that still hit the limit, a final review that found what two approvals missed, and three automatic reverts that were wrong.
- AI coding agents: permission and safety settings — How Claude Code, Codex CLI and Gemini CLI ask for approval, limit where the agent acts and switch safety off, compared from each tool's own help and docs.