fix: control exact commits in dirty Windows worktrees

This commit is contained in:
Codex
2026-07-11 02:56:09 +02:00
parent 7797d9d9b6
commit 4e0cfae91b
5 changed files with 143 additions and 0 deletions
+7
View File
@@ -502,6 +502,13 @@ PATCH
通过 `trans <providerId>` 执行多行脚本时,优先使用结构化 helper,例如 `trans G14 py < script.py`、`trans G14 sh <<'SH'` 或 `trans G14:k3s sh <<'SH'`。不要在远端命令字符串里再嵌套 heredoc、复杂引号或 `ssh 'python3 - <<EOF ...'` 形态;多层 shell 解析容易把 stdin 绑定到错误进程,结果会打开远端交互解释器并留下悬挂的 broker/SSH 会话。长脚本需要复用时,优先提交到 repo 或通过 stdin 传输到目标节点执行。
- Windows 固定脏 worktree 精确提交入口:
- `trans <route>:win/... git exact-commit status` 只读披露对象数量与安全停止边界;
- `plan --path <repo-relative-path>` 使用临时 index 生成待提交 tree,不更新 ref;
- `run --path <path> --message <message> --confirm` 使用 HEAD old-value CAS 更新当前分支,只刷新选中路径的 index,并验证未选中路径的 staged/unstaged 状态不变;
- 多文件必须重复传入 `--path`,禁止把当前 index 当作隐式提交范围;
- `gc-auto --confirm` 只运行 `git gc --auto`,不得直接 prune active、recent 或受 reflog 保护的 unreachable objects。
## Remote Main Server Passthrough
`--main-server-ip` 是一个全局前缀,必须放在需要透传的命令同一次调用中,例如 `bun scripts/cli.ts --main-server-ip 74.48.78.17 debug health`。默认传输是公网 frontend:本地 CLI 读取本仓库 `config.json` 中的 frontend 登录账号密码,登录 `http://<ip>:<frontendPort>/` 获取 HttpOnly session cookie,然后通过 frontend 的 `/api/*` 同源代理访问 backend-core 内网 API;因此计算节点只需要能访问公网 frontend,不需要主 server SSH key,也不需要打开 backend-core REST API 或 PostgreSQL 端口。