Skip to content

v0.2.2 — Hotfix: plan schema 补完 / BOM 兼容 / .claude/ 隔离

Choose a tag to compare

@Hugin-Z Hugin-Z released this 22 May 01:28
· 37 commits to main since this release

v0.2.2 — Hotfix: plan schema 补完 / BOM 兼容 / .claude/ 隔离

修复 v0.2.0 → v0.2.1 之后由 OpenAI Codex 持续六轮审查触发的 15 条问题。
v0.2.1 → v0.2.2 间隔较长,因本项目实行 "Codex 外审通过 = release 门禁" 工作流:
每个版本必须过 Codex 静态审查,通过才发版本。这一版迭代了六轮才达 "no blockers"。

修复(六轮累计 15 条)

Codex 第二轮(3 条)

  • execute_plan schema 缺 target_subdir 直接 KeyError 崩溃 → ERROR_INVALID_PLAN_ITEM
  • plan JSON 读取不支持 UTF-8 BOM(Windows PowerShell 默认输出)→ encoding=utf-8-sig
  • .claude/ Claude Code working state 未隔离 → .gitignore

Codex 第三轮(1 条)

  • README.md routing_plan schema 描述漏 target_subdir → 中英文双语同步代码必填字段

Codex 第四轮(2 条)

  • REQUIRED_FIELDS 仅 4 字段必填,文档声明 6 字段 → 代码侧补齐 frontmatter + ai_reason
  • smoke_test.py docstring 残留 v0.2.1 / 4 assert → 同步 v0.2.2 / 8 assert

Codex 第五轮(4 条)

  • target_subdir 只校 key 存在不校非空("" 通过,落到 bucket 根)→ 三层校验
  • frontmatter 只校 key 存在不校类型(str/None/list 通过,inject 阶段 .items() 崩)→ 类型强制 dict
  • smoke_test 路径边界 3 case 因缺新必填字段被 REQUIRED_FIELDS 假拦截(假覆盖)→ 补齐 6 字段 + 反向断言
  • smoke_test docstring 残留 "4 个 assert" → 同步 "10 assert"

系统性升级:validate_plan_schema 5 Layer 校验

第五轮反馈促成系统性升级,不再打补丁式扩字段:

Layer 维度
1 key 存在 missing required field: frontmatter
2 类型正确 frontmatter must be dict, got str
3 非空 ai_reason must not be empty string
4 字段特殊规则 src_abs must be absolute path / target_bucket whitelist / 01-projects bucket requires target_project
5 路径穿越 target_filename contains path traversal / absolute path prefix

校验失败统一转 ERROR_INVALID_PLAN_ITEM,不中断其他 items(沿用 v0.2.1 P0-2 同款机制)。

smoke_test.py 扩充到 10/10

  • [1] install 烟测调用参数(search.py --scope all)
  • [2] ingest.py scan-only 跑通
  • [3] 路径边界 3 case 真实拒(反向断言验证非假覆盖)
  • [4] 依赖 import(docx + yaml + markitdown)
  • [5] schema Layer 1: 缺 target_subdir
  • [6] BOM plan 兼容
  • [7] schema Layer 1: 缺 frontmatter
  • [8] schema Layer 1: 缺 ai_reason
  • [9] schema Layer 2: frontmatter 非 dict 类型拒(3 type cases)
  • [10] schema Layer 3: target_subdir / ai_reason 空串拒(3 empty cases)

10/10 PASS + 手工 16 边界 case = 22 case 全覆盖。详见 tests/v0.2.2-hotfix-progress.md

已知行为变更

旧 routing_plan.json(frontmatter=nullai_reason="" 风格)在 v0.2.2 之后会被 ERROR_INVALID_PLAN_ITEM 拒。这是 by-design 严格化,不是 regression。若有本地缓存的老 plan,重新让 AI 产新 plan 即可。

致谢:六轮 Codex 审查闭环

时间 动作
2026-05-21 01:50 UTC v0.2.0 release(PER 6 阶段 / 11 W 系)
2026-05-21 当天 Codex 第一轮 5 条 + GPT 4 条 → v0.2.1
2026-05-21 03:56 UTC v0.2.1 release(26h 内 hotfix 完成,详见 tests/v0.2.1-hotfix-progress.md)
2026-05-21 ~ 之后 Codex 第二/三/四/五/六轮持续审查,累计 15 条
2026-05-22 v0.2.2 release(六轮迭代追下来)

本项目实行 "Codex 外审通过 = release 门禁":Codex 找问题就修,修完再审,直到 "no blockers"。没有上限,不强行收尾。

这不只是修 bug,是重新定义 "可以 release" 的标准

v0.2 全程 PER 协议(Plan-Execute-Review)6 阶段 + 11 W 系观察点 + v0.2.1/v0.2.2 双 hotfix + 六轮 Codex 闭环,完整执行轨迹见: