-
Notifications
You must be signed in to change notification settings - Fork 3k
feat(review): add a --topology minimal single-pass A/B arm #9919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
395a1fc
0817a7c
c793f2d
cba3a29
dafe7a1
dc5a5cf
2fa7756
7e7f14a
11cf00c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -354,12 +354,12 @@ export function reviewWriteAuthorization(req: WriteAuthorizationRequest): { | |||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| const verdict = parseReviewArgs(raw, { comment: req.defaultComment }); | ||||||||||||||||||
| if (!verdict.comment.effective) { | ||||||||||||||||||
| // The refusal must name the REAL blocker. When comment was requested — | ||||||||||||||||||
| // by the flag or the standing `review.comment` setting — but the target | ||||||||||||||||||
| // is not a PR, effective is false because the arguments name no pull | ||||||||||||||||||
| // request to bind the write to; blaming a missing `--comment` flag the | ||||||||||||||||||
| // operator never typed (and implying typing one would fix it) misdirects. | ||||||||||||||||||
| if (!verdict.comment.effective && verdict.topology !== 'minimal') { | ||||||||||||||||||
| // When comment was requested — by the flag or the standing | ||||||||||||||||||
| // `review.comment` setting — but the target is not a PR, effective is | ||||||||||||||||||
| // false because the arguments name no pull request to bind the write to; | ||||||||||||||||||
| // blaming a missing `--comment` flag the operator never typed (and | ||||||||||||||||||
| // implying typing one would fix it) misdirects. | ||||||||||||||||||
| const commentRequested = | ||||||||||||||||||
| verdict.comment.requested || req.defaultComment === true; | ||||||||||||||||||
| return { | ||||||||||||||||||
|
|
@@ -371,6 +371,12 @@ export function reviewWriteAuthorization(req: WriteAuthorizationRequest): { | |||||||||||||||||
| `(${JSON.stringify(raw.trim())})`, | ||||||||||||||||||
| }; | ||||||||||||||||||
| } | ||||||||||||||||||
| // A minimal record falls through to the binding checks below: the refusal | ||||||||||||||||||
| // must name the REAL blocker, and the topology is it only when it is the | ||||||||||||||||||
| // SOLE one — "re-run the review without it" cannot lift a refusal that a | ||||||||||||||||||
| // non-PR target, or another PR's number, repo, or host, still holds, and | ||||||||||||||||||
| // leading with the topology sends the operator to re-run into the same | ||||||||||||||||||
| // refusal with the binding blocker still unnamed. | ||||||||||||||||||
|
|
||||||||||||||||||
| const t = verdict.target; | ||||||||||||||||||
| const authorisedPr = | ||||||||||||||||||
|
|
@@ -430,6 +436,19 @@ export function reviewWriteAuthorization(req: WriteAuthorizationRequest): { | |||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| if (!verdict.comment.effective) { | ||||||||||||||||||
| // Minimal, and bound to this write on every axis above — the parser | ||||||||||||||||||
| // forced effective false, so the topology is now the sole blocker, and | ||||||||||||||||||
| // its remedy lifts the refusal. | ||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] This comment states two invariants unconditionally — "the topology is now the sole blocker, and its remedy lifts the refusal" — that are false for the no-comment-source sub-case this same block serves. The final A maintainer of this refusal-wording-critical gate trusts this comment six months later: they "simplify" the
Suggested change
中文说明该注释无条件地断言了两个不变量——「topology 现在是唯一阻塞,且其补救能解除拒绝」——但对同一代码块所服务的「无 comment 来源」子情形并不成立。末尾的 六个月后,维护这个「拒绝措辞攸关」门控的维护者会信任这段注释:他们要么把 (建议修复:把注释限定为实际不变量,见上方代码块。) — qwen3.8-max via Qwen Code /review (v0.22.0) |
||||||||||||||||||
| return { | ||||||||||||||||||
| ok: false, | ||||||||||||||||||
| why: | ||||||||||||||||||
| `the review arguments (${JSON.stringify(raw.trim())}) ran with ` + | ||||||||||||||||||
| '`--topology minimal`, which is terminal-only and cannot authorise ' + | ||||||||||||||||||
| 'posting — re-run the review without it', | ||||||||||||||||||
|
Comment on lines
+474
to
+475
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] This new topology refusal is a third refusal class, but its only shape-sensitive consumer — the advice dispatch at Aggravating: that arm's other remedy — " Fix in 中文说明这个新的 topology 拒绝是第三个拒绝类别,但它唯一的「按措辞分流」的消费者—— 更糟的是:该分支的另一个补救——「用户已要求后用 请在 — qwen3.8-max via Qwen Code /review (v0.22.0) |
||||||||||||||||||
| }; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| return { | ||||||||||||||||||
| ok: true, | ||||||||||||||||||
| why: verdict.comment.requested | ||||||||||||||||||
|
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Suggestion] The reorder makes the gate shape-sensitive — A/B probe verified: at the round-3 anchor
cba3a2966cthe same minimal record answered the topology refusal under every caller shape; at this commit it flips to the host/repo-binding refusals on the second caller's shape — yet no test exercises a minimal record throughpublish-assets' call shape (repooptional,hostenv-resolved includingGH_HOST,absentHostFollowsRecordingomitted so an absent host reads as a github.com claim):topologyappears zero times inpublish-assets.test.ts, whose only refusal-wording gate cases are non-minimal.The gate's own header says "one function, two callers, one lesson-ledger", but this round's lesson is test-pinned for one caller only: a future refusal-ordering refactor — the exact edit class of this round; round 3's ordering was itself wrong and had to be reordered — regresses minimal handling on the publish-assets shape (wrong blocker named, or the evidence-image advice wrapper misapplied) while every suite stays green.
Mirror the new submit tests in
publish-assets.test.ts, matching the existingrun(...)/writeFileSync(argsFile, …)shape:plus a wrong-host record without
--reviewed-repo, expecting the host-binding refusal and not the topology wording.中文说明
重排使门控变得「形状敏感」——A/B 探针已验证:在第 3 轮锚点
cba3a2966c上,同一条 minimal 记录在所有调用者形状下都回答 topology 拒绝;而在本提交上,在第二调用者的形状下翻转为 host/仓库绑定拒绝——然而没有任何测试让 minimal 记录走一遍publish-assets的调用形状(repo可选、host经环境解析含GH_HOST、省略absentHostFollowsRecording因而缺省 host 读作 github.com 主张):publish-assets.test.ts中topology出现零次,其仅有的拒绝措辞门控用例均为非 minimal。门控自己的头部注释写着「一个函数,两个调用者,一本教训台账」,但本轮的教训只为其中一个调用者钉了测试:未来一次拒绝排序重构——正是本轮的编辑类别;第 3 轮的排序本身就是错的、不得不重排——会在 publish-assets 形状上使 minimal 处理回归(点名错误的阻塞,或误用证据图片建议包装),而所有套件保持绿色。
请在
publish-assets.test.ts中仿照新增的 submit 测试,按既有run(...)/writeFileSync(argsFile, …)形态补上(见上方代码块),另加一个不带--reviewed-repo的错误 host 记录用例,断言得到 host 绑定拒绝而非 topology 文案。— qwen3.8-max via Qwen Code /review (v0.22.0)