Replace tspath signature stubs with precise function bodies from the
semantic pipeline: 292 bodies with clone/move/borrow decisions, 0
build errors, 0 warnings. fswatch signatures remain as before.
Supersedes PR #27; the func-semantic-draft branch will be deleted.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
背景
函数迁移战役的基础分支 PR:全模块 struct 草稿重生成 + 已收官的 tspath 函数产物。fswatch 与各模块分支 base 在本分支之上,经各自 PR 合入。
变更内容
自测结果
第二轮:func-check 确认项修复(
d11dd8f)背景
csv-records/func-check/report.md(143 文件全覆盖)确认 high 3 项、medium 6 项,本轮按报告行动建议修复生成器并重生成;生成器侧提交在 tsox-scripts feat/func-tspath(19d1e99、81df547)。
变更内容
自测结果
按评审意见重生成函数迁移草稿两处: - 文件拆分:generated_funcs.rs/generated_funcs_test.rs 拆为目录 generated_funcs(/_test)/,impl owner 一个 <TypeName>.rs,自由函数按 Go 源文件 stem 落 free/<stem>.rs,别名类型(PathKey、CaseSensitivity 等)方法随类型同文件;4 模块共 88 叶,最大 300 行,mod.rs 骨架登记。 - 哨兵必红:642 个函数体哨兵由 todo!() 改 compile_error!("!todo body"), 编译即报错、grep !todo 可计数;linux 目标下 547 处报错(其余 95 处在 darwin/windows/bsd cfg 块内,对应目标激活时可见),签名哨兵 8 处 (*testing.B 槽位注释降级)维持可编译。 build 呈红为预期状态,债务在编译期可见,待函数体迁移阶段逐个消除。承接 tsox-scripts feat/func-tspath 修复重生成(func-check 确认项): - high#1 多值重赋回写:forceEncodeDynamicURIPathSegment1 分割结果 不再被 let 影子丢弃,("file.ts",true) 输出与 Go 一致 - high#2 map 缺键零值读:getCommonParentsWorker 扇出分支不再 panic,分组结果与 path_test.go 期望一致 - high#3 字节切片守卫:getExtensionRewrite 等切点落在多字节字符 内部时就近取整,不再 panic("./测试" 输入) - medium#1 nil 旗标:commonDirectoryOfFiles 首文件为纯根时返回 空串,["C:/","C:/a/b.ts"] 与 Go 一致 - medium#2-3 hex 严格+err 极性:奇数长度/+ 前缀拒绝,合法输入 恢复可解码(极性反转是差分实跑新暴露的既有缺陷) - medium#4-6 四 tools 模块重生成(修正错树解析后 gen_proto/ import_localization/machotool/gen_preferences 字段全部恢复, gen_proto/machotool 与 main 基线一致) 验证:cargo check --all-targets 非哨兵错误 0,哨兵 80 与基线持平; /tmp 差分 harness 10 用例全过;go test ./internal/tspath/ 原树全绿。随 scripts 生成器测试体翻译支持重生成 tspath funcs 产物: - 43 个测试函数体从 !todo 哨兵转为精确翻译(assert kit 断言、 t.Parallel no-op、闭包捕获克隆),含 TestCombinePaths 等表驱动 断言与 assertPanics 辅助;测试桩哨兵 80 -> 37(签名联动 10 + t.Run/struct{} 结果槽/闭包改写外层变量/regexp/表驱动字面量 解析等诚实阻塞 27) - tsox_core/generated_struct.rs 随 stand-ins 更新:GoAnyValue 补 From 实现,新增 assert_equal/assert_true(_msg) 断言 kit - 主代码闭包渲染随捕获克隆约定微调(for_each_ancestor 族),语义 等价经编译验证 验证:cargo check 0 错 0 警;--all-targets 37 错全为 !todo body 哨兵(改前 80,只减不增),警告 0;重生成逐字节幂等。术语更名:!todo 占位("哨兵")统一改叫"未实现",涉及验证口径、 未实现只减不增、测试桩未实现现状等表述;go-error-inventory 的 kind 分类保留 Go 术语但限定为"Go 哨兵错误"(io.EOF 类包级错误值, 与未实现占位是两个概念,加限定防混淆)。两仓 worktrees.md 副本 同步;scripts 仓 README 与 inventory-columns.md 同步更名。生成器 rest 切片惯例把 panic 唯一实参当接收者位切空,42 处 panic 全部 落成裸 panic!(),Go 侧消息(minComponents must be at least 1 等)尽失。 scripts 侧 Plan::Panic 改用 args.first() 后重生成,42 处消息逐字回填, 拼接消息走 panic!("{}", format!(..)) 保真;cargo test 72 全过。