Repository navigation
docs(managed-agent): name the pre-dispatch commit-spy assertion - #14756
Conversation
|
Thanks for the PR! Template looks good ✓ Problem: observed, and I confirmed it against the code rather than taking the description's word for it. On Direction: aligned. This is what the neighbouring "Mutation witnesses" section already does for the MySQL-lane cells, extended to the unit instrument, and AGENTS.md requires design docs to stay complete and synchronized in both languages. CHANGELOG: no direct reference — Size: not applicable. No core paths; 2 files, +10/-0, all prose (production 0 / test 0 / generated-schema 0). Approach: minimal, and correctly placed. Adding a paragraph to the existing section beats folding it into the mutation-witnesses list — that list is scoped to the integration cells, while this is the unit instrument. Nothing to cut, no drive-by edits, both languages in the same change as the design-doc rules require. Risk: no elevated risk signals (Stage 1e matched nothing). Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ 问题:是实际存在的,我对照代码确认过,没有只采信 PR 描述。 方向:对齐。这正是相邻「变异见证」一节为 MySQL lane 用例所做的事,现在延伸到单测仪器;且 AGENTS.md 要求设计文档在两种语言下都完整同步。CHANGELOG:无直接相关记录——仅涉及 规模:不适用。未触及核心路径;2 个文件,+10/-0,全为文字(生产 0 / 测试 0 / 生成-schema 0)。 方案:改动最小,位置也正确。在现有小节中新增一段,比并入「变异见证」列表更合适——那份列表针对集成用例,而这里是单测仪器。没有可砍的部分,没有夹带无关改动,且按设计文档规则在同一次变更中同时更新两种语言。 风险:无升级风险信号(Stage 1e 未命中任何路径)。 进入代码审查 🔍 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
Code reviewNo blockers, and no AGENTS.md violations. The interesting part of a docs PR is whether the prose is actually true, so I checked both claims against the code instead of against the description. The spy claim matches the merged test exactly. In The mutation claim holds structurally. In Design-doc conventions. Checked against the Nothing to cut. Adding a paragraph to the existing section rather than a bullet under "Mutation witnesses" is the right call — that list is scoped to the MySQL-lane integration cells, and this is the unit instrument. Test evidenceThis is an unattended CI run, so no PR-derived code was built, run, or mutated; the evidence below is the PR's own CI, read through the API for the reviewed commit. Everything that ran is green, and the skips are the expected ones for a Final CI results for
One row per check name (latest run); skipped checks omitted; failures sort first. / 每个检查名一行(取最新一次运行),省略 skipped,失败项排在最前。 Real-scenario testing: N/A — documentation only, nothing user-visible to drive. Sandboxed lane: skipped, explicitly. The diff is prose with an unchanged public surface, so there is no behavioural delta for 中文说明代码审查无阻塞问题,也无 AGENTS.md 违规。文档型 PR 的关键在于文字是否属实,所以我对照代码而非对照 PR 描述核验了两处论断。 探针论断与已合并的单测完全一致。 变异论断在结构上成立。 设计文档规范。 对照 没有可删减之处。相比在「变异见证」下加一条列表项,在现有小节中新增一段更合适——那份列表针对 MySQL lane 的集成用例,而这里是单测仪器。 测试证据本次为无人值守 CI 运行,因此未构建、未执行、也未变异任何 PR 派生代码;以下证据来自 PR 自身的 CI,通过 API 针对被审查的 commit 读取。所有实际运行的检查均为绿,跳过项也符合仅改动 (CI 结果见上方表格。) 真实场景测试:N/A——仅文档改动,无可驱动的用户可见行为。 沙箱验证 lane:明确跳过。 本次 diff 为文字,公开接口未变,因此没有可供 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
|
Confidence: 5/5 — clean at every stage; I verified the prose against the code rather than against the PR description, and it holds. My independent proposal before opening the diff was: the "Pre-dispatch cancel (unit instrument)" section names assertions that don't discriminate, so add a sentence identifying the spy that does, and mirror it in the Chinese version. That is exactly what this PR does, at that length, in that place. No simpler path was missed, and there is nothing in the diff that isn't needed for that goal — +10/-0, no drive-by edits, no reformatting of the surrounding text. The part I'd normally be suspicious of is a docs PR asserting something about test strength, because those claims are cheap to write and rarely checked. This one survives checking. Six months from now this is the paragraph that stops someone from deleting that checkpoint, watching the suite stay green, and concluding the arm was never pinned. That's a real maintenance saving for ten lines of prose, and it matches the mutation-witness discipline the rest of the document already keeps. Both languages moved together with identifiers preserved verbatim, which is what the design-doc rules ask for. One thing to be explicit about rather than bury: the mutant itself was never executed. This was an unattended CI run, so no PR-derived code was built or run, and in any case the mutation described here is a change to already-merged production code rather than to this diff — no sandboxed lane triggered on this head would run it. I settled it by reading the three checkpoints and the shared Approving. ✅ 中文说明Confidence: 5/5 — 各阶段均无问题;我是对照代码而非对照 PR 描述核验这段文字的,结论成立。 在看 diff 之前,我的独立方案是:「派发前取消(单测仪器)」一节所列的断言不具备区分度,因此应补一句点明真正承重的探针,并在中文版同步。这正是本 PR 所做的——篇幅相当、位置相同。没有遗漏更简的路径,diff 中也没有任何与该目标无关的内容:+10/-0,无夹带改动,未重排周围文字。 我通常会警惕的一点,是文档型 PR 对测试强度作出论断——这类话写起来很廉价,也很少被核验。而这一次经得起核验。 半年之后,正是这一段能阻止某人删掉那个检查点、看着测试套件仍为绿、进而得出「该分支从未被钉住」的结论。用十行文字换来这个实际的维护收益是划算的,也与文档其余部分一贯保持的变异见证纪律相符。两种语言同步更新且标识符逐字保留,这正是设计文档规则所要求的。 有一点要明确说出来而不是含糊带过:变异体本身并未被执行。本次为无人值守 CI 运行,因此未构建、未运行任何 PR 派生代码;而且此处描述的变异是对已合并生产代码的改动,而非对本 diff 的改动——在此 head 上触发的任何沙箱 lane 都不会执行它。我通过阅读三处检查点与共享的 已批准。✅ — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
qwen-code-review-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
yiliang114
left a comment
There was a problem hiding this comment.
LGTM. I checked the new paragraph against the code at e2dc40b0 instead of taking the description's word for it, and the mechanism it describes is the real one.
packages/cli/src/serve/hosted-hook-session.tshas exactly threecancelBeforeDispatch()call sites insideperform: pre-acquisition (1209), post-acquisition (1219), and one after thedispatch_startedcommit (1244). So "a third cancel checkpoint after thedispatch_startedcommit" is accurate, not an approximation.- Deleting the post-acquisition check still lands on that third checkpoint, which commits
cancelled/not_started_provenand returns before any dispatch. That is why the final-record assertion and the zero-hook-executecount stay green under the mutant, exactly as the paragraph claims. The only thing that goes red isexpect(dispatched).toEqual([])in the FG13d cell (test line 1205), fed by thecommitExtensionRecordspy filtered tohookId !== '__plan__' && run.execution === 'dispatch_started'. - The EN and
.zh-CNparagraphs carry the same mechanism and the same checkpoint count — no twin drift, which is the failure mode I usually find in these design-doc pairs.
Scope is cohesive (+10/-0 across the two design docs, one commit), and Lint & Static is green at this head. Nothing blocking.
|
Released in v0.26.0. |
What this PR does
Adds the missing sentence to the FG13d design docs (English and Chinese) naming the assertion that actually pins the pre-dispatch cancel arm: the
commitExtensionRecordspy on the child record'sdispatch_startedcommit.Why it's needed
#14735 added that test. Its design section described the cell as asserting
cancelled/not_started_provenwith zerohook-executerequests, which is what the test does — but those assertions do not discriminate. A third cancel checkpoint after thedispatch_startedcommit catches the same condition, so removing the post-acquisition check leaves the final record and the zero-hook-executecount green. Only the spy sees the commit that should not have happened. A future maintainer reading the doc, running the obvious mutant, and seeing green would wrongly conclude the arm is unpinned.Reviewer Test Plan
How to verify
Read the "Pre-dispatch cancel (unit instrument)" section in both language versions; they now carry the same sentence. The claim matches the merged test: the spy records
dispatch_startedonly for records whosehookIdis not__plan__, and the cell asserts that list is empty.Evidence (Before & After)
N/A — documentation only.
Tested on
Risk & Scope
Linked Issues
Follow-up to #14735 and part of #14449.