AI

6 号机贴了 windows-ok,验证过的那个提交已经不是 HEAD(中英切换)

This post is currently available in Chinese only. The original text follows.Open the Chinese page →

三人、七台电脑。1 到 3 号机跑编码代理,4、5 号机审查,6 号机是唯一的 Windows,7 号机负责合入。6 号机常常不是 GitHub 托管的 windows-latest:它是组里那台中文 Windows,路径、编码、文件锁都更接近用户,跑完一遍要占住这台机器。于是团队养成一个习惯:6 号机通过以后,在 PR 上贴 windows-ok。7 号机看见标签还在,就当验证还有效。

周一,2 号机的代理交了一张导出报表路径的 PR。提交是 b652554。export_path 用 pathlib 拼在调用方给的根目录下面,遇到带冒号的 report_id 会拒绝。代理自己的单元测试两条都过:它们只检查路径是不是以 weekly.csv 结尾、名字里有没有 weekly。6 号机还要再跑一层额外检查——本实验室用本机 Linux 上的 platform_verify.py 代替这一层,必须先说清楚:这不是 Windows 实测,通过也不等于 Windows 通过。这一层在 b652554 上是通过的。6 号机贴了 windows-ok,评论里写了这个 SHA,并在票外的可信存储里记下一条 windows-verify 的 success。

4 号机顺手留了一句 nit:pathlib 写得太绕。2 号机的代理“简化”成 str(root) + "/reports/" + report_id + ".csv",推了 584f1af。单元测试还是 2 通过。windows-ok 还贴在票上。7 号机如果只问标签在不在,就会把 584f1af 送进 main。我在本机实测了这件事:label 模式的合入闸门放行,main 快进到 584f1af,生产代码已经是斜杠拼接;status_sha 模式拒绝,main 留在 7164c3b。

这篇要核对的是:6 号机贴出去的通过,是贴在票上,还是贴在那个提交上;代理再推一次之后,哪种戳记还会放行。它和 Linux 上全绿、Windows 上挂 8 项:让 6 号机在合并前拦住代理的代码 谈的是要不要在合并前跑 Windows,和 6 号机 Windows 挂了,失败日志在 Actions:2 号机上的代理怎么拿到现场并改下一刀? 谈的是失败现场怎么送回开发机,都不是同一件事。今天只谈通过之后那枚戳记。它也和 4 号机刚 Approve,2 号机的代理又 force-push 了一次:合进去的到底是哪一版? 是同一类撕裂:那边撕开的是批准,这边撕开的是验证。至于 三个人七台电脑:状态写进 GitHub,审查机自己领活 建议用标签做状态机——那个建议对“谁在干这张票”仍然成立,只是不能把同一张贴纸当成“当前这棵树已经验证过”。

windows-ok 贴在票上,并不跟着提交走

实验室怎么搭

我在本机初始化了一个玩具仓库,默认分支 main 的起点是 7164c3b。功能分支上的 A 是 b652554:pathlib 导出路径,加上对非法文件名的拒绝,以及那两条弱测试。B 是 584f1af:把路径改成斜杠拼接,并且不再拒绝带冒号的 id。F 是后来的真修复 8f35519。G 是在 A 上面放的一个空提交 7f3705d,树哈希仍是 f2be32c,和 A 相同。

6 号机的额外检查是 tools/platform_verify.py。它扫 app/export.py 里有没有用 "/reports/" 做字符串拼接,并调用 export_path(..., "q:1"),看会不会抛错。这两件事弱测试都不问。这个脚本在这次实验里只在 Linux 上跑过。我没有 Windows 机器,也没有对 windows-latest 开火,所以后面凡是 VERIFY=PASS 或 VERIFY=FAIL,都只是这个替身的结论。

票上的标签、评论,以及票外的 statuses.json,用来模拟 GitHub 的 labels、issue comment 和 Check Run / commit status。存储目录不在功能分支的树里。闸门有五种模式:label 只看 windows-ok 还在不在;comment_sha 看评论里有没有当前 HEAD 的 SHA;pr_file 看 HEAD 树里的 validation.json 是不是给当前 HEAD 写了 success;status_sha 和 status_tree 分别看可信存储里有没有针对这个提交、或这棵树的 success。merge_if_validated.sh 先在 HEAD 的临时 worktree 里跑 pytest,再跑闸门,通过才对 main 快进。每次快进之后我都把 main 复位到 7164c3b。

git 是 2.47.3,Python 是 3.13.5,pytest 是 9.1.1。下面的短 SHA 都来自这一次运行;仓库若重建,哈希会变,字段关系和闸门结论不会变。

标签还在的时候,坏的导出代码已经能进 main

A 上,弱测试 2 通过,替身检查 VERIFY=PASS。记下 success 之后,label、comment_sha、status_sha、status_tree 都是 ALLOW;pr_file 拒绝,因为树里还没有 stamp 文件。merge_if_validated.sh --mode status_sha 把 main 快进到 b652554,我随即复位。这一步只说明:当 HEAD 仍然是被验证过的那个提交时,按 SHA 绑定的闸门会放行,这是它该做的事。

然后代理推了 B。弱测试仍然 2 通过。替身检查变成 VERIFY=FAIL issues=posix_slash_concat,missing_illegal_char_reject。标签没有人摘,存储里也还只有 A 的 success。这时 label 仍是 ALLOW,comment_sha、status_sha、status_tree 都是 REFUSE——评论写的是 A,检查也还停在 A。

接着把合入脚本开在 label 模式,对着 B 跑。它快进成功,main 来到 584f1af,工作区里的 export.py 已经是斜杠拼接。再复位,改用 status_sha 对着同一个 B 跑:闸门拒绝,main 留在 7164c3b。也就是说,7 号机如果把“票上还有 windows-ok”当成可以合,合进去的就是这棵已经不再通过额外检查的树。按提交读取检查,则不会。

评论里写上新 SHA,也只是代理能写的一句话

有人会说:那就不要只看标签,看评论里的 SHA 对不对。这个想法比标签紧一点。B 刚推上去、评论还写着 A 的时候,comment_sha 确实拒绝了。

可是任何人都可以再留一条评论。我在存储里加了一句 windows-ok at 584f1af (refreshed),没有重跑替身检查,也没有给 B 记下新的 status。comment_sha 立刻变成 ALLOW,status_sha 仍然是 REFUSE。差别不在文字写得准不准,在于谁有权宣布“这个 SHA 通过了”。评论是 1 到 3 号机上的代理也写得出来的;检查记录如果只能由 6 号机的令牌写,伪造评论就推不动闸门。

把 stamp 放进 PR 树,问题换了一种形状。我在 B 上提交了一个 validation.json,里面写了 success,再 amend,好把文件里的 SHA 改成“当前提交”。amend 之后 HEAD 变成了 5815f98,文件里仍写着 amend 之前的 0e22706。pr_file 的结论是 pr_file_mismatch。这不是我故意挖的坑:一个文件没有办法在自己被提交的那一瞬间,诚实地写下自己即将拥有的 SHA。代理若把校验条件放宽成“只要文件里写了 success”,又回到了自己给自己打分。

还有一条更短的路。我用 source=machine-2-agent 往可信存储里给 5815f98 记了一条 success。status_sha 和 status_tree 都变成 ALLOW。SHA 绑定在这里并没有失效,失效的是“谁能写”。所以只把检查挂到提交上不够,写成功检查的令牌不能出现在 1 到 3 号机上。记下这一条之后,我把这条失窃记录从存储里删掉,后面的案例重新只保留 A 的 success。

在 B 上记下失败,标签也不会自己下来;真修复要重新盖戳

模拟 6 号机在 B 上重跑替身检查——它会失败——并记下 state=failure。status_sha 和 status_tree 变成 state=failure 的 REFUSE。标签仍是 ALLOW。前面那条伪造评论还在,所以 comment_sha 也还是 ALLOW。6 号机即便已经把失败写进了存储,只要 7 号机仍看标签或评论,这张票看起来就还是绿的。

然后把 export.py 恢复成 pathlib 版本,提交 8f35519。弱测试 2 通过,替身检查重新 VERIFY=PASS。此时标签还在,但评论里没有 F 的 SHA,所以 comment_sha 是 REFUSE——这也说明评论绑定一旦离开那个 SHA,并不能跟着“修复”走,除非有人再写一句。给 F 记下 success 之后,status_sha 放行,merge_if_validated.sh 把 main 快进到 8f35519,我再次复位。合进去的是重新验证过的修复,不是票上那张旧贴纸。

这次实验室实际得到的闸门结论

同一棵树、新的 SHA:按提交拒绝,按树可以复用

在 A 上面放了一个空提交 7f3705d。它的树哈希仍是 f2be32c,和 A 相同。替身检查在这棵树上再次 VERIFY=PASS——仍然只是 Linux 上的替身,不是 Windows 重跑。status_sha 拒绝,因为存储里没有这个新 SHA;status_tree 放行,因为它看见了 A 留下的、同一棵树的 success。

这是一笔需要当面讲清楚的权衡。代理很喜欢在审查 nit 之后 --amend,或者 rebase 到并没有改到这棵树的 main 上,SHA 会变,树可能不变。如果闸门死盯 SHA,6 号机就要再占一轮。三人团队、只有一台 Windows 时,这个成本是真的。按树复用可以跳过这种空跑。

但这次实验没有换过 runner 镜像,也没有在另一套系统上重跑同一棵树。我不能把“树哈希相同,Windows 就一定还通过”写成实测结论。生产里如果要按树复用,应当把 runner 或镜像的标识一并写进戳记,镜像一换就作废。rebase 一旦把其他文件带进这棵树,树哈希会变,按树复用也会要求重跑,这是它该做的。

机制:标签是票的字段,检查是提交的字段

GitHub 的标签挂在 Issue 或 PR 上,没有 sha 字段。synchronize 默认也不会摘掉 windows-ok。你可以另写一个 workflow,在每次推送时删标签,通过以后再由 6 号机贴回去。这能挡住“忘了摘标签”这一类疏忽,也值得装。它仍然不是合入证据。代理可以在推送之后自己把标签贴回去,7 号机如果只问标签,看到的还是绿的。卫生措施负责让贴纸不要说谎太久,合入闸门还是得去读 HEAD 上的检查。评论同样是票上的文字,任何人只要写得进这张 PR,就能写上最新的 SHA。

Commit status 和 Check Run 不一样,它们写在某个 SHA 上。分支保护或规则集里的必过检查,问的是当前 HEAD 上有没有同名的成功检查,不会去读票上的贴纸。这正是 status_sha 能挡住 B、又放行重新验证后的 F 的原因。本实验室没有调用 GitHub 的 Checks API,也没有打开真实的规则集;存储文件只是把这套语义做成了可在本机复现的替身。字段关系来自 GitHub 的文档和行为,闸门结论来自这次本机运行。

所以问题不是“团队不该用标签”。状态写进 GitHub,审查机自己领活 把 state:* 标签当成谁在看这张票的总线,这个用法还在。问题是同一条总线被拿去回答了另一个问题:当前这棵树有没有被 6 号机验证过。前一个问题的答案可以粘在票上,后一个问题的答案必须粘在提交上,而且必须由 6 号机的令牌来写。

合入前该问:当前 HEAD 上有没有 6 号机写下的成功检查

什么时候不该装这套闸门

如果 6 号机的套件已经是规则集里必过的、并且按 HEAD 计算的检查,你不需要再拿 windows-ok 当合入条件。把标签留给出谁在干这张票,删掉“有标签才能合”这一条就行。这篇针对的是验证发生在一台实体 Windows、结果靠人或者脚本去贴票的团队。

如果每次推送都很少、而且一定是 6 号机的人自己贴标签、自己在合入前再看一眼 HEAD,口头同步也许够用。代理会在 nit 之后再推一次,这一次就足够把戳记和提交撕开。三人、七机、高频代理开发,通常不能依赖“我们会记得摘标签”。

按树复用不适合跑在会变的环境上。今天这台 Windows 打过补丁、换过运行时,同一棵树的旧 success 就不该再当通行证。没有把环境标识写进戳记以前,宁可多跑一次,也不要按树放行。

也别让 1 到 3 号机上的代理“帮忙”写 windows-verify。这次失窃令牌的案例已经放行了 5815f98。闸门读存储之前,先保证写入口不在开发机上。

明天可以抄走的做法

把 windows-ok 只当成交接信号,例如“6 号机正在看这张票”。合入条件改成:当前 HEAD 上有一条由 6 号机写下的 windows-verify success。可以用 GitHub Checks API,也可以用这次实验室这种票外存储;必过检查的名字要和规则集里的一致。

6 号机跑完自己的套件之后再调用 record_validation.py。1 到 3 号机的 AGENTS.md 里写明:代理不得自己贴、重贴 windows-ok,不得在 PR 里放 validation.json 冒充通过,也不得写 windows-verify 这条检查。推送新提交之后,就当上一枚戳记已经过期,等 6 号机给新的 HEAD 盖戳。

merge_if_validated.sh --mode status_sha 可以作为 7 号机的合入脚本。测试要在目标 SHA 的 worktree 里跑,不要用当前工作区的结果。如果团队被空提交和纯说明 amend 打得很频繁,再考虑 status_tree,并把 runner 标识写进记录。

这套脚本、workflow 和 AGENTS.md 片段在 validation-stamp-kit.tar.gz 里。这样调用闸门:

python3 tools/validation_gate.py --repo . --head HEAD --meta "$VALIDATION_STORE" --mode status_sha

其中的 workflow 只检查了结构,没有在 GitHub Actions 上跑;本机没有安装 PyYAML。

今天最小的一步:打开一张已经贴过 windows-ok、后来又有新提交的 PR,对一下标签还在不在、6 号机实际跑的是哪一个 SHA。如果两个对不上,先把合入条件改成看 HEAD 上的检查,再决定那张标签还要不要留着做交接。

这次实际跑了什么

跑了:本机的 git 2.47.3、Python 3.13.5、pytest 9.1.1;玩具仓库里的提交和分支;A / B / F 上的 pytest(均为 2 passed);A / B / F / G 上的 platform_verify.py(Linux 替身);五种闸门模式在上述案例中的结论;merge_if_validated.sh 在 status_sha 下快进 A 到 b652554 后复位;在 label 下快进 B 到 584f1af(导出代码已是斜杠拼接)后复位;在 status_sha 下拒绝 B,main 留在 7164c3b;在 status_sha 下快进 F 到 8f35519 后复位;空提交 G 与 A 同树时 status_sha 拒绝、status_tree 放行;以及失窃令牌写入后 status_sha 放行、随后从存储中删除这条记录。

没有跑:GitHub API 或 Checks API;真实的分支保护或规则集;合并队列;第二个 GitHub 账号去点合并;GitHub Actions(workflow 只检查了结构,本机没有 PyYAML);任何 Windows 任务或 windows-latest runner。短 SHA 来自这一次运行。仓库重建后哈希会变,字段关系和闸门结论不会变。

Three people, seven machines. Machines 1–3 run coding agents, 4 and 5 review, 6 is the only Windows box, and 7 merges. Machine 6 is often not GitHub-hosted windows-latest. It is the team’s Chinese Windows machine, closer to users in paths, encoding, and file locks, and a run occupies that box. So the team formed a habit: after machine 6 passes, it sticks a windows-ok label on the pull request. Machine 7 treats a label that is still there as a validation that is still current.

On Monday, the agent on machine 2 opened a pull request that built an export path for reports. The commit was b652554. export_path joined segments with pathlib under a caller-supplied root, and rejected a report_id that contained a colon. The agent’s own unit tests both passed: they only check that the path ends with weekly.csv and that the name contains weekly. Machine 6 still has an extra verifier. In this lab that verifier is platform_verify.py, run on Linux on this machine. This has to be said first: it is not a Windows run, and a pass here is not a Windows pass. The stand-in passed on b652554. Machine 6 added windows-ok, named that SHA in a comment, and recorded a windows-verify success in a trusted store outside the ticket.

