@aibyzero/cm-workflow 0.16.4 → 0.16.6

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.
Files changed (283) hide show
  1. package/.codex-plugin/plugin.json +1 -1
  2. package/AGENTS.md +22 -0
  3. package/CHANGELOG.md +57 -0
  4. package/README.md +22 -4
  5. package/THIRD_PARTY_NOTICES.md +9 -0
  6. package/VERSION +1 -1
  7. package/docs/architecture.md +43 -0
  8. package/docs/execution-optimizations.md +33 -0
  9. package/docs/external-models.md +114 -0
  10. package/docs/fixes/.reviews/20260929-bootstrap-unchanged-review-r1.md +7 -0
  11. package/docs/fixes/.reviews/20260930-develop-package-limit-recovery-r4.md +9 -0
  12. package/docs/fixes/20260929-bootstrap-rule-refresh-conflict.md +22 -0
  13. package/docs/fixes/20260929-bootstrap-unchanged-review.md +26 -0
  14. package/docs/fixes/20260930-develop-package-limit-recovery.md +65 -0
  15. package/docs/human-correction.md +31 -0
  16. package/docs/installation.md +48 -7
  17. package/docs/js-workflow-control.md +293 -33
  18. package/docs/live-evidence-drivers.md +62 -0
  19. package/docs/next-steps.md +15 -10
  20. package/docs/runtime-failover.md +1 -1
  21. package/docs/untested-branches.md +27 -4
  22. package/docs/user-guide.md +23 -8
  23. package/install-codex.sh +28 -11
  24. package/package.json +1 -1
  25. package/runtime/js/cm-ai/accepted-fix.mjs +23 -5
  26. package/runtime/js/cm-ai/bootstrap-feature.mjs +15 -0
  27. package/runtime/js/cm-ai/claude-review-adapter.mjs +7 -4
  28. package/runtime/js/cm-ai/claude-review-stream.mjs +12 -0
  29. package/runtime/js/cm-ai/claude-tool-preview.mjs +4 -4
  30. package/runtime/js/cm-ai/cm-ai-admission.mjs +115 -41
  31. package/runtime/js/cm-ai/cm-ai-context-refresh.mjs +3 -2
  32. package/runtime/js/cm-ai/cm-ai-conversation-entry.mjs +208 -34
  33. package/runtime/js/cm-ai/cm-ai-learning-handoff-writer.mjs +11 -9
  34. package/runtime/js/cm-ai/cm-ai-learning-writer.mjs +22 -5
  35. package/runtime/js/cm-ai/cm-ai-qa-log.mjs +181 -57
  36. package/runtime/js/cm-ai/cm-ai-run-finalizer.mjs +15 -58
  37. package/runtime/js/cm-ai/codex-config.mjs +3 -2
  38. package/runtime/js/cm-ai/codex-review-adapter.mjs +56 -17
  39. package/runtime/js/cm-ai/committed-rule-basis.mjs +76 -0
  40. package/runtime/js/cm-ai/developer-adapter.mjs +6 -2
  41. package/runtime/js/cm-ai/diagnostic-reason.mjs +10 -0
  42. package/runtime/js/cm-ai/drive-bootstrap.mjs +315 -0
  43. package/runtime/js/cm-ai/drive-core.mjs +47 -9
  44. package/runtime/js/cm-ai/durable-runner-state.mjs +413 -56
  45. package/runtime/js/cm-ai/effect-abandon-log.mjs +19 -0
  46. package/runtime/js/cm-ai/effect-contract.mjs +44 -2
  47. package/runtime/js/cm-ai/execution-policy.mjs +58 -0
  48. package/runtime/js/cm-ai/execution-store-limits.mjs +18 -0
  49. package/runtime/js/cm-ai/execution-store.mjs +6 -4
  50. package/runtime/js/cm-ai/external-group-models.mjs +53 -0
  51. package/runtime/js/cm-ai/external-model-launch.mjs +23 -0
  52. package/runtime/js/cm-ai/external-models.mjs +52 -0
  53. package/runtime/js/cm-ai/external-run-guard.mjs +96 -0
  54. package/runtime/js/cm-ai/fix-code-association.mjs +171 -18
  55. package/runtime/js/cm-ai/host-bootstrap.mjs +126 -29
  56. package/runtime/js/cm-ai/host-check.mjs +30 -4
  57. package/runtime/js/cm-ai/host-conversation-execution.mjs +66 -20
  58. package/runtime/js/cm-ai/host-handoff.mjs +13 -6
  59. package/runtime/js/cm-ai/host-progress.mjs +80 -0
  60. package/runtime/js/cm-ai/host-project-execution.mjs +16 -11
  61. package/runtime/js/cm-ai/host-qa-executor.mjs +23 -9
  62. package/runtime/js/cm-ai/host-qa-fix-owner.mjs +23 -6
  63. package/runtime/js/cm-ai/host-qa-policy.mjs +16 -7
  64. package/runtime/js/cm-ai/host-session.mjs +12 -4
  65. package/runtime/js/cm-ai/host-tool-bridge.mjs +1 -1
  66. package/runtime/js/cm-ai/host-workflow-capabilities.mjs +16 -5
  67. package/runtime/js/cm-ai/host.mjs +1 -1
  68. package/runtime/js/cm-ai/knowledge-closeout.mjs +56 -0
  69. package/runtime/js/cm-ai/launch-mismatch.mjs +42 -0
  70. package/runtime/js/cm-ai/legacy-model-run-preview.mjs +24 -0
  71. package/runtime/js/cm-ai/legacy-model-settings.mjs +59 -0
  72. package/runtime/js/cm-ai/live-evidence.mjs +96 -0
  73. package/runtime/js/cm-ai/log-rows.mjs +21 -0
  74. package/runtime/js/cm-ai/model-configuration-file.mjs +63 -0
  75. package/runtime/js/cm-ai/model_configuration_write.py +214 -0
  76. package/runtime/js/cm-ai/native-usage-log.mjs +26 -0
  77. package/runtime/js/cm-ai/operator-guidance.mjs +86 -0
  78. package/runtime/js/cm-ai/owned-process-cleanup.mjs +22 -0
  79. package/runtime/js/cm-ai/project-qa-gate.mjs +84 -0
  80. package/runtime/js/cm-ai/provider-review-observation.mjs +68 -9
  81. package/runtime/js/cm-ai/provider-usage.mjs +39 -0
  82. package/runtime/js/cm-ai/qa-config-revision.mjs +44 -10
  83. package/runtime/js/cm-ai/review-abandon-log.mjs +21 -0
  84. package/runtime/js/cm-ai/review-package.mjs +438 -31
  85. package/runtime/js/cm-ai/review-presentation.mjs +45 -0
  86. package/runtime/js/cm-ai/review-reconciliation.mjs +20 -0
  87. package/runtime/js/cm-ai/review-runner.mjs +47 -1
  88. package/runtime/js/cm-ai/reviewed-deliveries.mjs +97 -0
  89. package/runtime/js/cm-ai/reviewed-evidence-supersede.mjs +104 -10
  90. package/runtime/js/cm-ai/reviewed-evidence-supersession-record.mjs +42 -3
  91. package/runtime/js/cm-ai/specification-material.mjs +154 -12
  92. package/runtime/js/cm-ai/status-projection.mjs +93 -0
  93. package/runtime/js/cm-ai/task-commit.mjs +2 -2
  94. package/runtime/js/cm-ai/task-runner.mjs +658 -75
  95. package/runtime/js/cm-ai/tool-preview.mjs +8 -4
  96. package/runtime/js/cm-ai/worker-claude-developer.mjs +16 -7
  97. package/runtime/js/cm-ai/worker-claude.mjs +63 -19
  98. package/runtime/js/cm-ai/worker-codex-developer.mjs +15 -9
  99. package/runtime/js/cm-ai/worker-codex.mjs +45 -19
  100. package/runtime/js/cm-fix/cause-evidence.mjs +5 -3
  101. package/runtime/js/cm-fix/cause-invocation.mjs +6 -3
  102. package/runtime/js/cm-fix/cause-package.mjs +10 -1
  103. package/runtime/js/cm-fix/execution.mjs +279 -52
  104. package/runtime/js/cm-fix/final-review.mjs +18 -10
  105. package/runtime/js/cm-fix/host-review.mjs +32 -9
  106. package/runtime/js/cm-fix/host.mjs +6 -1
  107. package/runtime/js/cm-fix/layout.mjs +1 -1
  108. package/runtime/js/cm-fix/progress.mjs +5 -0
  109. package/runtime/js/cm-fix/protected-edits.mjs +15 -4
  110. package/runtime/js/cm-fix/qa-source.mjs +6 -4
  111. package/runtime/js/cm-fix/review-reconciliation.mjs +64 -0
  112. package/runtime/js/cm-prd/analysis.mjs +2 -1
  113. package/runtime/js/cm-prd/change.mjs +28 -10
  114. package/runtime/js/cm-prd/draft.mjs +5 -2
  115. package/runtime/js/cm-prd/response-recovery.mjs +23 -0
  116. package/runtime/js/cm-prd/review-preparation.mjs +10 -3
  117. package/runtime/js/cm-prd/review-publication.mjs +27 -15
  118. package/runtime/js/cm-prd/review-time.mjs +29 -0
  119. package/runtime/js/cm-prd/self-check.mjs +6 -3
  120. package/runtime/js/cm-prd/session.mjs +53 -6
  121. package/runtime/js/cm-prd/summary.mjs +3 -1
  122. package/runtime/js/cm-prd/validation-reason.mjs +20 -0
  123. package/runtime/js/cm-security/finalize.mjs +32 -0
  124. package/runtime/js/spec-task-line.mjs +117 -0
  125. package/runtime/js/specs-status.mjs +10 -3
  126. package/runtime/review.md +5 -0
  127. package/runtime/task-gates.md +6 -0
  128. package/runtime/workflow-config.md +10 -1
  129. package/scripts/cm-ai-abandon-effect-position.test.mjs +201 -0
  130. package/scripts/cm-ai-admission.mjs +18 -11
  131. package/scripts/cm-ai-admission.test.mjs +65 -1
  132. package/scripts/cm-ai-batch-drive.mjs +135 -34
  133. package/scripts/cm-ai-batch-drive.test.mjs +209 -3
  134. package/scripts/cm-ai-batch-host.mjs +63 -24
  135. package/scripts/cm-ai-batch-host.test.mjs +2 -1
  136. package/scripts/cm-ai-batch-run.mjs +101 -34
  137. package/scripts/cm-ai-batch-run.test.mjs +56 -5
  138. package/scripts/cm-ai-bootstrap-driver-preflight.test.mjs +45 -0
  139. package/scripts/cm-ai-bootstrap-flow.test.mjs +159 -0
  140. package/scripts/cm-ai-bootstrap-merge.test.mjs +162 -0
  141. package/scripts/cm-ai-bootstrap.test.mjs +174 -89
  142. package/scripts/cm-ai-conversation-entry-ops.test.mjs +97 -2
  143. package/scripts/cm-ai-develop-driver-gaps.test.mjs +924 -0
  144. package/scripts/cm-ai-drive-bootstrap-rules.test.mjs +468 -0
  145. package/scripts/cm-ai-drive-timeout.test.mjs +17 -0
  146. package/scripts/cm-ai-drive.mjs +526 -60
  147. package/scripts/cm-ai-drive.test.mjs +336 -10
  148. package/scripts/cm-ai-fix-later-delivery.test.mjs +383 -0
  149. package/scripts/cm-ai-host.mjs +142 -43
  150. package/scripts/cm-ai-host.test.mjs +232 -12
  151. package/scripts/cm-ai-launch-diagnostics.test.mjs +142 -0
  152. package/scripts/cm-ai-multi-root.test.mjs +9 -3
  153. package/scripts/cm-ai-operator-guidance.test.mjs +94 -0
  154. package/scripts/cm-ai-progress.test.mjs +521 -0
  155. package/scripts/cm-ai-project-qa-gate.test.mjs +308 -0
  156. package/scripts/cm-ai-qa-config-revision.test.mjs +187 -15
  157. package/scripts/cm-ai-qa-fingerprint-config.test.mjs +157 -0
  158. package/scripts/cm-ai-qa-fix-cross-session.test.mjs +27 -2
  159. package/scripts/cm-ai-qa-rerun-timeouts.test.mjs +400 -0
  160. package/scripts/cm-ai-review-drift-precedence.test.mjs +90 -0
  161. package/scripts/cm-ai-review-failure.test.mjs +977 -0
  162. package/scripts/cm-ai-review-timeout-config.test.mjs +29 -7
  163. package/scripts/cm-ai-review-timeout.test.mjs +199 -4
  164. package/scripts/cm-ai-run.mjs +206 -62
  165. package/scripts/cm-ai-run.test.mjs +6 -4
  166. package/scripts/cm-ai-runner-error-code-regression.test.mjs +219 -0
  167. package/scripts/cm-ai-selection-guard.test.mjs +100 -0
  168. package/scripts/cm-ai-session-chain.test.mjs +7 -3
  169. package/scripts/cm-ai-spec-rebind.test.mjs +481 -0
  170. package/scripts/cm-ai-supersede.test.mjs +571 -17
  171. package/scripts/cm-ai-verification-gate.test.mjs +2 -1
  172. package/scripts/cm-bootstrap-review-recovery.test.mjs +70 -0
  173. package/scripts/cm-capability-gate.test.mjs +21 -2
  174. package/scripts/cm-check-drive.test.mjs +2 -1
  175. package/scripts/cm-check-host.test.mjs +1 -1
  176. package/scripts/cm-check-runtime.sh +12 -1
  177. package/scripts/cm-claude-developer-worker.test.mjs +3 -1
  178. package/scripts/cm-claude-install-layout.test.mjs +26 -0
  179. package/scripts/cm-claude-probe.test.mjs +10 -2
  180. package/scripts/cm-claude-review-stream.test.mjs +25 -0
  181. package/scripts/cm-claude-worker.test.mjs +11 -4
  182. package/scripts/cm-codex-developer-worker.test.mjs +4 -2
  183. package/scripts/cm-codex-plugin-metadata.py +83 -0
  184. package/scripts/cm-codex-plugin-metadata.test.mjs +55 -0
  185. package/scripts/cm-efficiency-checks.test.mjs +37 -0
  186. package/scripts/cm-efficiency-diagnostics.test.mjs +74 -0
  187. package/scripts/cm-efficiency-offline.mjs +35 -0
  188. package/scripts/cm-efficiency-policy.test.mjs +48 -0
  189. package/scripts/cm-efficiency-presentation.test.mjs +35 -0
  190. package/scripts/cm-efficiency-response.test.mjs +117 -0
  191. package/scripts/cm-efficiency-usage.test.mjs +148 -0
  192. package/scripts/cm-external-batch-host.test.mjs +157 -0
  193. package/scripts/cm-external-fix-host.test.mjs +281 -0
  194. package/scripts/cm-external-fix-reconciliation.test.mjs +105 -0
  195. package/scripts/cm-external-group-models.test.mjs +60 -0
  196. package/scripts/cm-external-model-host.test.mjs +180 -0
  197. package/scripts/cm-external-model-recovery.test.mjs +108 -0
  198. package/scripts/cm-external-models.test.mjs +89 -0
  199. package/scripts/cm-external-process-cleanup.test.mjs +71 -0
  200. package/scripts/cm-external-qa-fix.test.mjs +170 -0
  201. package/scripts/cm-external-review-reconciliation.test.mjs +314 -0
  202. package/scripts/cm-failover.mjs +8 -8
  203. package/scripts/cm-fix-abandon.test.mjs +123 -5
  204. package/scripts/cm-fix-cause-package.test.mjs +2 -0
  205. package/scripts/cm-fix-drive.mjs +70 -23
  206. package/scripts/cm-fix-drive.test.mjs +36 -1
  207. package/scripts/cm-fix-final-review.test.mjs +11 -6
  208. package/scripts/cm-fix-host.mjs +24 -14
  209. package/scripts/cm-fix-protected-edits.test.mjs +12 -0
  210. package/scripts/cm-fix-rediagnosis.test.mjs +168 -0
  211. package/scripts/cm-fix-review-budget.test.mjs +147 -0
  212. package/scripts/cm-fixture-process-cleanup.test.mjs +95 -0
  213. package/scripts/cm-host-check.test.mjs +6 -3
  214. package/scripts/cm-host-qa-executor.test.mjs +213 -17
  215. package/scripts/cm-host-session-diagnostic.test.mjs +10 -0
  216. package/scripts/cm-interactive-qa-diagnostic.test.mjs +53 -0
  217. package/scripts/cm-knowledge-closeout.test.mjs +160 -0
  218. package/scripts/cm-live-evidence.test.mjs +64 -0
  219. package/scripts/cm-log-event.mjs +25 -2
  220. package/scripts/cm-log-event.py +15 -0
  221. package/scripts/cm-log-event.test.mjs +31 -0
  222. package/scripts/cm-model-setup.mjs +79 -0
  223. package/scripts/cm-prd-completion.test.mjs +75 -0
  224. package/scripts/cm-prd-draft.test.mjs +14 -0
  225. package/scripts/cm-prd-drive.mjs +32 -11
  226. package/scripts/cm-prd-drive.test.mjs +15 -0
  227. package/scripts/cm-prd-gate-diagnostic.test.mjs +100 -0
  228. package/scripts/cm-prd-host.mjs +13 -4
  229. package/scripts/cm-prd-review-gate.mjs +126 -81
  230. package/scripts/cm-prd-review-gate.test.mjs +105 -1
  231. package/scripts/cm-prd-review-preparation.test.mjs +15 -0
  232. package/scripts/cm-prd-review-publication.test.mjs +6 -0
  233. package/scripts/cm-prd-self-check.test.mjs +6 -0
  234. package/scripts/cm-prd-summary.test.mjs +9 -0
  235. package/scripts/cm-release-smoke.sh +5 -1
  236. package/scripts/cm-review-dependency-snapshot.test.mjs +15 -0
  237. package/scripts/cm-review-inventory.test.mjs +253 -1
  238. package/scripts/cm-runtime-i18n.mjs +15 -4
  239. package/scripts/cm-runtime-install.mjs +8 -4
  240. package/scripts/cm-runtime.mjs +116 -23
  241. package/scripts/cm-runtime.test.mjs +121 -12
  242. package/scripts/cm-security.test.mjs +32 -0
  243. package/scripts/cm-spec-manifest.mjs +28 -10
  244. package/scripts/cm-spec-manifest.test.mjs +8 -4
  245. package/scripts/cm-spec-task-line.test.mjs +138 -0
  246. package/scripts/cm-specs-status.test.mjs +12 -1
  247. package/scripts/cm-task-gate-correction.test.mjs +117 -0
  248. package/scripts/cm-task-gate.mjs +164 -20
  249. package/scripts/cm-task-gate.py +2 -1
  250. package/scripts/cm-test-branch-impact.test.mjs +6 -3
  251. package/scripts/cm-test-drive.mjs +10 -4
  252. package/scripts/cm-test-drive.test.mjs +14 -1
  253. package/scripts/cm-tool-preview-context.test.mjs +12 -0
  254. package/scripts/cm-usage-report.py +22 -3
  255. package/scripts/cm-workflow-config.mjs +10 -1
  256. package/scripts/fixtures/bootstrap-review-runner.mjs +102 -0
  257. package/scripts/fixtures/claude-review-process.mjs +1 -0
  258. package/scripts/fixtures/live-evidence-driver.mjs +35 -0
  259. package/scripts/fixtures/process-cleanup.mjs +101 -0
  260. package/scripts/test-cm-log-event.py +2 -0
  261. package/scripts/test-cm-native-usage.py +62 -0
  262. package/scripts/test-cm-prd-review-gate.py +2 -1
  263. package/scripts/test-external-model-setup.py +91 -0
  264. package/scripts/test-model-configuration-write.py +201 -0
  265. package/scripts/test-npm-install.py +11 -2
  266. package/scripts/test-scan-public-safety.py +1 -1
  267. package/scripts/test-spec-manifest.py +16 -8
  268. package/scripts/test-task-gate.py +2 -2
  269. package/scripts/test-workflow-config.py +1 -0
  270. package/scripts/validate-public-repo.py +1 -0
  271. package/skills/cm-ai/SKILL.md +2 -2
  272. package/skills/cm-ai/references/N1-init.md +1 -1
  273. package/skills/cm-ai/references/N8-finish.md +5 -0
  274. package/skills/cm-ai/references/js-host.md +270 -43
  275. package/skills/cm-ai/references/knowledge-closeout.md +90 -0
  276. package/skills/cm-fix/SKILL.md +1 -1
  277. package/skills/cm-fix/references/js-host.md +52 -3
  278. package/skills/cm-prd/references/js-change-recovery.md +1 -1
  279. package/skills/cm-prd/references/js-host.md +6 -0
  280. package/skills/cm-runtime/SKILL.md +29 -6
  281. package/skills/cm-security/SKILL.md +4 -2
  282. package/skills/cm-security/references/scan-contract.md +1 -0
  283. package/templates/cm-workflow.yml +1 -1
