@aibyzero/cm-workflow 0.16.9 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.codex-plugin/plugin.json +1 -1
- package/CHANGELOG.md +12 -0
- package/README.md +9 -1
- package/VERSION +1 -1
- package/docs/cm-control-policy-v2.md +331 -0
- package/docs/execution-optimizations.md +1 -1
- package/docs/external-models.md +3 -3
- package/docs/human-correction.md +5 -5
- package/docs/installation.md +1 -1
- package/docs/js-workflow-control.md +101 -84
- package/docs/next-steps.md +11 -0
- package/docs/untested-branches.md +2 -3
- package/docs/user-guide.md +3 -3
- package/package.json +1 -1
- package/runtime/js/cm-ai/cm-ai-conversation-entry.mjs +13 -69
- package/runtime/js/cm-ai/cm-ai-qa-log.mjs +10 -5
- package/runtime/js/cm-ai/control-policy.mjs +111 -0
- package/runtime/js/cm-ai/drive-bootstrap.mjs +11 -8
- package/runtime/js/cm-ai/durable-runner-state.mjs +32 -126
- package/runtime/js/cm-ai/gate-bridge.mjs +4 -4
- package/runtime/js/cm-ai/host-conversation-execution.mjs +22 -20
- package/runtime/js/cm-ai/host-qa-fix-owner.mjs +11 -2
- package/runtime/js/cm-ai/host-qa-policy.mjs +63 -21
- package/runtime/js/cm-ai/host-review-authority.mjs +2 -2
- package/runtime/js/cm-ai/host-review-file.mjs +1 -1
- package/runtime/js/cm-ai/host-tool-bridge.mjs +3 -0
- package/runtime/js/cm-ai/host-workflow-capabilities.mjs +21 -10
- package/runtime/js/cm-ai/host.mjs +1 -2
- package/runtime/js/cm-ai/operator-guidance.mjs +1 -24
- package/runtime/js/cm-ai/review-package.mjs +16 -4
- package/runtime/js/cm-ai/reviewed-deliveries.mjs +1 -1
- package/runtime/js/cm-ai/task-runner.mjs +36 -99
- package/runtime/js/cm-init/review-evidence.mjs +3 -1
- package/runtime/js/cm-prd/review-host.mjs +1 -1
- package/runtime/js/cm-prd/review-publication.mjs +5 -3
- package/runtime/js/cm-refactor/workflow.mjs +1 -1
- package/runtime/js/notify-send.mjs +15 -14
- package/runtime/js/notify.mjs +27 -4
- package/runtime/js/policy-binding-compat.mjs +2 -1
- package/runtime/review.md +52 -7
- package/runtime/task-gates.md +107 -9
- package/scripts/cm-ai-abandon-effect-position.test.mjs +1 -8
- package/scripts/cm-ai-answer-gap-driver.test.mjs +12 -12
- package/scripts/cm-ai-answer-gap-fixture.mjs +1 -8
- package/scripts/cm-ai-batch-drive.mjs +50 -31
- package/scripts/cm-ai-batch-drive.test.mjs +62 -19
- package/scripts/cm-ai-batch-host.mjs +39 -20
- package/scripts/cm-ai-batch-host.test.mjs +62 -38
- package/scripts/cm-ai-batch-run-fixture.mjs +6 -53
- package/scripts/cm-ai-batch-run-member-stops.test.mjs +0 -12
- package/scripts/cm-ai-batch-run.mjs +34 -8
- package/scripts/cm-ai-bootstrap-flow.test.mjs +1 -7
- package/scripts/cm-ai-bootstrap.test.mjs +2 -3
- package/scripts/cm-ai-control-launch.test.mjs +219 -0
- package/scripts/cm-ai-control-policy.test.mjs +124 -0
- package/scripts/cm-ai-control-v2-drive.test.mjs +270 -0
- package/scripts/cm-ai-develop-answer-invalid.test.mjs +1 -8
- package/scripts/cm-ai-develop-call-timeout.test.mjs +1 -8
- package/scripts/cm-ai-develop-driver-gaps.test.mjs +33 -20
- package/scripts/cm-ai-direct-review.test.mjs +348 -0
- package/scripts/cm-ai-documentation-sync-gap.test.mjs +3 -3
- package/scripts/cm-ai-drive-bootstrap-rules.test.mjs +54 -25
- package/scripts/cm-ai-drive.mjs +96 -54
- package/scripts/cm-ai-drive.test.mjs +43 -84
- package/scripts/cm-ai-fix-integration.test.mjs +3 -5
- package/scripts/cm-ai-fix-later-delivery.test.mjs +3 -6
- package/scripts/cm-ai-fix-run-delivery.test.mjs +3 -6
- package/scripts/cm-ai-host-cli-workflow.test.mjs +6 -10
- package/scripts/cm-ai-host-fixture.mjs +38 -10
- package/scripts/cm-ai-host-protected.test.mjs +35 -33
- package/scripts/cm-ai-host.mjs +103 -93
- package/scripts/cm-ai-host.test.mjs +19 -18
- package/scripts/cm-ai-launch-diagnostics.test.mjs +5 -3
- package/scripts/cm-ai-legacy-history.test.mjs +53 -0
- package/scripts/cm-ai-light-modules.test.mjs +4 -7
- package/scripts/cm-ai-multi-root.test.mjs +4 -4
- package/scripts/cm-ai-nested-execution.test.mjs +16 -19
- package/scripts/cm-ai-progress.test.mjs +10 -8
- package/scripts/cm-ai-project-qa-gate.test.mjs +37 -10
- package/scripts/cm-ai-protected-scope.test.mjs +1 -2
- package/scripts/cm-ai-qa-config-revision.test.mjs +1 -9
- package/scripts/cm-ai-qa-fingerprint-config.test.mjs +12 -9
- package/scripts/cm-ai-qa-fix-cross-session.test.mjs +18 -3
- package/scripts/cm-ai-qa-fixed-log.test.mjs +41 -0
- package/scripts/cm-ai-qa-recovery-args.test.mjs +7 -0
- package/scripts/cm-ai-qa-rerun-timeouts.test.mjs +3 -4
- package/scripts/cm-ai-review-drift-precedence.test.mjs +1 -1
- package/scripts/cm-ai-review-failure.test.mjs +13 -19
- package/scripts/cm-ai-review-timeout-config.test.mjs +3 -1
- package/scripts/cm-ai-review-timeout.test.mjs +15 -128
- package/scripts/cm-ai-run.mjs +78 -24
- package/scripts/cm-ai-run.test.mjs +11 -38
- package/scripts/cm-ai-selection-guard.test.mjs +2 -2
- package/scripts/cm-ai-session-chain.test.mjs +18 -15
- package/scripts/cm-ai-spec-rebind.test.mjs +14 -18
- package/scripts/cm-ai-supersede.test.mjs +3 -10
- package/scripts/cm-blocked-reason.test.mjs +2 -3
- package/scripts/cm-capability-gate.test.mjs +33 -1
- package/scripts/cm-check-drive-files.mjs +1 -1
- package/scripts/cm-check-runtime.sh +1 -1
- package/scripts/cm-claude-worker.test.mjs +5 -3
- package/scripts/cm-controlled-correction.test.mjs +469 -0
- package/scripts/cm-external-batch-host.test.mjs +30 -11
- package/scripts/cm-external-model-host.test.mjs +1 -1
- package/scripts/cm-external-model-recovery.test.mjs +3 -9
- package/scripts/cm-external-qa-fix.test.mjs +1 -1
- package/scripts/cm-external-review-reconciliation.test.mjs +6 -24
- package/scripts/cm-fix-review-recovery.test.mjs +1 -1
- package/scripts/cm-host-qa-executor.test.mjs +1 -2
- package/scripts/cm-host-qa-policy.test.mjs +43 -16
- package/scripts/cm-host-review-authority.test.mjs +0 -31
- package/scripts/cm-knowledge-closeout.test.mjs +3 -3
- package/scripts/cm-notify-command.test.mjs +54 -18
- package/scripts/cm-notify-read-drift.test.mjs +69 -4
- package/scripts/cm-notify.mjs +16 -4
- package/scripts/cm-notify.test.mjs +91 -19
- package/scripts/cm-patrol.test.mjs +3 -2
- package/scripts/cm-task-gate-correction.test.mjs +69 -16
- package/scripts/cm-task-gate.mjs +368 -34
- package/scripts/cm-task-gate.py +2 -0
- package/scripts/cm-task-gate.test.mjs +252 -4
- package/scripts/fixtures/bootstrap-review-runner.mjs +1 -7
- package/scripts/fixtures/native-gate-fixture.mjs +18 -0
- package/scripts/policy-binding-compat.test.mjs +4 -0
- package/skills/cm-ai/SKILL.md +8 -6
- package/skills/cm-ai/references/N3-execute-task.md +17 -2
- package/skills/cm-ai/references/N4-review.md +11 -21
- package/skills/cm-ai/references/N5-mark-done.md +1 -1
- package/skills/cm-ai/references/N6-qa-eval.md +49 -21
- package/skills/cm-ai/references/js-host-modes.md +35 -14
- package/skills/cm-ai/references/js-host-qa-recovery.md +60 -12
- package/skills/cm-ai/references/js-host-recovery.md +95 -47
- package/skills/cm-ai/references/js-host.md +65 -28
- package/skills/cm-fix/SKILL.md +12 -0
- package/skills/cm-init/references/js-host.md +1 -1
- package/skills/cm-prd/references/js-host.md +1 -1
- package/skills/cm-refactor/SKILL.md +12 -0
- package/runtime/js/cm-ai/review-dispatch-limits.mjs +0 -18
- package/scripts/cm-ai-review-dispatch-exit.test.mjs +0 -475
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cm-workflow",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "Spec-driven product development workflow for Codex: external research, PRD, implementation, read-only feature testing, review, QA, fixes, refactors, and documentation.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "cm-workflow maintainers",
|
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,18 @@
|
|
|
7
7
|
|
|
8
8
|
(暂无)
|
|
9
9
|
|
|
10
|
+
## 0.17.0 — 2026-10-12
|
|
11
|
+
|
|
12
|
+
- **新建 `cm-ai` 运行改用 `--control-config` 选能力**:`development` / `bootstrap` / `qa` / `qaFix` 四个模式替代逐项 `--allow-*`;常规独立审查在已确认范围内自动推进最多两轮,不再逐轮要授权参数。旧运行与旧 PLAN 继续走原协议,两种入口不能互用;异常恢复先 `status` 看到 `controlTarget`,再原样带回 `expectedControl`。合同见 `docs/cm-control-policy-v2.md`。
|
|
13
|
+
- **门禁目标收缩为防手滑与过期证据**:cm-ai 独立审查改为直接派发,删除「决定 → grant」交换和 `--human-authorized`;`independent`、`reviewer`、`decision_source` 统一为「来源声明」,文档写明门禁不承诺抵抗拥有完整写权限的人。旧 grant 登记的运行在命令行入口确定性报 `runner_invocation`,新增只读 `inspect-history` 查看历史,不恢复 grant、不改 journal。
|
|
14
|
+
- **N4 删除作者自审前置**,直接进入独立审查;N3 的正常检查继续保留,历史非独立凭证仍不能授权完成。
|
|
15
|
+
- **N6 改为固定检查点**:保留 feature 完成与连续五项未 QA;migration、认证、授权、支付和 API 由现有 workflow 的 `qa.criticalPaths` 与 runner 基线核对清单匹配。新决策 `score: null`,无命中为 `no_fixed_trigger`;API 收尾合并、旧整数记录、QA 执行类型与 blocking 用例合同保留。`qa_assess` 只确认清单来源,不再由会话提交类别。
|
|
16
|
+
- **兼容手工 N1–N8 门禁新增 `capture-baseline`**:N3 编辑前复用 review-package 捕获无内容清单;命令行 N4/N5 与完成入口按任务起点累计核对 `changed_files` 的新增、修改、删除等集,排除 specs 与 `.reviews`。库调用默认行为不变,JS 使用自己的审查包基线;cm-fix、cm-refactor 手工步骤补齐编辑前捕获。缺基线只经现有 `--allow-legacy-unbound` 披露清单未核验,原内容绑定与 handoff schema 保持不变。
|
|
17
|
+
- **兼容任务第二轮阻断后可做一次受控补正**:新增 `prepare-controlled-correction` / `publish-controlled-correction-review`,在原批准范围内修订一次并做一次独立审查;补正审查正文为严格 JSON(`conclusion` / `findings` / `resolved_findings`),零问题措辞不能掩盖未解 P2。与旧人工补正共用准备锁、互斥;有 JS journal、run 或未知证据时拒绝准备。
|
|
18
|
+
- **提醒发送失败时能看出原因**:托管发送器把「超过 12 秒期限」改为退出码 5、「意外错误」改为退出码 6,网络请求失败仍是 3。`notify.log` 只记退出码,以前超时和断网都记成 `exit_3`,分不清;现在一眼能看出是哪种。`/cm:notify test` 的结果文案同步更新。
|
|
19
|
+
- **提醒不再被坏文件卡住**:锁文件与 `notify-state.json` 改为不跟随链接、不阻塞的有界读取,命名管道、符号链接、超大文件一律跳过并记进 `notify.log`。
|
|
20
|
+
- **清单核对的排除范围收窄**:只排除代码根自己的 `.reviews` 和 specs 子树,代码里嵌套的同名目录算改动。导入扫描改为单遍词法分析,字符串、注释、正则里的假 `import` 不再误报漏报。`native-gate-fixture` 挪进 `scripts/fixtures` 随 npm 包发布,旧位置留转发。
|
|
21
|
+
|
|
10
22
|
## 0.16.9 — 2026-10-10
|
|
11
23
|
|
|
12
24
|
这一版主要补齐「外部应答缺口」第 1~4 批:外部应答缺失、无效、迟到或进程断开时,`cm-ai` 不再卡死,而是以可重试的退出或带中文指引的明确拒绝收尾;新增 `/cm:notify` 在 Bark 与 pushplus 之间切换并可自定义提醒文案;测试和 CI 也更快。
|
package/README.md
CHANGED
|
@@ -17,6 +17,14 @@
|
|
|
17
17
|
|
|
18
18
|
## 最近更新
|
|
19
19
|
|
|
20
|
+
**0.17.0**
|
|
21
|
+
|
|
22
|
+
- **升级注意**:新建 `cm-ai` 运行改用 `--control-config` 选能力(`development` / `bootstrap` / `qa` / `qaFix` 四个模式),不再传一串 `--allow-*`;`--human-authorized` 已删除。已经在跑的旧运行继续按原协议走完,两种入口不能互用。
|
|
23
|
+
- **审查不再逐轮要授权**:常规独立审查在已确认范围内自动推进最多两轮;N4 不再先让作者自审。门禁的目标收缩为「防手滑、防过期证据」,文档写明它不承诺抵抗拥有完整写权限的人。
|
|
24
|
+
- **N6 质检改成固定检查点**:feature 完成、连续五项没做 QA,以及 migration、认证、授权、支付、API 这些关键路径命中就触发,不再打四维分数。
|
|
25
|
+
- **手工走 N1–N8 的项目也能核对改动清单**:N3 编辑前先 `capture-baseline`,N4/N5 和完成入口按实际新增、修改、删除的文件核对 `changed_files`;兼容任务第二轮阻断后可以做一次有来源声明的受控补正。
|
|
26
|
+
- **提醒更结实**:设置、锁和状态文件被换成链接、管道或超大文件时直接跳过不卡住;发送失败能从 `notify.log` 看出是超时(5)、断网(3)还是意外错误(6)。
|
|
27
|
+
|
|
20
28
|
**0.16.9**
|
|
21
29
|
|
|
22
30
|
- **新增 `/cm:notify`(Codex 里是 `$cm-notify`)**:卡住、结束、等待的手机提醒可以在 Bark(iOS)和 pushplus(微信)之间一条命令切换,同一时刻只开一个。能看到两个渠道的密钥有没有填好(只说填没填,不显示内容),能发一条测试推送确认真的收得到,也能先预览、再自定义提醒的标题和正文。暂不支持 Windows。见[使用手册](docs/user-guide.md#卡住时提醒到手机可选)。
|
|
@@ -232,7 +240,7 @@ $cm-check
|
|
|
232
240
|
|
|
233
241
|
仓库直接分发 Skills 和脚本,无需在仓库根目录运行 `npm install` 或构建。完整安装行为、覆盖范围和卸载说明见[安装指南](docs/installation.md)。
|
|
234
242
|
|
|
235
|
-
需要固定版本时可使用 `npx @aibyzero/cm-workflow@0.
|
|
243
|
+
需要固定版本时可使用 `npx @aibyzero/cm-workflow@0.17.0 install`,请在 CM Workflow 源码仓库以外的目录执行,例如用户主目录。npm 安装入口复用原安装器,要求与覆盖范围见[安装指南](docs/installation.md#npm-installation-macos-codex)。
|
|
236
244
|
|
|
237
245
|
## 升级旧版本
|
|
238
246
|
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.17.0
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
# cm-ai control policy v2
|
|
2
|
+
|
|
3
|
+
control policy v2 把运行能力集中到一个严格的策略文件。原配置继续定义模型、命令、路径与预算。
|
|
4
|
+
加载配置不自动开启能力;策略也不能补齐缺失的配置。新建运行显式选择策略,旧运行继续原协议。
|
|
5
|
+
|
|
6
|
+
## 策略文件与能力
|
|
7
|
+
|
|
8
|
+
`POLICY.json` 必须完整包含以下五个字段,不接受额外字段、缺失字段、布尔值或旧权限数组:
|
|
9
|
+
|
|
10
|
+
```json
|
|
11
|
+
{
|
|
12
|
+
"version": 2,
|
|
13
|
+
"development": "conversation",
|
|
14
|
+
"bootstrap": "disabled",
|
|
15
|
+
"qa": "disabled",
|
|
16
|
+
"qaFix": "disabled"
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
| 字段 | 允许值 | 含义与前提 |
|
|
21
|
+
| --- | --- | --- |
|
|
22
|
+
| `version` | `2` | 固定为新版协议 |
|
|
23
|
+
| `development` | `conversation`、`provider` | 由当前会话应答开发请求,或使用原 provider 开发配置与保护边界 |
|
|
24
|
+
| `bootstrap` | `disabled`、`write` | 禁用或启用已批准 bootstrap 目标的规范写入;启用仍需原 bootstrap 配置与固定目标 |
|
|
25
|
+
| `qa` | `disabled`、`run` | 禁用或运行原测试合同与 QA 配置;必需 QA 不能靠 disabled 跳过 |
|
|
26
|
+
| `qaFix` | `disabled`、`manual`、`auto` | 禁用 QA 修复、显式选择原修复入口,或使用原已配置的自动修复;不改变修复子运行的门禁 |
|
|
27
|
+
|
|
28
|
+
`qaFix` 选择 `manual` 或 `auto` 时,`qa` 必须为 `run`;不满足时返回 `invalid_input`。
|
|
29
|
+
批次目前不支持 QA 修复,`qaFix` 必须为 `disabled`。其他值返回 `invalid_arguments`。
|
|
30
|
+
模式与配置冲突用 `invalid_arguments`;缺少必需配置仍沿原具体阻断,例如 `qa_fix_source_required`、`qa_fix_auto_authorization_required`。不得自动补开能力或改用另一入口。
|
|
31
|
+
`qa:"disabled"` 只关闭实际 QA executor,仍执行 `qa_assess` 清单来源确认和固定检查点判定;驾驶员只需合法的 `{"confirmed":true}` 答案。
|
|
32
|
+
关键路径登记使用现有工作流配置的 `qa.criticalPaths`,详见 [JS workflow control](js-workflow-control.md)。未登记关键路径的项目,N6 不做任何风险识别,只有这两个固定点。两点为 feature 完成及连续五项未 QA。`policies.tests` 只控制执行类型,不取消必跑;blocking cases 与环境 BLOCKED 合同不变。
|
|
33
|
+
触发必需 QA 却没有 executor 时,真实停点为 `qa_triggered`、`pendingAction:"qa_execution"`;不得报告 QA PASS 或 `run_done`。
|
|
34
|
+
`qaFix:"auto"` 只启用原自动修复能力,不替代其故障分型、范围、诊断、测试、fresh Review 和完成门禁。
|
|
35
|
+
|
|
36
|
+
审查不另加策略开关。当前已选任务在已确认范围内自动走最多两轮常规独立审查。
|
|
37
|
+
第 1 轮要求修改时,修订后使用 fresh Review;第 2 轮仍有阻断就停止,不创建第 3 轮。
|
|
38
|
+
审查配置仍在 create 时冻结。`--review-config` 缺失、模型或保护配置不可用时保留原具体阻断。
|
|
39
|
+
|
|
40
|
+
## 配置、来源声明与门禁的分工
|
|
41
|
+
|
|
42
|
+
| 材料 | 提供什么 | 不能证明什么 |
|
|
43
|
+
| --- | --- | --- |
|
|
44
|
+
| 已批准规格与当前用户对话 | 已确认任务范围与动作要求 | push、发布、部署或资金动作仍须单独确认 |
|
|
45
|
+
| `POLICY.json` | 已确认范围内明确启用的运行能力 | 不扩大 scope,不提供缺失模型或命令 |
|
|
46
|
+
| 原 review、workflow、protected、bootstrap、QA 修复配置 | 模型、命令、路径、保护方式与预算 | 加载配置不自动启用对应能力 |
|
|
47
|
+
| `reviewer`、`independent`、`decision_source` | 审查或决定的来源声明 | 不验证审查者身份或实际人工交互 |
|
|
48
|
+
| `expectedControl` | 显式恢复操作绑定的已展示状态目标 | 不授权新能力,不替代独立审查或完成凭证 |
|
|
49
|
+
|
|
50
|
+
CM 门禁检查来源声明的格式、任务与轮次、材料摘要、当前文件和执行记录的一致性,用于防手滑与过期证据。来源声明不验证审查者身份或实际人工交互;门禁不承诺抵抗拥有完整文件写权限和 shell 能力的会话造假。fresh 上下文、审查结果、检查通过和完成复查仍是正常工作流路径的完成条件。发布、部署、资金及其他范围外动作继续遵守其单独确认要求。
|
|
51
|
+
|
|
52
|
+
cm-ai 新旧入口均直接推进常规审查,不使用按轮 grant、TTL 或拒绝确认预算。策略、模型输出、operator 名称和返回 `approved` 不扩大本次任务范围;安装、push、发布、部署、资金和主网动作按其单独确认要求执行。
|
|
53
|
+
|
|
54
|
+
## 单任务启动
|
|
55
|
+
|
|
56
|
+
以下示例中的 `run.json` 是原准入工具生成且已核对的运行定义,`review.json` 是原 reviewer 配置。
|
|
57
|
+
当前会话 ID 来自真实宿主。脚本路径从活动 Skill 的插件根解析,不硬编码安装缓存。
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
node "{CM_WORKFLOW_ROOT}/scripts/cm-ai-host.mjs" serve \
|
|
61
|
+
--config run.json --mode create --host-context "{当前真实会话ID}" \
|
|
62
|
+
--control-config POLICY.json --review-config review.json --runtime codex
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
`--control-config` 位于原 config/mode/context 参数后,替代旧 `--allow-development`。
|
|
66
|
+
v2 **禁止任何 `--allow-*`**。`--workflow-config`、`--bootstrap-config`、`--protected-config` 等原配置参数按实际能力提供。
|
|
67
|
+
transport、模型选择与保护配置仍沿原合同;策略不是任意命令、动态模块或新 adapter。
|
|
68
|
+
|
|
69
|
+
收到 `host_ready` 后,发送请求 `version:2`;identity 沿运行定义和当前状态,不手改 attempt:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"version": 2,
|
|
74
|
+
"requestId": "advance-1",
|
|
75
|
+
"operation": "advance",
|
|
76
|
+
"identity": {
|
|
77
|
+
"repositoryId": "{原仓库ID}",
|
|
78
|
+
"runId": "{原运行ID}",
|
|
79
|
+
"taskId": "{当前任务ID}",
|
|
80
|
+
"attempt": 1
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
`advance` 沿原阶段推进。宿主过程中发出的 `host_request` 必须实时应答,不能等 advance 结束才读取。
|
|
86
|
+
当前会话只按固定任务与 scope 执行工具请求;开发、检查、QA 与文档结果沿原合同。
|
|
87
|
+
完成仍以原 runner、fresh 独立 Review、完成前复查及 finalizer 的真实结果为准。
|
|
88
|
+
|
|
89
|
+
## 驾驶员 PLAN
|
|
90
|
+
|
|
91
|
+
新 PLAN 必须显式包含相对 PLAN 文件的 `controlConfig` 路径。`permissions` 保留配置与运行参数,不含 `--allow-*`:
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"config": "run.json",
|
|
96
|
+
"controlConfig": "POLICY.json",
|
|
97
|
+
"mode": "create",
|
|
98
|
+
"hostContext": "{当前真实会话ID}",
|
|
99
|
+
"runtime": "codex",
|
|
100
|
+
"permissions": ["--review-config", "review.json"],
|
|
101
|
+
"answers": "answers",
|
|
102
|
+
"checks": [{"id": "syntax", "command": ["node", "--check", "target.mjs"]}]
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
node "{CM_WORKFLOW_ROOT}/scripts/cm-ai-drive.mjs" --plan PLAN.json advance
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
`checks` 必须是真实命令,结果由驾驶员实跑,不读取静态 `check.json`。
|
|
111
|
+
答案文件沿原合同:首轮 `develop.json` 或 `develop-a1.json`,第二轮只读 `develop-a2.json`。
|
|
112
|
+
自动审查可能要求第 2 轮开发。尚无 a2 答案时驾驶员 hold,在 `changes_requested/revision_answer_required` 停住,不写第二轮开发 intent。
|
|
113
|
+
读取原 r1 的真实 findings 后准备修订答案,再沿同一 run resume;不复用首轮答案。
|
|
114
|
+
纯 bootstrap 规范任务首轮始终 hold,先读真实 r1,再准备第 2 轮规范答案。
|
|
115
|
+
`develop-a2.json` 与首轮被要求修改的实现逐字节相同时仍由原门禁拒绝,不靠再次推进耗掉审查轮次。
|
|
116
|
+
|
|
117
|
+
普通 resume 的 `advance` 不需要 `expectedControl`。create 禁止 `expectedControl`。
|
|
118
|
+
换会话 resume 仍提供当前 `hostContext` 与创建时的 `originalHostContext`,不冒用旧会话、不换 runtime。
|
|
119
|
+
驾驶员不从 journal 或临时 status 自动生成、刷新恢复目标。
|
|
120
|
+
|
|
121
|
+
## 显式恢复:先展示目标,再固定它
|
|
122
|
+
|
|
123
|
+
`abandon_review`、`abandon_effect`、`develop_redo`、`bootstrap_review_recover`、`reconcile_review`
|
|
124
|
+
及原 QA 修复 `fix_action` 的显式恢复子操作,
|
|
125
|
+
必须绑定操作者实际看到并选择的原状态。普通 `advance` 的自动推进不需要这个绑定。
|
|
126
|
+
|
|
127
|
+
1. 以原策略与配置 `mode:"resume"` 只读 `status`,核对当前 state、code、identity 和原调用是否已停止。QA 修复子操作先读 `fix_status`,使用它返回的含 child 目标。
|
|
128
|
+
2. 展示待恢复操作及它会改变的原记录,取得当前真实对话中对此动作的决定。
|
|
129
|
+
3. 把该次返回的 `controlTarget` 完整复制到 PLAN 的 `expectedControl`;保留固定副本,不再刷新。
|
|
130
|
+
4. 使用相同策略、配置和身份发送显式恢复。需要 reason 的操作仍提供原合同的单行、最多 500 UTF-8 字节原因。
|
|
131
|
+
5. 返回 `snapshot_changed` 时停止。先核对变化与原决定是否仍适用,再形成新的具体决定;不自动读新 target 重发。
|
|
132
|
+
|
|
133
|
+
单任务 `controlTarget` 的严格字段集为:
|
|
134
|
+
|
|
135
|
+
```text
|
|
136
|
+
{version:2, identity, state, code, packageDigest, effectId, invocationId, revision}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
这些值取自 status,包括原 null 值和完整 identity。`revision` 为状态记录摘要绑定;不根据名称猜值、不自己计算替代值。
|
|
140
|
+
目标同时绑定当前身份、状态、审查包、操作 effect 或 invocation 以及记录摘要。
|
|
141
|
+
不同任务、attempt、包、调用或记录发生变化时,旧目标不能消费。
|
|
142
|
+
|
|
143
|
+
QA 修复子运行的显式恢复使用 `fix_status.controlTarget`,包含同一父目标及额外的
|
|
144
|
+
`child:{runId,revision,stage}`。调用 `fix_status` 仍携带原父 identity、失败 QA 的 packageDigest 与 testRunId。
|
|
145
|
+
把这份含 child 的完整目标作为 `fix_action.expectedControl` 或 PLAN.expectedControl。
|
|
146
|
+
普通父 `status` 不提供 child,不能代替 `fix_status`。父目标先核对,子目标在子运行实际 owner lock 内核对;
|
|
147
|
+
子记录或阶段变化时拒绝,不根据模型描述或父记录重建 child,不自动刷新旧目标。
|
|
148
|
+
|
|
149
|
+
例如 `develop_redo` 的恢复 PLAN 沿上述新 PLAN 改为 `mode:"resume"`,另添加真实单行 `reason` 与刚才展示的原 `expectedControl`:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
node "{CM_WORKFLOW_ROOT}/scripts/cm-ai-drive.mjs" --plan recovery.json develop_redo
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
直接宿主请求添加 `version:2`、同一 identity、`operation:"develop_redo"`、`reason` 与完整 `expectedControl`。
|
|
156
|
+
`abandon_review`、`abandon_effect`、`bootstrap_review_recover` 等保留各自原业务前提和预算;expectedControl 不绕过它们。
|
|
157
|
+
缺目标返回 `invalid_input`;目标陈旧或错配返回 `snapshot_changed`。
|
|
158
|
+
|
|
159
|
+
批次 target 的严格字段集为:
|
|
160
|
+
|
|
161
|
+
```text
|
|
162
|
+
{version:2, batchId, taskKey, member:{单任务controlTarget完整字段}, batchDigest}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
批次 status 默认返回当前成员的目标,不新增 `status.taskKey`。成员恢复用原 `taskKey`,绑定原批次、具体成员、成员状态与批次摘要。
|
|
166
|
+
不能把一个成员目标用于另一成员。
|
|
167
|
+
批次 PLAN 继续使用原任务 key、配置、答案布局与 checks 映射;不通过 v2 开放原本不支持的子运行能力。
|
|
168
|
+
批次宿主接受驾驶员传入的 `--mode create|resume` 布局,也保留原不含 `--mode` 的布局:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
node "{CM_WORKFLOW_ROOT}/scripts/cm-ai-batch-host.mjs" serve \
|
|
172
|
+
--config bundle.json --host-context "{当前真实会话ID}" \
|
|
173
|
+
--control-config POLICY.json --review-config review.json --runtime codex
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
含 mode 的布局是在 `--config bundle.json` 后加入 `--mode create|resume`。
|
|
177
|
+
顶层 mode 是入口兼容参数,各成员仍按自己的原运行是否存在选择 create 或 resume;它不强制整个批次使用同一种成员模式。
|
|
178
|
+
|
|
179
|
+
## 单任务启动型恢复:launchControlTarget
|
|
180
|
+
|
|
181
|
+
QA 重跑、QA 配置修订与规格换绑在创建 host 前改变恢复输入,使用单独的启动快照。
|
|
182
|
+
先按原配置只读 status,展示操作和前提,把原 `status.launchControlTarget` 完整保存到普通 UTF-8 JSON 文件,
|
|
183
|
+
再在原 `serve --mode resume` 启动中提供 `--expected-control FILE`。不能用 `status.controlTarget` 代替启动快照。
|
|
184
|
+
目标文件严格校验,拒绝重复键、软链接或硬链接;不自动计算或刷新目标。
|
|
185
|
+
真实 writer lock 内先核对 durable snapshot 与回放状态,缺失或陈旧时不执行修订、不追加恢复 journal。
|
|
186
|
+
|
|
187
|
+
| 原恢复动作 | v2 启动参数,另带原配置与 `--expected-control FILE` |
|
|
188
|
+
| --- | --- |
|
|
189
|
+
| 重跑未知 QA | `--rerun-unknown-qa`;环境故障还可提供原 `--qa-environment-failure REASON` |
|
|
190
|
+
| 重跑已阻断 QA | `--rerun-blocked-qa`;仍满足原可重跑条件与预算 |
|
|
191
|
+
| QA 配置修订 | `--revise-qa-config OLD_WORKFLOW.json --qa-config-revision-reason REASON`;当前 `--workflow-config` 提供已核对的新配置 |
|
|
192
|
+
| 已批准规格材料换绑 | `--rebind-spec-material --spec-rebind-reason REASON`;保留原重新批准与漂移门禁 |
|
|
193
|
+
|
|
194
|
+
例如重跑符合原条件的已阻断 QA:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
node "{CM_WORKFLOW_ROOT}/scripts/cm-ai-host.mjs" serve \
|
|
198
|
+
--config run.json --mode resume --host-context "{当前真实会话ID}" \
|
|
199
|
+
--control-config POLICY.json --review-config review.json --workflow-config workflow.json \
|
|
200
|
+
--expected-control launch-target.json --rerun-blocked-qa --runtime codex
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
`launch-target.json` 保存此前展示的完整 launchControlTarget,不能从本次启动的新状态替换它。
|
|
204
|
+
这些入口仍保留原 QA/规格恢复条件;新快照绑定不扩大可恢复状态、预算或范围。
|
|
205
|
+
普通 wire 操作的 `expectedControl` 与启动参数 `--expected-control` 是两种用途,不可互换。
|
|
206
|
+
v2 create supersede 尚未开放,返回 `supersede_unavailable`;保留原证据,不通过 legacy 作废旧运行。
|
|
207
|
+
|
|
208
|
+
## 旧运行与迁移拒绝
|
|
209
|
+
|
|
210
|
+
| 输入或情形 | 结果 |
|
|
211
|
+
| --- | --- |
|
|
212
|
+
| PLAN 不含 `controlConfig` | 沿原请求 version 1 与能力开关,常规审查直接派发 |
|
|
213
|
+
| cm-ai journal 含旧 grant 通道的审查登记 | `runner_invocation` 在指纹检查前拒绝;保留原记录,`cm-ai-run.mjs inspect-history --config 原run.json` 只读查看 |
|
|
214
|
+
| v2 入口带任意 `--allow-*` | `invalid_arguments` 或驾驶员启动前迁移拒绝 |
|
|
215
|
+
| 旧运行通过 v2 执行,或 v2 运行通过 legacy 执行 | `fingerprint_mismatch`,不转换历史后继续 |
|
|
216
|
+
| 策略启用的能力缺配置 | 沿原具体配置阻断;模式冲突用 `invalid_arguments`,不自动开启 |
|
|
217
|
+
| disabled QA 仍由原判定触发必需 QA | `qa_triggered`、`pendingAction:"qa_execution"`,没有 PASS 或 run_done |
|
|
218
|
+
| 批次 `qaFix` 不是 disabled | `invalid_arguments` |
|
|
219
|
+
| 显式恢复缺固定目标 | `invalid_input` 或驾驶员启动前拒绝 |
|
|
220
|
+
| 固定目标已陈旧或不匹配当前状态 | `snapshot_changed`,不自动刷新 |
|
|
221
|
+
| 恢复时策略改变 | `fingerprint_mismatch`,不替换原策略 |
|
|
222
|
+
| 恢复时原配置发生变化 | 沿原指纹与配置漂移门禁拒绝 |
|
|
223
|
+
| v2 create supersede | `supersede_unavailable`,不走旧入口作废运行 |
|
|
224
|
+
|
|
225
|
+
v2 策略随新运行持久化并纳入新版执行指纹。旧 metadata 中该字段缺省时,原格式与字节保持原样。
|
|
226
|
+
不重写旧 journal、旧指纹或旧控制记录,不把能回放旧记录扩称允许跨入口执行。
|
|
227
|
+
只读 status 可用于核对历史;执行入口仍必须匹配原协议。迁移需要独立的新运行决定,不能就地换入口规避旧证据。
|
|
228
|
+
单任务 QA 重跑、QA 配置修订与规格换绑使用上节 launchControlTarget;批次和 supersede 等出口以实际支持为准,不把单任务恢复合同理解成全部旧出口已开放。
|
|
229
|
+
|
|
230
|
+
## 兼容 taskgate 的一次受控补正
|
|
231
|
+
|
|
232
|
+
**仅支持没有 JS ownership 的兼容 taskgate 任务。** cm-ai 新单任务和批次的第二轮仍正式 blocked,
|
|
233
|
+
本轮没有 runner-owned correction 入口。它们不能通过这里的 prepare/publish/mark-done 完成原 run。
|
|
234
|
+
存在保留的 JS journal、JS run 或 unknown ownership 证据时,兼容 writer 正式拒绝;不得删证据、手改 journal/batch 或改走兼容 writer 绕过 owner。
|
|
235
|
+
准备前先核对该任务没有 JS ownership,准备入口也必须在发现这种证据时拒绝,不能先生成无法完成的半套补正材料。
|
|
236
|
+
兼容 writer 自己会拒绝的残留(空数据库、缺少或不匹配的 `writer-ready.json`、孤立证书)同样在准备前拒绝,不自动修复或重新初始化。
|
|
237
|
+
|
|
238
|
+
下面的 version 2 `cm-controlled-correction` 是独立 taskgate 证据协议,不表示 cm-ai v2 已支持阻断恢复。
|
|
239
|
+
兼容 taskgate 的常规两轮仍有阻断时,保留原 blocked r2 与 P2 等 findings。
|
|
240
|
+
确需在原批准范围内修订时最多使用一次;不新建第三轮,不覆盖 r1/r2 或旧人审协议。
|
|
241
|
+
先实际修改批准 scope、完成相关检查与最终 Learning/handoff,再准备完整修订包。
|
|
242
|
+
兼容 mark-done 只更新权威任务 checkbox,不推进 N6/N7/N8 或产生 `run_done`。
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
node "{CM_WORKFLOW_ROOT}/scripts/cm-task-gate.mjs" prepare-controlled-correction \
|
|
246
|
+
--handoff "{最终修订handoff}" --reviews-dir "{原reviews目录}" \
|
|
247
|
+
--feature "{原feature}" --task "{原task}" --project-root "{原代码根}" \
|
|
248
|
+
--decision-source operator --reason "{真实补正原因}"
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
`--decision-source` 只允许 `operator` 或 `model`,记录为 provenance-only 的来源声明,非身份认证或人工批准。
|
|
252
|
+
该新命令和旧人工补正命令都不接受 `--human-authorized`,不自动调用模型,也不允许自报批准完成。
|
|
253
|
+
返回固定的新 `correction`、`handoff`、`review` 路径及 `correction_sha256`。
|
|
254
|
+
在 Review 发布前,用新返回的 handoff 与 correction 通过原 N4 门禁:
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
node "{CM_WORKFLOW_ROOT}/scripts/cm-task-gate.mjs" check-n4 \
|
|
258
|
+
--handoff "{prepare返回的handoff}" --reviews-dir "{原reviews目录}" \
|
|
259
|
+
--feature "{原feature}" --task "{原task}" --project-root "{原代码根}" \
|
|
260
|
+
--correction "{prepare返回的correction}"
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
使用最终修订包执行 fresh 独立 Review,结果写入 prepare 返回的 review 路径。
|
|
264
|
+
不得复制旧批准或把自审写成独立审查。
|
|
265
|
+
|
|
266
|
+
新 Review 沿原头部字段,包含 `independent:true`、`attempt:2`、`round:2`、`handoff_sha256` 与完整 scope,
|
|
267
|
+
另绑定 `correction_sha256`。`at` 不得早于补正记录时间,reviewer 必须独立。
|
|
268
|
+
新版补正 Review 的正文必须是原始 JSON,精确包含 `conclusion`、`findings`、`resolved_findings` 三个键。
|
|
269
|
+
每条 finding 精确包含非空 `id`、`priority`、非空 `evidence`,priority 只接受 `P0`、`P1`、`P2`、`P3`;两个数组的 ID 合起来必须唯一。
|
|
270
|
+
`findings` 表示本次仍存在的问题,长度必须等于头部 `blocking_findings`。
|
|
271
|
+
`approved` 必须使用 `conclusion:"Zero findings."` 且 `findings:[]`;非 approved 使用 `conclusion:"Blocking findings."`。
|
|
272
|
+
已修复的历史 P2 只写在 `resolved_findings`,保留具体修复证据,不能混入当前 findings 后靠一句“零问题”宣布通过。
|
|
273
|
+
正文不加 Markdown 围栏,不夹带额外文字、字段或第二个 JSON 值;旧 human Review 正文保持原合同。
|
|
274
|
+
|
|
275
|
+
以下是新版补正 Review 文件的完整格式示例。占位摘要与证据必须替换成独立 reviewer 对最终包的真实结果,不可当作实际批准:
|
|
276
|
+
|
|
277
|
+
```text
|
|
278
|
+
---
|
|
279
|
+
at: {独立审查实际ISO时间,且不早于补正记录}
|
|
280
|
+
reviewer: codex-subagent
|
|
281
|
+
independent: true
|
|
282
|
+
task: T-001
|
|
283
|
+
attempt: 2
|
|
284
|
+
round: 2
|
|
285
|
+
verdict: approved
|
|
286
|
+
blocking_findings: 0
|
|
287
|
+
handoff: example-T-001-controlled-correction-handoff.json
|
|
288
|
+
handoff_sha256: {最终handoff的SHA-256}
|
|
289
|
+
correction_sha256: {prepare返回的correction_sha256}
|
|
290
|
+
scope:
|
|
291
|
+
- src/target.mjs
|
|
292
|
+
---
|
|
293
|
+
{
|
|
294
|
+
"conclusion": "Zero findings.",
|
|
295
|
+
"findings": [],
|
|
296
|
+
"resolved_findings": [
|
|
297
|
+
{
|
|
298
|
+
"id": "r2-P2-1",
|
|
299
|
+
"priority": "P2",
|
|
300
|
+
"evidence": "{已核对的修订路径、实际行为与回归检查证据}"
|
|
301
|
+
}
|
|
302
|
+
]
|
|
303
|
+
}
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
若仍有 P2,把它放在 `findings` 并使用 `Blocking findings.`,同时将头部 verdict 与计数改成真实阻断结果。
|
|
307
|
+
合法的阻断 Review 可被封存,但不能完成任务。只有 `approved`、计数零、无当前 finding、完整 scope 与修订后实现/handoff/Learning 全部绑定有效才能通过完成门禁。
|
|
308
|
+
发布调用仍为:
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
node "{CM_WORKFLOW_ROOT}/scripts/cm-task-gate.mjs" publish-controlled-correction-review \
|
|
312
|
+
--handoff "{prepare返回的handoff}" --reviews-dir "{原reviews目录}" \
|
|
313
|
+
--feature "{原feature}" --task "{原task}" --project-root "{原代码根}" \
|
|
314
|
+
--correction "{prepare返回的correction}"
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
发布仍不等于完成。仅满足无 JS ownership 前提的兼容任务继续 `check-n5` 和原 mark-done 门禁,传相同 selectors 与 correction;
|
|
318
|
+
mark-done 另绑定权威 `tasks.md`。内容漂移、旧 r1/r2 不匹配、未定稿 Learning、重复续次或新阻断均拒绝。
|
|
319
|
+
旧 `prepare-human-correction` 的授权与证据合同保持原样,两种 continuation 互斥,不能交叉消费证据。
|
|
320
|
+
两种 prepare 共用固定的 `{feature}-{task}-correction-prepare.lock`,记录 owner PID 与时间;全段互斥,锁冲突立即拒绝,不轮询等待。
|
|
321
|
+
另一协议只留下未封存的孤立 handoff 时,按原准备恢复核对保留它;已有 record、review 或 receipt 时禁止新增另一续次。
|
|
322
|
+
进程中断遗留的锁不自动清理。先核对 owner 确已退出,再核对准备与封存证据,通过明确人工协调处置;
|
|
323
|
+
owner 仍活跃或无法核实是否退出时保留锁与证据,不删锁重试,不宣称自动崩溃恢复。
|
|
324
|
+
|
|
325
|
+
## 交付证据范围
|
|
326
|
+
|
|
327
|
+
这里说明源入口的控制合同。源文件更新不表示已安装插件、当前会话已加载新版 Skill 或真实模型可用。
|
|
328
|
+
本地合成/临时目录检查、实际 provider 调用、独立 Review、安装与生产发布分别报告。
|
|
329
|
+
定向夹具和源码审查结果见本轮交接记录;本文示例不等于真实 provider 或业务运行验收。
|
|
330
|
+
cm-ai 新单任务/批次的 r2 blocked correction completion 未支持;上方独立 taskgate 补正不提供原 runner 或 batch 的完成路径。
|
|
331
|
+
本次本地方案不包含安装、提交、push、发布、部署或资金动作。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Optional execution optimizations, v1
|
|
2
2
|
|
|
3
|
-
Enable `--execution-optimizations` on a **new** `cm-ai-host`, `cm-ai-batch-host`, `cm-fix-host` or `cm-prd-host` launch. The matching drivers accept it in `PLAN.permissions`. Existing
|
|
3
|
+
Enable `--execution-optimizations` on a **new** `cm-ai-host`, `cm-ai-batch-host`, `cm-fix-host` or `cm-prd-host` launch. The matching drivers accept it in `PLAN.permissions`. Existing capability switches, model choices, round limits and timeouts still apply; cm-fix keeps its review grant contract, while cm-ai dispatches review directly. No provider is called by the flag itself.
|
|
4
4
|
|
|
5
5
|
The versioned policy is frozen in the new run configuration. PRD uses a separate v2 session schema; batch has a private `.cm-execution-policy-v1` binding so later members retain the same selection. Recovery reads the original snapshot even if the flag is omitted. Legacy runs remain readable and reject enabling the policy during recovery. QA creates new children with the parent's frozen policy; a legacy child cannot be retrofitted. Removing the flag disables the policy for future runs only. Do not edit snapshots or migrate old runs.
|
|
6
6
|
|
package/docs/external-models.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
当前宿主会话继续使用客户端当前模型;CM 不切换该会话。独立外部 CLI 调用按 provider
|
|
4
4
|
保存一组模型及可选推理强度。同一个 provider 的外部开发、独立审查共用这组参数,
|
|
5
|
-
|
|
5
|
+
审查仍使用新上下文;cm-ai 直接推进常规审查,cm-fix 保留原审查参数合同。项目的 coder/reviewer runtime 路由保持原规则。
|
|
6
6
|
|
|
7
7
|
## 配置一次
|
|
8
8
|
|
|
@@ -90,9 +90,9 @@ node scripts/cm-fix-drive.mjs --plan {FIX_PLAN.json} reconcile_review
|
|
|
90
90
|
```
|
|
91
91
|
|
|
92
92
|
batch PLAN 还需原 `taskKey`。QA 子运行沿原 `fix_action`,`fixOperation: reconcile_review`
|
|
93
|
-
及原 `invocationId
|
|
93
|
+
及原 `invocationId`,仍核对父子关联。对账只核对原调用记录,不启动模型或预检。
|
|
94
94
|
可信迟到合法结果恢复原审查状态;cm-ai 可信 provider failure 对账后允许原一次预算内、
|
|
95
|
-
|
|
95
|
+
新上下文直接重试。cm-fix 对账失败只进入 `review_provider_failed` 明确阻断,未提供
|
|
96
96
|
重试出口。无可信证据时禁止人工 abandon/recover 与自动重派。合法 `changes_requested`
|
|
97
97
|
保留原第二轮预算。旧无新快照的 run 保留原恢复合同,未迁移旧 run。
|
|
98
98
|
|
package/docs/human-correction.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 第二轮 blocked 后的人工补正
|
|
2
2
|
|
|
3
|
-
普通任务最多两轮独立 Review。第二轮 `blocked` 保留原 a1/r1/a2/r2;不得改成第三轮、重置 task/run
|
|
3
|
+
普通任务最多两轮独立 Review。第二轮 `blocked` 保留原 a1/r1/a2/r2;不得改成第三轮、重置 task/run 或覆盖旧报告。主执行者收到用户对具体补正范围的明确确认后,可使用一次性的人工补正入口。原因与原证据摘要记录补正请求;旧格式的 `authorization: explicit-human-confirmation` 保留为来源标签,不验证实际人工交互,也不自造批准。
|
|
4
4
|
|
|
5
5
|
这个入口适用于本地 task-gate 证据链;不会自动改变 cm-ai/cm-fix 宿主 journal 的 blocked 状态、恢复 provider 或提交代码。带宿主的运行仍需其既有恢复合同,不能用 checkbox 反向证明宿主完成。
|
|
6
6
|
|
|
@@ -11,10 +11,10 @@ node {CM_WORKFLOW_ROOT}/scripts/cm-task-gate.mjs prepare-human-correction \
|
|
|
11
11
|
--handoff {FINAL_CORRECTION_DRAFT} \
|
|
12
12
|
--reviews-dir {REVIEWS_DIR} --feature {FEATURE_SLUG} --task {TASK_ID} \
|
|
13
13
|
--project-root {CODE_PROJECT} \
|
|
14
|
-
--
|
|
14
|
+
--reason '{用户确认的具体补正与原因}'
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
输出固定补正 record、handoff、review 路径和 `correction_sha256
|
|
17
|
+
输出固定补正 record、handoff、review 路径和 `correction_sha256`。记录绑定原四份证据的字节摘要、最终 handoff 和补正原因的来源声明;已有 record 时拒绝重新准备。创建中断若只留下完全相同的 handoff,重试可补齐 record;其他残留应保留并人工核对,不覆盖。
|
|
18
18
|
|
|
19
19
|
用输出路径执行 `check-n4`(共同参数包括 `--handoff`、`--reviews-dir`、`--feature`、`--task`、`--project-root`),并增加 `--correction {CORRECTION_RECORD}`。独立 reviewer 在固定的新 review 路径写报告,保持原 task、`attempt: 2`、`round: 2`,绑定新 handoff 的精确摘要,再加:
|
|
20
20
|
|
|
@@ -22,9 +22,9 @@ node {CM_WORKFLOW_ROOT}/scripts/cm-task-gate.mjs prepare-human-correction \
|
|
|
22
22
|
correction_sha256: <准备命令输出的记录摘要>
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
这份报告属于人工补正,不是普通第三轮。审查只允许 `approved` 或 `blocked`;不独立的降级意见只能用于诊断。审查者范围必须覆盖全部 changed_files
|
|
25
|
+
这份报告属于人工补正,不是普通第三轮。审查只允许 `approved` 或 `blocked`;不独立的降级意见只能用于诊断。审查者范围必须覆盖全部 changed_files。主执行者使用 fresh 审查通道。本入口的 `reviewer`、`independent` 是来源声明,门禁核对其格式和材料绑定;补正记录使用上述旧格式来源标签,没有 `decision_source` 字段。
|
|
26
26
|
|
|
27
|
-
报告定稿后,主执行者用相同参数执行 `publish-human-correction-review`,独占创建封存回执。然后 `check-n5 --correction ...`
|
|
27
|
+
报告定稿后,主执行者用相同参数执行 `publish-human-correction-review`,独占创建封存回执。然后 `check-n5 --correction ...` 核对旧历史、来源声明、实现、handoff、review 和封存回执;仅独立 approved 通过。改动任何绑定内容都会使该批准失效。`blocked` 封存后不能覆盖、重审或重新准备;需要新的人工决策,当前一次性入口不提供后续自动循环。
|
|
28
28
|
|
|
29
29
|
若原任务尚未完成,继续使用现有 `python3 scripts/cm-task-gate.py mark-done`,共同参数增加 `--correction {CORRECTION_RECORD}` 和原权威 `--tasks`。完成计划固定八份证据,仍通过既有所有权锁、最终复核和原子替换;普通路径的最多四份证据与两轮规则保持原样。该操作不能绕过活动宿主的 writer。
|
|
30
30
|
|
package/docs/installation.md
CHANGED
|
@@ -76,7 +76,7 @@ Install or upgrade with the same command:
|
|
|
76
76
|
npx @aibyzero/cm-workflow@latest install
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
To pin a version, use `npx @aibyzero/cm-workflow@0.
|
|
79
|
+
To pin a version, use `npx @aibyzero/cm-workflow@0.17.0 install` from outside
|
|
80
80
|
the CM Workflow source checkout (for example, your home directory). Inside a
|
|
81
81
|
checkout with the same package name and version, npm can select the local
|
|
82
82
|
uninstalled package and report `cm-workflow: command not found`.
|