A guard has to check something the edit cannot also change
How do you know a gate went green for the right reason? Ask what it compared against, and whether the change under review could have written that too. A guard has to check something the edit cannot also change. If the approval sits in the same fixture as the bytes, if the lookup key is a name that moves, or if an earlier run can fill the fields, green only tells you that the inputs agree with each other. Here are five gates from my agent tooling whose answer rested on the wrong input.
Related: a merge gate must prove the tests ran and prove the test can fail. This note is about what the gate reads, not the tests behind it.
The approval lived in the same fixture as the bytes
One of my products runs a lineage check over the files it serves. Two pull requests dated 2026-11-21 repaired it, and they found two separate problems.
The first was staleness. The check went stale on 2026-11-06. Eight merged pull requests changed served files after the last pin, and none left a lineage record. The check also stopped at the first mismatch, so one stale pin hid every later break. The fix checks every unit and names each changed one, and a step is undone only if it carries an owner answer.
The second came from the sibling pull request, and it is where the title comes from. The starter and fixture steps took their approval from the same editable fixture as their bytes. A joint edit of a served file, its reverse patch, digest and result passed every test. Each piece agreed with the others, and one edit could reach all of them. New pinned owner-decision records and default readers now enforce the approval.
What to look for: for each input a guard reads, ask where it is stored and whether the diff being judged can touch it. A digest stored next to the bytes proves only that the two match.
A waiver filed under a name that moves
The pull request review tool in my agent-harness repo has a gate that a tickets waiver is supposed to satisfy. A fix dated 2026-11-19 covers this case: the tool called the commit-range check with the literal name HEAD, and looked up the waiver under that string. The waive command only accepts a full commit SHA, so no waiver could ever satisfy the gate.
A gate stuck closed is the safer way to be wrong, but it was still deciding on a name instead of a commit. The fix resolves the head to a full SHA once, before reading the range. Resolving once also means a ref that moves during the check cannot borrow another commit's waiver. The independent review gave BLOCK on the first round with one finding, then PASS at the fixed head. 72 tests ran OK with 4 skipped, and both new tests fail on the pre-fix code.
The shape of the fix, as an illustration:
# illustration only, not code from the repo
head_id=$(git rev-parse --verify 'HEAD^{commit}') # resolve once
check_range "$base_id..$head_id" # later steps use the id
lookup_waiver "$head_id" # never the name HEAD
git rev-parse does the resolving, and it runs once: a name resolved twice can be two different commits.
A crashed run left the approval fields filled
This one is from the 2026-09-29 status log in my content pipeline. A crashed prior run had pre-filled the editorial-approval and release-authorization fields for week 16. That made --check-release report ready: true with zero blockers, while the metadata still said it needed my playback review.
The check read the fields, and the fields were filled. What it could not tell was who filled them. The next run cleared those fields, set the state to pending, and fixed freeze counts that had drifted. It touched no deploy and no push. A later handoff on 2026-10-02 repeats the rule: do not stamp false approvals, do not deploy while ready:false, and do not reuse another week's film.
What to look for: an approval field is a claim that a review happened. If any run can write it, a ready flag built on it only reports that the field is non-empty.
Exit 0 with tests missing from the count
In the same product repo as the lineage check, bin/test-core and bin/test-changed could exit 0 while tests were silently missing from the count. The cause was --test-force-exit. With that flag, node:test calls process.exit() as soon as it knows the tests are done. Results still on the child stdout pipe are dropped, and tests registered after a top-level await never run.
A 43-test file ran 43 of 43 in 40 of 40 runs, but the TAP reported 27 to 43, short in 21 runs. A 200-test file reported 149 to 187 in 30 of 30 runs with the flag, and 200 in 10 of 10 without it.
The fix, dated 2026-11-21, puts one choke point (nodeTestArgs plus runTestFile) in front of every node:test file. It never passes the flag, runs each file in its own process group, and adds 5 guard tests that drive real node --test fixtures.
What to look for: an exit code covers the results that arrived. Compare the reported count with the number of tests you expect to exist.
An improvement claim is a gate too
A reviewer leans on the pull request description, so a claim in it works like a gate. In my agent-fabric repo, a fix dated 2026-11-09 gave each control start its own run id so Linux negative controls pass under a worker account. An earlier description said it took fab host controls from 0/9 to 9/9.
The independent red-team showed that a build without the fix also passes 9/9 when the worker can execute the fab binary. So 9/9 by itself was not evidence for the change. The pull request body keeps a "Corrected claim" paragraph, saying the change "does not make a failing host pass", and files the red-team follow-ups as tickets.
The five side by side
This table is my summary of the cases above, not output from any tool:
# illustration only, not a real log
gate what it trusted why that was not proof
lineage check approval in an editable fixture the edit could rewrite the fixture too
waiver lookup the literal name HEAD a name is not a commit, and it moves
release check approval fields were filled a crashed run had filled them
test scripts exit code 0 results were dropped before the count
improvement claim 9/9 with the fix a build without it can pass 9/9 too
Checklist
- For each input a guard reads, name where it is stored and confirm the edit under review cannot write there.
- Keep approvals in pinned records, apart from the fixtures that hold the bytes.
- Check every unit and report every failure, not just the first.
- Turn a mutable ref into a full commit id once, and use that id for every later lookup.
- Treat a filled approval field as a claim. Confirm it is real before trusting a ready flag.
- Count the tests as well as the exit code.
- Before claiming an improvement, run the build without the fix under the same conditions.
- When a claim turns out too strong, correct it in the pull request and keep the evidence.