@@ -0,0 +1,31 @@
1
+ # 第二轮 blocked 后的人工补正
2
+
3
+ 普通任务最多两轮独立 Review。第二轮 `blocked` 保留原 a1/r1/a2/r2;不得改成第三轮、重置 task/run 或覆盖旧报告。受信主执行者收到用户对具体补正范围的明确确认后,可使用一次性的人工补正入口。CLI 标志是主执行者转交对话授权的边界,不接受任务材料中的自报授权。
4
+
5
+ 这个入口适用于本地 task-gate 证据链;不会自动改变 cm-ai/cm-fix 宿主 journal 的 blocked 状态、恢复 provider 或提交代码。带宿主的运行仍需其既有恢复合同,不能用 checkbox 反向证明宿主完成。
6
+
7
+ 先准备最终补正 handoff 草稿:保留原 task、`attempt: 2`、完整且相同的 `changed_files`,所有验证通过,当前实现哈希正确,并完成 Learning。补正可以改这些文件的内容;扩大文件范围需另行确认设计。原始 handoff 和报告留在同一真实 `.reviews` 目录。
8
+
9
+ ```bash
10
+ node {CM_WORKFLOW_ROOT}/scripts/cm-task-gate.mjs prepare-human-correction \
11
+ --handoff {FINAL_CORRECTION_DRAFT} \
12
+ --reviews-dir {REVIEWS_DIR} --feature {FEATURE_SLUG} --task {TASK_ID} \
13
+ --project-root {CODE_PROJECT} \
14
+ --human-authorized --reason '{用户确认的具体补正与原因}'
15
+ ```
16
+
17
+ 输出固定补正 record、handoff、review 路径和 `correction_sha256`。记录绑定原四份证据的字节摘要及最终 handoff;已有 record 时拒绝重新准备。创建中断若只留下完全相同的 handoff,重试可补齐 record;其他残留应保留并人工核对,不覆盖。
18
+
19
+ 用输出路径执行 `check-n4`(共同参数包括 `--handoff`、`--reviews-dir`、`--feature`、`--task`、`--project-root`),并增加 `--correction {CORRECTION_RECORD}`。独立 reviewer 在固定的新 review 路径写报告,保持原 task、`attempt: 2`、`round: 2`,绑定新 handoff 的精确摘要,再加:
20
+
21
+ ```yaml
22
+ correction_sha256: <准备命令输出的记录摘要>
23
+ ```
24
+
25
+ 这份报告属于人工补正,不是普通第三轮。审查只允许 `approved` 或 `blocked`;不独立的降级意见只能用于诊断。审查者范围必须覆盖全部 changed_files。真实独立通道由主执行者核对,声明字段和封存回执本身不证明 reviewer 调用。
26
+
27
+ 报告定稿后,主执行者用相同参数执行 `publish-human-correction-review`,独占创建封存回执。然后 `check-n5 --correction ...` 核对旧历史、授权记录、实现、handoff、review 和封存回执;仅独立 approved 通过。改动任何绑定内容都会使该批准失效。`blocked` 封存后不能覆盖、重审或重新准备;需要新的人工决策,当前一次性入口不提供后续自动循环。
28
+
29
+ 若原任务尚未完成,继续使用现有 `python3 scripts/cm-task-gate.py mark-done`,共同参数增加 `--correction {CORRECTION_RECORD}` 和原权威 `--tasks`。完成计划固定八份证据,仍通过既有所有权锁、最终复核和原子替换;普通路径的最多四份证据与两轮规则保持原样。该操作不能绕过活动宿主的 writer。
30
+
31
+ 本地自动夹具使用合成 review 内容验证合同与拒绝路径;这些夹具不是实际审查证据。
@@ -1,5 +1,8 @@
1
1
  # Installation
2
2
 
3
+ 单任务外部模型的可选配置入口见 [外部模型配置](external-models.md)。配置向导不会安装、
4
+ 切换当前宿主模型或迁移运行;本阶段需在合法单任务计划显式启用。
5
+
3
6
  ## Requirements
4
7
 
5
8
  - Git, Python 3.9 or newer, and Node.js 18 or newer.
@@ -73,7 +76,7 @@ Install or upgrade with the same command:
73
76
  npx @aibyzero/cm-workflow@latest install
74
77
  ```
75
78
 
76
- To pin a version, use `npx @aibyzero/cm-workflow@0.16.4 install` from outside
79
+ To pin a version, use `npx @aibyzero/cm-workflow@0.16.6 install` from outside
77
80
  the CM Workflow source checkout (for example, your home directory). Inside a
78
81
  checkout with the same package name and version, npm can select the local
79
82
  uninstalled package and report `cm-workflow: command not found`.
@@ -153,6 +156,26 @@ The installed `/cm-ai` Skill invokes the same read-only
153
156
  `$CLAUDE_HOME/scripts/cm-ai-admission.mjs` N1/N2 authority used by Codex; no
154
157
  Claude-specific workflow fork is installed.
155
158
 
159
+ ### Claude Code 权限建议(可选)
160
+
161
+ 安装器把 CM 脚本放在 `$CLAUDE_HOME/scripts/`(默认 `~/.claude/scripts/`),不会代改项目的 `.claude/settings.json`。如需减少普通驱动调用的重复提示,可由项目所有者审阅后在项目配置中添加以下示例;自定义 `CLAUDE_HOME` 时替换路径:
162
+
163
+ ```json
164
+ {
165
+ "permissions": {
166
+ "allow": [
167
+ "Bash(node ~/.claude/scripts/cm-ai-drive.mjs:*)",
168
+ "Bash(node ~/.claude/scripts/cm-ai-batch-drive.mjs:*)",
169
+ "Bash(node ~/.claude/scripts/cm-fix-drive.mjs:*)",
170
+ "Bash(node ~/.claude/scripts/cm-prd-drive.mjs:*)",
171
+ "Bash(node ~/.claude/scripts/cm-ai-host.mjs --help)"
172
+ ]
173
+ }
174
+ }
175
+ ```
176
+
177
+ 这只是启动命令的建议规则,不是 CM 的运行授权;计划文件里的操作与权限仍须逐项审查。覆盖旧审查证据的 `--supersede-reviewed-evidence`、保留前驱代码漂移的 `--accept-superseded-code-drift`、SwiftPM 的 `--disable-sandbox`、QA 重跑的 `--rerun-unknown-qa`/`--rerun-blocked-qa`、放弃审查的 `--allow-abandon-review`,以及修改权限配置,都应由用户针对本次动作确认。尤其 `--supersede-reviewed-evidence` 和 `--accept-superseded-code-drift` 可以写在驱动的 `PLAN.permissions` 中,单凭上面的 Bash 通配规则无法识别;无法逐次审阅计划时,不要启用这些通配规则。要试改驱动脚本,请把副本放在项目或临时工作目录,不在 `~/.claude/scripts/` 原地编辑。若组织级权限策略继续拒绝,即使项目规则允许也应遵循该策略。
178
+
156
179
  ## Claude Code on Windows
157
180
 
158
181
  ```powershell
@@ -233,11 +256,16 @@ CM-owned paths you have reviewed, or restore from your own backup.
233
256
  ## Runtime declaration at installation
234
257
 
235
258
  After a successful core install, `install.sh`, `install-codex.sh`, and `install.ps1`
236
- ask which tools you have: Codex only, Claude only, or both. When both are selected,
237
- choose the coder (Codex recommended, Claude reviews; or the reverse).
259
+ offer an optional user-default setup. First-time setup defaults to skipping; an existing
260
+ declaration is displayed and “Keep it? [Y/n]” defaults to keeping it.
261
+ Only opting in asks which tools you have: Codex only, Claude only, or both, and which
262
+ tool codes when both are selected. Preview the target, fields and impact, then explicitly
263
+ confirm `[y/N]` to save. Enter at this final step does not save.
238
264
  The shared prompt writes only `~/.cm-workflow/runtimes.yml` using a temporary file
239
265
  and atomic rename. It never changes settings.json or CLAUDE.md.
240
- An existing declaration is displayed and “Keep it? [Y/n]” (or “保留?[Y/n]”) defaults to keeping it.
266
+ An invalid existing declaration is reported and preserved; setup does not overwrite it.
267
+ Configuration changes after the preview invalidate that confirmation and require a fresh preview.
268
+ The installer checks user defaults only, not effective configuration in individual projects.
241
269
  `--yes` (Bash), `-Yes` (PowerShell, also implies the existing `-Force`), `-Force`,
242
270
  or non-TTY input/output skips this prompt without creating or changing the file.
243
271
 
@@ -255,14 +283,20 @@ fields still take precedence and conflicts fail validation. `cm-init` inherits t
255
283
  user default without asking again and reports `来源: 用户级默认`.
256
284
 
257
285
  Run `$cm-runtime` in Codex, `/cm-runtime` in Claude Code, or `/cm:runtime` on macOS/Linux
258
- without arguments for three questions in your current conversation language:
286
+ without arguments to display current effective configuration, source and model aliases. Choose:
287
+ `[1] Keep current configuration (recommended, default)`, `[2] Change runtime preset`, or
288
+ `[3] Advanced model configuration` (documentation and validation only). Keeping missing
289
+ configuration does not create any file. Only option 2 starts the wizard:
259
290
  `[1] Current project / [2] User default` → `[1] Codex only / [2] Claude only / [3] Both`
260
291
  (with `[1] Codex writes, Claude reviews (recommended) / [2] Claude writes, Codex reviews`
261
- when both are selected) → preview the preset/current value and confirm `[Y/n]`.
292
+ when both are selected) → preview the fields and effective impact and confirm `[y/N]`.
262
293
  In a terminal, `node <workflow-root>/scripts/cm-runtime.mjs [--project PATH]` opens the same wizard.
