Skip to content

style(turn): simplify single-name import declarations - #5148

Merged
huangruiteng merged 1 commit into
mainfrom
codex/release-v1.2.1-turn-import-cleanup
Sep 26, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/release-v1.2.1-turn-import-cleanup

Conversation

@huangruiteng

Copy link
Copy Markdown
Collaborator

The 1.2.1 full-public release sweep rejects turn.py: 1,116 physical lines exceed its existing 1,114-line budget. Five single-name import declarations use unnecessary three-line wrapping. Render those imports on one line without changing import order, names, aliases, or any executable syntax; the complete base/head AST is identical and the same module guard passes at 1,106 lines.

The existing module owner and budget stay unchanged. This is lexical cleanup for the reproduced release blocker; it makes no runtime, error recovery, quota, state, permission, or default change. The earlier error-recovery repair and its rendering owner remain intact. AST equivalence, the original module/ownership smoke, targeted Ruff and real Turn CLI/error/journal regression tests verify the change; final publication remains gated on full qualification of the resulting clean commit.

Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

Reviewed exact head: 5148@3d243e89be958847bc33f912e7f72c57861d900e; base: 8962b1160c301d340da5ce965fe6f67c96e77dac.

动机

1.2.1 的全量发布验证实际发现 turn.py 为1116行,超过原有1114行模块预算。五个短的单名称 import 声明保留了多余的三行展开;无需改变运行逻辑或放宽预算即可恢复资格。

改动思路

沿用相邻导入的一行写法,统一整理五处声明。没有新 helper、模块、owner、兼容分支或规则。完整 base/head 语法树(除源码坐标)、import 顺序、名称与绑定完全相同;既有异常读回与 TypeScript journal owner 保留。这是单一、可撤销的词法清理。相邻边界的未来改动便利性检查认为保留既有 owner 即可,不需要为这次清理进行新的拆分。

具体改动

完整差异只有 loopx/cli_commands/turn.py 的5行增加、15行删除;原1114预算与原 smoke 不变,候选为1106行。Complete base/head AST equality; unchanged module/registration guard1116→1106 under1114; targeted Ruff/diff hygiene;100 real Turn CLI/error/journal tests; native premerge5checks and exact-scope quality pass. Initial missing npm dependency and120s timeout were retained, corrected/retried; final checks use the public suite600s execution timeout. 持续执行与用户体验均保持:完整执行语法没有改变,100项真实 CLI/File 故障恢复与 inspection 测试覆盖原有正反路径。没有 frontend/Lark/安装入口交互变化;其公开合同未被修改。最终发布仍由当前发布操作对干净合并提交执行全量资格和产物读回,该阶段先固定已经验证的词法修复。

对主干的风险

主要风险是整理时误改 import 或恢复语义;完整语法树对比比有限案例更直接地排除该情况,真实 CLI 正反路径另行验证。源码 traceback 的行号随物理行变化,异常内容、恢复身份、不确定效果、写回与权限行为均保持。不加入新的状态分类、默认激活或义务措辞,不改变预算、fixture 或扫描范围。最初预合入因缺少 npm dev 依赖及120秒执行超时失败,原失败记录保留;补齐既有依赖后,使用与全量公开检查相同的600秒执行上限重验,通过才形成此结论。配置明确不等候 CI;此结论依赖实际本地验证和精确 head,不把绿色 CI 或最终发布当作当前证据。

我的整体评价

该 head 消除了已复现的预算阻塞,未增加运行时行为或降低原有检查。可以依据窄清理规则自合入。无未解决的当前差异 blocker;最终1.2.1源码资格与远程产物交付仍须完成。

English verdict: APPROVE

@huangruiteng
huangruiteng merged commit 6669c17 into main Sep 26, 2026
7 checks passed
@huangruiteng
huangruiteng deleted the codex/release-v1.2.1-turn-import-cleanup branch September 26, 2026 20:24
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.

1 participant