ci(autofix): add cross-package contract verification - #7642
Conversation
|
Thanks for the PR! Template looks good ✓ — all required sections present, bilingual body complete. Problem: Real and independently verified, not theoretical. Full CI runs Direction: Aligned. This is phase 1 of #7638 and it strictly tightens the autofix safety boundary — it rejects candidates that would fail full CI rather than letting them through. It doesn't touch auth/sandbox/model/telemetry/release/public contract. CHANGELOG: no direct reference, but the autofix/CI verification area is clearly in scope for a Size: Not a core-path change ( Approach: Scope feels right and matches the issue's phase 1 exactly. Good reuse — it reuses the existing Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ —— 所有必填段落齐全,双语正文完整。 问题: 真实存在,且我已独立核实,并非理论性问题。完整 CI 会执行 方向: 对齐。这是 #7638 的第一阶段,且严格来说收紧了 autofix 安全边界——它会拒绝将在完整 CI 失败的候选,而不是放行。不触及 auth/sandbox/model/telemetry/release/public contract。CHANGELOG:无直接引用,但 autofix/CI 验证领域显然属于 规模: 非核心路径变更(仅 方案: 范围合理,与 issue 第一阶段完全吻合。复用良好——复用现有 进入代码审查 🔍 — Qwen Code · qwen3.8-max-preview Reviewed at |
Code reviewMy independent take before reading the diff: close the i18n gap by running No critical blockers and no convention violations. Notes from the read:
Real-scenario testingChecked out the reviewed commit 1. Workflow regression suite ( 2. New gate, non-contract path, real 3. New gate, contract path 4. Failure path (stub The gate runs the real i18n check on every candidate, additionally runs the Web Shell drift test exactly when the tool-name contract changes, and rejects with an explicit 中文说明代码审查读 diff 前我的独立方案:在两条 autofix 验证路径中运行 无关键阻塞项,无规范违规。阅读要点:
真实场景测试将受审 commit
gate 对每个候选都运行真实 i18n 检查,仅在 tool-name contract 变化时额外运行 Web Shell drift 测试,失败时以明确的 — Qwen Code · qwen3.8-max-preview Reviewed at |
|
Confidence: 5/5 — clean across every stage; the gap is real and independently verified, the fix is minimal and safe, and I confirmed it works end-to-end. Stepping back: this is exactly the kind of PR the gate should wave through. I verified both gaps against the code rather than taking the description at face value — My independent proposal matched the PR; I didn't find a simpler path it missed. The implementation is a 24-line gate that reuses the existing The risk profile is asymmetric in the safe direction: this only ever makes the autofix gate stricter, so it can't let a broken commit through — the worst case is a false-positive rejection, which is visible and reversible. After running it for real (102/102 suite, both happy paths with actual npm, and a forced failure writing No reservations to name. Shipping it. ✅ 中文说明置信度:5/5 —— 每个阶段都干净;gap 真实且已独立核实,修复最小且安全,并已端到端确认可用。 退一步看:这正是 gate 应当放行的 PR。我没有照单全收描述,而是对照代码核实了两个 gap—— 我的独立方案与 PR 一致;没找到它遗漏的更简路径。实现是一个 24 行的 gate,复用现有 风险偏向安全方向:它只会让 autofix gate 更严格,因此不会放行损坏的 commit——最坏情况是误拒,可见且可逆。真实运行后(102/102 套件、用真实 npm 跑通两条 happy path、以及强制失败写入 没有需要指出的保留意见。发布。✅ — Qwen Code · qwen3.8-max-preview Reviewed at |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
No issues found. LGTM! ✅
— qwen3.7-max via Qwen Code /review
What this PR does
Adds a trusted cross-package contract gate to both autofix verification paths. Every candidate now runs the repository i18n check before it can be published, and candidates that change the canonical tool-name contract also run the Web Shell tool-display drift test.
The verifier is staged from the trusted base checkout before the candidate branch is selected, matching the existing security boundary for verification helpers. Failures produce an explicit failed outcome, including on the review no-op path.
Why it's needed
The existing affected-workspace tests only exercise the workspace that owns a changed file. A core tool-name change therefore does not select the independent Web Shell workspace, so a stale display-name mapping can pass takeover verification and fail later in full CI. The autofix gate also omitted the i18n check that full CI already treats as required.
Reviewer Test Plan
How to verify
outcome=failed.Evidence (Before & After)
N/A — workflow-only change with behavioral regression coverage.
Tested on
Environment (optional)
Local Node.js 22 workspace. Verified with the focused workflow suite (102/102), the real i18n command, the targeted Web Shell drift test (2/2), full build, typecheck, ESLint, and targeted Prettier check.
Risk & Scope
Linked Issues
Refs #7638
中文说明
本 PR 做了什么
为两条 autofix 验证路径增加 trusted cross-package contract gate。现在每个候选修改在发布前都会执行仓库 i18n 检查;当候选修改 canonical tool-name contract 时,还会执行 Web Shell 的 tool-display drift 测试。
验证脚本会在切换到候选分支前从 trusted base checkout 暂存,与现有验证 helper 的安全边界一致。失败会产生明确的 failed outcome,包括 review no-op 路径。
为什么需要
现有 affected-workspace 测试只会执行 changed file 所属 workspace 的测试。因此 core tool-name 变化不会选中独立的 Web Shell workspace,过期的 display-name mapping 可能通过 takeover 验证,之后才在完整 CI 失败。autofix gate 也遗漏了完整 CI 已要求的 i18n 检查。
Reviewer Test Plan
如何验证
outcome=failed。证据(Before & After)
不适用——这是仅修改 workflow 的变更,并有行为回归测试覆盖。
测试平台
环境(可选)
本地 Node.js 22 workspace。已验证 focused workflow suite(102/102)、真实 i18n 命令、定向 Web Shell drift 测试(2/2)、完整 build、typecheck、ESLint 和定向 Prettier 检查。
风险与范围
关联 Issue
Refs #7638