三人、七台电脑。1 到 3 号机跑编码代理,4、5 号机审查,6 号机做 Windows 验证,7 号机负责合入。这周同时有两张票,改的是同一份支付回调。1 号机的票是给 webhook 加上 HMAC 验签:生产环境配了 WEBHOOK_SECRET 之后,没有有效 X-Signature 的请求必须被拒绝。这条已经合进 main,合入提交是 bae3940。3 号机的票是部分退款要回库。它没有等 1 号机合完,分支是从同一份种子 73b080e 拉出来的,头是 aa572a7。
7 号机让 3 号机先把 main 收进来再进审查。3 号机上的代理执行了 git merge origin/main。Git 停住了:billing.py 和 test_billing.py 都有冲突。代理最省事的做法,是把冲突收成「自己那一侧」。收完之后,单元测试 5 通过,部分退款也确实能回库。文件里还定义着 verify_signature。看起来两边都在。打开生产探针时,WEBHOOK_SECRET 已经配上,一次没有签名的扣库存请求却被接受了,库存从 8 变成 7。刚合进 main 的那道检查,不在这份代码里了。
这篇要核对的是:两台机器并行改同一份 webhook 时,git 会把冲突标在哪里;代理常用的 checkout --ours、checkout --theirs、git merge -X ours,以及「只留冲突块里自己那一侧」,会丢掉哪一部分;测试为什么仍然全绿;以及 7 号机用什么闸门才能看见「助手函数还在、真正拦请求的那几行没了」。它和 下层折扣 PR 被 squash 进 main 之后,上层结账分支对 main 做普通 rebase,停在已经合过的那条提交上 谈的是历史重放,和 审查意见回来时,同一份工作区里已经写下了下一单未完成的重试 谈的是另一张票写进同一份检出,都不是同一件事。今天只谈:冲突解决的时候,刚刚合进 main 的那一侧,会不会从工作区里消失。
我按常见的 git 命令准备了这些冲突解决,并没有再开一个编码模型来点选。玩具仓库的种子是 73b080e:一份用整数分记账、处理付款和全额退款的 webhook。实验在本地 git 2.47.3 上跑。我没有在 GitHub 网页上点过 Resolve conflicts,也没有调用合入 API,也没有跑 GitHub Actions。Windows 没有参与这次实验。陈浩、machine-1-agent 和 machine-3-agent 是夹具身份,不是真人。
冲突块只在文档字符串附近,两边的功能已经在文件里了
种子上有 4 条测试,都通过。没有配置密钥时,未签名请求会被接受,这是种子的行为;refund.partial 还不存在,探针会报 unknown event。
1 号机在 process_webhook 开头加上了验签:配置了 WEBHOOK_SECRET 时,读取 X-Signature,用 HMAC-SHA256 核对请求体,失败就抛 PermissionError。它还加了 verify_signature 助手,以及两条测试。合进 main 之后,头是 bae3940,测试 6 通过。探针里,未签名请求被拒绝,库存仍是 8;部分退款此时还不存在。
3 号机在同一函数末尾加上 refund.partial,并把文档字符串改成「包括部分退款」。测试文件末尾加了 test_partial_refund_restocks。分支头是 aa572a7,测试 5 通过。未签名请求仍被接受;部分退款会把 WID-1 从买入 2 件后的 6,回库到 7。
两边的合并基是种子 73b080e。3 号机对 origin/main 做 git merge 时,两份文件都出现一段冲突。billing.py 里,冲突块是这样的:
<<<<<<< HEAD
"""Apply a payment event, including partial refunds, ..."""
=======
"""Apply a signed payment event, ..."""
if WEBHOOK_SECRET:
provided = (headers or {}).get("X-Signature", "")
...
if not provided or not verify_signature(...):
raise PermissionError("invalid signature")
>>>>>>> origin/main
HEAD 一侧只有那行改过的文档字符串。来自 main 的一侧是另一行文档字符串,外加整段验签检查。再往上看,import hmac 和 verify_signature 已经在文件里了。再往下看,if event == "refund.partial" 也已经在文件里了。Git 已经把两边不重叠的改动接上。真正打架的,只是函数开头那一小段。
测试文件同样只有一段冲突:己方是部分退款测试,对家是验签的两条测试。谁只留一侧,谁就会连那一侧的测试一起带走。
把整个文件收成 --ours,已经自动合并的代码也会被扔掉
代理如果看到「both modified」,对两份冲突文件执行 git checkout --ours -- billing.py test_billing.py,再提交,得到的是 c46e468。在 merge 里,ours 是当前分支,也就是 3 号机的部分退款。这两份文件和 aa572a7 完全一样。verify_signature、hmac 导入、PermissionError 全部不在了。测试 5 通过。探针里,未签名请求被接受,部分退款仍能回库。行级检查报告:相对 main,丢掉了 35 行。
反方向 checkout --theirs 得到 3660b27,两份文件和 main 一样。验签还在,部分退款代码没了。测试 6 通过。探针里,未签名被拒绝,部分退款报 unknown event。相对功能分支,丢掉了 7 行。
这里的关键不是「ours 不好,theirs 才对」。关键是:整文件替换会把 git 已经自动接上的、不在冲突块里的改动一起丢掉。冲突块只在文档字符串附近,助手函数和 refund.partial 本来都已经在工作区里了。
rebase 时,ours 和 theirs 对调
同样两份文件,如果 3 号机跑的是 git rebase origin/main,冲突时的 ours 是新的基底,也就是 main;theirs 是正在重放的那条部分退款提交。
git checkout --ours 得到的头是 bae3940,也就是 main 自己。部分退款那条提交在变基之后不再存在。验签还在,部分退款没了,测试 6 通过。代理如果记着「ours 是我的代码」,在 rebase 里用这条命令,丢掉的是自己那张票。
git checkout --theirs 得到 a05f36f,效果和 merge 时的 --ours 一样:部分退款还在,验签整份消失,测试 5 通过。同一对旗标,在 merge 和 rebase 里指向相反的两侧。这是 git 的约定,不是这次实验的特例。
只留冲突块里自己那一侧:助手还在,拦请求的那几行没了
更接近「我在解决冲突」的动作,是只处理冲突标记中间的内容,或者直接跑 git merge -X ours origin/main。-X ours 并不是整文件的 checkout --ours:不冲突的改动两边都会留下,只有冲突块偏向己方。
这两条路的结果相同。只留己方块的提交是 34614dd,-X ours 的提交是 6d2a892。文件里还有 verify_signature,还有 refund.partial,文档字符串是 3 号机那句「包括部分退款」。PermissionError 那一段不在了。来自 main 的验签测试也不在了,因为它们就写在测试文件的那一段冲突里。测试 5 通过。探针里,部分退款回库成功;未签名的扣库存被接受,库存从 8 变成 7。行级检查报告:相对 main,丢掉 23 行,正是那一段检查和那组测试。
这比整文件 checkout --ours 更难看见。打开 billing.py,助手函数还在,部分退款还在,冲突标记也没了。缺的是真正把请求挡下来的那几行。测试也帮不上忙:会失败的那两条验签测试,已经和冲突块里「对家」的那一侧一起被丢掉了。
反过来,只留对家那一侧,或使用 git merge -X theirs,提交分别是 66b0c76 和 e53c635。验签检查和部分退款都在,两个探针都通过。测试 6 通过,少的是部分退款那一条测试,以及 3 号机那行文档字符串。功能是齐的,测试少一条。行级检查会拒绝,因为它看见了那 5 行缺失。不要把 -X theirs 当成以后都可以用的默认策略:下一次冲突块里如果放的是部分退款自己,同样的命令会把它丢掉。这次能保住两边,是因为真正的功能改动大部分已经被自动合并,冲突块里来自 main 的,恰好是那道检查。