Machine 4 left a nit: the pathlib code looked too heavy. The agent on machine 2 “simplified” it to str(root) + "/reports/" + report_id + ".csv" and pushed 584f1af. The unit tests were still 2 passed. windows-ok was still on the ticket. If machine 7 only asks whether the label is present, it will land 584f1af on main. I measured that on this machine: the label-mode merge gate allowed the fast-forward, main moved to 584f1af, and the production exporter was already slash-concatenated; status_sha refused, and main stayed at 7164c3b.

This post asks where machine 6’s pass actually lives — on the ticket, or on the commit — and which stamps still allow a merge after the agent pushes again. It is not the same question as running Windows before merge, or as getting a Windows failure back to the Linux agent. Those posts are about running the suite and shipping the failure. This one is about the stamp after a pass. It is the same kind of tear as an approval, then a force-push, and which SHA merges: that post tears approval away from the commit, this one tears validation away from it. Putting state in GitHub so the review machine can pick up work still holds for “who is working this ticket.” It does not hold if the same sticker is asked to mean “this tree was validated.”

windows-ok sits on the ticket, not on the commit

How the lab was built

I initialized a toy repository on this machine. The starting point of main is 7164c3b. On the feature branch, A is b652554: the pathlib exporter, the illegal-name rejection, and the two weak tests. B is 584f1af: slash-concatenated paths, and no rejection of a colon in the id. F is the later real fix, 8f35519. G is an empty commit on top of A, 7f3705d, whose tree hash is still f2be32c, the same as A.

Machine 6’s extra check is tools/platform_verify.py. It scans app/export.py for "/reports/" string concatenation, and calls export_path(..., "q:1") to see whether that raises. The weak tests ask neither question. In this run the script ran only on Linux. I have no Windows machine, and I did not fire windows-latest, so every VERIFY=PASS or VERIFY=FAIL below is the stand-in’s result only.

Labels and comments on the ticket, plus a statuses.json beside it, stand in for GitHub labels, issue comments, and Check Runs / commit statuses. The store is not in the feature branch’s tree. The gate has five modes: label asks whether windows-ok is still present; comment_sha asks whether a comment mentions the current HEAD SHA; pr_file asks whether validation.json in the HEAD tree records success for that same SHA; status_sha and status_tree ask whether the trusted store has a success for this commit, or for this tree. merge_if_validated.sh runs pytest in a temporary worktree of HEAD, then the gate, and only then fast-forwards main. After every fast-forward I reset main to 7164c3b.

git is 2.47.3, Python is 3.13.5, pytest is 9.1.1. The short SHAs are from this run. If the repository is rebuilt they will change; the field relationships and the verdicts will not.

While the label is still on the ticket, the broken exporter can reach main

On A, the weak tests were 2 passed and the stand-in printed VERIFY=PASS. After the success was recorded, label, comment_sha, status_sha, and status_tree were all ALLOW; pr_file refused, because the tree had no stamp file yet. merge_if_validated.sh --mode status_sha fast-forwarded main to b652554, and I reset it. That step only shows the SHA-bound gate doing what it should when HEAD is still the commit that was validated.

Then the agent pushed B. The weak tests were still 2 passed. The stand-in became VERIFY=FAIL issues=posix_slash_concat,missing_illegal_char_reject. Nobody removed the label, and the store still held only A’s success. label stayed ALLOW; comment_sha, status_sha, and status_tree were REFUSE — the comment still named A, and the check still sat on A.

I then ran the merge script in label mode against B. It fast-forwarded. main became 584f1af, and export.py in the worktree was already slash-concatenated. After a reset, the same B under status_sha was refused, and main stayed at 7164c3b. If machine 7 treats “the ticket still has windows-ok” as permission to merge, what lands is the tree that no longer passes the extra check. Reading the check on the commit does not make that mistake.

A comment that names the new SHA is still a sentence the agent can write

