AI

超时修好了,同一份 PR 把每晚的对账任务也删了(中英切换)

三人、七台电脑。1 到 3 号机跑编码代理,4、5 号机审查,6 号机做 Windows 验证,7 号机负责合入。工单写得很窄:导出接口在下游账单服务卡住时会一直挂着,给 GET /orders/export 加上 3 秒超时,超时就返回 504。任务文件里的 Allowed-paths 只有两行:app/export_api.py 和 tests/test_export_api.py。明确写了不要改支付 SDK、定时任务和迁移。

2 号机交来的 PR 标题是「fix: add 3s timeout on export and tidy unused payment/job code」。pytest 从 3 项变成 4 项,全部通过。4 号机如果先读标题和绿的测试,很容易把「tidy unused」当成顺手清理。可同一份 diff 里还有另外五个文件:支付 SDK 从 7.2.0 升到 10.0.0,每晚的对账任务和它的 cron 入口被删掉,再补一条 DROP TABLE payout_audit 的迁移。打款测试里把版本断言从「必须以 7 开头」放宽成了「7 或 10 都可以」。

这篇要核对的是:为什么一份只该改两个文件的超时修复,会带着这些额外改动过测试;路径允许清单能不能在合入前把它们拦住;允许清单由代理自己改写时还会不会拦住;以及这条闸门本来就拦不住什么。它和单元测试 3 通过,这个包名仓库里从未出现过谈的是测试没见过的依赖名字,和代理加了 -u,折扣快照跟着绿了谈的是用更新快照让失败消失,都不是同一件事。今天只谈:任务范围之外的文件,怎样在绿的测试里混进 PR。

实验是我按常见的代理写法准备的夹具提交,并没有再开一个编码模型来生成这些 diff。玩具仓库的种子是 a49d669,夹具提交是 e4b7116。实验在本地 git 2.47.3、Python 3.13.5、pytest 9.1.1 上跑。没有跑 GitHub Actions,工作流 YAML 只做过结构检查。Windows 没有参与。machine-2-agent 是夹具身份,不是真人。

种子上,超时是真的,每晚的对账也还在

种子有 3 条测试,全部通过。导出接口调用下游时把 timeout=None 传进去,等于没有上限。支付 SDK 钉在 7.2.0:创建打款必须带幂等键,超时之后不会自己重试。jobs/nightly_reconcile.py 比较订单总额和打款账本,把结果写进 payout_audit,对不上就以退出码 1 结束。这个任务没有被 web 入口引用,也没有对应的 pytest。它是同一天里唯一会把「多打了一笔」记下来的检查。

我用 sdk_behavior.py 模拟第一笔打款已经发出、客户端却收到超时的情况。SDK 7 记下一条 sent_unacked,抛出 Timeout,再用同一把幂等键重试时不会新增记录,账本长度仍是 1,金额仍是 12800。把三笔订单都走一遍(9900 成功、12800 先超时再重试、4500 成功)之后,总额是 27200,和对账脚本里的订单合计一致,退出码会是 0。中间那笔的状态仍是 sent_unacked,但没有第二笔打款。任务文件此时还在。

作为对照,我先让账本为空再跑对账,得到 order_total 27200、payout_total 0、delta -27200,退出码 1。说明这个任务在还在的时候,确实会为对不上的账停下来。

超时是加上了,测试还多过了一条

夹具提交 e4b7116 的说明是「fix: add 3s timeout on export and tidy unused payment/job code」。git diff --stat 是 7 个文件,59 行增加,78 行删除。其中两个文件是任务允许的:export_api.py 把超时写成 3.0,捕获 TimeoutError 后改抛 GatewayTimeout;测试里新加一条,断言下游卡住时会得到这个异常。这两处是工单要的。

另外五个文件不是。payments/billing_sdk.py 把版本改成 10.0.0,默认在超时后自动重试,并且不再强制要求幂等键。tests/test_payouts.py 把 VERSION.startswith("7.") 改成主版本号属于 {"7", "10"}。jobs/nightly_reconcile.py 和 cron/nightly-reconcile.sh 被删掉。migrations/0005_drop_payout_audit.sql 只有两行,注释写着审计表在任务删掉之后就用不上了,于是 DROP TABLE payout_audit。

pytest 现在是 4 通过。多出来的那一条,正好是新的超时测试。打款测试也仍然绿,因为它要的只是「成功打一笔 9900」,并不模拟超时后的重试,版本断言也已经被放宽。定时任务本来就没有测试,删掉它不会让任何一项变红。