看起来合并了,测试会红;再把红的测试删掉,就又绿了
我另外做了一份「看起来像合并」的提交 b5c568d:手工留下助手函数和部分退款,也留下两边的测试,只是去掉 process_webhook 里对 verify_signature 的调用。测试是 1 失败、6 通过,失败的是 test_process_rejects_bad_signature。探针里,未签名请求被接受。这是测试还在起作用的情况。
若代理在 rebase 时已经把 billing.py 收成功能分支的整份版本,工作区里没有 verify_signature,却先把两边测试都留了下来,pytest 给出的是 1 error:导入 verify_signature 失败。把验签测试删掉之后,提交是 b27d37a,测试 5 通过,未签名请求再次被接受。红测试被当成「变基留下的过时用例」,而不是「解决冲突时把检查丢掉了」。
rerere 会把这次错误再放一遍
第一次用 checkout --ours 整文件解决并提交之后,我把分支重设回原来的 aa572a7,再对 origin/main 合并一次。没有打开 rerere.autoupdate 时,git 仍然报告冲突,退出码是 1,但工作区里已经没有冲突标记。标准错误里有一句 Resolved 'billing.py' using previous resolution. billing.py 和功能分支上的版本相同,验签整份不在。再 git add 并提交,得到 ef7bbf9,测试 5 通过,未签名请求被接受。
打开 rerere.autoupdate 之后,同样的重放会把文件直接暂存。标准错误里是 Staged 'billing.py' using previous resolution. 状态变成「All conflicts fixed but you are still merging」。只需再执行一次 git commit。得到 c3b25bb,结果同样是功能分支的整份文件。rerere 不会判断上次的解决是对是错。它只是把记录下来的结果再放一遍。代理看到「已用上次的解决」,很容易直接提交。

