devops: 环境就绪探针 —— 一次性列出所有缺失项,而不是查一个失败一个
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 1h 7m
- Merged PRs (30d)
- 969
Description
## 背景
2026-09-06 一次「新环境/新版本落地」花了四轮来回,每轮都是**查一个失败一个**:
1. deploy.env 缺 `DIAG_DB_PASSWORD` → 部署跑到第 4b-ii 步才 `unbound variable` 死掉;
2. `/opt/workspacex/real-model-e2e.env` 不存在 → 真实模型取证通道 preflight 才发现;
3. 特权脚本副本落后于仓库 → 部署"成功"但改动没生效;
4. sudoers 少一条白名单 → 免 ssh 安装入口 `sudo: I'm sorry ... I can't do that`。
每一条单独看都有清晰报错,但它们是**逐个暴露**的:修一条、再跑一轮、再暴露下一条。
## 要做什么
一条**就绪探针**(`pnpm harness env-check`,或 workflow_dispatch 的形态),一次性把
这套环境所有缺失项**全列出来**,每条附可照抄的修复命令,而不是遇到第一条就退出。
至少要覆盖:
- `deploy.env` 必需键(清单本身要是单一事实源,`deploy.sh` 的点名检查复用它)
- 凭据文件存在性与权限(`real-model-e2e.env` 0600、属主)
- 特权脚本副本与仓库是否一致(复用 `deploy-gate.sh` 的比对逻辑)
- sudoers 两条白名单是否都在
- docker 可用性 + 沙箱容器里的预装库与字体
- 端口占用(按 `project/PROJECT.md` 的端口分配表)
- CI runner 用户与 `RUNNER_USER` 是否一致
## 验收
- 在一台**故意缺三项**的环境上跑一次,输出里三条都在,且每条带修复命令(反证:
补齐其中一条后,它从输出里消失,另外两条仍在);
- 全部就绪时退出码 0;有任何缺失时非 0。
- `new-environment-bringup.md` 第 4 节引用它。
## 参考
- `.harness/instructions/new-environment-bringup.md`
- `.harness/instructions/deployment-verification-standard.md`
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the pnpm harness env-check entry point and read .harness/instructions/new-environment-bringup.md, deployment-verification-standard.md, deploy.sh, deploy-gate.sh, and project/PROJECT.md. Trace the existing checks and their comparison logic before defining the single-source environment-key list. Done means one run reports every missing item with a repair command, updates as items are fixed, returns 0 only when ready, and is referenced from section 4 of new-environment-bringup.md.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, shell, typescript
- Domain
- ci-cd, devops, infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100