Skip to content

chore: repair v1.2.0 release hygiene gates - #5017

Merged
huangruiteng merged 2 commits into
mainfrom
codex/release-ruff-clean
Sep 24, 2026
Merged

huangruiteng merged 2 commits into
mainfrom
codex/release-ruff-clean

Conversation

@huangruiteng

@huangruiteng huangruiteng commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Two exact-commit v1.2.0 gates exposed stale hygiene: whole-package Ruff found four unused imports, and the project-registry I/O census omitted one codec read after recent Todo changes. This PR removes only those unused imports and regenerates the existing typed census, preserving all 233 classified I/O sites with zero unclassified direct sites.

Validation: ruff check loopx passed; the manifest generator's --check readback passed; the two relevant architecture test modules passed (9 tests); git diff --check passed. The diff changes no scanner branch, registry I/O implementation, authority rule, or release identity. Full release gates will rerun on the merged exact commit.

Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
@huangruiteng huangruiteng changed the title chore: clear unused imports for v1.2.0 release lint chore: repair v1.2.0 release hygiene gates Sep 24, 2026

@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: 3b3e92e.

动机

用户要求完成必要修复后发布 v1.2.0。确切发布候选上,全包 Ruff 因四个未使用的导入失败,项目 registry I/O 清单因新增合法 codec read 未同步而使两个架构测试失败。若直接跳过这些检查,发布门槛就不能说明当前源码是否可复现地通过。

改动思路

只删除确认没有调用点的导入,保留探索运行时和公开安全扫描器的原有分支;按现有生成器重建项目 registry I/O 清单,不人工改写分类规则。新增的 load_registry 仍属于既有 codec_api,没有新权限、存储格式或第二份 I/O 权威。相关的行为与失败路径由原有测试继续负责。

具体改动

harness_runtime.py 删除未使用的 family_routing_terms 导入;scan_cli.py 删除未使用的 json、subprocess、ScanResult 导入。生成清单更新三处文件的当前行号,并记录 todo.py 中第六个 load_registry 读取点;总计 233 个站点,零个未分类直接 I/O。没有修改函数体、导出名称、scanner 规则、Goal authority、默认开关、用户文案或 CLI 合同。

关键代码讲解

  1. 删除的四个名字在对应模块没有使用,也没有被外部调用作为转发出口;运行分支和返回值不变。
  2. 清单的 site 与 classification 沿用 project_registry_io 扫描器生成;新增读取通过现有 codec,而不是绕过它的直接 JSON 访问。
  3. --check 从当前源码重新扫描,能发现过期行号、遗漏和未分类直接访问;架构测试的负例仍会拒绝不受管控的直接读写。

对主干的风险

主要风险是误删公共重导出或把新增直接 I/O 误标为合法。代码搜索和差异检查确认这些导入只在本模块未使用;新站点是 load_registry codec read,清单生成器给它 codec_api 分类。全包 Ruff、清单 --check、两个架构模块共 9 项测试与 diff 检查均通过;risk-based premerge 选中 5/5 通过,编译和差异检查也通过,失败、跳过、手工 hold 为 0。真实发布仍需要合并后的确切提交完整验证,这份 PR 的通过结果不能替代最终标签。若清单再次漂移,应在改变读取点的 PR 中重建并检查,而不是放宽清单验证。

我的整体评价

这是两个发布门槛发现的同一类源码卫生偏差,范围只有删除无用导入和更新权威清单。它恢复既有检查的信号,没有引入字符串推断规则、产品专属控制面义务、隐藏默认行为或新的 authority。相关的小幅整理已在当前 PR 完成;进一步抽象扫描器没有实际需要。批准此确切 head 作为 v1.2.0 发布前的可逆修复。

English verdict: APPROVE - exact head 3b3e92e; unused imports are removed, the canonical registry I/O census is current, focused tests and risk-based premerge pass, and no authority or runtime branch changes.

@huangruiteng
huangruiteng merged commit 0ac4122 into main Sep 24, 2026
2 of 3 checks passed
@huangruiteng
huangruiteng deleted the codex/release-ruff-clean branch September 24, 2026 18:06
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