@aibyzero/cm-workflow 0.21.6 → 0.25.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 +58 -0
- package/README.md +18 -3
- package/VERSION +1 -1
- package/docs/architecture.md +9 -0
- package/docs/cm-acceptance-completion.md +3 -1
- package/docs/cm-control-policy-v2.md +35 -3
- package/docs/execution-optimizations.md +1 -1
- package/docs/external-models.md +1 -0
- package/docs/human-correction.md +1 -1
- package/docs/installation.md +42 -16
- package/docs/js-workflow-control.md +65 -30
- package/docs/next-steps.md +10 -0
- package/docs/runtime-failover.md +5 -3
- package/docs/user-guide.md +6 -6
- package/package.json +1 -1
- package/runtime/js/cm-ai/batch-location.mjs +14 -0
- package/runtime/js/cm-ai/batch-plan.mjs +6 -2
- package/runtime/js/cm-ai/checkpoint-package-material.mjs +9 -2
- package/runtime/js/cm-ai/cm-ai-admission.mjs +9 -3
- package/runtime/js/cm-ai/cm-ai-conversation-entry.mjs +51 -8
- package/runtime/js/cm-ai/cm-ai-qa-log.mjs +30 -4
- package/runtime/js/cm-ai/codex-review-adapter.mjs +2 -4
- package/runtime/js/cm-ai/delivery-evidence.mjs +3 -1
- package/runtime/js/cm-ai/developer-adapter.mjs +15 -1
- package/runtime/js/cm-ai/drive-core.mjs +50 -6
- package/runtime/js/cm-ai/drive-next-step.mjs +61 -0
- package/runtime/js/cm-ai/durable-runner-state.mjs +85 -23
- package/runtime/js/cm-ai/execution-snapshot.mjs +5 -2
- package/runtime/js/cm-ai/execution-store.mjs +21 -3
- package/runtime/js/cm-ai/external-run-guard.mjs +9 -1
- package/runtime/js/cm-ai/host-check.mjs +4 -2
- package/runtime/js/cm-ai/host-conversation-execution.mjs +23 -2
- package/runtime/js/cm-ai/host-handoff.mjs +7 -0
- package/runtime/js/cm-ai/host-progress.mjs +18 -0
- package/runtime/js/cm-ai/host-qa-executor.mjs +47 -15
- package/runtime/js/cm-ai/host-qa-fix-owner.mjs +11 -2
- package/runtime/js/cm-ai/host-qa-policy.mjs +24 -14
- package/runtime/js/cm-ai/host-session.mjs +1 -1
- package/runtime/js/cm-ai/host-workflow-capabilities.mjs +1 -1
- package/runtime/js/cm-ai/host.mjs +1 -1
- package/runtime/js/cm-ai/operator-guidance.mjs +126 -2
- package/runtime/js/cm-ai/project-qa-gate.mjs +13 -2
- package/runtime/js/cm-ai/provider-review-observation.mjs +7 -3
- package/runtime/js/cm-ai/qa-plan-notes.mjs +106 -0
- package/runtime/js/cm-ai/review-continuation.mjs +102 -0
- package/runtime/js/cm-ai/review-evidence-file.mjs +11 -0
- package/runtime/js/cm-ai/review-package.mjs +25 -4
- package/runtime/js/cm-ai/review-presentation.mjs +31 -14
- package/runtime/js/cm-ai/review-runner.mjs +5 -4
- package/runtime/js/cm-ai/review-verdict-rules.mjs +7 -0
- package/runtime/js/cm-ai/reviewed-evidence-supersede.mjs +30 -1
- package/runtime/js/cm-ai/task-commit-codec.mjs +11 -1
- package/runtime/js/cm-ai/task-commit.mjs +7 -4
- package/runtime/js/cm-ai/task-owner.mjs +5 -2
- package/runtime/js/cm-ai/task-runner.mjs +343 -52
- package/runtime/js/cm-ai/tool-preview.mjs +6 -0
- package/runtime/js/cm-fix/diagnosis.mjs +16 -3
- package/runtime/js/cm-fix/execution.mjs +47 -9
- package/runtime/js/cm-fix/finish.mjs +9 -1
- package/runtime/js/cm-fix/step-timing.mjs +222 -0
- package/runtime/js/cm-idea/session.mjs +22 -3
- package/runtime/js/cm-init/review-evidence.mjs +20 -7
- package/runtime/js/cm-prd/ai-draft.mjs +260 -0
- package/runtime/js/cm-prd/analysis.mjs +27 -9
- package/runtime/js/cm-prd/change.mjs +29 -8
- package/runtime/js/cm-prd/failed-correction.mjs +24 -4
- package/runtime/js/cm-prd/narrow-review.mjs +63 -3
- package/runtime/js/cm-prd/review-correction.mjs +65 -5
- package/runtime/js/cm-prd/review-disposition.mjs +10 -1
- package/runtime/js/cm-prd/self-check.mjs +121 -9
- package/runtime/js/cm-prd/session.mjs +55 -13
- package/runtime/js/cm-prd/summary.mjs +34 -6
- package/runtime/js/cm-prd/task-scope-record.mjs +40 -15
- package/runtime/js/cm-refactor/records.mjs +82 -11
- package/runtime/js/cm-refactor/workflow.mjs +3 -1
- package/runtime/js/executor-version.mjs +81 -0
- package/runtime/js/python-log-writer.mjs +15 -0
- package/runtime/js/run-analysis.mjs +136 -11
- package/runtime/logging.md +6 -0
- package/runtime/review.md +3 -1
- package/runtime/workflow-config.md +1 -1
- package/scripts/ci-test-weights.json +1 -0
- package/scripts/cm-ai-admission.mjs +27 -1
- package/scripts/cm-ai-admission.test.mjs +34 -2
- package/scripts/cm-ai-answer-gap-recheck.test.mjs +3 -2
- package/scripts/cm-ai-batch-drive.mjs +54 -17
- package/scripts/cm-ai-batch-drive.test.mjs +123 -6
- package/scripts/cm-ai-batch-host.mjs +55 -9
- package/scripts/cm-ai-batch-host.test.mjs +22 -3
- package/scripts/cm-ai-batch-location.test.mjs +22 -1
- package/scripts/cm-ai-batch-merge.mjs +102 -0
- package/scripts/cm-ai-batch-plan.mjs +55 -2
- package/scripts/cm-ai-batch-plan.test.mjs +228 -6
- package/scripts/cm-ai-batch-run-fixture.mjs +239 -15
- package/scripts/cm-ai-batch-run-parallel.test.mjs +23 -1
- package/scripts/cm-ai-batch-run.mjs +435 -33
- package/scripts/cm-ai-batch-session-member.test.mjs +85 -0
- package/scripts/cm-ai-check-recheck-cancellation.test.mjs +23 -2
- package/scripts/cm-ai-checkpoint-package-material.test.mjs +28 -0
- package/scripts/cm-ai-completion-summary.test.mjs +2 -1
- package/scripts/cm-ai-control-v2-drive.test.mjs +39 -9
- package/scripts/cm-ai-direct-review.test.mjs +1 -1
- package/scripts/cm-ai-disk-edits.test.mjs +229 -0
- package/scripts/cm-ai-drive-next-step.test.mjs +191 -0
- package/scripts/cm-ai-drive.mjs +66 -14
- package/scripts/cm-ai-drive.test.mjs +13 -3
- package/scripts/cm-ai-host-cli-workflow.test.mjs +4 -2
- package/scripts/cm-ai-host.mjs +16 -8
- package/scripts/cm-ai-host.test.mjs +12 -0
- package/scripts/cm-ai-operator-guidance.test.mjs +132 -1
- package/scripts/cm-ai-project-qa-gate.test.mjs +26 -0
- package/scripts/cm-ai-qa-fix-cross-session.test.mjs +18 -0
- package/scripts/cm-ai-review-continuation.test.mjs +335 -0
- package/scripts/cm-ai-review-failure.test.mjs +13 -10
- package/scripts/cm-ai-review-timeout.test.mjs +1 -1
- package/scripts/cm-ai-run.mjs +42 -11
- package/scripts/cm-ai-run.test.mjs +26 -0
- package/scripts/cm-ai-supersede.test.mjs +10 -2
- package/scripts/cm-capability-gate.test.mjs +1 -1
- package/scripts/cm-check-runtime.sh +9 -0
- package/scripts/cm-codex-clean-env.test.mjs +40 -0
- package/scripts/cm-codex-prompt-input.test.mjs +2 -1
- package/scripts/cm-developer-self-review.test.mjs +27 -0
- package/scripts/cm-efficiency-presentation-delta.test.mjs +4 -3
- package/scripts/cm-efficiency-response.test.mjs +2 -1
- package/scripts/cm-executor-version-draft.test.mjs +251 -0
- package/scripts/cm-executor-version-entries.test.mjs +93 -0
- package/scripts/cm-executor-version-prd.test.mjs +154 -0
- package/scripts/cm-executor-version-records.test.mjs +256 -0
- package/scripts/cm-executor-version.test.mjs +250 -0
- package/scripts/cm-external-model-host.test.mjs +6 -1
- package/scripts/cm-external-review-reconciliation.test.mjs +1 -1
- package/scripts/cm-fix-closeout-preflight.test.mjs +123 -0
- package/scripts/cm-fix-diagnosis-module-correction.test.mjs +5 -1
- package/scripts/cm-fix-drive.mjs +7 -2
- package/scripts/cm-fix-drive.test.mjs +45 -0
- package/scripts/cm-fix-entry.mjs +5 -2
- package/scripts/cm-fix-frozen-baseline.test.mjs +50 -0
- package/scripts/cm-fix-host.mjs +9 -2
- package/scripts/cm-fix-test-extension.test.mjs +30 -2
- package/scripts/cm-host-check.test.mjs +12 -0
- package/scripts/cm-host-qa-executor.test.mjs +172 -1
- package/scripts/cm-host-qa-policy.test.mjs +55 -1
- package/scripts/cm-idea-drive.mjs +5 -2
- package/scripts/cm-idea-entry.mjs +5 -2
- package/scripts/cm-idea-host.mjs +3 -1
- package/scripts/cm-init-drive.mjs +8 -5
- package/scripts/cm-init-entry.mjs +5 -2
- package/scripts/cm-init-host.mjs +6 -2
- package/scripts/cm-log-event.mjs +10 -2
- package/scripts/cm-log-event.test.mjs +29 -0
- package/scripts/cm-prd-ai-draft-fixture.mjs +18 -0
- package/scripts/cm-prd-ai-draft.test.mjs +505 -0
- package/scripts/cm-prd-answer-gaps.test.mjs +110 -5
- package/scripts/cm-prd-completion.test.mjs +67 -4
- package/scripts/cm-prd-design-phase.test.mjs +48 -13
- package/scripts/cm-prd-drive.mjs +89 -20
- package/scripts/cm-prd-drive.test.mjs +109 -4
- package/scripts/cm-prd-entry.mjs +5 -2
- package/scripts/cm-prd-host.mjs +89 -20
- package/scripts/cm-prd-host.test.mjs +17 -8
- package/scripts/cm-prd-narrow-review.test.mjs +49 -1
- package/scripts/cm-prd-review-disposition.test.mjs +94 -1
- package/scripts/cm-prd-review-gate.mjs +11 -4
- package/scripts/cm-prd-self-check-rules.test.mjs +175 -10
- package/scripts/cm-prd-self-check.test.mjs +1 -1
- package/scripts/cm-refactor-drive.mjs +10 -4
- package/scripts/cm-refactor-entry.mjs +5 -2
- package/scripts/cm-refactor-host.mjs +3 -1
- package/scripts/cm-run-analysis.test.mjs +373 -1
- package/scripts/cm-runtime-i18n.mjs +3 -3
- package/scripts/cm-runtime-install.mjs +19 -10
- package/scripts/cm-runtime.mjs +2 -4
- package/scripts/cm-runtime.test.mjs +55 -13
- package/scripts/cm-skill-hints-autowire.test.mjs +1 -1
- package/scripts/cm-skill-hints-exam.mjs +3 -1
- package/scripts/cm-skill-hints-install.test.mjs +1 -1
- package/scripts/cm-skill-hints.mjs +106 -10
- package/scripts/cm-skill-hints.test.mjs +162 -6
- package/scripts/cm-skill-judge.mjs +2 -1
- package/scripts/cm-statusline.test.mjs +54 -0
- package/scripts/cm-task-gate.mjs +88 -18
- package/scripts/cm-task-scope.test.mjs +1 -1
- package/scripts/cm-test-drive.mjs +13 -8
- package/scripts/cm-test-entry.mjs +5 -2
- package/scripts/cm-test-host.mjs +3 -1
- package/scripts/cm-upgrade-compat-batch.test.mjs +62 -9
- package/scripts/fixtures/fresh-completion-checks.mjs +8 -0
- package/scripts/fixtures/prd-review-gate-python-oracle.py +9 -0
- package/scripts/policy-binding-compat.test.mjs +3 -2
- package/scripts/test-cm-prd-review-gate.py +25 -0
- package/skills/cm-ai/SKILL.md +1 -1
- package/skills/cm-ai/references/N1-init.md +4 -3
- package/skills/cm-ai/references/N4-review.md +6 -3
- package/skills/cm-ai/references/N6-qa-eval.md +3 -1
- package/skills/cm-ai/references/js-host-recovery.md +4 -1
- package/skills/cm-ai/references/js-host.md +25 -5
- package/skills/cm-fix/references/js-host.md +20 -0
- package/skills/cm-fix/references/test-extension.md +1 -1
- package/skills/cm-prd/SKILL.md +8 -6
- package/skills/cm-prd/references/ai-draft.md +81 -0
- package/skills/cm-prd/references/change-mode.md +2 -0
- package/skills/cm-prd/references/greenfield.md +2 -0
- package/skills/cm-prd/references/js-change-recovery.md +2 -2
- package/skills/cm-prd/references/js-host.md +9 -6
- package/skills/cm-prd/references/light-mode.md +19 -0
- package/skills/cm-prd/references/requirement-grilling.md +2 -0
- package/skills/cm-prd/references/spec-self-check.md +1 -0
- package/skills/cm-prd/references/summary-card.md +1 -0
- package/skills/cm-runtime/SKILL.md +6 -6
- package/templates/statusline/cm-statusline.sh +63 -1
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
导出的库函数默认保持原返回字段和报错,不核对这份清单;JS runner、cm-fix、cm-refactor
|
|
16
16
|
使用各自审查包基线,宿主和驾驶员行为不受影响。
|
|
17
17
|
|
|
18
|
-
cm-ai 单/批 r2 blocked
|
|
18
|
+
cm-ai 单/批 r2 blocked 没有通用的 runner-owned correction;原兼容任务门禁的人工补正合同保持原样,不能用来完成原 cm-ai run。
|
|
19
|
+
唯一例外是新版单任务停在 `review_limit` 后经显式授权的「第三次受控审查」,见 [控制策略 v2](cm-control-policy-v2.md#第三次受控审查试点)。
|
|
19
20
|
|
|
20
21
|
下文原 `cm-ai` 能力开关和请求 `version:1` 示例用于未启用 v2 的旧运行、旧 PLAN 或原进程内接线。
|
|
21
22
|
cm-ai 新旧入口均直接审查,不再使用逐轮审查参数。v2 使用上方文档中的策略与固定恢复目标。
|
|
@@ -377,13 +378,13 @@ scope 和 requirements 是相对代码根的已有 runner 输入,不是额外
|
|
|
377
378
|
所选 feature 已无待办任务时,准入返回 `requestedFeatureComplete` 和明确 warning(项目其他 feature 仍有待办时 `state` 为 ready、`nextTask` 是项目自己的下一任务;全部完成时为 complete),`--print-run-definition` 一律以 `feature_tasks_terminal` 退出 1,宿主建运行一律以 `task_selection_mismatch` 拒绝并写明「已无待办任务」,不会为其他 feature 生成定义或建运行;名称不存在时为 `feature_selection_invalid`。所选批次最后一个任务完成后,该运行的上下文刷新仍包含它自己的规格。单步驾驶员 `cm-ai-drive.mjs` 的 `PLAN.permissions` 可写 `--feature N.slug`、`--review-runtime claude`,原样转发给宿主,驾驶员预检也按同一有效定义计算。
|
|
378
379
|
`featureSelection` 进入运行定义与恢复指纹:用 `--feature` 创建的运行恢复时也要带 `--feature`(或改用写入该字段的运行定义);运行内的上下文刷新、Learning 输入、文档同步的末任务判断与 QA 跳过判断都按所选 feature 读准入。未显式选择的运行(含 0.16.6 项目补丁期间创建的运行)不写该字段,恢复与指纹不变。QA 执行计划与合并判断仍按默认准入,所选批次不是默认批次时不做跨 feature 的 QA 合并。
|
|
379
380
|
|
|
380
|
-
|
|
381
|
+
**当前会话跨工具审查**:普通单任务宿主与批次宿主都可用 `--runtime codex --review-runtime claude`(或反过来)让当前会话开发、另一工具审查;批次给所有会话开发的成员,并写进批次计划摘要:开跑后漏传报 `batch_plan_mismatch`,改值时,与写代码方相同报 `invalid_arguments`,其余与声明不符报 `runtime_selection_mismatch`;批次只接受与写代码方不同的审查端,批次配置文件不能自己写 `reviewRuntime`。两端须与有效 `.cm-workflow.yml` 的 roles/runtimes 一致,否则 `runtime_selection_mismatch`;该选择以 `reviewRuntime` 写入运行配置与指纹,恢复必须带同一选项。审查配置的 preflight 须由审查端生成(`preflight --runtime claude`)。不能与 `--protected-config`、`--external-models` 同用(它们按 roles 自行选审查端)。此选项选择审查端;模型、任务和材料仍绑定原配置,常规审查直接推进。
|
|
381
382
|
|
|
382
383
|
`tasks.md` 的任务行只有一套语法(`runtime/js/spec-task-line.mjs`),准入、cm-prd 自检与变更守卫、N5 勾选、审批 manifest 的完成标记归一化和 failover 都用它:列表项 + 复选框,任意缩进,可选 `~~`,任务号后接英文冒号、全角冒号或空白,例如 `- [ ] T-003: 描述`、`- [ ] T-003 描述`、`- [ ] T-003:描述`、嵌套的 ` - [ ] T-003: 描述`。``` / ~~~ 围栏内的行是示例,不是任务。全角冒号选择接受而非拒绝:中文输入法常打出它,failover 早已接受,拒绝它只会逼用户为标点改规格再批准。语法随批准绑定:批准在 `.cm-specs-status` 记 `taskGrammar`(2 或 3,沿用待审状态携带的值,见下文「任务语法 3」);更早记录的批准继续用原解析器(准入、规格材料、N5 勾选、supersede 与 failover 都按旧规则读),例如同文件里未加围栏的 `- [ ] T-001:示例` 在旧批准下仍是说明而不是重复任务,已批准的字节含义不变;重新批准后才切换到新语法。重新批准会让全部 feature(包括本次没改的)改用新语法,因此 `--approve` 先按新语法检查每个 feature 的 tasks.md,任一无效(如上例变成重复任务),或从旧语法切换时任何 feature 的任务集合(哪些行是任务、编号、勾选状态)在新旧语法下不一致(如唯一的 `- [ ] T-099:示例` 会变成待办任务),即以 `task_grammar_conflict` 拒绝,`approveReason` 写明文件、行号和原文,提示把这类示例放进围栏或删去后再批准;不会写入新语法,也不退回旧语法——退回会让新写的全角冒号任务行悄悄不算任务。cm-prd 变更守卫读取已批准原文时同样按其批准的语法。状态文件把上次批准的 `taskGrammar` 经 cm-prd 变更与发布一路带到下次批准(重新批准前连续多次 `cm-prd --change` 时,变更守卫按这一携带值读取原文;不带该值的待审状态不会切到新语法);项目一旦用上新语法就不再做新旧对照,从未批准过的项目首次批准直接用新语法。cm-prd 草稿与自检按会话绑定的语法读取(见下文「任务语法 3」)。
|
|
383
384
|
|
|
384
|
-
**任务语法 3(`- 开发: 会话`)**:语法 3 与 2 的任务行完全相同,只多认一种任务子项 `- 开发: 会话`(别名 `developer: session`;写开发进程/`provider` 视为默认),表示该任务由当前会话完成(例如浏览器人工走查),只能是功能的最后一个任务、最多一个、不进并行组。语法 1、2 下同一行仍是说明文字,不重新赋义。版本按规格目录绑定:`/cm:prd` 新会话在规格目录还没有 `.cm-specs-status` 或其 `taskGrammar` 已是 3 时绑定语法 3
|
|
385
|
+
**任务语法 3(`- 开发: 会话`)**:语法 3 与 2 的任务行完全相同,只多认一种任务子项 `- 开发: 会话`(别名 `developer: session`;写开发进程/`provider` 视为默认),表示该任务由当前会话完成(例如浏览器人工走查),只能是功能的最后一个任务、最多一个、不进并行组。语法 1、2 下同一行仍是说明文字,不重新赋义。版本按规格目录绑定:`/cm:prd` 新会话在规格目录还没有 `.cm-specs-status` 或其 `taskGrammar` 已是 3 时绑定语法 3 与当前自检规则 8(会话任务位置检查,并要求新写的会话任务在自己下面声明执行脚本文件、核对走查内容的 `- 必跑检查:`),否则沿用语法 2 与规则 6(旧会话无绑定字段时取语法 2、规则 3 的固定值;规则 7 是未发布的首版证据检查,只供它落盘的记录按原样复算);首次发布写会话绑定的语法,此后发布与批准沿用状态里携带的语法,2 不会被批准成 3。批次规划从语法 3 的 tasks.md 生成 `batch.memberDevelopment`(只列会话成员),v2 `development:"provider"` 批次里这些成员不交开发进程,由驾驶员的实时 `develop` 请求交给会话(见 `docs/live-evidence-drivers.md`)。旧版本批准的 manifest 按旧归一化规则计算,核验时每行同时接受新旧规则的摘要,因此已批准的规格原样继续匹配(有意的小幅放宽:旧批准下全角冒号或缩进任务行的勾选变化也按运行时标记处理);只有旧规则下批准时就已勾选的无冒号/缩进任务行,在之后再勾选别的此类任务时仍会漂移,需要重新批准一次(新批准按新规则记录)。
|
|
385
386
|
|
|
386
|
-
|
|
387
|
+
规格待审批时先展示摘要卡并请用户回复“开始”。只识别“开始”“开始吧”“可以开始”“确认开始”“开始执行”“现在开始”“可以,请开始开发”“开工”“开工吧”“批准开工”“同意开工”“批准开始”“同意开始”及其尾部标点/空白(整句匹配,“开始开发”“请开始开发”等仍不算);单独的“批准”“同意”和带附加条件的句子同样不算;泛化授权仍是 `not_approval`,提示明确回复“开始”。`--approve` 写入仍须原完整准入门禁。
|
|
387
388
|
|
|
388
389
|
```bash
|
|
389
390
|
node scripts/cm-ai-run.mjs serve --config /absolute/run.json --mode create
|
|
@@ -475,7 +476,7 @@ host-context 必须是真实当前会话身份;宿主将其排除出独立审
|
|
|
475
476
|
|
|
476
477
|
开发检查有任一失败或不可用时,在生成审查包前停 `blocked/develop_checks_not_passed`;`reason` 列出失败 id 和证据摘要,`pendingAction: "resume"`。修好环境后在原 run `advance` 重新开发并检查,使用新 effect id,审查轮次不增加。已经审查过失败检查的旧 journal 仍按原历史回放;其完成阶段 `blocked/checks_not_passed` 保持终态,不能重新开发。
|
|
477
478
|
|
|
478
|
-
|
|
479
|
+
已批准任务在完成前会重新执行检查;例外:新建运行(运行配置冻结了 `completionCheckReuse`)在第一次完成时,若审查包里的检查全是已通过的命令检查、当前代码用已审检查重建出的审查包逐字节一致,就直接复用已审检查,不再执行(日志记 `check_reuse`);新协议下的多人并行成员合入后完成时不复用,照常重跑合并后的 N5 检查。含视觉检查、开发检查执行期间改写/删除/改权限了已有文件(证据里带 `[cm] checks rewrote existing files` 标记)、本运行此前已有完成结果、已进入任务写入或旧运行,仍按下文重新执行。复用只证明代码与已审时相同,检查依赖的代码以外的输入(环境文件、外部服务)在完成前不再复查,由之后的 QA 兜底;这类项目在创建运行时设环境变量 `CM_AI_COMPLETION_CHECK_REUSE=off`,该运行就不冻结复用、完成前照旧重新执行(只在创建时读取,恢复不受影响)。审查回执及原 `packageDigest` 不改:完成门禁重建代码、scope、需求、指令与 handoff 等非检查字段并逐项比较;检查只比较有序的 `id`、`command`、`outcome`、`exitCode`,视觉检查在结果相同时还比较前后载体,`evidence` 诊断文字可变化。代码、handoff 字节或检查身份漂移会列出差异路径并阻断;检查期间新出现的范围外文件为可重试的 `blocked/completion_package_changed`,移走后在原运行用新的 complete effect id 重试。仅检查结果(`outcome`、`exitCode`)变化记录 `blocked/completion_checks_changed`,不标记完成;失败或不可用时 `reason` 列出检查 id 和证据摘要;视觉检查从 passed 变成 unavailable 时,即使 after 载体按合同变成 null,也先按结果漂移处理。恢复原 runId 后重新执行检查,结果恢复一致时用新的 complete effect id 继续原批准,不重新审查。`advance` 和 `complete` 均可续跑,持久 journal 回放接受该重试状态;旧 journal 与回执保持原格式。重试仍受原 effect 数量上限约束。
|
|
479
480
|
|
|
480
481
|
回复固定为以下形状;三个绑定值必须逐字取自该次请求,不要自行计算或沿用上次值:
|
|
481
482
|
|
|
@@ -960,6 +961,11 @@ beforeSha256使用expected原值(缺文件为null),blocked要求空edits
|
|
|
960
961
|
只有 QA、上下文、文档核验及既有 finalizer 均通过后才返回 run_done。
|
|
961
962
|
首次审查要求修改时,沿 runner 的既有第 2 轮执行修复和 fresh Review;第二轮仍要求修改
|
|
962
963
|
则以 `review_limit` 停止,不创建第三轮。请求、回执、来源声明与当前材料仍逐轮核对。
|
|
964
|
+
停在 `review_limit` 时结果带只读的 `reviewLimitCard`(驾驶员同时打印):最后一轮审查包的检查实跑结果与改动清单、
|
|
965
|
+
两轮审查意见对照(第 2 轮落在第 1 轮已指出文件的条数),以及出口:supersede 重开、规格变更后重开(意见指向规格本身时先 `cm-prd --change` 再 supersede;审查只认已批准规格,对话里批准的例外不算)、第三次受控审查(只修实现;新版单任务运行、
|
|
966
|
+
每任务一次,否则写明不可用原因;批次成员不提供)、人工补正(对 cm-ai 运行固定不适用)。数据只取运行回放的回执与审查包,
|
|
967
|
+
读不到的逐项列在 `missing`;卡片 `authorizationGranted:false`、不派发调用,也不改变两轮上限。
|
|
968
|
+
第三次受控审查不通过时停在 `review_continuation_rejected`,同样展示决策卡。
|
|
963
969
|
|
|
964
970
|
审查提示写明 verdict 规则:P0 为安全漏洞、数据丢失或主路径崩溃/错误结果,P1 为用户会遇到的错误行为或未满足验收标准,
|
|
965
971
|
P2 为合并前必须修的边界、错误处理、契约或测试缺陷,P3 为不阻断的建议;`approved` 不得有 P0–P2,`changes_requested`
|
|
@@ -1025,6 +1031,29 @@ feature 完成和连续五项未 QA 沿用原机械计算,命中规则用逗
|
|
|
1025
1031
|
未登记关键路径的项目,N6 不做任何风险识别,只有这两个固定点。
|
|
1026
1032
|
这两个固定点为 `feature_complete`、`five_tasks_without_qa`。本轮不输出文档或类型专属跳过理由。
|
|
1027
1033
|
|
|
1034
|
+
QA 节奏 `feature-v1` 只对新运行生效:V3 任务运行新建时 journal 冻结 `qaCadence: 'feature-v1'`,恢复只沿用不新增;
|
|
1035
|
+
单任务入口中旧的空 store 按 create 打开时不冻结(批次成员见下文,按批次计数)。入口把它作为 `qaCadence` 传给决策:`five_tasks_without_qa` 只计本 feature 的已完成任务,
|
|
1036
|
+
其他 feature 的 QA 行既不计数也不清零;本 feature 无 QA 行的已完成任务照旧一直计数(它们在 N6 外完成,与某次 QA 的先后无从得知),triggered 只清空此前累计的有 QA 行的计数,之后重新累计。
|
|
1037
|
+
决策原因恰为 `five_tasks_without_qa` 时,入口以 `prepare({periodic:true})` 准备定期计划:feature 未完成时 browser 用例记入
|
|
1038
|
+
`periodic_deferred_cases`(报告开头一行注明,不另起 `## ` 节),logic 用例与命令照跑;去掉后无可执行项时保留原计划。
|
|
1039
|
+
计划由已记录的决策与冻结的节奏决定,同一运行重跑一致。start 行记 `periodic_deferred_cases`;收尾门禁见到 feature 已无待办而最新一轮是带延后的
|
|
1040
|
+
定期 QA(末任务在 N6 外完成),报 `qa_periodic_only`,不当作功能验收;正在收尾的本运行同样检查。批次只用一种计数(`batch-location.mjs` 的 `batchQaCadence`):
|
|
1041
|
+
已写 `batch_start` 时按其 `qa_cadence`(无该字段即 `legacy`:升级前开始的批次,或按 `legacy` 续跑时写下的);尚未写时,只要有成员运行已初始化而未冻结 `feature-v1`(旧版本如查状态时建的),
|
|
1042
|
+
整批为 `legacy`,否则 `feature-v1`(只有空 store 不算旧成员)。推算复核、`batch_start`(仅 `feature-v1` 时写字段)与成员打开时传的 `batchQaCadence` 都用它,新建与空 store 恢复都按它冻结。
|
|
1043
|
+
每次操作取得 `batch.lock` 后、以及每次打开成员前(含锁外的控制目标预览)重读一次;与宿主启动时不同(另一个驾驶员其间建了成员或写了 `batch_start`)即以 `batch_qa_cadence_changed` 拒绝(附重启提示),
|
|
1044
|
+
重启批次宿主按新记录复核。成员运行存档存在却读不了(不是不存在)时计数记为未知,不猜旧或新;只启动宿主照常,任何操作与成员打开都以 `batch_member_store_unreadable` 拒绝,修好或移走该存档后重启宿主。新旧两版宿主同时驱动同一批次时,锁外打开成员仍有极短的时间差,属于不支持的用法。
|
|
1045
|
+
`feature-v1` 运行开工时入口还以 `prepare({coverage:true})` 算验收对照(`qa-plan-notes.mjs`):requirements/design/tasks 声明的每条 AC
|
|
1046
|
+
(只有全部声明都写 `NOT_APPLICABLE` 才跳过,任一处普通声明即保留)标为 `planned`(本轮有用例跑)、`later`(适用用例在等未完成任务或定期延后)、
|
|
1047
|
+
`not_selected`(绑定的用例既非 blocking 也不在 tests 策略内)、`dropped`(用例只绑 [DROPPED] 任务,报告列为不适用)、`no_case`(没有用例)。
|
|
1048
|
+
本轮 BLOCKED 时另按缺口归类,每类一条中文说明及对应用例:缺测试命令、命令超时、逻辑用例没映射命令、[需确认]、没接入浏览器或设备执行方、
|
|
1049
|
+
执行方说环境不可用及原话、实际环境与登记不一致及应有的 kind/carrier/target、证据或清理缺失、超时、代码中途改动等;浏览器用例优先用执行器自己判的原因
|
|
1050
|
+
(只在旁路传给说明,不写进用例行);宿主占位行按没有 `exitCode` 识别,同名的声明命令仍按命令归类。
|
|
1051
|
+
两者只进报告:开头各一行(「Acceptance coverage at QA start」「Blocked because」)及 `## notes/acceptance_coverage`、`## notes/blocked_needs` 两节,
|
|
1052
|
+
节名带 `/`,与任何用例或命令编号都不会重名;计划、start 行和用例行都不带它们,所以不占计划、日志行的大小预算,计划摘要也不变。
|
|
1053
|
+
说明会让报告超过 1 MiB 时整体省略,放得下时写一行「QA notes omitted」,连这一行也放不下就不写(`qaBlockedNeeds` 此时为空,结果照常登记)。`qa_result` 返回 `qaBlockedNeeds`,从本轮完成行绑定的报告读,读不出就是空,不影响结果。
|
|
1054
|
+
都只解释,不改任何用例结论;重跑读取跳过这两节,与 `deferred_cases` 相同;执行方原话压成一行。
|
|
1055
|
+
没有 `qaCadence` 的运行行为不变。
|
|
1056
|
+
|
|
1028
1057
|
正式 runner 的 `qaChangedFiles(packageDigest)` 只读返回审查包的 `changes` 路径;该清单来自编辑前基线与实际内容,
|
|
1029
1058
|
不按 handoff 作者清单重建。状态和包摘要沿用原 entry 前后核对。日志字段 `changed_files_source` 与 reason 分离:
|
|
1030
1059
|
`review_package` 为基线核对清单,`handoff_only` 为可信适配器仅有 handoff 的兼容输入,`unavailable` 为旧适配器未提供清单。
|
|
@@ -1445,13 +1474,14 @@ key 形如 `1.work/T-001`,与 `tasks` 的 `feature/taskId` 一致。省略该
|
|
|
1445
1474
|
N6 与串行任务相同、按固定检查点判定,触发时在该工作树里执行 QA,通过后才封存合并。批次没有 QA 修复出口,所以生成器只把
|
|
1446
1475
|
不会在中途触发固定检查点的任务单独成组:范围(加 `AGENTS.md` 与 `applicableAgentFiles`)不命中工作流 `qa.criticalPaths`
|
|
1447
1476
|
(`cm-ai-batch-plan.mjs --workflow-config` 传入),且按日志推算不会成为连续第 5 个未 QA 的任务。推算(`soloQaCounter`)沿批次顺序记下
|
|
1448
|
-
计数可能的取值:1 人组不触发,加一;留在主目录的任务计数到 5 时 QA 一定触发,回到保底数(从无 QA
|
|
1477
|
+
计数可能的取值:1 人组不触发,加一;留在主目录的任务计数到 5 时 QA 一定触发,回到保底数(从无 QA 记录的已完成任务,触发也不清零)。
|
|
1478
|
+
新批次成员冻结 `feature-v1`,推算只计本功能;升级前开始、或已有旧版本建的成员运行的批次整批沿用旧计数;
|
|
1449
1479
|
范围命中关键路径的主目录任务可能触发也可能不触发(判定看实际改动文件),两种都保留;n 人组成员延后 QA 各加一,但被阻断的成员在组收尾前
|
|
1450
1480
|
改回主目录重做、可能触发,所以组后还可能是保底数加 0 到 n-1。只有宿主策略判定 QA 时(工作流配置的 `qa` 不为 `null`,或有控制策略)才按
|
|
1451
1481
|
这些规则推算,否则会话给的结论可能是任意一种。判断复用 `host-qa-policy.mjs` 的 `decideHostQaPolicy` 与同一份日志计数
|
|
1452
1482
|
(`qaUnassessedTaskCounts`)。新批次宿主按实际 `workflows` 与控制策略、按批次顺序再核,不符报 `parallel_solo_qa_checkpoint`;
|
|
1453
1483
|
有 1 人组时组员必须在批次顺序里相邻(被阻断的成员在它成为第一个未完成任务时才重做,隔开的成员会晚于中间的组外任务),否则报
|
|
1454
|
-
`parallel_solo_split_group`;批次含多个功能时不产生 1
|
|
1484
|
+
`parallel_solo_split_group`;批次含多个功能时不产生 1 人组(推算只按单个功能计数;旧计数还跨功能累计),报 `parallel_solo_multi_feature`。工作树从 HEAD 检出,所以主目录的项目配置文件(`.cm-workflow.yml` 等)必须与 HEAD 中该路径的 blob
|
|
1455
1485
|
(`git cat-file blob HEAD:./<文件>`,不经过滤器)逐字节相同才产生 1 人组;只看「已跟踪且 `git status` 干净」不够,`skip-worktree`/
|
|
1456
1486
|
`assume-unchanged` 下的本地改动不会显示。不在提交里报 `parallel_solo_config_untracked`,内容不同报 `parallel_solo_config_diverged`;
|
|
1457
1487
|
生成器与新批次宿主(`validateGroups`)调用同一个函数 `soloWorktreeBlocker`。这只是预筛(Git 检出过滤器、或提交里有两份配置文件而
|
|
@@ -1479,29 +1509,32 @@ QA 报告修复、删除工作树与分支、剩余任务用 `cm-ai-batch-plan.m
|
|
|
1479
1509
|
`worktree_segment`,前缀相同的两个批次不再共用工作树和分支;此前已开始、`batch_start` 没有该字段的批次
|
|
1480
1510
|
恢复时仍用前 8 个字符。驾驶员、批次宿主与调度器共用 `runtime/js/cm-ai/batch-location.mjs`。
|
|
1481
1511
|
|
|
1482
|
-
启动前对整组跑一次 `check-parallel-write
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
`
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1512
|
+
启动前对整组跑一次 `check-parallel-write`。新建的 2 人及以上组并行开发和独立审查,成员通过审查后停在
|
|
1513
|
+
`approved`。调度器按任务顺序预检 N5,使用审查包中的检查结果核对当前交付、Learning 交接和审查凭证,无需启动检查命令。
|
|
1514
|
+
随后封存已审交付,用 `git merge --no-ff` 合入固定的成员提交,并在主目录跑已配置的合并后检查。没有配置命令时记为 `skipped`。
|
|
1515
|
+
批次记录 `batch_merge_verified` 后,原成员运行会重新执行项目检查,并由原生 N5 勾选 `tasks.md`。延后 QA 和上下文刷新结束后,批次记录 `batch_handoff`,
|
|
1516
|
+
再清理工作树和分支。
|
|
1517
|
+
|
|
1518
|
+
较早成员在等重试或恢复时,后面的就绪成员继续等候。可改排的开发或审查阻断仍按原规则改排串行第二代。
|
|
1519
|
+
首次推进前主工作区必须干净(含未跟踪文件)。批次停止时保留已有交付和证据。
|
|
1520
|
+
|
|
1521
|
+
**中断恢复。** 同一批次的 `advance` 沿原日志恢复。封存期间或已记录合并意图时核对成员交付、目标 HEAD 和 Git
|
|
1522
|
+
合并现场。Git 已合入、检查结果尚未记录时,仅在原合并提交和原检查配置吻合且上次检查进程已确认退出时检查。
|
|
1523
|
+
已有 `batch_merge_verified` 时,续原成员的 N5 或交接。已有 N5 提交意图时使用原生恢复核对 `tasks.md` 的提交
|
|
1524
|
+
前后字节。原生 N5 仅开始检查就中断时,能使用原运行恢复操作的成员须先确认旧检查进程已停止,随后按批次指引恢复。
|
|
1525
|
+
证据或 Git 现场归属不明时停止。已有交接仅补工作树和分支清理。
|
|
1526
|
+
|
|
1527
|
+
**合并冲突(`merge_conflict`)。** 合并撤销后该成员未合入。它和后续未合并的成员保持未勾选。停止结果列出
|
|
1528
|
+
冲突文件与待勾选任务,已封存的成员提交留在分支上。
|
|
1529
|
+
|
|
1530
|
+
**合并后检查失败(`post_merge_check_failed`)。** 主目录保留合并提交,该成员保持未勾选。此前已交接的成员
|
|
1531
|
+
保留完成状态。操作员可在主目录解决冲突或修复检查失败,复核组合结果,并用新的批次 ID 重新规划未完成任务。
|
|
1532
|
+
恢复后的交付仍经过独立审查与原生 N5,原批次保留停止记录。
|
|
1533
|
+
|
|
1534
|
+
**历史批次。** 新批次在 `batch_start` 写入 `completion_protocol`。缺少该字段的批次继续按创建时的顺序
|
|
1535
|
+
恢复,成员先由 N5 勾选,再合入 Git。旧批次冲突时,原指引仍列出已勾选但未合并的成员,提示按顺序处理这些
|
|
1536
|
+
分支。旧合并意图先收尾,再合其余成员。`status` 保持只读,旧协议的 `advance` 仍可补提交后重显指引。
|
|
1537
|
+
单成员组按上文的原路径执行。
|
|
1505
1538
|
|
|
1506
1539
|
**QA 延后。** 2 人及以上组的成员的 N6 自动记为 `skipped`(`reason: parallel_member_deferred`,`score: null`),
|
|
1507
1540
|
不逐任务跑 QA;整个 feature 的 QA 在末任务触发一次,覆盖合并后的结果。1 人组不延后,见上文「1 人组」。
|
|
@@ -1674,6 +1707,8 @@ node scripts/cm-ai-drive.mjs --plan abandon-effect.json abandon_effect
|
|
|
1674
1707
|
|
|
1675
1708
|
## cm-prd:规格生成、需求变更与恢复
|
|
1676
1709
|
|
|
1710
|
+
新建模式的新会话在创建时记下 `specDrafting: "ai-draft-v1"`:AI 直接起草接口、数据结构、任务拆分和测试合同并写明依据,只向用户问产品取舍(问题须带产品类别标签,技术类别以 `prd_technical_question_forbidden` 拒绝);摘要多出产品取舍决策清单与 AI 起草摘要(`decisionCard`)。审批门禁、manifest 与审批位不变。之前开的会话、`--change` 与受控修订沿原行为。合同见 `skills/cm-prd/references/ai-draft.md`。
|
|
1711
|
+
|
|
1677
1712
|
原材料在审查中途真正改变时,可经用户明确授权执行 `replace_inputs`,保留不可覆盖的旧批次记录并终止它;以 `--predecessor` 关联独立的新 specs 目录,从分析开始全量重审。旧批次只读,不继承旧批准;具体参数、恢复方式和限制见 `skills/cm-prd/references/js-change-recovery.md` 的“原材料改变”章节。
|
|
1678
1713
|
|
|
1679
1714
|
当前同一宿主支持新建、原C1–C8变更和已审整稿受控修订。操作及返回合同以
|
package/docs/next-steps.md
CHANGED
|
@@ -81,6 +81,16 @@ cm-ai 的 V3 会话父运行用 `--original-host-context` 恢复后,QA 修复
|
|
|
81
81
|
|
|
82
82
|
**下一步**:做绑定到已打开句柄的所有者与 ACL 核对(不能只按路径),区分 NULL 与空 DACL,再在 Windows 实机上测试通过后,才解除 `runtime/js/notify-send.mjs` 的 `WINDOWS_UNSUPPORTED` 拒绝。
|
|
83
83
|
|
|
84
|
+
### 5. 执行器版本记录的遗留项(0.22.0 审查放行,不阻断)
|
|
85
|
+
|
|
86
|
+
- **0.21.7 拒绝前会写临时批次锁**:0.22.0 开的批次只有 `batch_start`、还没有成员存档时,用 0.21.7 推进会先建 `batch.lock`,再因计划摘要不符拒绝并删锁。已有成员存档时,0.21.7 在只读预检就报 `invalid_input`。旧版代码改不了,记录与成员存档不变。
|
|
87
|
+
- **`cc6a129` 格式批次不能续跑**:该提交从未发版或推送,只影响本机按它启动过的批次,报 `batch_plan_mismatch`。
|
|
88
|
+
- **同类临时锁**:0.21.7 读到新格式的 cm-prd、cm-idea、cm-init 会话时,同样先写再删一个临时锁文件,再拒绝;状态字节不变。
|
|
89
|
+
- **检查后、加锁前的空隙**:长驻宿主刚查过版本、还没加锁时,更新版本恰好建了日志或会话,本版会先写再删一个临时锁,再报升级原因;记录不变。检查和加锁之间无法完全消除这段空隙。
|
|
90
|
+
- **不守写入锁的程序**:cm-test、cm-refactor 读执行日志时已核对文件身份、大小和读到末尾;但最后一次核对之后、本版追加之前,仍有一个空隙。另一个绕过 `.writer.json` 的程序在这里追加,会让下次打开报 `refactor_journal_invalid`,记录字节不丢。防这种情况靠写入锁,读取时的检查补不完。
|
|
91
|
+
- **Windows 上原日志挪走、原路径换成指回它的符号链接**:仍会读到原日志内容,不拒绝。
|
|
92
|
+
- **cm-test 带 `--session-dir` 的 `status` 也会取锁**:所以对更新版本开的会话同样拒绝(带原因);只读历史查看不受影响。
|
|
93
|
+
|
|
84
94
|
## 第四档:内部协议分支(清单里的 B 类)
|
|
85
95
|
|
|
86
96
|
**已完成**:B 类六项都已在 CI 执行的 `scripts/*.test.mjs` 补测试并完成变异验证。`gzip` / `zstd` / 未声明编码的回环测试由审查方在沙箱外运行通过,并做了 gzip 解码故意改坏的变异验证(注意 `cm-claude-probe` 整份测试只在 macOS 运行,Linux CI 上跳过)。明细见 `docs/untested-branches.md` 的已覆盖表。
|
package/docs/runtime-failover.md
CHANGED
|
@@ -84,11 +84,13 @@ cm-ai-host failover: CLI 可解析不等于配额可用;本次切换只决定
|
|
|
84
84
|
### 限制
|
|
85
85
|
|
|
86
86
|
- **只决定起跑运行时**,任务开始后不再切换;中途失效由 L1 交接接手。
|
|
87
|
-
- 与 `--protected-config` 互斥(protected
|
|
87
|
+
- 与 `--protected-config` 互斥(protected 模式按 roles 自行选开发/审查端,不走起跑选路),组合报
|
|
88
88
|
`failover_unsupported_in_protected_mode`。
|
|
89
89
|
- 当前会话 host 下 developer 与 reviewer 共用同一 runtime 参数,选路按
|
|
90
|
-
`developer` 角色进行。要让 N4
|
|
91
|
-
`
|
|
90
|
+
`developer` 角色进行。要让 N4 跨模型,普通单任务或批次宿主显式传 `--review-runtime {另一端}`(并按
|
|
91
|
+
`skills/cm-ai/references/js-host.md` 用审查端生成预检、配 `--review-config`),或走
|
|
92
|
+
`codex-review` skill。`--failover` 只属于单任务宿主;与它同用时,起跑端若因故障切到另一端,开发端与声明不符,
|
|
93
|
+
宿主会以 `runtime_selection_mismatch` 拒绝,声明端 CLI 仍不可用时,去掉 `--failover` 并先恢复该端,或改项目声明。
|
|
92
94
|
|
|
93
95
|
## 定点测试
|
|
94
96
|
|
package/docs/user-guide.md
CHANGED
|
@@ -175,7 +175,7 @@ $cm-prd ~/projects/my-app-specs
|
|
|
175
175
|
|
|
176
176
|
检查工作流给出的需求摘要、方案、任务边界和验收条件。确认没有问题后,再进入实现。
|
|
177
177
|
|
|
178
|
-
`$cm-ai` 遇到 `.cm-specs-status` 为 `awaiting_review`
|
|
178
|
+
`$cm-ai` 遇到 `.cm-specs-status` 为 `awaiting_review` 时会暂停。你必须明确回复开工,例如“开始”“开工”“批准开工”(完整说法见 `docs/js-workflow-control.md`);普通的“继续”“同意”不算审批。
|
|
179
179
|
|
|
180
180
|
### 5. 执行实现
|
|
181
181
|
|
|
@@ -796,7 +796,7 @@ $cm-security {项目路径} --semgrep-rules {外部本地规则文件} --osv-db
|
|
|
796
796
|
|
|
797
797
|
交互安装在核心成功后提供可跳过的用户默认配置入口;已有文件显示当前值并默认保留。
|
|
798
798
|
主动配置才询问“只有 Codex / 只有 Claude / 两个都有”,两家都有再问谁写代码,
|
|
799
|
-
|
|
799
|
+
预览后输入显示的 8 位确认码才保存为 `~/.cm-workflow/runtimes.yml`,回车或输错都不保存。
|
|
800
800
|
`--yes` / `-Yes` 或非 TTY 跳过提问且不写文件。测试时可用 `CM_WORKFLOW_HOME` 覆盖目录。
|
|
801
801
|
|
|
802
802
|
优先级:**项目 > 用户级默认 > 未声明**。项目没有 `runtimes.available` 才读取用户文件;
|
|
@@ -814,11 +814,11 @@ $cm-security {项目路径} --semgrep-rules {外部本地规则文件} --osv-db
|
|
|
814
814
|
直接输入 `$cm-runtime`(Claude Code 为 `/cm-runtime`)会先展示当前有效配置、来源和模型别名,
|
|
815
815
|
提供 `[1] 保留当前配置(推荐,默认)`、`[2] 修改运行时预设`、`[3] 查看高级模型配置说明`。
|
|
816
816
|
保留时不写文件,配置缺失也不会创建;高级选项只显示说明与校验方法。只有选 2 才进入:
|
|
817
|
-
`[1] 当前项目 / [2] 用户级默认` → `[1] 只有 Codex / [2] 只有 Claude / [3] 两个都有`
|
|
818
|
-
(选 3 再选 `[1] Codex 写、Claude
|
|
817
|
+
`[1] 当前项目 / [2] 用户级默认` → `[1] 只有 Codex / [2] 只有 Claude(默认) / [3] 两个都有`
|
|
818
|
+
(选 3 再选 `[1] Codex 写、Claude 审 / [2] Claude 写、Codex 审(默认)`)→ 预览后由你在对话里明确回复同意才保存(8 位确认码只出现在终端向导)。
|
|
819
819
|
终端无参数运行 `node <workflow-root>/scripts/cm-runtime.mjs [--project PATH]` 进入同一向导。
|
|
820
|
-
有项目配置时范围默认 1,否则默认 2;无配置选 1
|
|
821
|
-
Ctrl+C、EOF
|
|
820
|
+
有项目配置时范围默认 1,否则默认 2;无配置选 1 会提示从模板新建。工具问题与写代码问题直接回车默认选 Claude;
|
|
821
|
+
Ctrl+C、EOF、拒绝确认或最终确认直接回车均不写。
|
|
822
822
|
预览显示目标文件/范围、字段前后值、当前项目保存后的实际有效值;项目声明覆盖用户默认时会说明
|
|
823
823
|
当前项目不会切换。模型别名保持原样,但更换适配器后可能不兼容。校验不证明模型可调用或配额可用。
|
|
824
824
|
等待确认时相关配置改变会拒绝旧确认,须重新预览;无效配置报告错误并保留,不自动修复。
|
package/package.json
CHANGED
|
@@ -33,6 +33,20 @@ function startRow(specsDir,batchId){
|
|
|
33
33
|
return found;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
// The batch's N6 count (task-runner QA_CADENCE), fixed once its batch_start is written:
|
|
37
|
+
// a row without qa_cadence is a batch started before it. Before that, a member run
|
|
38
|
+
// already initialized without the cadence (an older host created it) keeps the whole
|
|
39
|
+
// batch on the historical count, so the solo prediction and every member agree.
|
|
40
|
+
// readSnapshot(runId) returns the member's execution snapshot or null when none exists.
|
|
41
|
+
export function batchQaCadence({specsDir,batchId,runIds,readSnapshot}){
|
|
42
|
+
const row=startRow(specsDir,batchId);
|
|
43
|
+
if(row!==null)return row.qa_cadence==='feature-v1'?'feature-v1':'legacy';
|
|
44
|
+
// Every member is read before deciding: a reader that refuses one (an unreadable
|
|
45
|
+
// store) must stop the decision even after an older member was already found.
|
|
46
|
+
const firsts=runIds.map(runId=>readSnapshot(runId)?.records?.[0]);
|
|
47
|
+
return firsts.some(first=>first!==undefined&&first?.payload?.config?.qaCadence!=='feature-v1')?'legacy':'feature-v1';
|
|
48
|
+
}
|
|
49
|
+
|
|
36
50
|
// {dir, ref}: the directory segment and the ref segment. They differ only for a
|
|
37
51
|
// legacy batch whose 8-character prefix contains a dot.
|
|
38
52
|
export function batchSegments({specsDir,batchId}){
|
|
@@ -67,8 +67,12 @@ export function soloQaCheckpoint({scope,count,workflow=null}){
|
|
|
67
67
|
unassessedTasks:count});
|
|
68
68
|
return decision.status==='triggered'?decision.reason:null;
|
|
69
69
|
}
|
|
70
|
-
// {count,floor} before the batch (qaUnassessedTaskCounts)
|
|
71
|
-
|
|
70
|
+
// {count,floor} before the batch (qaUnassessedTaskCounts), by the count the batch's member
|
|
71
|
+
// runs freeze (batch-location batchQaCadence; a new batch: feature-v1, 'legacy': none).
|
|
72
|
+
export const soloQaBase=({specsDir,codeProject,feature,repositoryId,qaCadence='feature-v1'})=>{
|
|
73
|
+
need(['feature-v1','legacy'].includes(qaCadence),'invalid_input');
|
|
74
|
+
return qaUnassessedTaskCounts({specsDir,codeProject,feature,repositoryId,cadence:qaCadence==='legacy'?null:qaCadence});
|
|
75
|
+
};
|
|
72
76
|
|
|
73
77
|
// The five_tasks_without_qa count along the batch order, as the set of values it may
|
|
74
78
|
// have before the next task. A triggered QA leaves floor counted (tasks with no QA row
|
|
@@ -17,7 +17,11 @@ const sameRun=(left,right)=>same({...left,attempt:right.attempt},right);
|
|
|
17
17
|
// It is not scope authority, a recovery grant, or a requirement to revise scope.
|
|
18
18
|
export function packageMaterialEligible(rawConfig,version=3){
|
|
19
19
|
try{const config=json(rawConfig,STATE_LIMIT),policy=config.controlPolicy;
|
|
20
|
-
|
|
20
|
+
// verification 是 control policy 的合法可选项(取值规则同 readControlPolicy):漏掉它会让开了验证闸门的运行
|
|
21
|
+
// 永远不能存档审查包,审查包稍大就卡在开工前(实跑实拦)。验证闸门与存储表示正交,这里只放行这一项
|
|
22
|
+
const verifies=policy!==null&&typeof policy==='object'&&Object.hasOwn(policy,'verification');
|
|
23
|
+
validIdentity(config.identity);shape(policy,['version','development','bootstrap','qa','qaFix',...(verifies?['verification']:[])]);
|
|
24
|
+
must(!verifies||['disabled','precheck','auto'].includes(policy.verification));
|
|
21
25
|
must(['disabled','run'].includes(policy.qa)&&['disabled','manual','auto'].includes(policy.qaFix)
|
|
22
26
|
&&(policy.qaFix==='disabled'||policy.qa==='run'));
|
|
23
27
|
return version===3&&typeof config.root==='string'&&path.isAbsolute(config.root)
|
|
@@ -157,7 +161,10 @@ export function checkpointStoragePlan({records:rawRecords,effectId,checkpoint:ra
|
|
|
157
161
|
// Those later records enforce their actual limit, not that future reserve again;
|
|
158
162
|
// a review or completion (including a reconciled review invocation) cannot
|
|
159
163
|
// introduce a first material archive.
|
|
160
|
-
|
|
164
|
+
// 同理,不是合法存档来源的开发检查点(不在待审、或包不属于本轮,如第二轮失败仍保留的第一轮内联包)也不能
|
|
165
|
+
// 开第一份存档:资格可能在运行中途翻转(升级后放行 verification),这时照旧内联,按记录上限落盘(Codex 审查实拦)
|
|
166
|
+
const source=effect.kind==='develop'&&checkpoint.state==='awaiting_review'&&same(pkg.identity,identity)&&checkpoint.attempt===pkg.identity.attempt;
|
|
167
|
+
if(!ref&&!source){
|
|
161
168
|
must(size(payload)<=JOURNAL_PAYLOAD_LIMIT);return freeze({checkpoint,payloadFields:{}});
|
|
162
169
|
}
|
|
163
170
|
const budget=checkpointPackageBudget({inlineBytes:size(payload),packageBytes:size(pkg),reserve,enabled,referenced:ref!==null});
|
|
@@ -92,12 +92,15 @@ function directory(value){
|
|
|
92
92
|
try{return fs.statSync(resolved).isDirectory()?resolved:null;}catch{return null;}
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
// Whole-sentence start phrases only; generic consent stays not_approval (dogfood: 「批准开工」 was refused).
|
|
96
|
+
export const APPROVAL_PHRASES=new Set(['开始','开始吧','可以开始','确认开始','开始执行','现在开始','可以,请开始开发',
|
|
97
|
+
'开工','开工吧','批准开工','同意开工','批准开始','同意开始']);
|
|
95
98
|
function approvalIntent(response,assumeYes){
|
|
96
99
|
if(assumeYes===true)return 'explicit';
|
|
97
100
|
if(response===undefined||response===null||response==='')return 'none';
|
|
98
101
|
if(typeof response!=='string')return 'not_approval';
|
|
99
102
|
const normalized=response.trim().replace(/[。!!.~~\s]+$/gu,'');
|
|
100
|
-
return
|
|
103
|
+
return APPROVAL_PHRASES.has(normalized)?'explicit':'not_approval';
|
|
101
104
|
}
|
|
102
105
|
|
|
103
106
|
|
|
@@ -446,7 +449,7 @@ export function approveCmAiSpecs(options){
|
|
|
446
449
|
throw Object.assign(new Error('revision_changed_during_approval'),{code:'revision_changed_during_approval'});
|
|
447
450
|
}};
|
|
448
451
|
}
|
|
449
|
-
let specAmend;
|
|
452
|
+
let specAmend,approvalTiming=null;
|
|
450
453
|
// Runs under the approval lock shared with spec amendment re-binding. The decision
|
|
451
454
|
// rests on the status bytes validated above; it is void if another approval or
|
|
452
455
|
// publication replaced them since (inspect is re-run below for the rest).
|
|
@@ -495,6 +498,9 @@ export function approveCmAiSpecs(options){
|
|
|
495
498
|
approval:{response:approvalResponse,at},taskGrammar:grammar,
|
|
496
499
|
...(status.value&&Object.hasOwn(status.value,'revisionDigest')?{revisionDigest:status.value.revisionDigest}:{})},
|
|
497
500
|
bound?{beforeRename:()=>bound.check()}:{});
|
|
501
|
+
// Diagnostic timing only: how long the published specs waited for this approval.
|
|
502
|
+
approvalTiming={publishedAt:status.value?.status==='awaiting_review'?status.value.at??null:null,approvedAt:at,
|
|
503
|
+
kind:standing?'standing':'response',featureCount:discovered.names.length};
|
|
498
504
|
// The snapshot only enables later reviewed corrections; failing to write it
|
|
499
505
|
// never undoes the human approval, it just leaves every change at tier 2.
|
|
500
506
|
try{specAmend={...writeApprovalSnapshot(specsDir,{features:discovered.names,specFiles,
|
|
@@ -507,7 +513,7 @@ export function approveCmAiSpecs(options){
|
|
|
507
513
|
const refused=withApprovalLock(specsDir,write);
|
|
508
514
|
if(refused)return refused;
|
|
509
515
|
}catch(error){return refuse(error.code??error.message);}
|
|
510
|
-
return {projectResults:inspect(),specAmend};
|
|
516
|
+
return {projectResults:inspect(),specAmend,approvalTiming};
|
|
511
517
|
}
|
|
512
518
|
|
|
513
519
|
function admissionFor(options,inProgressBootstrap=null){
|
|
@@ -3,13 +3,13 @@ import {inspectCmAiAdmission,matchesCmAiTaskSelection,selectedFeature} from './c
|
|
|
3
3
|
import {inspectCmAiContextRefresh,inspectCmAiTaskLearningInput} from './cm-ai-context-refresh.mjs';
|
|
4
4
|
import {findCmAiQaDecision,inspectCmAiQaDecision,inspectCmAiQaResult,recordCmAiQaDecision,
|
|
5
5
|
latestCmAiQaRun,recordCmAiQaRun,inspectCmAiQaRecovery,inspectCmAiQaConfigurationRecovery,timedOutQaDecision,
|
|
6
|
-
replacesTimedOutQaDecision,validEnvironmentFailureReason} from './cm-ai-qa-log.mjs';
|
|
6
|
+
replacesTimedOutQaDecision,validEnvironmentFailureReason,readCmAiQaBlockedNeeds} from './cm-ai-qa-log.mjs';
|
|
7
7
|
import {recordCmAiRunDone} from './cm-ai-run-finalizer.mjs';
|
|
8
8
|
import {releaseVerifiedQaResources} from './qa-resource-release.mjs';
|
|
9
9
|
import {QA_MAX_ROUNDS} from './qa-round-budget.mjs';
|
|
10
10
|
import {qaRoundDeadlineMs} from './host-qa-executor.mjs';
|
|
11
11
|
import {projectHostResult} from './host-progress.mjs';
|
|
12
|
-
import {operatorGuidance} from './operator-guidance.mjs';
|
|
12
|
+
import {operatorGuidance,reviewLimitCard,REVIEW_LIMIT_CARD_CODES} from './operator-guidance.mjs';
|
|
13
13
|
import {outstandingFeatureQa,describeOutstandingQa} from './project-qa-gate.mjs';
|
|
14
14
|
import {REVIEWED_HANDOFF_HINT} from './host-handoff.mjs';
|
|
15
15
|
import {readHostQaFixHandoff} from './host-qa-fix.mjs';
|
|
@@ -32,7 +32,7 @@ const retryReview=reviewRetryable;
|
|
|
32
32
|
// batch driver decides retryability from the same predicate instead of keeping a
|
|
33
33
|
// second copy of the code list that silently drifts.
|
|
34
34
|
export const developmentRetryable=status=>status.state==='blocked'
|
|
35
|
-
&&['developer_result_invalid','verification_precheck_failed','check_output_out_of_scope','develop_checks_not_passed','develop_unchanged_after_review','develop_empty_changes','develop_requirement_missing','develop_package_too_large','bootstrap_verification_failed','develop_call_timeout','develop_answer_invalid',
|
|
35
|
+
&&['developer_result_invalid','verification_precheck_failed','check_output_out_of_scope','develop_checks_not_passed','develop_unchanged_after_review','develop_continuation_scope_mismatch','develop_empty_changes','develop_requirement_missing','develop_package_too_large','bootstrap_verification_failed','develop_call_timeout','develop_answer_invalid',
|
|
36
36
|
'check_answer_missing','check_answer_invalid','develop_out_of_scope','develop_answer_missing','develop_dispatch_failed','develop_interrupted',
|
|
37
37
|
// Q16/Q17: only documentation_sync is asked again (durable-runner-state.mjs DOCUMENTATION_SYNC_CODES).
|
|
38
38
|
'documentation_sync_answer_missing','documentation_sync_answer_invalid','documentation_sync_answer_blocked','documentation_sync_out_of_scope','documentation_sync_interrupted'].includes(status.code)
|
|
@@ -272,6 +272,10 @@ export function createCmAiConversationEntry(options) {
|
|
|
272
272
|
if(runner&&Object.hasOwn(runner,'qaAllowsSymlinks'))runnerKeys.push('qaAllowsSymlinks');
|
|
273
273
|
if(runner&&Object.hasOwn(runner,'qaChangedFiles'))runnerKeys.push('qaChangedFiles');
|
|
274
274
|
if(runner&&Object.hasOwn(runner,'qaCompletionChecks'))runnerKeys.push('qaCompletionChecks');
|
|
275
|
+
if(runner&&Object.hasOwn(runner,'qaCadence'))runnerKeys.push('qaCadence');
|
|
276
|
+
if(runner&&Object.hasOwn(runner,'reviewLimitEvidence'))runnerKeys.push('reviewLimitEvidence');
|
|
277
|
+
for(const key of ['reviewContinuationAvailability','reviewContinuationActive','authorizeReviewContinuation','repairReviewPublication'])
|
|
278
|
+
if(runner&&Object.hasOwn(runner,key))runnerKeys.push(key);
|
|
275
279
|
if(runner&&Object.hasOwn(runner,'verificationBlocks'))runnerKeys.push('verificationBlocks');
|
|
276
280
|
if(runner&&Object.hasOwn(runner,'completionBlocks'))runnerKeys.push('completionBlocks');
|
|
277
281
|
if(runner&&Object.hasOwn(runner,'reviewEffectIds'))runnerKeys.push('reviewEffectIds');
|
|
@@ -293,12 +297,21 @@ export function createCmAiConversationEntry(options) {
|
|
|
293
297
|
if(runner&&Object.hasOwn(runner,'reviseScope'))runnerKeys.push('reviseScope');
|
|
294
298
|
if(runner&&Object.hasOwn(runner,'redoDevelop'))runnerKeys.push('redoDevelop');
|
|
295
299
|
if(runner&&Object.hasOwn(runner,'recoverCommit'))runnerKeys.push('recoverCommit');
|
|
300
|
+
if(runner&&Object.hasOwn(runner,'preflightBatchCompletion'))runnerKeys.push('preflightBatchCompletion');
|
|
296
301
|
if(runner&&Object.hasOwn(runner,'interruptions'))runnerKeys.push('interruptions');
|
|
297
302
|
if(runner&&Object.hasOwn(runner,'inspectBootstrapAdmission'))runnerKeys.push('inspectBootstrapAdmission');
|
|
298
303
|
shape(runner,runnerKeys);
|
|
299
304
|
if(Object.hasOwn(runner,'qaAllowsSymlinks'))need(typeof runner.qaAllowsSymlinks==='function');
|
|
300
305
|
if(Object.hasOwn(runner,'qaChangedFiles'))need(typeof runner.qaChangedFiles==='function');
|
|
301
306
|
if(Object.hasOwn(runner,'qaCompletionChecks'))need(typeof runner.qaCompletionChecks==='function');
|
|
307
|
+
if(Object.hasOwn(runner,'qaCadence'))need(typeof runner.qaCadence==='function');
|
|
308
|
+
if(Object.hasOwn(runner,'reviewLimitEvidence'))need(typeof runner.reviewLimitEvidence==='function');
|
|
309
|
+
for(const key of ['reviewContinuationAvailability','reviewContinuationActive','authorizeReviewContinuation','repairReviewPublication'])
|
|
310
|
+
if(Object.hasOwn(runner,key))need(typeof runner[key]==='function');
|
|
311
|
+
// Third controlled review deliveries keep attempt 2 under their own effect ids.
|
|
312
|
+
const round=identity=>`${identity.attempt}${runner.reviewContinuationActive?.()===true?'-continuation':''}`;
|
|
313
|
+
// The run's frozen N6 cadence; null keeps the historical decision and plan.
|
|
314
|
+
const qaCadence=()=>{const value=runner.qaCadence?.()??null;need(value===null||value==='feature-v1','invalid_input');return value;};
|
|
302
315
|
for(const name of ['executeEffect','status','cancel','run'])need(typeof runner[name]==='function');
|
|
303
316
|
if(Object.hasOwn(runner,'completionBlocks'))need(typeof runner.completionBlocks==='function');
|
|
304
317
|
if(Object.hasOwn(runner,'reviewEffectIds'))need(typeof runner.reviewEffectIds==='function');
|
|
@@ -314,6 +327,7 @@ export function createCmAiConversationEntry(options) {
|
|
|
314
327
|
if(Object.hasOwn(runner,'recoverBootstrapReview'))need(typeof runner.recoverBootstrapReview==='function');
|
|
315
328
|
if(Object.hasOwn(runner,'redoDevelop'))need(typeof runner.redoDevelop==='function');
|
|
316
329
|
if(Object.hasOwn(runner,'recoverCommit'))need(typeof runner.recoverCommit==='function');
|
|
330
|
+
if(Object.hasOwn(runner,'preflightBatchCompletion'))need(typeof runner.preflightBatchCompletion==='function');
|
|
317
331
|
if(Object.hasOwn(runner,'interruptions'))need(typeof runner.interruptions==='function');
|
|
318
332
|
if(Object.hasOwn(runner,'inspectBootstrapAdmission'))need(typeof runner.inspectBootstrapAdmission==='function');
|
|
319
333
|
need(options.allowAbandonReview===undefined||typeof options.allowAbandonReview==='boolean','invalid_input');
|
|
@@ -480,7 +494,13 @@ export function createCmAiConversationEntry(options) {
|
|
|
480
494
|
// The host is constructed before N5 marks the task complete. Freeze the
|
|
481
495
|
// execution plan only now, then retain it throughout this invocation.
|
|
482
496
|
if(qaExecutor.prepare){
|
|
483
|
-
|
|
497
|
+
// A feature-v1 run whose QA was triggered only by five_tasks_without_qa
|
|
498
|
+
// runs a periodic plan; the recorded decision fixes it on every resume.
|
|
499
|
+
const triggeredBy=qaCadence()===null?null:findCmAiQaDecision({specsDir:options.specsDir,feature:options.feature,
|
|
500
|
+
identity:result.identity,packageDigest:result.packageDigest})?.reason??null;
|
|
501
|
+
// feature-v1 runs also note acceptance coverage and, when BLOCKED, what is missing.
|
|
502
|
+
const choice={...(triggeredBy==='five_tasks_without_qa'?{periodic:true}:{}),...(qaCadence()===null?{}:{coverage:true})};
|
|
503
|
+
const prepared=json(Object.keys(choice).length?qaExecutor.prepare(choice):qaExecutor.prepare());shape(prepared,['mode','caseCount','configuration']);
|
|
484
504
|
need(['commands','browser','all'].includes(prepared.mode)
|
|
485
505
|
&&Number.isSafeInteger(prepared.caseCount)&&prepared.caseCount>0,'qa_plan_invalid');
|
|
486
506
|
qaExecutor={...qaExecutor,...prepared};
|
|
@@ -565,6 +585,7 @@ export function createCmAiConversationEntry(options) {
|
|
|
565
585
|
deferredCases:qaExecutor.configuration?.plan?.deferred_cases??[],
|
|
566
586
|
...(qaExecutor.configuration?.plan?.dropped_task_cases?{droppedTaskCases:qaExecutor.configuration.plan.dropped_task_cases}:{}),
|
|
567
587
|
...(qaExecutor.configuration?.plan?.dropped_task_commands?{droppedTaskCommands:qaExecutor.configuration.plan.dropped_task_commands}:{}),
|
|
588
|
+
...(qaExecutor.configuration?.plan?.periodic_deferred_cases?{periodicDeferredCases:qaExecutor.configuration.plan.periodic_deferred_cases}:{}),
|
|
568
589
|
...(recovery?{previousTestRunId:recovery.testRunId}:{})});
|
|
569
590
|
// Only an executor whose plan declares reuseCheck receives the task
|
|
570
591
|
// checks; a package that no longer matches the code root yields null
|
|
@@ -707,7 +728,7 @@ export function createCmAiConversationEntry(options) {
|
|
|
707
728
|
if(!(status.state==='awaiting_review'&&status.code===null)&&!retryReview(status))return summary(operation,status,'reported');
|
|
708
729
|
need(!status.cancellationRequested&&!status.cancelAfterCommit,'cancelled');
|
|
709
730
|
const resumed=runner.interruptions?.('review')??0,roundIds=runner.reviewEffectIds?.();
|
|
710
|
-
const idFor=n=>`review-${identity
|
|
731
|
+
const idFor=n=>`review-${round(identity)}${n?`-retry-${n}`:''}${resumed?`-resume-${resumed}`:''}`;
|
|
711
732
|
let retries=0;
|
|
712
733
|
if(retryReview(status)){
|
|
713
734
|
retries=Math.max(Array.isArray(roundIds)?roundIds.length:0,
|
|
@@ -732,7 +753,7 @@ export function createCmAiConversationEntry(options) {
|
|
|
732
753
|
return effectSummary(operation,recovered,runner,identity);
|
|
733
754
|
}
|
|
734
755
|
const retries=runner.completionBlocks?.()??0,resumed=runner.interruptions?.('complete')??0;
|
|
735
|
-
const effectId=`complete-${identity
|
|
756
|
+
const effectId=`complete-${round(identity)}${retries?`-retry-${retries}`:''}${resumed?`-resume-${resumed}`:''}`;
|
|
736
757
|
const result=await runner.executeEffect({version:1,id:effectId,identity,kind:'complete'});
|
|
737
758
|
return effectSummary(operation,result,runner,identity);
|
|
738
759
|
}
|
|
@@ -769,6 +790,7 @@ export function createCmAiConversationEntry(options) {
|
|
|
769
790
|
Promise.resolve().then(()=>{need(!controller.signal.aborted,'cancelled');
|
|
770
791
|
return decideQa(freeze({...binding,codeProject:options.codeProject,
|
|
771
792
|
changedFiles:runner.qaChangedFiles?.(operation.packageDigest)??{paths:[],source:'unavailable'},
|
|
793
|
+
...(qaCadence()===null?{}:{qaCadence:qaCadence()}),
|
|
772
794
|
...(previousDecisionId===null?{}:{previousDecisionId})}),controller.signal);}),interrupted]));
|
|
773
795
|
need(!controller.signal.aborted,'cancelled');
|
|
774
796
|
const current=boundStatus(runner.status(),identity);
|
|
@@ -809,7 +831,12 @@ export function createCmAiConversationEntry(options) {
|
|
|
809
831
|
pendingAction:fixHandoff.status==='authorization_required'?'fix_authorization':
|
|
810
832
|
fixHandoff.status==='dispatch_required'?'fix_dispatch':'none'});
|
|
811
833
|
}
|
|
834
|
+
// feature-v1: say in plain words what the BLOCKED round is missing.
|
|
835
|
+
const blockedNeeds=code==='qa_result_blocked'&&qaCadence()!==null
|
|
836
|
+
?readCmAiQaBlockedNeeds({specsDir:options.specsDir,feature:options.feature,identity,
|
|
837
|
+
packageDigest:operation.packageDigest,testRunId:operation.testRunId}):[];
|
|
812
838
|
return freeze({...summary(operation,{...status,code},'verified'),
|
|
839
|
+
...(blockedNeeds.length?{qaBlockedNeeds:blockedNeeds}:{}),
|
|
813
840
|
...(code==='qa_result_blocked'&&rerunBlockedQa?{pendingAction:'qa'}:{})});
|
|
814
841
|
}
|
|
815
842
|
if(operation.operation==='context_refresh'){
|
|
@@ -922,10 +949,21 @@ export function createCmAiConversationEntry(options) {
|
|
|
922
949
|
// Both kinds of local rejection need a fresh effect id: an invalid developer
|
|
923
950
|
// result, and one the host gate blocked before the review package existed.
|
|
924
951
|
const retries=rejectedValues+(runner.verificationBlocks?.()??0),resumed=runner.interruptions?.('develop')??0;
|
|
925
|
-
const effectId=`develop-${identity
|
|
952
|
+
const effectId=`develop-${round(identity)}${retries?`-retry-${retries}`:''}${resumed?`-resume-${resumed}`:''}`;
|
|
926
953
|
const result=await runner.executeEffect({version:1,id:effectId,identity,kind:'develop',learningInput});
|
|
927
954
|
return effectSummary(operation,result,runner,identity);
|
|
928
955
|
}
|
|
956
|
+
// Read-only decision card after the review rounds are spent: replayed facts only.
|
|
957
|
+
// A read failure degrades to a card that names what is missing; never a permission.
|
|
958
|
+
const reviewLimitCardFor=routed=>{
|
|
959
|
+
if(routed?.state!=='blocked'||typeof runner.reviewLimitEvidence!=='function')return null;
|
|
960
|
+
// A pending review-file projection keeps the card: it lists the missing file.
|
|
961
|
+
const code=routed.code==='review_publication_required'?runner.status().publicationBlockedCode:routed.code;
|
|
962
|
+
if(!REVIEW_LIMIT_CARD_CODES.has(code))return null;
|
|
963
|
+
let evidence=null,continuation=null;try{evidence=runner.reviewLimitEvidence();}catch{evidence=null;}
|
|
964
|
+
try{continuation=runner.reviewContinuationAvailability?.()??null;}catch{continuation=null;}
|
|
965
|
+
return reviewLimitCard(evidence,{continuation});
|
|
966
|
+
};
|
|
929
967
|
const handle=async raw=>{
|
|
930
968
|
let token=null,operation=null;const epoch=cancellationEpoch;
|
|
931
969
|
try{
|
|
@@ -933,8 +971,13 @@ export function createCmAiConversationEntry(options) {
|
|
|
933
971
|
if(!['status','cancel','reconcile_review','abandon_review','abandon_effect','bootstrap_review_recover','develop_redo','completion_rework','development_rework','revise_scope'].includes(operation.operation)){
|
|
934
972
|
token=Symbol(operation.operation);inFlightHandles.add(token);
|
|
935
973
|
}
|
|
974
|
+
// Heal a missing review-file projection of a journaled receipt before
|
|
975
|
+
// acting; a failure stays visible as review_publication_required.
|
|
976
|
+
if(['advance','start','decision','complete'].includes(operation.operation))try{runner.repairReviewPublication?.();}catch{}
|
|
936
977
|
const routed=await route(operation);
|
|
937
|
-
const
|
|
978
|
+
const card=reviewLimitCardFor(routed);
|
|
979
|
+
const projected={...routed,completion:completionSummary({specsDir:options.specsDir,feature:options.feature,result:routed}),
|
|
980
|
+
...(card?{reviewLimitCard:card}:{})};
|
|
938
981
|
const guidance=operatorGuidance(projected,{executionActive:inFlightHandles.size>(token===null?0:1)});
|
|
939
982
|
const result=freeze({...projected,...(guidance?{guidance}:{})});
|
|
940
983
|
if(!admissionReports.has(routed)&&(epoch===cancellationEpoch||operation.operation==='cancel'))projectHostResult({specsDir:options.specsDir,
|