Repository navigation
fix(tests): spell the steward evidence sender as a def - #8084
Conversation
`tests/test_manager_context_roundtrip.py` assigned a lambda to `sender`, which the `ruff check tests` step in `kernel-static-checks` rejects with E731. The rule is in ruff's default E7 set, so the lane went red for every pull request from that commit onward: `checks` depends on `kernel-static-checks`, and `pytest`, `stage2c-correctness-e2e` and `merge-gate` all depend on `checks`. The queued-sender callback only returns one fixed receipt, so a nested def says the same thing without the lint exemption. `ruff check --select E4,E7,E9,F` on the file now passes. Signed-off-by: ChengLong GU <88359731+gcl-coder@users.noreply.github.com>
|
This pull request has merge conflicts with Choose the remote for the base repository, not an out-of-date fork. git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEADFor a same-repository clone whose Keep the DCO |
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; gpt-6.1-sol; OpenAI; runtime_reported; reasoning_effort=max.
动机 / Motivation
运行本仓库静态检查并维护管家交接回归的贡献者。 既有测试把 sender 赋为 lambda,完整 Ruff 以 E731 失败;同一局部 def 保持回执和参数语义,使完整 Ruff 通过。 独立基线和 head 各99项交接测试通过,完整 lint 从唯一 E731 变为通过;没有更改产品代码。 不修复所有历史 CI、不改变交接权限或发送流程,也不新增 smoke、fixture、状态或页面。
独立审查完整 exact head 3eaea44e61b4e7203f981a4bf1b1b946cf6a6eb7,不可变 base 92294e7245cb3ad50119c6b817667410a4517c2f。这是已有测试的具体维护缺口,不以增加测试或 PR 数认定价值;没有把作者“所有红灯同一根因”的陈述当作已核验的远端 CI 事实。
改动思路 / Approach
保留原作用域和 *_ 参数,只用普通函数定义表达同一固定回执,比 lint 豁免、新 helper 或新增测试更小。生产 roundtrip._return_provider 直接调用 callable sender,并未依据函数名决策;原 partial/final/later-remainder 与权限断言全部保留。贡献者从既有命令到可用结果不增加配置、确认或信息重填。
具体改动 / Changes
一文件 +3/-1,没有产品代码、fixture、断言或 workflow 改动,唯一提交具备 DCO。spec_ref: CONTRIBUTING.md,spec_revision: 92294e7245cb3ad50119c6b817667410a4517c2f;按 Local Development 的 focused tests / 完整 Ruff 验证维护结果,按 What CI runs on a pull request 保留 required checks 与 merge authority 的独立边界,两项在本次范围均 implemented。
关键内容讲解
- 局部 sender 与原回归:参数和回执字典未改,owner / original-audience 两种场景仍检查 partial 保留、final 结清、later remainder 重开、重启读回和权限变化。将此唯一 def 规范化回原 lambda 后,整个模块其余 AST 完全一致。
- 真实 callback consumer:既有 typed return transaction 处理身份与状态,provider 分支只按 callable 协议调用 sender。改动没有增加发送权或改变重试/去重;完整模块用隔离真实 TS owner 验证,并未发送真实外部消息。
对主干的风险 / Risks
没有阻塞性的代码发现。 最强风险是假定“写法改变”暗中改变 callback 的签名、返回值或依赖函数名;已通过源调用方检查、完整 AST 对照及同一完整99项回归否定。完整 native queue 的同作者两项分别解决 portable IO 与既有 E731,不是新增同形 smoke;这里没有新增可被合并或删薄的测试。
| 独立检查 | base | head |
|---|---|---|
| 完整 configured Ruff | FAIL:唯一 E731 | PASS,无规则豁免 |
| 完整 roundtrip 模块 | PASS:99项 | PASS:99项 |
| configured mypy,无增量缓存 | FAIL:208B no-any-return | 相同完整208B失败 |
| native standard premerge | 未重复运行无改动基线 | PASS:5 direct;catalog0项;无 manual hold |
| strict exact-scope CQR | 无本次修复 receipt | cqr_c5d0475cd0614a478c3b:fail,保留 mypy required 红灯 |
mypy 失败位于未改的 task_orchestration_admission.py:110;两端完整输出字节相同,失败文件、pyproject 与生产 return consumer 均相同,变更路径另有99项实际回归与 Ruff 正向证据。这支持代码批准,不把 required 检查改为通过,也不宣称 CI 全面恢复。当前源元数据显示与 main 有合并冲突,须由原作者在新头解决;此批准不能跨到之后的新提交。
我的整体评价 / Verdict
APPROVE 此准确头的一处维护改动。具体 E731 缺口 goal_achieved;长程交接语义 preserved,贡献者运行静态检查的体验 improved。只改变 tests/test_manager_context_roundtrip.py 的局部测试回调,没有渲染页面变化。 没有查询远端 CI;独立复现的既有 mypy 失败与当前合并冲突仍待各自 owner 处理。
它采用原测试和常规语言写法,没有新状态 vocabulary、兼容分支、产品入口或额外人工流程。已有类型失败、strict CQR、冲突和随后原生 merge-readiness 是分开的 hold;未合并、未替作者修改源码,也未用 admin bypass。
English verdict: APPROVE — 3eaea44: the in-place callback cleanup removes the reproduced Ruff violation and preserves the complete99-test behavior; existing type-check and merge-conflict holds remain separate.
loopx-agent
left a comment
There was a problem hiding this comment.
Self-review after conflict repair — exact head 5331fd09d771ac6594ed9fac9695d3742b3932c6.
- The sole conflict was duplicated formatting for the same
sendercallback: currentmainalready contains the PR fix. - Resolved by accepting
mainformatting and committing the GitHub-generated merge; the target test file is byte-identical to currentmain. ruff check --select E4,E7,E9,F tests/test_manager_context_roundtrip.pypasses on the exact head worktree.- The merge commit is GitHub-authored/committed and is eligible for the repository DCO merge-commit verification path.
APPROVE. No semantic code delta remains after syncing; this is a merge-readiness repair for an already-reviewed fix.
huangruiteng
left a comment
There was a problem hiding this comment.
Independent approval of exact head 5331fd0 after conflict repair.
|
更正我在上一条评审中的主干价值判断:该评审针对 原准确头的代码验证记录保留,原评审当前状态为 |
问题
main上kernel-static-checks现在是红的,根因只有一条 ruff 报错:E731 属于 ruff 默认的 E7 规则集,而
kernel-static-checks的ruff check tests loopx/canary loopx/control_plane loopx/domain_packs loopx/presentation以退出码 1 结束。它挡住的不只是一个 job:checks依赖kernel-static-checks,pytest、stage2c-correctness-e2e、merge-gate又都依赖checks,所以从引入这一行的提交之后,每个 PR 都是九个红灯,其中五个是同一个根因的传导(test-shard根本不会启动)。证据
acecb5d6b fix(chat): retain partial handoff scope in steward evidence reads (#8056)引入;bd79adc64上执行ruff check --select E4,E7,E9,F tests/test_manager_context_roundtrip.py(即 CI 实际使用的默认规则集)得到 1 个错误,就是这一行,没有其他;All checks passed!。改动
sender只返回一个固定回执字典,改成同作用域的def表达同一件事,不需要 lint 豁免:测试
ruff check --select E4,E7,E9,F tests/test_manager_context_roundtrip.py→ All checks passedEffectRuntimeHostPermissionError,所以行为一致性以 CI 的kernel-static-checks与该文件的测试 lane 为准。范围:一个测试文件,三行。