feat(pi): 新增 Windows Git PATH 解析模块 - #2869
Conversation
|
| Filename | Overview |
|---|---|
| packages/maker-core/src/agents/pi/windows-git-path.ts | 新增隔离的 Windows Git/PATH 发现与转换模块;先前线程要求的非标准 shim 拒绝行为已由布局校验实现。 |
| packages/maker-core/src/agents/pi/windows-git-path.test.ts | 覆盖注册表解码、PATH 候选、标准布局、shim 拒绝、MSYS 转换及超时保留部分结果等行为。 |
| scripts/generate-third-party-notices.mjs | 将固定 commit 的 oh-my-pi 适配代码加入桌面第三方声明生成源。 |
| scripts/tests/third-party-notices.test.mjs | 增加桌面分发声明包含 oh-my-pi 版权信息的回归断言。 |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Windows PATH 与注册表] --> B[收集 Git 候选]
B --> C[分离本地与网络路径]
C --> D[PowerShell 有界路径探测]
D --> E[验证标准 Git for Windows 布局]
E --> F[转换 MSYS 路径并去重]
F --> G[返回解析后的 PATH]
Reviews (12): Last reviewed commit: "fix(pi): 复用 Windows 路径探测快照" | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 85f8f13c97
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@nanaco666 👋 这个 PR 还有 3 条 review conversation 没 resolve(packages/maker-core/src/agents/pi/windows-git-path.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
|
👋 这个 PR 触发了维护者确认门(product:feat 新增能力 + arch:核心路径 343 行)。已开讨论 issue:#2877 维护者直接在 PR 上点 Approve 即放行;需要修改就 Request Changes,作者改完后重新 Approve。确认前本 PR 不会被自动合并,自动审查仍会照常进行。 |
Signed-off-by: nanaco <823073145h@gmail.com>
Signed-off-by: nanaco <823073145h@gmail.com>
85f8f13 to
4c9d858
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c9d8586ba
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: nanaco <823073145h@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 405546d34d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: nanaco <823073145h@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f0d68facc5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@nanaco666 👋 这个 PR 还有 1 条 review conversation 没 resolve(packages/maker-core/src/agents/pi/windows-git-path.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
Signed-off-by: nanaco <823073145h@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 68bed6622c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: nanaco <823073145h@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1cae0031d6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: nanaco <823073145h@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7cb555e179
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: nana <823073145@qq.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 83457d306f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: nana <823073145@qq.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b8f7397701
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: nana <823073145@qq.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4cfdbc4cfe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: nana <823073145@qq.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 716be85ea2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@nanaco666 👋 这个 PR 还有 1 条 review conversation 没 resolve(packages/maker-core/src/agents/pi/windows-git-path.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
Signed-off-by: nana <823073145@qq.com>
MagicLizi
left a comment
There was a problem hiding this comment.
P1×1:PR 描述仍写会用 Git 官方 git --exec-path 解析 shim,但当前 head 已完全去掉对 PATH 里 git 的执行,只做目录布局检查。请把摘要和「本 PR 包含」那条改成与现实现一致(并顺手更新过时的 27 个单测数字)。代码本身的安全方向是对的,卡的是描述与 diff 不符。
| @@ -0,0 +1,527 @@ | |||
| import { execFileSync } from 'node:child_process'; | |||
There was a problem hiding this comment.
P1:当前模块没有任何 git --exec-path / 对 PATH 候选 git.exe 的执行;execFileSync 只打 powershell.exe。PR 描述(摘要 + 「对可直接执行的 shim 使用 Git 官方 git --exec-path」)还在描述已删除的旧设计。请改描述对齐现实现,避免后续接线 PR 或安全审查按错误模型理解。
|
@nanaco666 👋 这个 PR 还有 1 条 review conversation 没 resolve(packages/maker-core/src/agents/pi/windows-git-path.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
这次改了什么
摘要
新增一个独立、可测试的 Windows Git/PATH 解析模块,为后续让 Cindy 管理的 Pi 在 Windows 上自动找到 Git Bash 提供基础能力。本次 review 修复保留 Windows 原生探测子进程在超时前已经输出的有效记录,避免断开的 UNC/映射盘候选抹掉同批次已成功探测的本地 Git 路径。
实现复用了 Git for Windows 的标准安装契约、Git 官方
git --exec-path以及 oh-my-pi 已使用的 Windows PATH 处理方案,并按 Cindy 的 Pi harness 隔离结构收缩为纯探测模块。本 PR 只交付发现模块和测试,不接入 Pi 启动链路,因此不会提前改变线上行为。变更类型
feat新功能fix缺陷修复refactor/perf重构或性能优化docs/test/chore文档、测试或工程维护范围
git.exe,避免where.exe原生代码页损坏,同时不搜索当前工作目录cmd、bin、usr/bin、mingw*/bin布局git --exec-path解析真实安装目录,不为 Scoop、Chocolatey 等包管理器写特判.cmd等不能安全直接执行的 wrapper 保持 fail-open,不启用shell: truesettings.json~/.pi/agent/settings.json或项目 Pi 配置UI 变化
不涉及。
怎么验证的
自动验证
pnpm test:unit:related结果:通过。
其他针对性验证:
pnpm --filter @cindy/maker-core run --if-present typecheck:退出码 0;该 package 当前未定义独立 typecheck scriptpnpm --filter @cindy/maker-core exec vitest run src/agents/pi/windows-git-path.test.ts:1 个测试文件,27/27 通过pnpm --filter @cindy/maker-core exec eslint src/agents/pi/windows-git-path.ts src/agents/pi/windows-git-path.test.ts:通过git diff --check:通过未执行的验证
风险
statSync;异常保持 fail-open。提交前检查
git commit -s)