263
294
  Scope defaults to 1 with an existing project config, otherwise 2. Choosing 1 without a config
264
295
  announces creation from the template. The tool question has no default. Ctrl+C, three consecutive
265
- empty answers to that required question, or declining confirmation cancels without writing.
296
+ empty answers to that required question, EOF, declining confirmation or Enter at confirmation
297
+ cancels without writing. Invalid configuration is reported and preserved, not automatically repaired.
298
+ Project overrides are shown explicitly. Model aliases are retained across adapter changes;
299
+ validation does not prove provider compatibility, model access or quota.
266
300
  Without a TTY, no command prints usage and exits 2.
267
301
 
268
302
  Installer prompts, terminal wizard, diagnostics and the user-file comment use Chinese or English:
@@ -273,6 +307,8 @@ For scripting, use explicit commands:
273
307
 
274
308
  ```text
275
309
  cm-runtime show [--project PATH]
310
+ cm-runtime preview codex-codes [--project PATH] [--json]
311
+ cm-runtime set codex-codes [--project PATH] --expect-preview <preview_sha256>
276
312
  cm-runtime set codex-codes [--project PATH]
277
313
  cm-runtime set --user claude-codes
278
314
  cm-runtime unset --user
@@ -282,6 +318,11 @@ Presets: `codex-only`, `claude-only`, `codex-codes`, `claude-codes`.
282
318
  For the literal terminal entry, use `node <workflow-root>/scripts/cm-runtime.mjs`.
283
319
  A project set preserves every unrelated byte in an existing config; a new config
284
320
  uses the distributed template. Unsetting the user file preserves project declarations.
321
+ It is not a reset of all configuration. The conversational wizard uses readonly `preview`
322
+ and `set --expect-preview` to bind approval to the displayed inputs. Preserve the same
323
+ project working directory, language, runtime and user configuration directory across both calls.
324
+ For user defaults, run `preview <preset> --user` in the code project directory to show its
325
+ effective overrides. Stale previews must be regenerated and explicitly confirmed again.
285
326
  Changes affect new runs only; existing runs retain their bound configuration.
286
327
  `show` is read-only and missing CLIs only produce WARN (presence does not prove quota).
287
328
  Successful `set` records a private `decision/route` through the existing log writer;