-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat(review): disclose that Aone posts join the discussion gate only #9625
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 all commits
0eb0dbf
7a399f5
f903862
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 |
|---|---|---|
|
|
@@ -283,6 +283,18 @@ describe('submit posts an authorised Aone target through a1', () => { | |
| expect(stderrMock).toHaveBeenCalledWith( | ||
| expect.stringContaining('1 inline Critical(s) block the merge'), | ||
| ); | ||
| // The Q4 probe outcome (issue #9614) is disclosed in the same note: | ||
| // a1 cannot mark a comment as AI, so the posted Criticals join the | ||
| // discussion gate only — the repo's ai_comment gate never sees them. | ||
| // One contiguous fragment from the blocking clause to the end of the | ||
| // disclosure pins subject-to-predicate and clause-to-call — inverted | ||
| // gate attribution, split calls, and a disclosure moved onto the | ||
| // unconditional `Posted …` line each break it. | ||
| expect(stderrMock).toHaveBeenCalledWith( | ||
| expect.stringContaining( | ||
| "block the merge while their discussions stay unresolved. They are NOT marked as AI comments — `a1 repo mr comment create` cannot set the flag — so they join the generic discussion gate only; a repo's dedicated ai_comment merge gate does not track them", | ||
| ), | ||
| ); | ||
|
Comment on lines
+293
to
+297
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] These pins exercise only the attribution-ON shape — no test pins this note under an attribution-OFF post. The note's count source is deliberately the MARKED pre-post payload ( expect(stderrMock).toHaveBeenCalledWith(
expect.stringContaining('1 inline Critical(s) block the merge'),
);
expect(stderrMock).toHaveBeenCalledWith(
expect.stringContaining('ai_comment merge gate does not track them'),
);The suggested assertions pass the committed code (29/29) and fail the count-source mutant (1 failed) — probe-verified at the reviewed commit. 中文说明这些钉子只覆盖 attribution-ON 形态——没有任何测试在 attribution-OFF 发布下钉住该提示。提示的计数源刻意取自打标后的发布前载荷( — qwen3.8-max via Qwen Code /review (v0.21.15) |
||
| }); | ||
|
|
||
| it('an UNAUTHORISED Aone run takes the normal auth-refusal path first', () => { | ||
|
|
@@ -929,6 +941,16 @@ describe('submit posts an authorised Aone target through a1', () => { | |
| expect(req.comments).toHaveLength(1); | ||
| expect(req.comments[0].body).not.toContain('**[Critical]**'); | ||
| expect(req.comments[0].body).toContain('<!-- qwen-review critical -->'); | ||
| // The note counts off the MARKED pre-post payload, not the stripped | ||
| // bodies pinned above (severityOf is a leading-marker classifier and | ||
| // reads null on them): attribution-OFF still names the posted | ||
| // Critical and the gate disclosure. | ||
| expect(stderrMock).toHaveBeenCalledWith( | ||
| expect.stringContaining('1 inline Critical(s) block the merge'), | ||
| ); | ||
| expect(stderrMock).toHaveBeenCalledWith( | ||
| expect.stringContaining('ai_comment merge gate does not track them'), | ||
| ); | ||
| }); | ||
|
|
||
| it('the Aone success JSON carries NO url key when a1 answered without detailUrl', () => { | ||
|
|
@@ -965,5 +987,10 @@ describe('submit posts an authorised Aone target through a1', () => { | |
| expect(stderrMock).toHaveBeenCalledWith( | ||
| expect.stringContaining('NO inline Critical discussions'), | ||
| ); | ||
| // The gate disclosure fires only when inline Criticals actually | ||
| // posted — the zero-Critical shape discloses no gate at all. | ||
| expect(stderrMock).not.toHaveBeenCalledWith( | ||
| expect.stringContaining('does not track them'), | ||
| ); | ||
| }); | ||
| }); | ||
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 two assertions pin the disclosure only as independent substring-existence checks over
stderrMock's whole call history — each passes if ANY recorded stderr call matches, and neither binds subject to predicate or clause to call — so the note this PR exists to pin (documented as provisional: "Until a1 ships a flag, this note is the disclosure",submit.ts:1010-1011) stays unpinned along three probe-verified axes:writeStderrLinecalls also passes.a1 repo mr comment createcannot set the flag") are pinned by no assertion — swapping or trimming either stays green, even though the comment above these assertions claims to pin "The Q4 probe outcome", which lives in the unpinned causal clause.Note:line (the singlewriteStderrLineatsubmit.ts:1015), and no test pins when the note fires — moving the disclosure sentence into the unconditionalPosted …line (submit.ts:993) keeps every assertion green (the contiguous-fragment fix round 1 suggested in this thread survives it too) while an APPROVE post also prints a disclosure about nonexistent blocking Criticals, and the SKILL.md relay (SKILL.md:109) keys on aNote:line that lost the gate disclosure.Each mutant was run at the reviewed commit: the inverted wording, split calls, positive-clause swap and causal-clause trim all pass 29/29, and the moved-disclosure mutant additionally passes a probe assertion printing the disclosure on APPROVE. Pin one contiguous fragment from the blocking clause to the end of the disclosure — content and call-binding in one check — plus an emission-condition negative:
and in
a REQUEST_CHANGES with zero inline Criticals says nothing mechanically blocks, add:Both halves of the spanning fragment were separately verified contiguous in the real emitted note; the combined pin passes the committed code (29/29) and fails every mutant above (probe: 1–2 tests failed per mutant).
中文说明
这两条断言仅以独立的子串存在性检查钉住披露——每条都对
stderrMock的全部调用历史匹配,任一 stderr 调用命中即通过;两者既不把主语与谓词绑定,也不把子句与调用绑定。因此本 PR 要钉住的这条提示(源码注释已注明其为过渡方案:"Until a1 ships a flag, this note is the disclosure",submit.ts:1010-1011)在三个经探测验证的轴向上仍未被钉住:writeStderrLine调用同样通过。a1 repo mr comment createcannot set the flag")没有任何断言钉住——互换或删掉任一子句测试依旧全绿,尽管上方注释声称这里钉住的是 "The Q4 probe outcome"(该结论恰在未钉住的因果子句中)。Note:行(submit.ts:1015处唯一的writeStderrLine)出自同一次调用,也没有测试钉住它的触发条件——把披露句移入无条件的Posted …行(submit.ts:993)后所有断言依旧全绿(本线程 round 1 建议的连续片段修法同样拦不住),APPROVE 发布也会打印一条关于不存在的阻塞 Critical 的披露,而 SKILL.md 的转发(SKILL.md:109)会引用一条已失去门禁披露的Note:行。上述每个变异体都在受审提交上实际运行过:取反表述、拆分调用、正向子句互换、因果子句裁剪均 29/29 全绿;移动披露的变异体还会让一条 APPROVE 打印披露的探测断言通过。建议用一个从阻塞子句延伸到披露末尾的连续片段——一次检查同时钉住内容与调用绑定——再加一个触发条件负向断言(代码块见英文部分)。
— qwen3.8-max via Qwen Code /review (v0.21.15)