docs: codify commander firsthand rules
This commit is contained in:
@@ -1,67 +1,75 @@
|
||||
# HWLAB Commander Collaboration Reference
|
||||
# HWLAB 指挥官协作参考
|
||||
|
||||
This reference defines stable commander, runner, branch, and prompt handoff
|
||||
rules.
|
||||
本文定义 HWLAB 指挥官、runner、分支、PR 和 prompt handoff 的长期规则。
|
||||
|
||||
## Worktree Rules
|
||||
## 指挥作风
|
||||
|
||||
- Use `/workspace/hwlab` as the normal runner and commander worktree.
|
||||
- Start by checking the branch and working tree status.
|
||||
- Keep D601 publishing and rollout work in `/home/ubuntu/workspace/hwlab`.
|
||||
- Do not clean, reset, or reuse unrelated runner worktrees for publishing.
|
||||
- 指挥官必须亲自掌握关键一手事实,不能只依赖 runner 的二手摘要。
|
||||
- 必须亲自查看 `http://74.48.78.17:16666/` 默认首屏、`/gate` 或内部诊断页、关键 PR diff、部署 revision、DEV 验收结果和失败证据。
|
||||
- 一层 Code Queue 直接执行业务实现、修复、部署和验证是允许的基层指挥模式。
|
||||
- 不得把战略判断、是否偏离用户目标的判断、关键 PR 最终审查、关键部署证据审查、指挥官自我反省和指挥规则更新外派给 runner。
|
||||
- 不得为了 Gate 生成 Gate、为了报告生成报告、为了审查再派审查、为了管理继续拆管理;Gate、报告、预检和观测脚本只能作为真实上线、真实 E2E 或 blocker 解除的必要最小工具。
|
||||
- 派单前必须能回答该任务直接带来的用户可见变化、运行态变化或 blocker 解除是什么;回答不了时默认不派单。
|
||||
- 用户反馈 issue 默认高优先级处理;`pikasTech/HWLAB#131` 是当前指挥作风纠偏的权威来源。
|
||||
|
||||
## Branch And PR Workflow
|
||||
## 工作区规则
|
||||
|
||||
- Create a short branch from latest `origin/main`.
|
||||
- Do not push directly to `main`.
|
||||
- Do not change PROD.
|
||||
- Do not restart services unless a task explicitly authorizes it.
|
||||
- Open a PR against `pikasTech/HWLAB:main`.
|
||||
- Do not merge the PR from the runner.
|
||||
- Let the commander review complex conflicts; runners should not perform broad
|
||||
conflict surgery unless explicitly assigned.
|
||||
- 常规 runner 和指挥官工作区是 `/workspace/hwlab`。
|
||||
- 进入仓库先检查分支和工作树状态。
|
||||
- D601 发布和 rollout 工作区是 `/home/ubuntu/workspace/hwlab`。
|
||||
- 不要清理、reset 或复用无关 runner worktree 作为发布真相。
|
||||
|
||||
## Prompt Contract
|
||||
## 分支和 PR 工作流
|
||||
|
||||
Every HWLAB runner task should be self-contained. Include:
|
||||
- 从最新 `origin/main` 创建短分支。
|
||||
- 不要直推 `main`。
|
||||
- 不要修改 PROD。
|
||||
- 除非任务明确授权,不要重启服务。
|
||||
- 向 `pikasTech/HWLAB:main` 创建 PR。
|
||||
- runner 不合并自己的 PR。
|
||||
- PR 冲突由指挥官审阅并处理;runner 不做大范围冲突手术,除非被明确分配。
|
||||
- 指挥官合并 PR 时必须同时 review,确认方向没有偏离 #7、#78、#99 和当前用户反馈。
|
||||
|
||||
- repository and worktree path;
|
||||
- branch base and target PR branch;
|
||||
- objective and linked issue context;
|
||||
- current stable constraints, especially `DC-DCSN-P0-2026-003` when relevant;
|
||||
- forbidden actions;
|
||||
- acceptance criteria;
|
||||
- exact validation commands;
|
||||
- final response requirements.
|
||||
## Prompt 合同
|
||||
|
||||
Do not assume the runner can read issue comments. When issue/PR visibility is
|
||||
needed, run:
|
||||
每个 HWLAB runner 任务必须自包含,并包含:
|
||||
|
||||
- 仓库和工作区路径;
|
||||
- 分支 base 和目标 PR 分支;
|
||||
- 任务目标和关联 issue 背景;
|
||||
- 当前稳定约束,尤其是相关时必须引用 `DC-DCSN-P0-2026-003`;
|
||||
- 禁止动作;
|
||||
- 验收标准;
|
||||
- 精确验证命令;
|
||||
- 最终回复要求。
|
||||
|
||||
派单前必须用 dry-run 或提交结果确认 prompt 实际内容不是本地临时文件路径、空字符串或被 shell 转义污染的文本。误派的任务要立即 cancel,并在后续派单中改用 `--prompt-file`。
|
||||
|
||||
不要假设 runner 能读取 issue 评论。需要 issue/PR 可见性时,运行:
|
||||
|
||||
```sh
|
||||
node scripts/runner-issue-visibility-preflight.mjs
|
||||
```
|
||||
|
||||
Use [runner-issue-visibility-handoff.md](runner-issue-visibility-handoff.md)
|
||||
as the detailed prompt handoff contract.
|
||||
详细 prompt handoff 合同见 [runner-issue-visibility-handoff.md](runner-issue-visibility-handoff.md)。
|
||||
|
||||
## Review Guardrails
|
||||
## 审查护栏
|
||||
|
||||
During review, reject outputs that:
|
||||
审查时必须拒绝以下输出:
|
||||
|
||||
- use SOURCE, LOCAL, DRY-RUN, fixtures, edge-only health, or front-end state as
|
||||
DEV-LIVE;
|
||||
- bypass `hwlab-patch-panel` for M3;
|
||||
- use UniDesk runtime as a substitute for HWLAB runtime;
|
||||
- put Gate or diagnostics back as the default Cloud Web homepage;
|
||||
- use legacy public `:6666` or `:6667` as current DEV entry points.
|
||||
- 把 SOURCE、LOCAL、DRY-RUN、fixture、edge-only health 或前端状态说成 DEV-LIVE;
|
||||
- M3 绕过 `hwlab-patch-panel`;
|
||||
- 用 UniDesk runtime 替代 HWLAB runtime;
|
||||
- 把 Gate 或 diagnostics 放回 Cloud Web 默认首页;
|
||||
- 继续使用历史公网 `:6666` 或 `:6667` 作为当前 DEV 入口;
|
||||
- 把 runner kubeconfig 缺失、runner 观测 gap 或瞬时网络问题直接写成 D601/k3s 不可用;
|
||||
- 用报告完成、Gate 通过、预检通过替代用户可见上线、真实 DEV 运行态变化或 M3 blocker 解除。
|
||||
|
||||
## Stable Sources
|
||||
## 稳定来源
|
||||
|
||||
- [pikasTech/HWLAB#7](https://github.com/pikasTech/HWLAB/issues/7): current
|
||||
commander board.
|
||||
- [pikasTech/HWLAB#78](https://github.com/pikasTech/HWLAB/issues/78): M3
|
||||
prompt and review constraints.
|
||||
- [pikasTech/HWLAB#109](https://github.com/pikasTech/HWLAB/issues/109):
|
||||
documentation governance task.
|
||||
- [runner-issue-visibility-handoff.md](runner-issue-visibility-handoff.md):
|
||||
detailed runner visibility and prompt handoff.
|
||||
- [pikasTech/HWLAB#7](https://github.com/pikasTech/HWLAB/issues/7):当前指挥官总看板。
|
||||
- [pikasTech/HWLAB#78](https://github.com/pikasTech/HWLAB/issues/78):M3 prompt 和审查约束。
|
||||
- [pikasTech/HWLAB#99](https://github.com/pikasTech/HWLAB/issues/99):Cloud Workbench 用户工作台主线。
|
||||
- [pikasTech/HWLAB#131](https://github.com/pikasTech/HWLAB/issues/131):指挥作风纠偏,一手调研和真实推进规则。
|
||||
- [pikasTech/HWLAB#109](https://github.com/pikasTech/HWLAB/issues/109):文档治理任务。
|
||||
- [runner-issue-visibility-handoff.md](runner-issue-visibility-handoff.md):runner 可见性和 prompt handoff 详细规则。
|
||||
|
||||
Reference in New Issue
Block a user