docs(autofix): make bot PR comments bilingual with collapsed Chinese - #7137
Conversation
Files the workflow posts verbatim as PR comments (address-summary.md, no-action.md, e2e-report.md) must now end with a complete collapsed Chinese translation (<details><summary>中文说明</summary>…), mirroring the repository's PR-body convention, so the bot's review reports and E2E reports read natively for both audiences. failure.md/handoff.md stay English-only without a details block: handoff comments embed a byte-truncated excerpt, and a severed <details> tag would swallow the rest of the rendered comment. Contract test pins the rule (bilingual instruction present, the three files named, the truncation-safety exclusion stated). 51/51.
|
Thanks for the PR! Template looks good ✓ Problem: observed gap — the autofix bot's per-round review reports (e.g. PR #7113) are English-only while the repo convention requires bilingual PR bodies. Extending the same convention to bot-posted comments is a consistency fix with evidence from a real review round. Direction: aligned. The repo already requires bilingual PR bodies; applying the same rule to bot comments that are posted verbatim is a natural, zero-pipeline-cost extension. The Size: not applicable — no core paths touched. 23 production lines in a skill prompt doc + 16 test lines. Approach: scope is minimal and focused. One new Shared Rules entry with a clear example, three short pointers at the write sites, and a contract test that pins the rule. No scope creep. Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ 问题:已观测到的差距——autofix bot 的逐轮 review 报告(如 PR #7113)是纯英文,而仓库约定要求 PR 正文双语。把同一约定延伸到 bot 逐字发布的评论是一次一致性修补,有真实 review 轮次作为证据。 方向:对齐。仓库已要求双语 PR 正文;对 bot 逐字发布的评论应用同一规则是自然的、零管道成本的扩展。 规模:不适用——未触及核心路径。skill 提示文档 23 行生产代码 + 16 行测试。 方案:范围最小且聚焦。一条新的 Shared Rules 条目带有清晰示例,三处写入点的简短提示,以及一个钉住规则的契约测试。无范围蔓延。 进入代码审查 🔍 — Qwen Code · qwen3.7-max Reviewed at |
Code ReviewClean diff — the PR does exactly what it says and nothing more. The new Shared Rules entry is well-placed (between the "do not skip failing checks" and "never ask the user a question" rules) with a clear format example. The three write-site pointers ( One thing I verified: the The contract test asserts the three critical invariants: the TestingContract test: 51/51 pass ✅ (including the new bilingual test) Real-scenario testing: not applicable — this is a prompt-only change. The bilingual output behavior only manifests when the autofix agent runs autonomously; there's no interactive CLI path to exercise. The PR body acknowledges this ("prompt-only change; the behavior lands on the next agent run"). The contract test is the appropriate verification here. 中文说明代码审查干净的 diff——PR 精确地完成了所声明的事情,没有多余内容。 新增的 Shared Rules 条目位置合理(在"不跳过失败检查"与"不向用户提问"规则之间),带有清晰的格式示例。三处写入点提示(develop-issue 第 9 步的 验证了一点: 契约测试断言了三个关键不变量: 测试契约测试: 51/51 通过 ✅(含新增双语测试) 真实场景测试: 不适用——这是纯 prompt 改动。双语输出行为仅在 autofix agent 自主运行时体现,无可交互的 CLI 路径。PR 正文已说明("纯 prompt 改动;行为在下一次 agent 运行时落地")。契约测试是此处恰当的验证手段。 — Qwen Code · qwen3.7-max Reviewed at |
|
Confidence: 5/5 Reflection: this is a well-scoped, prompt-only change that extends an existing repo convention (bilingual PR bodies) to bot-posted comments. The diff is clean, the reasoning for the Verdict: Approve ✅ 中文说明信心度:5/5 反思:这是一个范围合理、纯 prompt 的改动,将仓库既有约定(双语 PR 正文)延伸到 bot 发布的评论。diff 干净, 结论:批准 ✅ — Qwen Code · qwen3.7-max Reviewed at |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
— qwen3.7-max via Qwen Code /review
What this PR does
Makes the autofix bot's PR comments bilingual. Every agent-written file that the workflow posts verbatim as a PR comment — the review-round report bodies (
address-summary.md,no-action.md) and the issue-phase E2E report (e2e-report.md) — must now be written in English and end with a complete collapsed Chinese translation (<details><summary>中文说明</summary>…</details>), mirroring the repository's existing PR-body convention.failure.mdandhandoff.mdare explicitly kept English-only without a details block. The contract test pins the rule.Why it's needed
The repository already requires every PR body to carry a full collapsed Chinese translation, but the bot's comment output — e.g. its per-round review reports like the one on PR #7113 — is English-only, so half the convention's audience reads machine reports in a foreign language while human-authored PR bodies are bilingual. Extending the same convention to bot comments closes that gap at zero workflow cost (it is an agent-output rule, not a pipeline change). The failure/handoff exclusion is deliberate: handoff comments embed a byte-truncated excerpt of those files (
head -c 1500), and a<details>block severed mid-tag would swallow the remainder of the rendered comment.Reviewer Test Plan
How to verify
.qwen/skills/autofix/SKILL.md: it names exactly the three verbatim-posted files, shows the details-block shape, requires a complete section-by-section translation, and states the truncation-safety exclusion forfailure.md/handoff.md. The three write sites (develop-issue step 9, the two address-review outcomes) carry short pointers to the rule.address-summary.md/no-action.mdarecat-ed intoreport.mdand posted viagh pr commentin the review phase;e2e-report.mdis posted viagh pr comment --body-filein the issue phase;failure.md/handoff.mdonly ever reach comments as truncated excerpts.npx vitest run scripts/tests/qwen-autofix-workflow.test.js— 51/51, including the new test asserting the bilingual instruction, the three file names, and the English-only exclusion.Behavioral expectation after merge: the next address round or issue-phase E2E report posts a comment whose English body ends with a collapsed 中文说明 section containing the full translation.
Evidence (Before & After)
Tested on
Environment (optional)
Contract test via vitest on a worktree checkout of main. Prompt-only change; the behavior lands on the next agent run.
Risk & Scope
Linked Issues
Follow-up to #6998/#7094; prompted by maintainer feedback on the report comment at PR #7113.
中文说明
本 PR 做了什么
让 autofix bot 的 PR 评论双语化。工作流逐字发布为 PR 评论的每个 agent 产物 —— review 轮次报告正文(
address-summary.md、no-action.md)与 issue 阶段的 E2E 报告(e2e-report.md)—— 现在必须以英文撰写,并以完整的折叠中文翻译结尾(<details><summary>中文说明</summary>…</details>),与仓库既有的 PR 正文约定一致。failure.md与handoff.md明确保持纯英文、不带 details 块。契约测试钉住该规则。为什么需要
仓库已要求每个 PR 正文携带完整折叠中文翻译,但 bot 的评论输出(例如 PR #7113 上的逐轮 review 报告)是纯英文 —— 该约定的一半受众要用外语读机器报告,而人写的 PR 正文却是双语。把同一约定延伸到 bot 评论零工作流成本地补齐了这个缺口(这是 agent 输出规则,不是管道改动)。failure/handoff 的排除是刻意的:交接评论嵌入这两个文件的字节截断摘录(
head -c 1500),<details>块若在标签中间被切断,会吞掉渲染后评论的剩余部分。评审验证方案
如何验证
.qwen/skills/autofix/SKILL.md新增的 Shared Rules 条目:精确点名三个逐字发布的文件、给出 details 块样式、要求逐段完整翻译、说明failure.md/handoff.md的截断安全排除。三处写入点(develop-issue 第 9 步、address-review 两个结局)带有指向该规则的简短提示。address-summary.md/no-action.md被cat进report.md后经gh pr comment发布;issue 阶段e2e-report.md经gh pr comment --body-file发布;failure.md/handoff.md只以截断摘录形式进入评论。npx vitest run scripts/tests/qwen-autofix-workflow.test.js—— 51/51,含新测试:断言双语指令存在、三个文件名被点名、纯英文排除条款在案。合并后的行为预期:下一次 address 轮次或 issue 阶段 E2E 报告发布的评论,英文正文之后以折叠的 中文说明 段收尾,内含完整翻译。
证据(前后对比)
测试情况
环境(可选)
在 main 的 worktree 检出上用 vitest 跑契约测试。纯 prompt 改动;行为在下一次 agent 运行时生效。
风险与范围
关联 Issue
#6998/#7094 的后续;由维护者对 PR #7113 报告评论的反馈触发。