Skip to content

fix(tests): remove quota route lint failure - #8008

Merged
huangruiteng merged 1 commit into
mainfrom
codex/lark-route-fixture-ruff-20261104
Nov 4, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/lark-route-fixture-ruff-20261104

Conversation

@huangruiteng

Copy link
Copy Markdown
Collaborator

main 的 kernel-static-checks 被 quota 路由测试中的 Ruff E731 阻塞,后续依赖检查随之跳过(失败 job)。将局部 lambda 赋值改为等价函数,保留无容量分支与 allocation 返回值的行为。

验证:对应的 6 个参数化用例通过;CI 同范围 Ruff 检查(tests、canary、control_plane、domain_packs、presentation)全部通过。该独立修复用于解除 #8005 等 PR 继承的 lint 阻塞。

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | reasoning_effort=max

动机 / Motivation

维护 Lark 私聊恢复测试和运行仓库静态检查的贡献者。 同一条静态检查命令在 base 因局部 lambda 赋值报 E731,测试尚未执行就会受 lint 阻塞;改为局部 def 后,检查通过,原六条恢复与拒绝路径仍通过。 已在不可变 base 和当前 head 独立复现 E731 的消失,并验证原六个参数化用例、返回值与调用时机保持。 只修测试夹具的 lint,不修改生产恢复、额度、权限、CI 配置或合并规则,不宣称远端 CI 或已安装 App 已通过。

改动思路 / Approach

继续使用原测试中的局部 quota-route 夹具,只把赋值 lambda 改写为 def route(*_)。两处 monkeypatch 的消费者、闭包中的 fault/allocation 和调用时才执行的条件表达式都保留。对这个已复现的维护问题,在原位置改写比删除用例、忽略 E731 或新增通用 helper 更直接;没有新增配置、状态或产品路径。

具体改动 / Changes

精确 head:48c514d;不可变 base:5f1a9d7。完整 diff 只有 tests/test_lark_private_conversations.py 的 +3/-2,没有生产代码、参数化输入或断言变化。

既有维护规范为 docs/development/good-smokes.md,spec_revision 5f1a9d7(该版本)。按原规范核对:Review Checklist 保留独立语义断言和既有入口;Consolidate Without Losing Coverage 保留原六条成功/拒绝路径,没有新增重复 smoke;Public-Safe Fixtures 保留合成 provider、fake host 和临时存储,不把 fixture 当真实模型验收。

当前局部函数及调用 对 no-capacity 返回 None,且不读取时钟;其余路径仍返回原 allocation 对象、空 blocked_primary 和本次调用的 observed_at。base/head 的参数和返回表达式 AST 完全一致。独立进行了36次同输入调用对照,验证对象身份、惰性时钟及任意位置参数均保持;原成功测试还断言恢复只发生一次、重复 reconcile 不再派发。

对主干的风险 / Risks

未发现当前阻塞项。 最强反例是函数改写意外提前计算时间、复制 allocation,或让 no-capacity 获得容量;上述对照和原有拒绝用例均未出现这些变化。

  • PASS:同一条 CI 范围的本地 Ruff 命令,base 仅报第62行 E731,head 全部通过。范围为 tests、canary、control_plane、domain_packs、presentation;没有更改 lint 规则。
  • PASS:原 test_original_worker_continues_proven_unstarted_argon_quota_on_codex 六个参数化用例,在 base/head 分别6 passed,零 skip。包括正常恢复、stop、source-changed、later-source、no-capacity、native-tool。
  • PASS:当前 static-check 的依赖锁与顶层模块约束7项通过,完整 diff check 干净。验证使用 Python3.14.8 和对应 checkout 的实际源包。
  • UNVERIFIED,诊断项:未查询、轮询或等待远端 CI,也未读取作者链接的失败 job 来推断根因。未运行整仓测试、Linux/Python3.11 或真实模型;本次只改测试局部 callable,以上当前证据足以覆盖其变更风险。

我的整体评价 / Verdict

APPROVE,仅针对该精确 head。 这是完成的局部维护修复:消除了独立复现的 lint 阻塞,同时保留已有恢复测试的语义价值。当前同作者队列没有显示新增重复 smoke 的模式,不需要新增框架或仪式性后继任务。

long_horizon 与 user_experience 的运行时评估均不适用:生产路径、持续状态和用户交互未变化。视觉评审不适用:tests/test_lark_private_conversations.py 仅修改局部测试函数,没有渲染页面或首屏变化。未评估已安装 App、真实模型或整仓测试;不属于本次局部 lint 修复的验收。未知 CI 不阻止这次代码批准;merge-readiness 和实际合并仍分开判断,本评审不执行合并。

English verdict: APPROVE — 48c514d. The equivalent local def removes the reproduced E731 while preserving the original six recovery/refusal cases, allocation identity and lazy timestamp evaluation. Matched base/head tests, full static-scope local Ruff and seven repository invariants passed at head; remote CI was not consulted.

@huangruiteng
huangruiteng merged commit f818165 into main Nov 4, 2026
26 of 37 checks passed
@huangruiteng
huangruiteng deleted the codex/lark-route-fixture-ruff-20261104 branch November 4, 2026 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants