refactor(core): break config client runtime cycle - #9959
Conversation
|
✅ Qwen Triage finished — CI landed green on ✅ Qwen Triage 已完成 —— |
|
Thanks for the PR! Template looks good ✓ Problem: real, and statically verified. Direction: aligned — internal dependency hygiene with zero API change. The public Size: core path ( Approach: this is the minimal possible fix — import the enum from its leaf definition ( Risk: no elevated risk signals — none of the changed paths match the revert-correlated high-risk set. Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ 问题:真实存在,且已静态验证。 方向:对齐——纯内部依赖治理,零 API 变化。 规模:触及核心路径( 方案:这是最小修复——从叶子定义导入枚举( 风险:无升级风险信号——改动路径均不匹配高回滚相关路径集合。 进入代码审查 🔍 — Qwen Code · qwen3.7-max Reviewed at |
Code reviewCompared against my independent baseline: the minimal way to break the The checks that matter for a change like this:
No blockers, no convention violations. TestingEvidence source: the PR's own CI on the reviewed commit, read through the API — triage does not run PR code. At review time Final CI results for
One row per check name (latest run); skipped checks omitted; failures sort first. / 每个检查名一行(取最新一次运行),省略 skipped,失败项排在最前。 Nothing user-visible to drive in a terminal — this is an import-source change with no behavioral surface. 中文说明代码审查与独立基线比对:打破 此类改动的关键核查点:
无阻塞项,无约定违规。 测试证据来源:被审提交上 PR 自身的 CI,通过 API 读取——triage 不运行 PR 代码。 审查时点 无用户可见行为可在终端驱动——这只是导入来源变更,没有行为面。 — Qwen Code · qwen3.7-max Reviewed at |
|
Confidence: 5/5 — verified cycle, minimal fix, identity-preserving, zero API change; nothing left to doubt. Stepping back: this is exactly the shape of change the gate should wave through. The problem was checked first, not assumed — the cycle is statically observable ( The risk that matters for this kind of change is enum identity, and it's covered: the facade re-exports the same object from the leaf, so every comparison and switch in Approval is deferred only because the PR's own CI has not settled on the reviewed commit yet — the unit suite is still running at review time. Approval deferred until CI lands green on 中文说明置信度:5/5 —— 循环已验证、修复最小化、枚举身份保持不变、零 API 变化;没有遗留疑点。 退一步看:这正是门禁应当放行的改动形态。问题是先核实过的,不是假设的——循环在静态层面可观察( 这类改动真正的风险是枚举身份,已经覆盖:facade 从叶子模块原样 re-export 同一对象, 唯一推迟批准的原因是 PR 自身 CI 在被审提交上尚未落定——审查时单测仍在运行。CI 在该提交上全绿后自动批准。 — Qwen Code · qwen3.7-max Reviewed at |
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.
LGTM, looks ready to ship — CI landed green after the review. ✅
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Partially reviewed — gaps disclosed.
Not reviewed: build-and-test — Integration Tests (CLI, No Sandbox) was skipped in CI and its suite did not run locally.
Not reviewed: reverse audit — stopped before round 1 by the review time budget.
中文说明
仅完成部分审查,审查缺口已披露。
未审查:build-and-test — Integration Tests (CLI, No Sandbox) was skipped in CI and its suite did not run locally。
未审查:反向审计——评审时间预算不足,未能开始第 1 轮。
— qwen3.8-max via Qwen Code /review (v0.22.0)
|
@qwen-code /takeover |
|
🤝 Takeover engaged: the autofix loop now manages this PR — it will address new review feedback and resolve base conflicts until the label is removed or the round cap is reached. Remove the 中文说明🤝 已接管:autofix 循环现在管理此 PR —— 将持续处理新的评审反馈与 base 冲突,直到移除标签或达到轮次上限。移除 |
|
Released in v0.22.2. |
What this PR does
The Core client now imports the approval-mode runtime enum from its dependency-neutral definition while keeping the public configuration type import type-only. The public configuration export remains unchanged.
Why it's needed
The configuration facade initializes the client, while the client imported that same facade at runtime only to access one enum. Importing the enum from its leaf definition removes the direct runtime cycle without changing API shape or adding an abstraction.
Reviewer Test Plan
How to verify
Initialize the Core client through the public configuration path and confirm approval modes, including automatic edit approval, map to the same runtime behavior. Confirm the client can be imported without depending on configuration-facade initialization order.
The targeted client suite passes: 1 relevant test, with 365 unrelated cases skipped by the test filter.
Evidence (Before & After)
N/A — dependency import correction with no user-facing behavior change.
Tested on
Environment (optional)
macOS arm64, Node.js v25.6.1; targeted Vitest test, Core build, and ESLint completed successfully.
Risk & Scope
Linked Issues
None.
中文说明
本 PR 做了什么
Core client 现在从无依赖的定义模块导入运行时 approval-mode 枚举,同时保持公共配置类型为纯类型导入。公共配置导出保持不变。
为什么需要
配置 facade 会初始化 client,而 client 此前仅为访问一个枚举就在运行时反向导入同一个 facade。直接从叶子定义导入枚举,在不改变 API 形态、也不增加抽象的情况下移除了直接运行时循环。
Reviewer 测试计划
如何验证
通过公共配置路径初始化 Core client,确认包括自动编辑批准在内的 approval mode 仍映射到相同运行时行为。确认导入 client 时不再依赖配置 facade 的初始化顺序。
定向 client 测试通过:1 个相关测试;测试过滤器跳过 365 个无关用例。
证据(修改前与修改后)
不适用——这是依赖导入修正,没有用户可见行为变化。
测试平台
环境(可选)
macOS arm64、Node.js v25.6.1;定向 Vitest 测试、Core 构建和 ESLint 均成功完成。
风险与范围
关联 Issue
无。