7 号机要跑两边功能的探针
只看测试,34614dd、6d2a892、c46e468 都会放行。测试通过,是因为验签测试已经不在仓库里,不是因为检查还在生效。
按「相对合并基,两边新增的行都还在结果里」来做闸门,能抓住整文件 checkout,也能抓住丢掉的检查。但它会误伤手工保留两边的 d46caeb:那次提交把两行文档字符串合成了一句「signed payment event, including partial refunds」,原来的两行都不在了,闸门报告各缺 1 行,测试却是 7 通过,两个探针都通过。重叠的那一行需要人看。所以行级完整只能当警告,不能当唯一的合入条件。
真正该必过的,是两边功能的探针。check_features.py 会设置 WEBHOOK_SECRET,发出一次没有签名的扣库存请求,它必须被拒绝,且库存仍是 8;再跑一次部分退款,WID-1 必须从 6 回库到 7。文件里还定义着 verify_signature 并不算过:34614dd 和 b5c568d 都有这个函数,闸门都拒绝。d46caeb 放行。e53c635 也放行,尽管它少了一条部分退款测试——探针看的是行为,不是测试文件是否齐。少测试是审查要提的问题,不是这篇闸门要单独解决的问题。

什么时候不该这样装
不要在 rebase 里把 --ours 当成「我写的那一侧」。旗标在 merge 和 rebase 里是对调的。记不住的时候,用提交哈希把文件取出来,不要靠 ours/theirs 这两个词。
不要把 git merge -X ours 或 -X theirs 设成默认策略。-X 只影响冲突块,这比整文件 checkout 温和,也正因为如此,它更容易留下一个还在的助手函数和一道已经消失的检查。下一次冲突块里放的若是另一张票的核心逻辑,同样的默认就会把它删掉。
不要只在文件里搜索 def verify_signature,或者只看冲突标记是否已消失。34614dd 两项都满足,未签名请求仍然会被接受。
不要把 rerere 的「用了上次的解决」当成这次是对的。上次如果是整文件 --ours,这次就会再丢一遍。rerere.autoupdate 只会让提交更顺手,不会让错误变少。
不要在变基之后把失败的、从 main 带来的测试删掉。先假设是解决冲突时丢掉了检查。
一人一次只改一份文件、不会并行改同一处的团队,不必上这套闸门。没有验签、没有第二张会碰到同一文件的票,探针也没有对象。闸门回答的是「刚刚合进 main 的那一侧是否还在生效」,不是「部分退款的金额算对没有」。GitHub 网页上的冲突编辑器、merge queue 和 Actions,这次都没有跑,不能把本地 git 的结果直接写成这些产品的行为。
明天可以抄走的步骤
在 1 到 3 号机的 AGENTS.md 里写清楚:遇到冲突时,禁止对整份文件使用 git checkout --ours 或 git checkout --theirs。先看冲突块有多长,再看块外是不是已经留下了另一侧的函数或分支。解决时要留下两边各自新增的逻辑,重叠的那几行自己合。
冲突标记清掉之后,先跑已经落在默认分支上的测试,再跑本分支的测试。默认分支带来的测试如果失败,去改解决结果,不要删测试。
7 号机合入前运行功能探针,而不是只看测试是否通过:
python3 tools/check_features.py --repo .
行级脚本 check_resolution.py 可以一起跑,但只当作警告:它会把合写后的文档字符串也标成缺行。
脚本、AGENTS.md 片段和一份工作流样例在 conflict-resolution-kit.tar.gz。工作流 YAML 只做过结构检查,没有在 GitHub Actions 上跑过。
今天最小的一步:对一张刚从 main 收过冲突的代理 PR,不要先看测试是不是绿。看生产路径上,刚刚合进 main 的那道检查是不是还在拦请求。
实际跑了什么
运行环境:本机 git 2.47.3、Python 3.13.5、pytest 9.1.1。提交时间戳固定在 2026-11-20T11:59:59Z 起按秒递增,因此短哈希在这次重建里是稳定的。种子 73b080e:测试 4 通过,未签名请求被接受,部分退款报错。1 号机分支 fea489c 合进 main 后是 bae3940:测试 6 通过,未签名被拒绝。3 号机分支 aa572a7:测试 5 通过,部分退款回库到 7。合并基是 73b080e。
git merge origin/main 在 billing.py 和 test_billing.py 上各停在一段冲突。整文件 checkout --ours 是 c46e468,测试 5 通过,未签名被接受,与功能分支相同,丢掉 main 的 35 行。整文件 checkout --theirs 是 3660b27,测试 6 通过,部分退款报错。rebase 时 --ours 的头是 bae3940,部分退款提交消失;--theirs 是 a05f36f,验签消失。只留己方块 34614dd 与 -X ours 的 6d2a892 行为相同:助手还在,检查没了,测试 5 通过,未签名被接受,丢掉 23 行。只留对家块 66b0c76 与 -X theirs 的 e53c635 两个探针都通过,测试 6 通过,少部分退款测试。手工保留两边是 d46caeb,测试 7 通过,两个探针通过,行级闸门因文档字符串各缺 1 行而拒绝。b5c568d 留下助手、去掉调用,测试 1 失败 6 通过。删掉失败测试后是 b27d37a,测试 5 通过。rerere 不带 autoupdate 重放后提交 ef7bbf9,第二次 merge 退出码 1,工作区已无标记,标准错误为 Resolved ... using previous resolution.;打开 autoupdate 后是 c3b25bb,状态为 All conflicts fixed,标准错误为 Staged ... using previous resolution.
未跑:GitHub 网页上的 Resolve conflicts、合入 API、GitHub Actions(YAML 只做过结构检查)、branch protection 或 ruleset、Windows 或 windows-latest、由 Cursor 或 Claude Code 当场生成的冲突解决(命令是按常见用法写进脚本的)、第二个 GitHub 账号。陈浩、chenhao@team.invalid、machine-1-agent@iotxing.invalid 和 machine-3-agent@iotxing.invalid 是夹具身份。
Three people, seven computers. Machines 1 to 3 run coding agents, 4 and 5 review, 6 validates on Windows, and 7 merges. This week two tickets touched the same payment webhook. Machine 1's ticket was to add HMAC verification: once production sets WEBHOOK_SECRET, a request without a valid X-Signature must be rejected. That work had already landed on main, at merge commit bae3940. Machine 3's ticket was that a partial refund must restock inventory. It did not wait for machine 1 to land. The branch was taken from the same seed 73b080e, and its head is aa572a7.
Machine 7 asked machine 3 to take main before review. The agent on machine 3 ran git merge origin/main. Git stopped: both billing.py and test_billing.py had conflicts. The cheapest move is to keep "our side." After that, the unit tests were 5 passed, and a partial refund did restock. The file still defined verify_signature. It looked as if both sides were present. A production probe set WEBHOOK_SECRET and sent an unsigned charge. The request was accepted, and inventory went from 8 to 7. The check that had just landed on main was not in this tree.
This post checks where git places the conflict when two machines edit the same webhook; which part is dropped by the usual agent moves — checkout --ours, checkout --theirs, git merge -X ours, and keeping only our side of the hunk; why the tests can still be green; and what machine 7 can require in order to see that the helper is still there while the lines that actually reject a request are gone. It is not the same question as a stacked branch stopping on a commit that already landed, after the base was squash-merged, or review coming back to a checkout that already contains the next unfinished retry. Today is only this: when a conflict is resolved, does the side that just landed on main disappear from the work tree.
I prepared the resolutions with ordinary git commands. I did not start a coding model to pick sides. The toy repository seed is 73b080e: a webhook that records amounts in integer cents and handles charges and full refunds. The run used local git 2.47.3. I did not click Resolve conflicts on GitHub, I did not call a merge API, and I did not run GitHub Actions. Windows was not part of this run. Chen Hao, machine-1-agent, and machine-3-agent are lab fixtures, not real people.
The conflict hunk sits next to the docstring; both features are already in the file
On the seed, 4 tests passed. With no secret configured, an unsigned request is accepted, which is the seed's behaviour; refund.partial does not exist yet, so that probe raises unknown event.
Machine 1 added a signature check at the start of process_webhook: when WEBHOOK_SECRET is set, it reads X-Signature, checks the body with HMAC-SHA256, and raises PermissionError on failure. It also added a verify_signature helper and two tests. After the merge to main, the head is bae3940, and the tests were 6 passed. The unsigned probe is rejected and inventory stays at 8; a partial refund does not exist yet.
Machine 3 added refund.partial at the end of the same function, and changed the docstring to mention partial refunds. It appended test_partial_refund_restocks to the test file. The branch head is aa572a7, and the tests were 5 passed. An unsigned request is still accepted; a partial refund restocks WID-1 from 6, after a charge of 2, to 7.
The merge base is the seed 73b080e. When machine 3 merged origin/main, each file had one conflict. In billing.py the hunk looked like this:
<<<<<<< HEAD
"""Apply a payment event, including partial refunds, ..."""
=======
"""Apply a signed payment event, ..."""
if WEBHOOK_SECRET:
provided = (headers or {}).get("X-Signature", "")
...
if not provided or not verify_signature(...):
raise PermissionError("invalid signature")
>>>>>>> origin/main
The HEAD side is only the rewritten docstring. The side from main is the other docstring plus the whole signature check. Above the hunk, import hmac and verify_signature were already in the file. Below it, if event == "refund.partial" was already in the file. Git had already joined the non-overlapping edits. The fight was only that short stretch at the top of the function.
The test file also had a single hunk: our side is the partial-refund test, their side is the two signature tests. Keep only one side, and you take that side's tests with it.
Checking out the whole file as --ours also throws away what git had already merged
If the agent sees "both modified" and runs git checkout --ours -- billing.py test_billing.py on both conflicted files, then commits, the result is c46e468. In a merge, ours is the current branch, which is machine 3's partial refund. Both files are identical to aa572a7. verify_signature, the hmac imports, and PermissionError are all gone. The tests were 5 passed. The unsigned probe is accepted; the partial refund still restocks. The line-level check reports 35 lines dropped relative to main.
The opposite, checkout --theirs, is 3660b27. Both files match main. The signature check is present; the partial-refund code is gone. The tests were 6 passed. The unsigned probe is rejected; the partial refund raises unknown event. 7 lines were dropped relative to the feature branch.
The point is not that theirs is safer than ours. The point is that replacing the whole file also drops edits git had already merged outside the conflict hunk. The hunk sat next to the docstring. The helper and refund.partial were already in the work tree.
During a rebase, ours and theirs swap
On the same two files, if machine 3 runs git rebase origin/main, then at the conflict ours is the new base, which is main, and theirs is the partial-refund commit being replayed.
git checkout --ours leaves the head at bae3940, which is main itself. The partial-refund commit is no longer there after the rebase. The signature check remains, the partial refund is gone, and the tests were 6 passed. An agent that remembers "ours is my work" and uses that flag during a rebase drops its own ticket.
git checkout --theirs leaves a05f36f, the same outcome as --ours during a merge: the partial refund stays, the signature check is gone, and the tests were 5 passed. The same pair of flags points at opposite sides in a merge and in a rebase. That is git's convention, not a quirk of this run.
Keeping only our side of the hunk: the helper stays, the lines that reject a request do not
A closer match for "I am resolving the conflict" is to edit only what sits between the markers, or to run git merge -X ours origin/main. -X ours is not a whole-file checkout --ours: non-conflicting edits from both sides are kept, and only the conflict hunks prefer our side.
Those two paths produced the same behaviour. Keeping our side of each hunk is 34614dd; -X ours is 6d2a892. The file still has verify_signature and refund.partial, and the docstring is machine 3's sentence about partial refunds. The PermissionError block is gone. The signature tests from main are gone too, because they lived in the same test-file hunk. The tests were 5 passed. The partial-refund probe restocks; an unsigned charge is accepted, and inventory goes from 8 to 7. The line-level check reports 23 lines dropped relative to main: exactly that check and those tests.
This is harder to see than a whole-file checkout --ours. Open billing.py and the helper is there, the partial refund is there, and the markers are gone. What is missing are the lines that actually reject the request. The tests cannot help: the two signature tests that would have failed were dropped with the incoming side of the hunk.
The other way — keeping only their side of each hunk, or git merge -X theirs — is 66b0c76 and e53c635. Both the signature check and the partial refund are present, and both probes pass. The tests were 6 passed. What is missing is the partial-refund test, and machine 3's docstring line. The features are complete; one test is missing. The line-level check refuses, because it sees those 5 missing lines. Do not make -X theirs a standing default. The next time the conflict hunk is the partial refund itself, the same command will drop it. Both features survived here because most of the real work had already been auto-merged, and the incoming side of the hunk happened to be the check.

A resolution that only looks merged turns the tests red; deleting those tests makes them green again
I also built a "looks merged" commit, b5c568d: the helper and the partial refund are kept, both sets of tests are kept, and only the call to verify_signature inside process_webhook is removed. The tests were 1 failed, 6 passed, and the failure was test_process_rejects_bad_signature. The unsigned probe is accepted. That is the case where the tests still do their job.
If, during a rebase, the agent has already replaced billing.py with the feature-branch file, verify_signature is missing, and both sets of tests are kept first, pytest reports 1 error: the import of verify_signature fails. After the signature tests are deleted, the commit is b27d37a, the tests were 5 passed, and an unsigned request is accepted again. The red tests are treated as stale leftovers from the rebase, not as evidence that the check was dropped during the resolution.
rerere will replay this mistake
After the first whole-file checkout --ours was committed, I reset the branch back to the original aa572a7 and merged origin/main again. Without rerere.autoupdate, git still reports a conflict and exits 1, but the work tree has no conflict markers. stderr contains Resolved 'billing.py' using previous resolution. billing.py matches the feature branch, and the signature check is gone. Adding and committing produces ef7bbf9: the tests were 5 passed, and an unsigned request is accepted.
With rerere.autoupdate, the same replay stages the files. stderr contains Staged 'billing.py' using previous resolution. The status becomes "All conflicts fixed but you are still merging." One git commit remains. The result is c3b25bb, again the feature-branch files. rerere does not judge whether the previous resolution was right. It replays whatever was recorded. An agent that sees "used the previous resolution" will often just commit.

Machine 7 has to probe both features
A tests-only gate allows 34614dd, 6d2a892, and c46e468. The tests pass because the signature tests are no longer in the repository, not because the check still runs.
A gate that requires every unique added line from either parent, relative to the merge base, to be present in the result will catch a whole-file checkout and a dropped check. It also refuses the hand-kept d46caeb: that commit combined the two docstrings into "signed payment event, including partial refunds," so both original lines are gone. The gate reports one missing line on each side, even though the tests were 7 passed and both probes pass. The overlapping line needs a person. Line-level completeness is a warning, not the only merge condition.
The required check should be the two behavioral probes. check_features.py sets WEBHOOK_SECRET, sends an unsigned charge, and requires a rejection with inventory still at 8; then it runs a partial refund and requires WID-1 to restock from 6 to 7. A remaining verify_signature definition is not enough: both 34614dd and b5c568d still have that function, and the gate refuses both. d46caeb is allowed. e53c635 is allowed too, even though it is missing the partial-refund test — the probe watches behaviour, not whether the test file is complete. A missing test is a review comment, not something this gate has to solve on its own.

When not to install this
Do not treat --ours during a rebase as "the side I wrote." The flags swap between merge and rebase. If you cannot keep that straight, check the file out by commit hash, and do not rely on the words ours and theirs.
Do not make git merge -X ours or -X theirs a default policy. -X only affects conflict hunks, which is gentler than a whole-file checkout, and that is why it is better at leaving a helper in place after the check that uses it has disappeared. The next time the hunk holds the core of the other ticket, the same default will delete it.
Do not search the file for def verify_signature, or stop at whether the conflict markers are gone. 34614dd satisfies both, and an unsigned request is still accepted.
Do not take rerere's "used the previous resolution" as a sign that this resolution is right. If the previous one was a whole-file --ours, this one will drop the same lines again. rerere.autoupdate only makes the commit smoother. It does not make the mistake rarer.
Do not delete failing tests that arrived from main after a rebase. Assume first that the resolution dropped the check.
A team that never edits the same file in parallel does not need this gate. Without a signature check, and without a second ticket that will touch the same file, the probes have nothing to catch. The gate answers whether the side that just landed on main is still in effect, not whether the partial-refund amount is right. The GitHub conflict editor, a merge queue, and Actions were not run in this experiment, so the local git results must not be written as the behaviour of those products.
What you can copy tomorrow
In AGENTS.md for machines 1 to 3, write that a conflict must not be resolved by git checkout --ours or git checkout --theirs on a whole file. Look at how long the hunk is, and whether the other side's function or branch is already present outside it. Keep the unique additions from both sides, and combine the overlapping lines yourself.
After the markers are gone, run the tests that already landed on the default branch, then the tests on this branch. If a test that came from the default branch fails, fix the resolution. Do not delete the test.
Before machine 7 merges, run the behavioral probes, not only the unit tests:
python3 tools/check_features.py --repo .
The line-level script check_resolution.py can run alongside them, as a warning: it will also flag a rewritten docstring.
The scripts, an AGENTS.md snippet, and a sample workflow are in conflict-resolution-kit.tar.gz. The workflow YAML was checked for structure. It was not run on GitHub Actions.
The smallest step today: on an agent pull request that has just taken main through a conflict, do not start with whether the tests are green. Check whether the guard that just landed on main still rejects a request on the production path.
What was actually run
Runtime: git 2.47.3, Python 3.13.5, and pytest 9.1.1 on this machine. Commit timestamps were fixed at 2026-11-20T11:59:59Z and incremented by seconds, so the short hashes are stable in this rebuild. Seed 73b080e: tests 4 passed, an unsigned request is accepted, a partial refund errors. Machine 1's branch fea489c merged to main is bae3940: tests 6 passed, an unsigned request is rejected. Machine 3's branch aa572a7: tests 5 passed, a partial refund restocks to 7. The merge base is 73b080e.
git merge origin/main stopped with one conflict each in billing.py and test_billing.py. Whole-file checkout --ours is c46e468, tests 5 passed, an unsigned request is accepted, identical to the feature branch, 35 lines dropped from main. Whole-file checkout --theirs is 3660b27, tests 6 passed, a partial refund errors. During rebase, --ours lands at bae3940 and the partial-refund commit disappears; --theirs is a05f36f and the signature check disappears. Keeping our hunk, 34614dd, matches -X ours at 6d2a892: the helper stays, the check is gone, tests 5 passed, an unsigned request is accepted, 23 lines dropped. Keeping their hunk, 66b0c76, matches -X theirs at e53c635: both probes pass, tests 6 passed, the partial-refund test is missing. The hand-kept both-features commit is d46caeb, tests 7 passed, both probes pass, and the line-level gate refuses because each original docstring line is missing. b5c568d keeps the helper and drops the call, tests 1 failed and 6 passed. After deleting the failing tests, b27d37a, tests 5 passed. rerere without autoupdate replays into ef7bbf9; the second merge exits 1, the work tree has no markers, and stderr is Resolved ... using previous resolution. With autoupdate, c3b25bb, the status is All conflicts fixed, and stderr is Staged ... using previous resolution.
Not run: Resolve conflicts in the GitHub UI; a merge API; GitHub Actions (the YAML was checked for structure); branch protection or a ruleset; Windows or windows-latest; a conflict resolution produced live by Cursor or Claude Code (the commands were written into the script from ordinary usage); a second GitHub account. Chen Hao, chenhao@team.invalid, machine-1-agent@iotxing.invalid, and machine-3-agent@iotxing.invalid are lab fixtures.