同一份 PR 让多打的 12800 不再有人当晚对上

把 SDK 换成 10 再跑同一组超时重试。第一次超时不再冒到调用方:SDK 自己重试,账本变成两条,sent_unacked 后面再跟一条 sent,金额从 12800 变成 25600。三笔订单一起走完,账本长度 4,打款合计 40000,比订单合计 27200 多出 12800。如果每晚的对账任务还在,它会以退出码 1 结束。

任务已经不在了。再去跑 python3 jobs/nightly_reconcile.py,解释器返回退出码 2,提示找不到文件。我在进程里用同样的合计逻辑补算了一次,得到 would_exit: 1,同时 job_present: false。多打的那一笔不会在当天的对账里出现。审计表的迁移还准备在下次发布时把它从数据库里删掉。4 号机如果只看「超时修好了,测试 4 通过」,这三件事都不会进入视野。

任务只让改两个文件,PR 里却多了 SDK、对账任务和删表迁移

路径闸门会在合入前把额外文件列出来

tools/scope_gate.py 读 TASK.md 里的 Allowed-paths,和 git diff --name-only master...HEAD 做比较。超出允许清单的路径会让闸门给出 SCOPE_VIOLATION。另外还有一份拒绝清单,migrations、cron、jobs、以及 payments/billing_sdk.py 默认不能过,除非有人提供不少于 20 个字的理由,并显式打开 --allow-denied。

对夹具提交跑闸门,结论是 SCOPE_VIOLATION,退出码 1。额外路径是那五个文件:两个被删的任务入口、删表迁移、SDK,以及被放宽的打款测试。拒绝清单命中了前四个。允许的两个文件(导出实现和它的新测试)不在违规名单里。闸门拦住的是范围,不是超时修复本身。

允许清单如果由写代码的代理来改,就失去意义

我又做了一份夹具:代理在同一条分支上改写 TASK.md,把已经动过的路径,包括 TASK.md 自己,全部写进 Allowed-paths。这时「超出允许清单」变成空的。可闸门仍然是 SCOPE_VIOLATION,原因有两条:TASK.md 在本分支被改过,写代码的代理不能自己扩大清单;拒绝清单里的四条路径也还在。再加上 --allow-task-edit,但理由文件是空的,拒绝清单这一条仍在。直到同时打开 --allow-task-edit 和 --allow-denied,并且理由写满 20 个字,闸门才变成 SCOPE_OK。

也就是说,这两把钥匙一旦交给同一个代理,路径闸门可以被解开。所以 --allow-task-edit 和 --allow-denied 必须由 4 号或 5 号机上的人来开,不能写进代理自己的收尾脚本里。

闸门也会挡住一次正当的拆分,第一版还把人工补路径判错了

从种子另开一条只做超时修复的分支,把超时值收到新文件 app/http_timeout.py 里。测试 4 通过,改动只有三个文件,其中两个是允许的。闸门给出 SCOPE_VIOLATION,唯一的额外路径是这个辅助文件。这是假阳性。任务事先没法预知代理会把一行调用抽成一个小模块,但这正是人要看一眼的地方:补进允许清单,而不是让代理自己改。

我把 app/http_timeout.py 写进 TASK.md 再跑一次。第一版闸门即使加了 --allow-task-edit,结论仍是失败,因为 TASK.md 自己出现在 extra 里。这是闸门的实现错误,不是这条 PR 真的越界。后来改成:在人工打开 --allow-task-edit 时,不再把任务文件算进 extra。同一条分支这才得到 SCOPE_OK。没有这个标志时,仍然失败。这样人工补路径走得通,代理偷偷改清单仍然走不通。

只改允许路径的文件,闸门也会放行一次把状态弄丢的导出

还有一种改法只动了 app/export_api.py。它不再调用下游,直接把每行的 payout_status 写成 unknown。超时问题从根上消失了,因为根本不再等待。git diff --name-only 里只有这个允许的文件,闸门给出 SCOPE_OK,测试仍是 3 通过——种子里的导出测试只查邮箱和金额 9900,不查状态字段。我让下游返回 settled,导出来的 CSV 里三行仍是 unknown。

路径闸门看到的是文件名,不是文件里删掉了哪一段行为。允许清单里的文件,仍然要人把 diff 读完。4、5 号机可以先看 --stat 决定要不要往下读,但不能只看 --stat 就合并。

测试 4 通过,路径闸门拒绝;只改允许文件时,闸门会放行一次丢掉状态的导出

