This repository was archived by the owner on Sep 28, 2026. It is now read-only.
Repository navigation
test: 修复 Windows 路径与真实 Git hook 可验证性 - #15
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
目的与边界
承接已合入的 #14,修复 Windows 上测试夹具的可验证性,不回滚已正常工作的 doctor Git hook 后备。
变更仅限 README 和 7 个既有测试文件:test_adopt、test_amend、test_cli、test_config、test_doctor、test_relocate、test_sources。不修改 src、冻结门禁契约、产品依赖版本、锁文件或 CI 规则;不增加 noqa,不批量 skip,不恢复旧 Issue。
根因与最小修复
tomllib.TOMLDecodeError: Invalid hex value。沿用各文件现有局部 fixture,使用标准库json.dumps(str(path), ensure_ascii=False)序列化路径,并按 UTF-8 写入;不手工换路径分隔符。.cmd,POSIX 保留 shell 文件。shlex.quote引用 Python 可执行文件及PYTHONPATH,避免反斜杠、中文、空格和&被 shell 错解。check_returncode(),负向 gate 场景仍显式消费 nonzero。修后真实提交成功,status: frozen用例通过 Git HEAD 读取完整新文档确认修改已提交;没有放宽生产冻结条件。commit != "?"代替提交证明;内容错误测试确认缺失的 description 字段及 HEAD 原文未变,而不固定笼统的refused措辞。已实际验证
Windows 完整套件
在独占 worktree 内,使用既有 Python 3.12 环境,并先按仓内锁文件执行:
最终:293 passed / 1 skipped,另 9 subtests passed。唯一 skip 是 Windows 不适用的 POSIX hook 执行位检查。两个 Mermaid 用例已实际执行,不是跳过交付。sidecar 安装的是既有 dompurify 3.4.9、jsdom 27.3.0、mermaid 11.15.0;不下载浏览器、不需要外部付费服务,未改锁文件或用户全局环境。
历史第一次无 sidecar 的本轮全套结果为 291 passed / 3 skipped,不能冒充完整结果;旧 #14 的 66 failed / 225 passed / 3 skipped 仅为已知基线,不重复跑旧整套确认。
路径边界与实际 CLI
&,全部成功。包含批准冻结修改、未批准冻结修改被拒、frontmatter 内容错误被拒、冻结 relocate 提交成功。临时目录链接及源码副本已清理,没有字符串断言代替实际 hook 执行。&路径)及 registry,执行rhizome check --all → memex-sync compile → memex query --lane lexical → 按命中 path 读取完整 Markdown 真源,各命令 exit 0、身份与真源内容一致;临时 source/compiled 已清理。此处 rhizome 明确使用待合入 worktree,不冒充正常部署验收。合入与部署验收约束
仅在当前实际 head 的所有适用 CI 完成且通过后,用
--match-head-commit锁定该 SHA 合入,并回读 MERGED / merge SHA;不绕过保护。Linux CI 若仍按既有流程跳过两个 optional Mermaid 用例,将如实记录为依赖条件 skip,不称为 POSIX skip。合后仅当正常 editable root clean 且可安全 fast-forward 时同步;不改 uv、PATH、registry、desk 或生产 compiled。随后独立 worker 使用正常 PATH 入口再执行完整
check → compile → lexical query → 读取 Markdown 真源,与隔离 smoke 分开记录。原始输出与报告保留仓外,不提交本机私人路径或临时执行脚本。最终交付验收
9dabb5b96261b38a7f7d9d5f10f170bf4434880f的 10 项检查 SUCCESS;3 项 Release 条件检查(build-library、publish、fleet-e2e)按原规则 SKIPPED,无失败或待运行检查。--helpsmoke 均通过。--match-head-commit 9dabb5b96261b38a7f7d9d5f10f170bf4434880f合入;远端回读 MERGED,merge SHAc06d72b5105f29bfb6de00b0d3c249e4d26946ba。--ff-only同步至该 merge SHA;同步后 clean。安装元数据仍绑定原正常源码目录,没有更换安装或 PATH。PYTHONPATH,针对临时真实 Git source 执行check --all → compile → lexical query → 读取 Markdown 真源。三步均 exit 0,精确命中smoke-kb:notes:roundtrip/notes/roundtrip.md,完整 Markdown 真源与写入内容一致;中文、空格及&源路径已实际经过完整链路。