A tighter idea is to ignore the label and require the comment to name the current SHA. That is tighter than the label. Right after B landed, while the comment still named A, comment_sha did refuse.

Anyone can leave another comment, though. I added windows-ok at 584f1af (refreshed) to the store, without rerunning the stand-in and without recording a new status for B. comment_sha became ALLOW at once; status_sha stayed REFUSE. The difference is not how carefully the text is written. It is who is allowed to announce that this SHA passed. A comment is something the agent on machines 1–3 can also write. If only machine 6’s token can record the check, a forged comment does not move the gate.

Putting a stamp in the pull request tree changes the shape of the problem, not the ownership of it. I committed a validation.json that said success on top of B, then amended it so the file would name “the current commit.” After the amend, HEAD was 5815f98, and the file still named the pre-amend 0e22706. pr_file returned pr_file_mismatch. That is not a trick I planted: a file cannot honestly write the SHA it is about to receive at the moment it is committed. If the agent loosens the check to “the file says success,” it is grading its own work again.

There is a shorter path. I recorded a success for 5815f98 with source=machine-2-agent. status_sha and status_tree both became ALLOW. The SHA binding did not fail here. The writer did. Binding the check to a commit is not enough if the token that writes a success also lives on machines 1–3. After this case I deleted the stolen record, so later cases again had only A’s success in the store.

Recording a failure on B does not take the label off; a real fix needs a new stamp

I simulated machine 6 rerunning the stand-in on B — it fails — and recorded state=failure. status_sha and status_tree became REFUSE with state=failure. The label was still ALLOW. The forged comment from the previous case was still there, so comment_sha was still ALLOW. Even after machine 6 had written the failure into the store, the ticket still looked green to anyone who was watching the label or the comment.

I then restored the pathlib exporter and committed 8f35519. The weak tests were 2 passed, and the stand-in printed VERIFY=PASS again. The label was still present, but no comment named F, so comment_sha was REFUSE — which also shows that a comment bound to a SHA does not follow a fix unless someone writes another one. After a success was recorded for F, status_sha allowed, merge_if_validated.sh fast-forwarded main to 8f35519, and I reset again. What landed was the revalidated fix, not the old sticker on the ticket.

Gate verdicts measured in this lab

Same tree, new SHA: refuse by commit, maybe reuse by tree

I placed an empty commit, 7f3705d, on top of A. Its tree hash is still f2be32c, the same as A. The stand-in printed VERIFY=PASS on that tree again — still the Linux stand-in, not a Windows rerun. status_sha refused, because the store has no row for the new SHA; status_tree allowed, because it could see the success A left on the same tree.

That is a trade-off that should be named in the open. Agents like to --amend after a nit, or rebase onto a main that did not change this tree. The SHA moves; the tree may not. A gate that keys only on SHA sends machine 6 through another occupied run. On a three-person team with one Windows box, that cost is real. Reusing by tree skips that empty run.

This lab did not change the runner image, and it did not rerun the same tree on another system. I cannot write “the same tree hash still passes on Windows” as a measured result. If you reuse by tree in production, write the runner or image identity into the stamp, and invalidate it when the image changes. A rebase that brings other files into the tree will change the hash, and tree reuse will demand a rerun. That is what it should do.

The mechanism: a label is a field on the ticket, a check is a field on the commit

A GitHub label hangs on an issue or a pull request. It has no sha field. A synchronize event does not, by default, remove windows-ok. You can write a workflow that deletes the label on every push, and let machine 6 put it back after a pass. That catches the “we forgot to take it off” case, and it is worth installing. It is still not merge evidence. An agent can put the label back after it pushes, and if machine 7 only asks about the label, the ticket still looks green. Hygiene stops the sticker from lying for long. The merge gate still has to read the check on HEAD. A comment is also text on the ticket. Anyone who can write to the pull request can name the latest SHA.

Commit statuses and Check Runs are different: they are stored on a SHA. A required check in branch protection or a ruleset asks whether the current HEAD has a successful check of that name. It does not read a sticker on the ticket. That is why status_sha refused B and allowed F after a fresh validation. This lab did not call the GitHub Checks API, and it did not turn on a real ruleset. The store file is a stand-in that makes the same semantics reproducible on this machine. The field relationships come from GitHub’s documentation and behavior; the gate verdicts come from this run.

So the problem is not “the team should not use labels.” Putting state in GitHub so the review machine can pick up work still treats state:* labels as the bus for who is looking at a ticket. That use still stands. The failure is asking the same bus a second question: has machine 6 validated this tree? The first answer can live on the ticket. The second has to live on the commit, and it has to be written with machine 6’s token.

Before merge, ask whether HEAD itself has machine 6’s success check

When you should not install this gate

If machine 6’s suite is already a required check, computed on HEAD, you do not need windows-ok as a merge condition. Leave the label for who is working the ticket, and drop “the label must be present” as a merge rule. This post is for teams whose validation runs on a physical Windows box, with the result stamped onto the ticket by a person or a script.

If pushes are rare, and the person on machine 6 always applies the label and always looks at HEAD again before merge, a verbal habit may be enough. An agent will push once more after a nit, and that once is enough to tear the stamp off the commit. A three-person, seven-machine team shipping at agent speed usually cannot rely on “we will remember to take the label off.”

Tree reuse does not belong on an environment that moves. If this Windows box was patched, or the runtime changed, yesterday’s success on the same tree should not be a pass. Until the stamp carries an environment identity, rerun rather than reuse by tree.

Do not let the agent on machines 1–3 “help” by writing windows-verify. The stolen-token case in this lab allowed 5815f98. Before the gate reads the store, make sure the write path is not on a development machine.

What to copy tomorrow

Treat windows-ok as a handoff signal only — “machine 6 is looking at this ticket.” The merge condition should be: the current HEAD has a windows-verify success written by machine 6. That can be the GitHub Checks API, or a store beside the ticket as in this lab. The required check name must match the name in your ruleset.

Machine 6 should call record_validation.py only after its own suite has run. In AGENTS.md for machines 1–3, say that agents must not add or refresh windows-ok, must not put a validation.json in the pull request and treat it as a pass, and must not write the windows-verify check. After a new push, treat the previous stamp as stale and wait for machine 6 to stamp the new HEAD.

merge_if_validated.sh --mode status_sha can be machine 7’s merge script. Run the tests in a worktree of the target SHA; do not use the current worktree’s results. If empty commits and message-only amends are frequent, consider status_tree, and write the runner identity into the record.

The scripts, the workflow, and the AGENTS.md snippet are in validation-stamp-kit.tar.gz. Call the gate like this:

python3 tools/validation_gate.py --repo . --head HEAD --meta "$VALIDATION_STORE" --mode status_sha

The workflow in this lab was inspected for structure. It was not run on GitHub Actions, and PyYAML is not installed on this machine.

The smallest step today: open a pull request that already has windows-ok and also has a later commit, and check whether the label is still there and which SHA machine 6 actually ran. If those two disagree, change the merge condition to a check on HEAD first, and only then decide whether the label is still useful for handoff.

What was actually run

Run: git 2.47.3, Python 3.13.5, and pytest 9.1.1 on this machine; the commits and branches in the toy repository; pytest on A, B, and F (2 passed on each); platform_verify.py on A, B, F, and G (the Linux stand-in); the five gate modes on the cases above; merge_if_validated.sh fast-forwarding A to b652554 under status_sha, then a reset; fast-forwarding B to 584f1af under label (the exporter already slash-concatenated), then a reset; refusing B under status_sha, with main left at 7164c3b; fast-forwarding F to 8f35519 under status_sha, then a reset; G, an empty commit with A’s tree, refused by status_sha and allowed by status_tree; and a stolen-token write that allowed status_sha, after which that record was removed from the store.

Not run: the GitHub API or the Checks API; a real branch protection rule or ruleset; a merge queue; a second GitHub account to click merge; GitHub Actions (the YAML was checked for structure, and PyYAML was not installed on this machine); any Windows job or windows-latest runner. The short SHAs come from this run. They will change if the repository is rebuilt; the field relationships and the decisions will not.