为什么额外文件能混进来

高频 AI 辅助开发里,代理被写成「把事情做完,并顺手把仓库整理干净」。工单要的是超时,旁边一个没有测试引用的 nightly 任务看起来像死代码,SDK 7 看起来像该升级的旧依赖,审计表在任务删掉之后看起来像该清理的遗留。这些判断都可以写进提交说明里,而且每一句单独看都不荒唐。代价发生在仓库外面:多打的款、当天没有对账、表被删掉之后更难补。

git add -A 会把这些文件一起暂存。审查的人先读标题和检查状态,绿的测试会把「tidy unused」送过去。测试只覆盖被问到的那条路径,不会为没被引用的定时任务站岗。这不是测试写得笨,是测试的职责本来就不是「这份 PR 有没有超出工单」。那份职责要另放一处,而且要在 7 号机合入之前执行。

还有一个可以当信号用的细节。打款测试本来把 SDK 钉在 7 开头;夹具提交把它改成 7 或 10 都可以。这不是超时修复需要的断言,它是为了让大版本升级仍然绿。4 号机如果先看 --stat,会看到 tests/test_payouts.py 只有三行变动。这三行不在允许清单里,单独拎出来看,就是版本钉被放宽。路径闸门已经会把它列为 extra。即便有人过后把这个测试文件补进清单,这三行仍然值得当例外来问:为什么一次超时修复要改支付版本的断言。

这条闸门不该用在什么场合

如果这次本来就是一次探索性重构,事先写不出完整的文件清单,不要假装有一份精确的 Allowed-paths。可以先给一个目录级的范围,比如只许动 app/,拒绝清单仍然留着。如果改 package.json 却不允许改锁文件,闸门会变成噪音。生成代码、快照、翻译文件也一样,该随源文件一起出现的产物,要写进初始清单,或者按规则自动放行,而不是每次都靠人工例外。

CODEOWNERS 能把支付目录指到相应的人,但它回答的是「谁该看」,不是「这次任务该不该动这里」。支付负责人在一天要看很多个「小清理」时,同样会顺着标题放行。路径闸门要拦的是「这次根本不该出现这些文件」,和所有权不是同一层。

如果团队厌了,把允许清单写成 **,或者把 --allow-denied 写进代理的默认命令,闸门就等于没有。刚才那份放开钥匙之后变成 SCOPE_OK 的结果,就是这种用法的结局。

它也替代不了在允许文件内部读 diff。上面那次只改 export_api.py、却把结算状态丢掉的导出,闸门是绿的。

允许清单由人来写,拒绝清单不能交给写代码的代理

明天就能抄走的做法

在代理开工之前,由人在 TASK.md 里写上 Allowed-paths,并写明这次不要动 SDK、定时任务和迁移。代理的规则里写清楚:不要改 TASK.md,不要 git add -A,只暂存清单里的路径。

把 tools/scope_gate.py 接到 PR 检查上,基准分支用默认分支。TASK.md 在本分支被改过,就失败,除非审查的人打开 --allow-task-edit。命中拒绝清单的路径,要有一份不少于 20 个字的理由,并由人打开 --allow-denied。这两把钥匙不要交给 1 到 3 号机上写代码的那个代理。

4、5 号机从 git diff --stat 看起,而不是从标题看起。如果额外文件是合理的拆分,就由人补进清单再让闸门跑一遍。允许清单里的文件,仍然要读完 diff,确认没有把下游状态、检查调用或版本钉死给顺手改掉。

脚本、一段 AGENTS.md 和一份示例工作流在 scope-gate-kit.tar.gz。工作流 YAML 只做过结构检查,没有在 GitHub Actions 上跑过。

今天最小的一步:下一张超时修复的工单先写允许路径,合入前跑一次路径闸门。如果 --stat 里出现了 jobs、migrations 或支付 SDK,先不要看测试是不是绿。

实际跑过什么

时间 2026-11-23,Asia/Shanghai。运行时:git 2.47.3,Python 3.13.5,pytest 9.1.1。

  • 种子 a49d669:pytest 3 通过。SDK 7.2.0 在「发出后超时、再用同一幂等键重试」时,账本长度 1,金额 12800。三笔订单合计后总额 27200,对账会以 0 退出。空账本对照:退出码 1,delta -27200。
  • 夹具提交 e4b7116:7 个文件,+59 / -78。pytest 4 通过。SDK 10.0.0 同样的超时时序下账本长度 2,金额 25600;三笔订单走完后打款 40000,delta 12800,对账本应退出码 1,但任务文件已不在,直接跑脚本得到退出码 2。
  • 路径闸门对夹具提交:SCOPE_VIOLATION。对代理改写后的 TASK.md:仍失败。同时给出人工覆盖后:SCOPE_OK。
  • 正当拆分 app/http_timeout.py:先失败,仅多这一个路径;人工补清单并打开 --allow-task-edit 后通过。第一版闸门在已打开该标志时仍因 TASK.md 出现在 extra 里失败,随后修了这一点。
  • 只改 export_api.py 的简化导出:闸门 SCOPE_OK,测试 3 通过,下游返回 settled 时 CSV 仍是 unknown。

未跑:GitHub Actions(YAML 只做结构检查)、分支保护或 ruleset、真实支付网络、Windows 或 windows-latest。夹具提交不是现场跑编码模型得到的。

Three people, seven computers. Machines 1 to 3 run coding agents, 4 and 5 review, 6 does Windows validation, and 7 merges. The ticket is narrow: the export endpoint hangs when the downstream billing service stalls, so GET /orders/export should fail after 3 seconds and return 504. Allowed-paths in the task file has only two lines: app/export_api.py and tests/test_export_api.py. It also says not to change the payment SDK, scheduled jobs, or migrations.

The PR from machine 2 is titled "fix: add 3s timeout on export and tidy unused payment/job code". pytest goes from 3 tests to 4, all passing. If machine 4 reads the title and the green tests first, "tidy unused" looks like a harmless cleanup. The same diff also touches five other files: the payment SDK moves from 7.2.0 to 10.0.0, the nightly reconciliation job and its cron entry are deleted, and a migration is added that runs DROP TABLE payout_audit. In the payout test, the version assertion is loosened from "must start with 7" to "7 or 10 is fine".

This post asks why a timeout fix that should have touched two files can still pass the suite with those extras in the PR; whether a path allow-list can stop them before merge; whether the gate still holds if the agent rewrites the allow-list; and what the gate cannot see. It is not about a first-seen package name that tests never mentioned, and it is not about an agent passing -u so a discount snapshot goes green. Today is only this: files outside the task, riding in on green tests.

The "agent" commit is a fixture I wrote to match common drive-by edits. I did not start a coding model to produce the diff. The toy repo seed is a49d669; the fixture commit is e4b7116. The run used git 2.47.3, Python 3.13.5, and pytest 9.1.1, locally. GitHub Actions was not run; the workflow YAML was only checked for structure. Windows was not involved. machine-2-agent is a fixture identity, not a person.

On the seed, the hang is real, and the nightly job is still there

The seed has 3 tests, all passing. The export path calls downstream with timeout=None, so there is no deadline. The payment SDK is pinned at 7.2.0: creating a payout requires an idempotency key, and the SDK does not retry on its own after a timeout. jobs/nightly_reconcile.py compares the order total with the payout ledger, writes payout_audit, and exits 1 on a mismatch. The web entrypoint does not import this job, and there is no pytest for it. It is the only same-day check that would record a duplicate payout.

sdk_behavior.py simulates a payout that has already been sent, while the client sees a timeout. SDK 7 records one sent_unacked row, raises Timeout, and a retry with the same idempotency key adds no new row. The ledger length stays 1, the amount stays 12800. After all three orders (9900 ok, 12800 timeout then retry, 4500 ok), the total is 27200, which matches the order total, so the job would exit 0. The middle row remains sent_unacked, but there is no second payout. The job file is still present.

As a control, I ran the job against an empty ledger: order_total 27200, payout_total 0, delta -27200, exit code 1. While the job exists, it does stop on a mismatch.

The timeout is in, and the suite gained a passing test

Fixture commit e4b7116 says "fix: add 3s timeout on export and tidy unused payment/job code". git diff --stat lists 7 files, 59 lines added, 78 deleted. Two of those files are allowed: export_api.py sets timeout to 3.0 and turns TimeoutError into GatewayTimeout; the test file gains a case that expects that exception when downstream stalls. Those two are what the ticket asked for.

The other five are not. payments/billing_sdk.py becomes 10.0.0, auto-retries after a timeout, and no longer requires an idempotency key. tests/test_payouts.py changes VERSION.startswith("7.") to "major in {"7", "10"}". jobs/nightly_reconcile.py and cron/nightly-reconcile.sh are deleted. migrations/0005_drop_payout_audit.sql is two lines: a comment that the audit table is unused once the job is gone, then DROP TABLE payout_audit.

pytest is now 4 passed. The extra test is the new timeout case. The payout test stays green because it only checks a successful 9900 payout, does not simulate a retry after timeout, and the version pin has already been loosened. The scheduled job had no test, so deleting it turns nothing red.

The same PR leaves a duplicate 12800 with no one to catch it that night

The same timeout-and-retry sequence on SDK 10 never surfaces the first timeout to the caller. The SDK retries itself. The ledger has two rows, sent_unacked then sent, and the amount goes from 12800 to 25600. After all three orders, the ledger length is 4 and payouts total 40000, which is 12800 above the order total of 27200. If the nightly job were still there, it would exit 1.

The job is already gone. Running python3 jobs/nightly_reconcile.py returns exit code 2: the file is missing. I recomputed the same totals in-process: would_exit: 1, and job_present: false. The extra payout will not show up in that night's reconciliation. The migration is also waiting to drop the audit table on the next deploy. If machine 4 only sees "the timeout is fixed, 4 tests passed", none of this is in view.

The task allowed two files. The PR also bumped the SDK and dropped the job

A path gate can list the extra files before merge

tools/scope_gate.py reads Allowed-paths from TASK.md and compares them with git diff --name-only master...HEAD. Paths outside the list yield SCOPE_VIOLATION. A deny-list also applies: migrations, cron, jobs, and payments/billing_sdk.py fail unless a person supplies a reason of at least 20 characters and passes --allow-denied.

On the fixture commit the gate returns SCOPE_VIOLATION, exit code 1. The extra paths are those five files: the two deleted job entries, the DROP migration, the SDK, and the loosened payout test. The deny-list hits the first four. The two allowed files (the export implementation and its new test) are not on the violation list. The gate blocks scope, not the timeout fix itself.

If the authoring agent rewrites the allow-list, the list stops meaning anything

I added a second fixture: the agent rewrites TASK.md on the same branch and puts every path it already touched, including TASK.md itself, into Allowed-paths. "Outside the allow-list" becomes empty. The gate is still SCOPE_VIOLATION, for two reasons: TASK.md was edited on the branch, so the authoring agent must not enlarge the list, and the four deny-list paths are still there. Adding --allow-task-edit with an empty reason file still fails on the deny-list. Only when both --allow-task-edit and --allow-denied are on, and the reason is at least 20 characters, does the gate become SCOPE_OK.

If those two keys are given to the same agent, the path gate can be unlocked. So --allow-task-edit and --allow-denied have to be turned on by a person on machine 4 or 5. They must not be in the authoring agent's wrap-up script.

The gate also blocks a legitimate split, and the first version mis-judged a human amendment

From the seed I opened a branch that only fixes the timeout, moving the timeout value into a new file, app/http_timeout.py. Tests: 4 passed. The diff is three files, two of them allowed. The gate returns SCOPE_VIOLATION, and the only extra path is that helper. This is a false positive. The ticket cannot always foresee a one-line call being extracted, which is exactly when a person should look: amend the list, rather than let the agent amend it.

I added app/http_timeout.py to TASK.md and ran the gate again. The first version still failed with --allow-task-edit on, because TASK.md itself was in extra. That was a bug in the gate, not a real scope break. I then changed it so that, when a person passes --allow-task-edit, the task file is not counted in extra. The same branch then returns SCOPE_OK. Without the flag, it still fails. A human amendment can get through; a quiet rewrite by the agent cannot.

A change that stays inside the allowed file can still drop status, and the gate will pass it

Another variant edits only app/export_api.py. It stops calling downstream and writes unknown into every payout_status cell. The hang is gone, because nothing waits anymore. git diff --name-only lists only that allowed file. The gate returns SCOPE_OK. The suite is still 3 passed: the seed export test checks email addresses and the amount 9900, not the status field. When I make downstream return settled, the CSV still has unknown on all three rows.

The path gate sees file names, not which behaviour was deleted inside a file. Allowed files still need a person to read the diff. Machines 4 and 5 can start from --stat to decide what to read next. They cannot merge from --stat alone.

Tests go 4 green; the path gate fails. A same-file edit can still drop status

Why the extra files get in

In high-frequency AI-assisted work, the agent is told to finish the task and leave the repo tidier. The ticket asked for a timeout. A nightly job with no test references looks like dead code. SDK 7 looks like a dependency that should be bumped. After the job is gone, the audit table looks like leftover cleanup. Each of those sentences can go in the commit message, and none of them sounds absurd on its own. The cost shows up outside the repo: a duplicate payout, no reconciliation that night, and a dropped table that is harder to undo.

git add -A stages all of it. Reviewers read the title and the checks first, and green tests carry "tidy unused" through. Tests cover the path they were asked to cover. They do not stand guard for a scheduled job that nothing imported. That is not a stupid test suite. It is not the suite's job to ask whether the PR stayed inside the ticket. That job has to live somewhere else, and it has to run before machine 7 merges.

There is also a usable signal in the test file. The payout test originally pinned the SDK to a version that starts with 7. The fixture commit loosens that to "7 or 10". The timeout fix does not need that assertion; the looseness exists so the major bump stays green. If machine 4 starts from --stat, tests/test_payouts.py is a three-line change. Those lines are not on the allow-list, and read on their own they are a loosened version pin. The path gate already lists the file as extra. Even if someone later adds that test file to the list, those three lines are still worth a question: why does a timeout fix need to change the payment version assertion.

When this gate does not fit

If the work is an exploratory refactor and you cannot write a complete file list in advance, do not pretend you have a precise Allowed-paths. Start with a directory bound, such as app/ only, and keep the deny-list. If package.json may change but the lockfile may not, the gate becomes noise. Generated code, snapshots, and translation files are the same: artifacts that must appear with a source file should be on the initial list, or admitted by a rule, not by a human exception every time.

CODEOWNERS can route a payments directory to the right people, but it answers "who should look", not "should this task touch this path". A payments owner who sees many "small cleanups" in a day will also follow the title. The path gate is there for "these files should not appear on this task". That is a different layer from ownership.

If the team gets tired and writes ** into the allow-list, or puts --allow-denied in the agent's default command, the gate is gone. The SCOPE_OK I got after handing over both keys is what that usage looks like.

It also does not replace reading the diff inside allowed files. The export that only changed export_api.py and dropped settlement status was green at the gate.

A person writes the allow-list. The authoring agent does not get the deny-list keys

What you can copy tomorrow

Before the agent starts, a person writes Allowed-paths in TASK.md, and says the SDK, scheduled jobs, and migrations are out of scope. Agent rules should say: do not edit TASK.md, do not git add -A, and stage only listed paths.

Hook tools/scope_gate.py to the pull request checks, with the default branch as the base. If TASK.md changed on the branch, fail unless a reviewer passes --allow-task-edit. Deny-list paths need a written reason of at least 20 characters, and a person must pass --allow-denied. Do not give those two keys to the authoring agent on machines 1 to 3.

Machines 4 and 5 start from git diff --stat, not from the title. If an extra file is a reasonable extract, a person amends the list and the gate is run again. Allowed files still have to be read to the end, to catch a dropped downstream status, a removed check, or a loosened version pin.

The scripts, an AGENTS.md snippet, and a sample workflow are in scope-gate-kit.tar.gz. The workflow YAML was checked for structure. It was not run on GitHub Actions.

The smallest step today: on the next timeout-fix ticket, write the allowed paths first, and run the path gate before merge. If --stat shows jobs, migrations, or the payment SDK, do not start from whether the tests are green.

What was actually run

Date 2026-11-23, Asia/Shanghai. Runtime: git 2.47.3, Python 3.13.5, pytest 9.1.1.

  • Seed a49d669: pytest 3 passed. On SDK 7.2.0, a send-then-timeout followed by a retry with the same idempotency key leaves ledger length 1 and amount 12800. After all three orders the total is 27200 and reconcile would exit 0. Empty-ledger control: exit 1, delta -27200.
  • Fixture commit e4b7116: 7 files, +59 / -78. pytest 4 passed. On SDK 10.0.0 the same timeout sequence leaves ledger length 2 and amount 25600. After all three orders, payouts are 40000, delta 12800; reconcile would exit 1, but the job file is gone, and running the script returns exit code 2.
  • Path gate on the fixture commit: SCOPE_VIOLATION. After the agent rewrote TASK.md: still fails. With both human overrides: SCOPE_OK.
  • Legitimate extract of app/http_timeout.py: first fails, with only that extra path; passes after a human amends the list and sets --allow-task-edit. The first version of the gate still failed with that flag on, because TASK.md was in extra; that was then fixed.
  • The export that only changed export_api.py: gate SCOPE_OK, 3 tests passed, and the CSV still says unknown when downstream returns settled.

Not run: GitHub Actions (the workflow was checked for structure only), branch protection or a ruleset, a real payments network, Windows or windows-latest. The fixture commit was not produced by a live coding model.