@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cm-workflow",
3
- "version": "0.16.4",
3
+ "version": "0.16.6",
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/AGENTS.md CHANGED
@@ -60,6 +60,11 @@ Read the relevant files under `.claude/rules/` when modifying shell scripts, doc
60
60
 
61
61
  ## 项目教训
62
62
 
63
+ - **显示投影须在资格判断后惰性读取真实状态**:状态查询与规格准入摘要不能为显示层额外访问 runner;可投影响应只在既有异常隔离内读取一次最新状态,再核对 state/run/task/attempt。用准入摘要的私有来源标记区分实际等待转换,不能笼统跳过所有 awaiting;读取失败保留原业务结果,取消 epoch 与锁内归属检查仍须生效。来源:基线状态读取回归修复;证据:`scripts/cm-ai-progress.test.mjs` 的只读 status、准入、真实等待、异常读取、迟到与取消用例。[已结构化]
64
+
65
+ - **状态归属核对与替换必须在同一个锁区间**:多运行共享状态卡时,真实阶段开始认领,完成只更新仍属同一 feature/task/run/attempt 的状态,并用阶段 token 拒绝迟到回调;核对后另行原子改名仍有竞态。复用既有跨进程锁覆盖核对和替换,QA/收尾也使用归属规则,历史回放不算新阶段,状态只作显示。来源:当前任务进度修复;证据:`scripts/cm-ai-progress.test.mjs` 的两进程、旧 QA/N8 和迟到响应用例,`scripts/cm-ai-qa-config-revision.test.mjs` 的真实 resume/status 回放用例。[已结构化]
66
+
67
+ - **交互确认要绑定预览时的配置快照**:配置向导复用同一解析器生成候选,保存前核对目标、继承来源和新建模板;只在落盘时读取旧值无法防止等待确认期间的改动被覆盖。会话、终端和安装器共用该校验,摘要不替代用户授权。来源:运行时配置默认保留;证据:`scripts/cm-runtime.test.mjs` 的 CLI、TTY、安装器预览漂移与严格配置合同用例。[已结构化]
63
68
  - **扫描例外必须同时绑定文件与具体命中**:为已审查的本地测试或诊断地址设置例外时,只放行该文件中的精确回环 authority,不跳过整类私有地址检测;同文件中的内网地址、凭证和个人路径仍须失败,并用独立 CLI 夹具验证。来源:PR 22 CI 阻塞修复;证据:`scripts/scan-public-safety.py`、`scripts/test-scan-public-safety.py` 的 RFC1918、伪装 authority 与混合命中用例。[已结构化]
64
69
  - **进程退出信号不等于用户取消**:判断 provider 中断时检查显式取消与超时证据;仅收到 SIGTERM 不能记作用户取消,因为错误清理也会发送它。来源:C1a;证据:`experiments/js-orchestration/worker-codex.mjs`、`experiments/js-orchestration/provider-review-observation.test.mjs` 的 signal/timeout 用例。[已结构化]
65
70
  - **观测到 approved 不等于允许完成**:review 观察器的结构化结果不能充当可信调用登记或完成凭证;保留独立审查与任务门禁,不因文本通过就勾选任务。来源:C1a;证据:`experiments/js-orchestration/provider-review-observation.test.mjs` 的 runner 拒绝观察结果用例。[已结构化]
@@ -80,3 +85,20 @@ Read the relevant files under `.claude/rules/` when modifying shell scripts, doc
80
85
  - **归档恢复须区分旧摘要与新同名证据**:新运行把旧 handoff/回执按摘要归档后会复用原文件名;再次恢复时,若归档中已存在记录的旧摘要,应保留原名下的新文件,只补齐尚未归档的旧文件。来源:cm-ai 已审证据重跑;证据:`runtime/js/cm-ai/reviewed-evidence-supersede.mjs`、`scripts/cm-ai-supersede.test.mjs` 的重复恢复与中途归档用例。[已结构化]
81
86
  - **终态快照还要核对旧 writer 是否仍打开**:旧 journal 显示 blocked 或 unknown 时,宿主进程仍可能持有 writer;跨运行归档前只读检查旧 writer 的进程占用,不能仅凭终态快照归档。来源:cm-ai 已审证据重跑;证据:`runtime/js/cm-ai/reviewed-evidence-supersede.mjs`、`scripts/cm-ai-supersede.test.mjs` 的终态但 writer 未关闭用例。[已结构化]
82
87
  - **回归测试须落在 CI 收集的路径**:新增自动保护前核对 `.github/workflows/ci.yml` 的测试文件枚举和排除名单;只把测试放在 `experiments/js-orchestration/` 不会进入当前 CI。来源:B 类内部协议测试第一轮审查;证据:`.github/workflows/ci.yml` 的 `ls scripts/*.test.mjs`、本轮迁入 `scripts/` 的测试及其变异验证。[已结构化]
88
+ - **可判定的本地门禁不得落入通用 unknown**:普通开发调用成功且检查已通过后,审查材料或存档预算超限属于可重做的开发交付阻断;在通用异常出口前归一为 `develop_package_too_large`,并只对带审查快照诊断、满足同一证据形状的旧 `unknown/limit_exceeded` 做回放投影。instruction bootstrap 不得借该通用迁移取得重派开发权限。来源:bootstrap-T-008 超大交付恢复;证据:`runtime/js/cm-ai/task-runner.mjs`、`runtime/js/cm-ai/durable-runner-state.mjs`、`scripts/cm-ai-develop-driver-gaps.test.mjs`、`scripts/cm-bootstrap-review-recovery.test.mjs`。[已结构化]
89
+ - **规则审查要区分本轮写入与原始审查基线**:bootstrap 目标内容未变时须在审查包 `unchangedScope` 中按最终 SHA 核对;第 2 轮的写入前 SHA 可能来自第 1 轮,不能拿它代替任务原始基线。已写入规则、检查和 handoff 后若审查包构建失败,只能在原 run 严格重建并追加可回放恢复记录,不重派开发。来源:1.bootstrap/T-010 规则刷新审查包修复;证据:`scripts/cm-ai-bootstrap-merge.test.mjs`、`scripts/cm-bootstrap-review-recovery.test.mjs`。[已结构化]
90
+ - **后续规则任务须绑定已完成任务与提交快照**:同一 bootstrap feature 的规则刷新只有在前序规则任务完成、固定目标与 HEAD 和暂存区一致时才以已提交内容为基准;保留 `AGENTS.md` 教训段,派发前的确定性冲突记 blocked,生成后的漂移仍保留 unknown。来源:1.bootstrap/T-010 阻断修复;证据:`scripts/cm-ai-bootstrap-merge.test.mjs`、`scripts/cm-ai-bootstrap.test.mjs` 的提交基准、漂移与回放用例。[已结构化]
91
+ - **取消响应须同时核对持久状态与入口在途工作**:空闲 unknown 若未写入终态,应报告原状态;cancel 若中止了在途 handle 或等待中的宿主操作,即使 runner 已是 fixture_completed,outcome 仍为 cancelled,state 仍取真实 runner 状态。放弃未结审查先写绑定原调用的 journal 记录,再投影可回放状态。来源:cm-ai 无结果 Review 放弃出口及首轮审查修复;证据:`runtime/js/cm-ai/cm-ai-conversation-entry.mjs`、`scripts/cm-ai-conversation-entry-ops.test.mjs`、`experiments/js-orchestration/cm-ai-conversation-entry.test.mjs` 的双向 cancel 用例与 `scripts/cm-ai-review-timeout.test.mjs` 的回放用例。[已结构化]
92
+ - **人工答案须绑定请求轮次并预检跨轮路径**:宿主一次 `advance` 可从待审继续到下一轮开发;驾驶员按请求 identity 的 attempt 选答案,并在审查授权可能跨轮时于启动前检查下一轮文件,不复用首轮编辑。来源:2026-09-28 cm-ai 第二轮重复开发事故;证据:`scripts/cm-ai-drive.test.mjs` 的真实宿主 review→develop 路径及 fallback/reachability 变异检查,`scripts/cm-ai-batch-drive.test.mjs`、`scripts/cm-fix-drive.test.mjs` 的预检夹具。[已结构化]
93
+ - **bootstrap 规范写入要带入先前 Learning**:骨架任务先写了 AGENTS.md 后,规则生成须核对原文件快照,把既有 `## 项目教训` 原字节合入最终草稿,并将最终内容绑定同次 Review;其他既有约束若不能原样保留则阻断。来源:A1+C6 编号 bootstrap 修复;证据:`runtime/js/cm-ai/host-bootstrap.mjs`、`scripts/cm-ai-bootstrap-flow.test.mjs`、`scripts/cm-ai-bootstrap-merge.test.mjs`。[已结构化]
94
+ - **完成前重跑检查要分离审查证据与检查结果**:保留原审查包摘要和回执;完成时严格比较代码、范围、handoff 与检查身份,只忽略可变的 evidence 文字。检查结果漂移仅在原 run 允许新 effect id 重试,且宿主路由与 journal 回放都须接受;其他漂移仍终止。来源:A4 完成前复核修复;证据:`experiments/js-orchestration/task-runner.test.mjs`、`experiments/js-orchestration/review-package.test.mjs`、`scripts/cm-ai-conversation-entry-ops.test.mjs`。[已结构化]
95
+ - **检查阻断要在审查前停住并换新 effect id**:开发检查失败或不可用时保留原轮次与失败证据,修复后沿原 run 重做;开发检查用独立的 `develop_checks_not_passed`,不能复用旧完成门禁的终态 `checks_not_passed`。检查产物越界等本地阻断必须计入新 develop effect id,否则缓存会永久返回旧结果。完成复查失败保持可重试并受 effect 上限约束。来源:D1 预发布审计及完成门禁审查修复;证据:`experiments/js-orchestration/task-runner.test.mjs`、`scripts/cm-ai-runner-error-code-regression.test.mjs` 的回放与变异用例。[已结构化]
96
+ - **中断的 effect 要先在原运行审计退出**:V3 journal 留下 develop/complete intent 而无 checkpoint 时,supersede 不能把 unknown 当终态;仅在确认旧宿主及其子进程已退出、没有 provider-mode 开发或 task-commit-intent 时,用绑定原 intent 的 `effect-abandoned` 转为 cancelled。提交意图可能已改写 `tasks.md`,必须核对后走原提交恢复路径。来源:预发布审计 finding #1;证据:`runtime/js/cm-ai/durable-runner-state.mjs`、`scripts/cm-ai-supersede.test.mjs` 的中断、拒绝及回放绑定用例。[已结构化]
97
+ - **忽略决定要冻结基线并在两侧取并集**:代码根跳过 IDE/构建杂项和 Git ignored 路径时,任务 scope、AGENTS.md 与规格必须继续检查;新基线有界记录忽略路径,审查及恢复把基线与当前决定同时应用于比较两侧,不把可编辑的规则文件或无关 Git 配置当成漂移。超限明确退回固定列表,旧 journal 依原格式回放。审查调用已观察到 verdict 后即使树漂移,也要留下可回放的回执与路径阻断。来源:预发布审计 Task group S 及独立审查补正;证据:`scripts/cm-review-inventory.test.mjs`、`experiments/js-orchestration/review-invocation-v3.test.mjs`、`experiments/js-orchestration/task-runner.test.mjs` 的忽略并集、真实 Git 审查与旧日志恢复用例。[已结构化]
98
+ - **审查期间的规格漂移先于回执登记**:审查返回后若已批准规格改变,先阻断为 `spec_drift`,不得把它降为可清理后复用 verdict 的 `review_package_changed`;只有规格未变时才保留代码根漂移的回执恢复路径。来源:PR #164 阻断审查修复;证据:`scripts/cm-ai-review-drift-precedence.test.mjs` 的规格、代码根及同时漂移用例与定向变异。[已结构化]
99
+
100
+ - **有效拒绝后的恢复必须绑定旧结论并另存新轮证据**:已完成且有效的根因审查不能当 unknown 放弃;原运行重新诊断时追加绑定历史、旧包、旧 observation 与原因的记录,保留复现和 r1 字节,强制 fresh r2 并限制第二次拒绝,live/replay 共用同一边界;异步准备返回后重查原源包与 r2 占位,再登记唯一续次,驾驶员续行只按应用登记事件和重新诊断记录取最新 Learning,不能把同前缀的写回结果当应用而清空已有值。来源:原运行重新诊断候选及 r1 独立审查补正;证据:`scripts/cm-fix-rediagnosis.test.mjs` 的原记录保留、恢复、源漂移前拒绝、旧 thread 拒绝与第二次拒绝上限用例。该教训随本轮改动待独立审查。
101
+
102
+ - **失败终态计数与执行结论分别处理**:只从原生 CLI 的原会话终态读取官方 usage,失败仍失败;通用 error notice 不覆盖后续 turn.failed 的计数。按 provider 原生字段映射 cache-write 和 reasoning,reasoning 只作 output 子集,缺失明确 unavailable;记录失败不能重派或放行。来源:可选执行优化独立审查的失败终态与原生字段修复;证据:`scripts/cm-efficiency-usage.test.mjs` 的四 worker 成功/失败/缺失、双失败方言与字段冲突用例,`scripts/test-cm-native-usage.py` 的子集与去重用例。该教训随本轮改动待独立审查。
103
+
104
+ - **基线复现不能代替失败根因**:区分测试正文与清理钩子失败;相同基线失败只说明不是新增回归,丢失原 cause 后仍保留未知。预检与夹具失败只记录有限系统字段,不打印原 message/stderr,不把能力受限或超时改成通过;夹具总截止与已有驱动预算对齐,产品预算和业务断言保持原值。来源:执行优化回归的启动错误丢失、清理失败和外层夹具超时收尾;证据:`scripts/cm-efficiency-diagnostics.test.mjs` 的无真实枚举/监听错误注入、`scripts/cm-ai-batch-drive.test.mjs` 的实际 live 用例,以及保存的原始失败与基线对照。该教训随本轮改动待独立审查。
package/CHANGELOG.md CHANGED
@@ -7,6 +7,63 @@
7
7
 
8
8
  (暂无)
9
9
 
10
+ ## 0.16.6 — 2026-10-03
11
+
12
+ - `cm-runtime` 无参数入口先展示当前有效配置、来源和模型别名,默认保留;只有明确选择修改才进入四预设向导。高级模型入口提供合同说明和校验方法,建议保留默认配置。
13
+ - 终端、会话向导和安装后的运行时配置统一在预览后明确确认,最终提示为 `[y/N]`,回车、取消、EOF 或 Ctrl+C 不保存;首次安装可跳过配置,已有用户默认优先保留,非法配置报告错误并保留原文件。
14
+ - 预览显示目标文件、范围、字段前后值及当前项目的实际生效结果;项目声明覆盖用户默认时如实说明。新增只读 `preview` 与 `set --expect-preview`,保存前核对相关配置快照,等待确认期间发生变化则要求重新预览确认。
15
+ - 预设切换继续保留已有模型别名、其他配置和正在运行的任务;明确提示模型别名可能不兼容新的适配器,配置校验不证明模型可调用或配额可用。原有显式 `show/set/unset` 命令保持兼容,`unset --user` 只删除用户默认。
16
+
17
+ ## 0.16.5 — 2026-09-29
18
+
19
+ - cm-ai 审查轮次用完(`review_limit`/`review_blocked`)后用 supersede 新建的运行,第 1 轮开发与独立审查会看到上个运行最后一次审查的 findings(标明只是参考、不是结论,不跳过审查、不改轮次),开发不再重犯同样问题;该内容写入新运行记录,回放时不可替换,旧记录照常回放。
20
+ - cm-ai 当前会话驱动 bootstrap 规范任务时,会话返回未通过的 `init_verify`(第 1 轮或第 2 轮)不再停在无法恢复的 `unknown/execution_error`,改为同一运行、同一轮可重试的 `blocked/bootstrap_verification_failed`(原因列出未通过的核验组),规范未写入、已记录的规范证据保留,修正后在原运行 `advance` 重新生成与核验;旧运行存档照原样重放。
21
+ - cm-prd 审查门禁的每个拒绝带稳定错误码,宿主 stderr 诊断写明回执与改动文件(只含校验过的规格相对路径),不再只报 `host_request_failed` / `detail: unavailable`;内容为 `null` 的回执与非法 UTF-8 也带码,CLI 报错文字不变。
22
+ - cm-ai 单任务驾驶员可驾驶 bootstrap 规范任务(通常 T-002)及第 2 轮修订:启动前校验 `init-generate.json`/`init-verify.json`(第 2 轮只读 `*-a2.json`,须在读取首轮 findings 后编写),`init_verify` 的命令组只由驾驶员在宿主接受启动后、发送操作前实跑会话列出的草稿命令得出(先用宿主自己的读取器与 admission 函数核对写入授权、配置、任务选择与 nextTask,受保护模式在 specs 沙箱内运行,跑后重核规范目标与绑定文件),未通过不发送操作,其余四组核验与 Learning 来自会话答案;规范写入后检查未通过可在原运行修好后同轮重试,宿主与驾驶员只接受本运行存档记录的写入;含业务文件、多代码根或 `--protected-config` 的规范任务及批次驾驶员仍在启动前拒绝。
23
+ - cm-ai N6 的 `qa_assess` 应答超时不再落盘为永久阻塞决定,改为可重试的 `rejected/qa_decision_timeout`,恢复原运行后再次 `advance` 重新询问;旧版本已记录的 `阻塞:host_request_timeout` 决定默认照旧返回 `qa_blocked`(附原因),显式 `--rerun-blocked-qa` 只重新询问一次并以 `previous_decision_id` 追加替代决定,历史不改写。修正 js-host.md 中 `qa.timeoutMs` 上限为 3600000。
24
+ - cm-ai `--rerun-blocked-qa` 可在同一代码上重跑会话如实回答的 BLOCKED(如模拟器不可用)与没有退出码的 QA 命令结果(超时、被杀、启动或输出失败)及受其牵连的 logic 用例;非零退出仍是产品 FAIL,只有同时加 `--qa-environment-failure "原因"` 显式声明环境故障才替代,理由与失败用例写入 superseded 记录。每次重跑都占用同一个最多三轮的 QA 预算。
25
+ - cm-ai N6 的 `qa_assess` 应答超时不再落盘为永久阻塞决定,改为可重试的 `rejected/qa_decision_timeout`,恢复原运行后再次 `advance` 重新询问;旧版本已记录的 `阻塞:host_request_timeout` 决定默认照旧返回 `qa_blocked`(附原因),显式 `--rerun-blocked-qa` 只重新询问一次并以 `previous_decision_id` 追加替代决定,历史不改写;替代决定写入后、首轮 QA 开跑前中断时,同一命令可直接续跑。修正 js-host.md 中 `qa.timeoutMs` 上限为 3600000。
26
+ - cm-ai `--rerun-blocked-qa` 可在同一代码上重跑会话如实回答的 BLOCKED(如模拟器不可用)与没有退出码的 QA 命令结果(超时、被杀、启动或输出失败)及只因其阻断的 logic 用例(`[需确认]` 以 test-cases.json 为准一律除外,报告标记只作交叉核对);非零退出仍是产品 FAIL,只有同时加 `--qa-environment-failure "原因"` 显式声明环境故障才替代,理由与失败用例写入 superseded 记录。每次重跑都占用同一个最多三轮的 QA 预算。
27
+ - cm-ai `--revise-qa-config` 支持首轮 QA 前修订(开发中、待审、N5 完成但 QA 未开跑),记为不消耗轮次的 round-0 修订并在运行日志留痕,首轮仍为 qaRound 1;QA 开跑后的修订规则不变。
28
+ - cm-ai 独立审查 CLI 未登录、限流、服务端过载、模型不存在、输出无法识别的事件或没有结论就退出(未调用工具、未给结论、进程已退出)时,不再停在 unknown,而是 `pending_review/review_provider_failed`,reason 写明失败类别和下一步(先登录或等额度),同一 attempt 与传输超时、abandon 共用一次重派;超出后为 `blocked/review_provider_failed`。已有最终消息但被超时截断的审查改为提示 `abandon_review`,操作员留痕放弃后同样只重派一次;旧 journal 照原样回放,旧 unknown 不自动改类。
29
+ - cm-ai 审查提示写明 verdict 规则(P0–P3 含义、approved 不能带 P0–P2、changes_requested 至少一条 P0–P2、只有代码无法在范围内修好时才用 blocked、规格文件不是 finding 路径);审查答复违反这些规则时记为 `pending_review/review_verdict_invalid` 并保留具体代码(如 `contradictory_verdict`),同一预算内重派一次;`blocked` 仍是终态但 reason 写明审查给出的原因。
30
+ - cm-ai 调大 `--review-config` 的 `timeoutMs`(超过 30 分钟)不再在 30 分钟被运行器截断并耗掉唯一重试:运行器的审查计时改为审查预算加 1 分钟余量,且不写入 journal,恢复时可继续调大。
31
+ - cm-ai 可重试的开发阻断(如检查产物越界、开发检查未通过)反复出现、剩余调用名额已不够再交付一次并送审,或剩余 effect 名额已不够再交付并送审时,在派发开发前停在终态 `blocked/develop_retry_limit`(journal 记 `develop-retry-limit`,不写 intent、不调用开发者),reason 写明上次阻断原因并提示 supersede 新建运行,不再让第 7 次调用跑完后检查点被拒、运行变成 unknown,也不再停在 complete 被 `limit_exceeded` 拒绝、永远无法完成的 approved;显式放弃的审查调用也不再占调用名额。
32
+ - cm-ai 完成(complete)不再占六个 effect 名额:审查已批准的运行总能进入完成,包括旧版本已用满六个 develop/review 名额后停在 approved、complete 被 `limit_exceeded` 拒绝的运行。完成前复查因检查结果或新文件变化被拦下(`completion_checks_changed`/`completion_package_changed`)时改为单独最多重试 3 次;第 4 次仍被拦下即写入 `completion-retry-limit` 并停在终态 `blocked/completion_retry_limit`(`pendingAction: none`),reason 提示先修好检查环境再 supersede 新建运行,不再出现已批准却因 `limit_exceeded` 永远完成不了的任务。
33
+ - cm-ai 第 2 轮交付与第 1 轮被要求修改的代码逐字节相同时,停在可重试的 `blocked/develop_unchanged_after_review`,不送审、不耗第 2 轮审查;同时修正第 2 轮开发检查被门禁拦下时 journal 回放失败、运行变成 unknown 的问题。
34
+ - cm-ai 带 QA 的运行不再因项目 `.cm-workflow.yml`、用户 `~/.cm-workflow/runtimes.yml` 或插件内置默认值变化而无法恢复:新运行的指纹只绑定宿主给出的 QA 输入,执行计划由每轮 QA 在 N6 冻结并记入 `test_run`;`--revise-qa-config` 也不再用当前配置重建旧计划。此前创建的运行照原指纹打开,配置已变时仍 `fingerprint_mismatch`,并附原因提示恢复创建时的配置。
35
+ - cm-ai 收尾 `finish`/`run_finalize` 在任一已批准 feature 的最新 QA 未通过(FAIL、BLOCKED、已触发未执行或结果未知),或任务已全部完成的 feature 没有 feature 完成时的 QA PASS(无 QA 记录或最新为 skipped)时返回 `project_qa_not_passed`,列出 feature、任务和 runId,不做文档核验、不写 run_done;准入选下一任务时在 `warnings` 中提示。
36
+ - cm-ai 已完成运行的 QA 恢复、QA 修复、配置修订与收尾不再被其他任务后续的已审交付锁住:同一代码根、其他任务已完成并提交运行的审查包(含其已登记 QA 修复、AGENTS.md 教训行和对同一文件的修改),凡审查晚于本运行批准审查的,全部按审查时间顺序逐个严格接续(审查前状态必须等于当时的组合),本运行的 QA 修复按其最终审查时间插在同一序列中,不挑选、不搜索;最终组合须与当前内容和文件权限完全一致,任务范围外的项目根 CM 配置可以修改。接受修复时尚未记录、审查早于该修复的交付排在它之前,以只含运行 ID 与包摘要的 version 2 关联记录存进 journal,此后不变,接受之后才提交的交付排在修复之后现场接续;每条都须能从所列运行的真实交付包推出,存档在时回放即核实、不在时后续操作失败关闭,记录超出存储限制时以 `fix_record_too_large` 拒绝而不写入(一条记录最多 2048 个后续交付;未覆盖存储目录 32 MiB 物理上限与崩溃残留临时文件,见文档),旧记录照原样回放;对不上时(含已审交付之后的手工回退)为 `correction_review_required`,并在 `reason` 列出路径。
37
+ - cm-fix 原因审查与第二轮最终审查登记后没有结论(宿主被杀、超时、断连或取消)时,可用 `abandon_review`(专用 `--allow-abandon-review`,父宿主 `--allow-qa-fix-abandon-review`)各留痕放弃一次,再以新审查线程重审;审查等待改用审查配置的 `timeoutMs`(默认 15 分钟),不再沿用复现命令超时,原因审查超时会记下结果。替代旧审查证据时,QA FAIL 不再被误报为「已完成或 QA 已通过」,并提示改走 QA 修复。
38
+ - cm-ai 批次驾驶员对尚未开跑的后续任务也按答案本身预检审查材料合计:答案写入的 scope 文件合计已超过 2 MiB 时在启动第一个任务前退出 2,不再等到开跑后才被审查包拒绝。
39
+ - cm-ai 单任务、批次与 cm-fix 宿主的工具应答上限随 `--input-limit` 一起放大(cm-fix 宿主新增该参数,cm-fix 驾驶员用 PLAN `inputLimit`),超长输入行报 `request_too_large` 并说明上限;宿主拒收应答时驾驶员立即结束会话并退出 1,受保护模式在启动前估算应答大小并提示应加的值,不再无限等待。
40
+ - cm-ai 开发答案 `develop.json.edits` 支持 `{mode:"0755"|"0644"}`、`{file,mode}` 和 `{delete:true}`,改名即删旧写新;启动前校验(同时是 requirements 的路径不能删除,当前会话仍删除时为可重试的 `blocked/develop_requirement_missing`),审查包原有的权限位与删除记录在审查提示中说明,事后改权限按包漂移阻断。
41
+ - cm-ai 驾驶员在启动前拒绝单文件超过 1 MiB、审查材料(与审查包快照同一选取,含树中全部 AGENTS.md)超过 2 MiB 或 256 个文件、与基线完全相同的开发答案并写明路径和上限;第 2 轮的开发阶段阻断(如 `develop_checks_not_passed`)此前回放即失败为 `store_failure`,现可在原轮次重试;审查包装不进运行存档单条 1 MiB 记录(按有界审查结果推出的预留计,小任务约 550 KiB 以上的单文件交付,或过大的任务基线)时驾驶员以宿主同一套构建代码(含 handoff 与 AGENTS.md 回写)启动前拒绝,宿主在建存档前拒绝过大基线,当前会话交付则为可重试的 `blocked/develop_package_too_large`;审查结果超过 12 KiB 时按固定规则截断并省略末尾 finding(保留 verdict 与至少一条阻断 finding);列出路径的阻断原因统一有界(「等 N 个」),长路径不再让检查点超出回放上限;当前会话交付空改动改为可重试的 `blocked/develop_empty_changes`,旧 `unknown/empty_changes` 历史按原样回放。
42
+ - cm-ai 单任务驾驶员恢复时按存档里的当前轮次发送 identity,第 2 轮的 decision、complete、qa 等不再报 `identity_mismatch`。
43
+ - cm-ai 批次驾驶员带首轮审查授权但缺 `develop-a2.json` 时不再启动前拒绝:审查要求修改时任务停在 `changes_requested/revision_answer_required`,读完 findings 写好第 2 轮答案再继续。
44
+ - cm-ai 受保护当前会话模式在启动前拒绝非 UTF-8 的开发内容(不再被替换字符悄悄改坏),新文件以 0644 创建。
45
+ - cm-ai 新建运行前检查 `runId` 须为 8–128 个字符(与运行日志同一规则),不再在开发 intent 写入后才失败;已有运行恢复不受影响。
46
+ - cm-ai 任务进行中规格经正规流程改动并重新批准后,状态报 `spec_drift`、列出变化文件与真实出口,不再提示会被拒绝的动作;只动了其他任务的条目、依赖或用例(requirements.md、design.md 整份未变,本任务条目含续行及任何点名本任务的行与用例未变,由新记录的 `taskScopeDigest` 证明)时可在原运行用 `--rebind-spec-material --spec-rebind-reason` 显式换绑(journal 记 `specification-rebound`,只换批准哈希;旧版本创建的运行不可换绑),已有开发与审查结论保留;内容有变则拒绝并点名,可还原规格继续或 supersede 重做。
47
+ - cm-ai 启动参数错误不再只报裸错误码:`fingerprint_mismatch` 点名与创建时不同的输入(runtime、审查配置、会话等),`invalid_arguments` 写明参数;单任务 create 与新批次都必须带 `--review-config`,避免运行到待审后才发现无法补加;批次成员不提示换绑,改为说明可用出口。
48
+ - cm-ai `tasks.md` 任务行统一为一套语法(无冒号、全角冒号、缩进嵌套均可,围栏内示例不算),准入、cm-prd 自检、N5 勾选与审批 manifest 归一化一致,勾选后不再误报整个项目规格漂移;语法随批准绑定(新批准记 `taskGrammar: 2`),旧批准继续按原解析器读取,重新批准时若有 feature 在新语法下无效、或从旧语法切换会改变任务集合,则 `task_grammar_conflict` 拒绝并点名行号,旧版批准的 manifest 仍原样匹配。
49
+ - cm-ai `--task` 选择依赖已 DROPPED 任务的下一任务时与 `nextTask` 同样视为依赖已满足;`task_selection_mismatch` 附带原因。
50
+ - cm-ai 普通新建运行会拒绝悄悄接收同任务旧运行留下的未审改动(同 supersede 的漂移检查与 `--accept-superseded-code-drift` 记录);第 1 轮就结束、没有可归档证据的旧运行也可以 supersede。
51
+
52
+ - cm-ai 单任务驾驶员对 bootstrap 规范任务在启动前拒绝缺少实时 `init_verify` runner,并将 unknown/reconcile 宿主结果作为失败退出;补充当前会话宿主路径与旧运行恢复说明。
53
+ - cm-ai 开发检查失败或不可用时以独立的 `develop_checks_not_passed` 在审查前阻断并可在原运行重试;旧完成门禁的 `checks_not_passed` 保持终态。检查产物越界重试改用新 effect id,完成复查失败保留原审查重试,单任务和批次驾驶员支持每项及默认检查超时(默认 15 分钟)。
54
+ - cm-ai 代码根快照跳过 macOS/iOS IDE 与构建杂项及 Git 忽略路径,保留任务范围、AGENTS.md 与规格检查;基线保存有界忽略决定并在后续比较两侧取并集,允许任务修改 `.gitignore`、运行中 `git init` 及无关 Git 配置变化。漂移诊断列出路径,审查中漂移保存 verdict 并可在原运行清理后继续,完成复核漂移可重试。
55
+ - cm-ai 单任务 V3 新增 `abandon_effect`:当前会话 develop/complete 在 intent 后中断且无 task commit 时,操作员确认旧 host 与子进程退出后可在原 run 留痕退出为 `cancelled/effect_abandoned`;新运行仍执行原有审查证据及代码漂移门禁。
56
+ - cm-ai 单任务与批次驾驶员按请求轮次读取开发答案;第 2 轮只接受 `develop-a2.json`,审查授权可能跨轮时提前检查,避免把首轮编辑重复用于修订。cm-fix 驾驶员的修订测试/修复答案同样改为 `*-a2.json`。
57
+ - cm-task-gate Python 适配器按 UTF-8 读取 Node 输出,避免 Windows 系统默认编码使中文诊断解码失败。
58
+ - cm-ai 规格审批接受六种明确开始语及尾部标点,泛化授权仍拒绝;cm-prd 草稿与审查校验为时间、标题、依赖、大小和测试理由提供字段级诊断,原门禁不变。
59
+ - cm-ai 新建运行替代旧审查证据前,只核对尚未被其他旧运行替代的直接前驱运行的 V2 逐文件代码基线;漂移默认以 `supersede_code_drift` 拒绝,操作员也可显式加 `--accept-superseded-code-drift` 保留并记录前驱 runId、路径和当前摘要。更早运行仍照常归档;检查发生在新 journal 与新基线创建前。
60
+ - 补充 iOS 系统服务检查的分根与沙箱边界、当前会话驱动脚本和 Claude Code 权限建议,并在 cm-ai 宿主帮助中指向驱动。
61
+ - cm-ai bootstrap支持已批准的单个编号`*.bootstrap`(含`1.bootstrap`),拒绝多个候选,并在规范写入前保留AGENTS.md既有Learning段及其他约束。
62
+ - cm-ai 已批准任务在完成前重跑检查时,仅比较检查身份与结果(id、command、outcome、exitCode),允许 evidence 摘要文字变化;检查结果变化保留原审查并以 `blocked/completion_checks_changed` 在同一 run 重试完成,代码、范围、handoff 或检查身份漂移仍终态阻断。
63
+ - cm-ai 改进检查产物越界诊断和同 run 恢复、独立审查 15 分钟默认超时、Claude 模型拒绝提示及交互 QA 载体说明。
64
+ - cm-ai 单任务可显式选择同 feature 的依赖就绪任务;新运行提前拒绝已审 handoff 冲突,同会话恢复可省略 `originalHostContext`,换会话继续校验创建会话与配置指纹。
65
+ - cm-ai 单任务 V3 新增 `abandon_review`:操作员确认中断的独立审查进程已退出后,在原 run 上留痕放弃无结果调用,恢复到可重派审查;修正 unknown 上 `cancel` 虚报已取消。
66
+
10
67
  ## 0.16.4 — 2026-09-27
11
68
 
12
69
  - Claude review 与 developer 的 CLI 流解析器接受 init 前后的 `dev_intent` 通知,校验会话并计入 32 条通知上限。
package/README.md CHANGED
@@ -17,6 +17,24 @@
17
17
 
18
18
  ## 最近更新
19
19
 
20
+ **0.16.6**
21
+
22
+ - **运行时配置默认保留**:打开 `cm-runtime` 先看当前配置和来源,主动选择修改才进入预设向导;高级模型入口只提供说明和校验方法。
23
+ - **外部模型按 provider 配置**:单任务、批次及修复可显式启用 `cm-model-setup.mjs` 的模型及可选强度;宿主保持当前模型,run 冻结参数,未知调用停止重派。见[配置与恢复边界](docs/external-models.md)。
24
+ - **确认前看清影响**:预览目标、字段变化和项目覆盖关系,最终 `[y/N]` 回车不保存;确认期间配置改变会要求重新预览。安装后的配置可跳过,已有用户默认优先保留。
25
+ - **保留模型别名并提示兼容性**:切换预设不改已有模型或正在运行的任务;配置校验不代表新适配器一定支持该模型。
26
+
27
+ **0.16.5**
28
+
29
+ 这一版修的都是拿 cm-ai 跑真实项目(AI潮)时撞上的阻断:跑到一半卡死、报错看不懂、只能手改文件才能继续的情况,现在大多有了明确的出口。
30
+
31
+ - **中断和超时不再卡死运行**:宿主在审查中途被杀或审查进程出错,可以在原运行上留痕放弃并重派审查;在开发或收尾中途被杀,可以留痕放弃这一步、正式关闭原运行,再新建运行重做;QA 评估超时、检查超时都能重试,环境原因造成的 QA 阻断可以在原代码上重跑。
32
+ - **重试是真的重做**:审查退回后第二轮用第二轮的答案,清理后重试真正重跑开发,检查没过不送审;重试次数和收尾不会再撞上限把自己锁死。
33
+ - **规格中途改了也能接着跑**:任务进行中重新批准规格,只要改动只涉及其他任务,就能显式换绑到新规格继续;批次成员会写明能走的出口。
34
+ - **报错说人话**:启动参数不对会点名是哪个参数、和创建时哪里不同;cm-prd 审查闸门的每种拒绝都带固定错误码和原因,不再只报 `unavailable`;扫描代码目录时跳过系统和构建杂文件,出错写明路径。
35
+ - **规则任务(通常是 T-002)能用单任务驱动跑完**:会话核验没通过时停在可重试的状态,改好后在原运行重新生成和核验,不会再落到无法恢复的 `unknown`。
36
+ - **重做任务会带上旧的审查意见**:审查轮次用完后新建运行重做,第一轮开发和审查会看到上个运行最后一次审查的问题清单(只作参考,不跳过审查)。
37
+
20
38
  **0.16.4**
21
39
 
22
40
  - **项目类型通知不再导致审查失败**:Claude Code CLI 2.1.x 在 Xcode 等项目目录里会多发一条「项目类型」通知,而且可能排在初始化消息前面,CM 的审查解析器不认它,真实审查就以 `transport_incomplete` 收场。现在审查方和开发方的解析器都能接受这条通知,其余消息仍按原规则严格校验。
@@ -176,7 +194,7 @@ $cm-check
176
194
 
177
195
  仓库直接分发 Skills 和脚本,无需在仓库根目录运行 `npm install` 或构建。完整安装行为、覆盖范围和卸载说明见[安装指南](docs/installation.md)。
178
196
 
179
- 需要固定版本时可使用 `npx @aibyzero/cm-workflow@0.16.4 install`,请在 CM Workflow 源码仓库以外的目录执行,例如用户主目录。npm 安装入口复用原安装器,要求与覆盖范围见[安装指南](docs/installation.md#npm-installation-macos-codex)。
197
+ 需要固定版本时可使用 `npx @aibyzero/cm-workflow@0.16.6 install`,请在 CM Workflow 源码仓库以外的目录执行,例如用户主目录。npm 安装入口复用原安装器,要求与覆盖范围见[安装指南](docs/installation.md#npm-installation-macos-codex)。
180
198
 
181
199
  ## 升级旧版本
182
200
 
@@ -220,7 +238,7 @@ git pull --ff-only origin main
220
238
  | 测试已有功能 | `$cm-test {项目路径}` | 分层测试结果与证据 |
221
239
  | 修复可复现缺陷 | `$cm-fix {specs路径} {项目路径} {问题}` | 红灯测试、最小修复、回归验证 |
222
240
  | 整理结构并保持行为 | `$cm-refactor` | 按行为等价约束分批重构 |
223
- | 查看/切换运行时声明 | `$cm-runtime` 三问向导;支持 `show` / `set` / `unset --user` | 会话随对话语言、终端随系统语言中英提示;仅影响新 run |
241
+ | 查看/切换运行时声明 | `$cm-runtime` 默认查看并保留;主动选修改才进入预设向导 | 中英提示;预览后明确确认才写;高级模型入口只提供说明;仅影响新 run |
224
242
  | 检查安装与工作流 | `$cm-check` | 环境、引用和合同检查结果 |
225
243
 
226
244
  需要单独讨论方案或研究复杂问题时,可显式使用可选工具 `$external-expert`。外部建议由本地核验,不能代替独立代码审查或测试证据。详见[使用手册](docs/user-guide.md)与[外部专家合同](runtime/external-expert.md)。
@@ -360,7 +378,7 @@ Pi 资源加载器直接发现 Skills 与 Prompts,不运行上述安装器,
360
378
 
361
379
  ## 配置与深入阅读
362
380
 
363
- 交互安装会询问单/双 AI 与谁写代码,保存到 `~/.cm-workflow/runtimes.yml`;`--yes` / `-Yes` 或非 TTY 跳过且不写。运行时声明按 **项目 > 用户级默认 > 未声明** 解析。`$cm-runtime` 可查看/切换,已创建 run 保留原配置。
381
+ 交互安装可跳过运行时配置;已有用户默认优先保留,主动配置后再以 `[y/N]` 明确确认保存到 `~/.cm-workflow/runtimes.yml`。`--yes` / `-Yes` 或非 TTY 跳过且不写。运行时声明按 **项目 > 用户级默认 > 未声明** 解析。`$cm-runtime` 默认查看并保留,主动修改时预览影响、保留模型别名,配置改变后须重新确认;已创建 run 保留原配置。
364
382
 
365
383
  配置独立审查时,`--review-model` 要写本机 CLI 实际接受的完整模型 id,预检会替你核对;真实审查一次常超过一分钟,建议在审查配置里把 `timeoutMs` 调大(上限一小时)。没等到结果就超时时记为可续跑的审查超时,同一轮最多重派一次;已经收到部分结果的超时要先核对,不会自动重派。
366
384
 
@@ -411,4 +429,4 @@ python3 scripts/scan-public-safety.py
411
429
 
412
430
  ## License
413
431
 
414
- [MIT License](LICENSE)。Darwin Skill 与 Kenney CC0 素材的来源和许可见 [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)。
432
+ [MIT License](LICENSE)。Darwin Skill、neat-freak 只读核对原则与 Kenney CC0 素材的来源和许可见 [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)。
@@ -3,6 +3,15 @@
3
3
  CM Workflow is MIT licensed. The following bundled materials retain their own
4
4
  attribution and license status.
5
5
 
6
+ ## Neat-freak read-only closeout principles
7
+
8
+ - Source: https://github.com/KKKKhazix/khazix-skills
9
+ - Fixed commit: `322346ded8129436b3f64707789a73e732ae24d9`, neat-freak 3.0.0
10
+ - Copyright: © 2026 数字生命卡兹克
11
+ - License: MIT; full upstream text is retained in `skills/cm-ai/references/knowledge-closeout.md`.
12
+ - Adaptation: only bounded, read-only evidence reconciliation and reporting principles.
13
+ No upstream scripts, memory maintenance, cleanup, or additional authority is bundled.
14
+
6
15
  ## Darwin Skill
7
16
 
8
17
  - Source: https://github.com/alchaincyf/darwin-skill
package/VERSION CHANGED
@@ -1 +1 @@
1
- 0.16.4
1
+ 0.16.6
@@ -135,6 +135,24 @@ conversation orchestration in the active Skill and use the same JS gates, while
135
135
  fresh context supplies independent review. Real durable N1–N8 dogfood and authorized
136
136
  installation evidence remain later work; no Claude-native adapter is required.
137
137
 
138
+ ## Current-session driver evidence
139
+
140
+ The four single-step drivers share `runtime/js/cm-ai/live-evidence.mjs` for opt-in
141
+ file transport of fresh host requests. A private exchange stays outside all code,
142
+ specs and future batch-worktree roots. Responses bind the original session, call
143
+ and request digest; the original host still owns semantic validation. Static
144
+ answers cannot supply execution evidence. This is current-session material/QA
145
+ execution, not an autonomous browser or PDF runtime; timeout or invalid responses
146
+ keep the original conservative recovery boundary. See `docs/live-evidence-drivers.md`.
147
+
148
+ Standalone cm-fix can explicitly append one rediagnosis after a valid rejected
149
+ cause review on the original run. The marker binds history and old review evidence,
150
+ retains original reproduction/attempt/r1, and requires a fresh cause-r2 review.
151
+ A second rejection reaches a limit; unknown results are not automatically retried.
152
+ Final implementation review excludes both cause-review threads. The owner and
153
+ replay enforce the same transitions; no installation or product recovery follows
154
+ from a successful protocol fixture.
155
+
138
156
  ## External reasoning model
139
157
 
140
158
  `external-expert` is an independent utility Skill for product deliberation,
@@ -179,6 +197,29 @@ and fixtures use paired resource events; an unmatched acquisition blocks the
179
197
  next task or run completion. Each acquisition has a unique run-local resource
180
198
  id, so a delayed cleanup cannot close a later resource.
181
199
 
200
+ The cm-ai conversation host projects actual development, checks, verification and
201
+ review stages into `.cm-status.json`. Only an observed provider thread changes
202
+ `review_starting` to `reviewing`; this display never authorizes review or completion.
203
+ `runtime/js/cm-ai/status-projection.mjs` uses the log adapter's project lock to
204
+ check feature/task/run/attempt ownership and phase token and replace the file in
205
+ one critical section. New phase starts claim the card; delayed completions,
206
+ including QA and N8, cannot claim it from another task. A changes-requested result
207
+ may move the same run's card to its next attempt. Status-only writes do not append
208
+ events, acquire the global log lock or move `.cm-run.json`. This is one last-started
209
+ phase card, not an aggregate view of parallel runs; read-only status requests do
210
+ not refresh it.
211
+ Replaying QA configuration revisions, including repair of a missing audit mirror,
212
+ does not claim or refresh the card; only a newly authorized revision projects its
213
+ pending phase.
214
+
215
+ The single and batch drivers report each check's start and result on stderr,
216
+ alongside their existing streamed command output. Shared QA commands also report
217
+ start and result boundaries. Protected checks report the
218
+ same boundaries without forwarding raw project output or changing their sandbox.
219
+ Custom bridges must forward their own command output. Progress logging and display
220
+ failures are diagnostics, never a different check verdict. Event pairs describe
221
+ observed calls; an unmatched start after interruption is not a completion.
222
+
182
223
  ## Testing model
183
224
 
184
225
  `cm-prd` can generate one `test-cases.json` per behavior-bearing feature.
@@ -214,3 +255,5 @@ Semgrep local rules and OSV offline scanning behind an adapter. Source and proje
214
255
  scanner configuration are never executed. Symlinks/protected paths/limits are explicit
215
256
  gaps. The current host reviews business boundaries and checks the source digest again;
216
257
  scanner output is candidate evidence, never a task-completion or release gate.
258
+
259
+ 人工补正合同:`docs/human-correction.md`。第二轮 blocked 后,仅经明确人审范围的一次性 task-gate 入口可封存独立补正审查;原证据与普通 attempt 上限保留,宿主 journal 不自动重开。
@@ -0,0 +1,33 @@
1
+ # Optional execution optimizations, v1
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 action permissions, model choices, review grants, round limits and timeouts still apply. No provider is called by the flag itself.
4
+
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
+
7
+ ## Checks and full review evidence
8
+
9
+ An explicit `{id, command, sameExecutionAs}` check may share the immediately preceding check's physical execution when the argv, cwd, timeout and execution controls match in that plan. The source must pass. Both check identities remain in the result and the alias names its source. Identical commands without the annotation execute separately. The next plan, including final acceptance, executes fresh checks. There is no generic cache.
10
+
11
+ Review presentation stores identical complete file content once in an inline table. UTF-8 conversion must reproduce the exact bytes; other content stays base64. All acceptance criteria, interfaces, system context, checks, findings and handoff content stay in the same prompt. Reviewers still use no tools. The canonical package and digest remain unchanged. If the presentation is larger in actual UTF-8 bytes, the adapter sends the complete original format. Output evidence and existing limits remain authoritative; no truncation or on-demand fetch is introduced.
12
+
13
+ ## Recover a recorded PRD response
14
+
15
+ Use `repair_review_response` only after examining the original recorded `prd_review` call. Supply `binding: {callId, requestDigest, resultDigest, packageDigest, reason}` with the exact original values and a bounded single-line reason; `resultDigest` is the shared canonical `digest(call.result)`. The driver and host validate before writing. It requires the existing `--allow-review-write` permission. Afterwards `resume` continues the original operation.
16
+
17
+ The whitelist permits only independent `degradedReason: null` omission and timestamp canonicalization of the exact same instant. Missing timezone, ambiguous timezone, invalid dates and nonzero sub-millisecond precision are refused. Verdict, findings, contexts, independence and original stored response remain unchanged. The projection and original recorded JSON bytes are retained with their binding. Repeating the same repair is idempotent. This records the stored response serialization; it does not claim to preserve network whitespace that was never stored.
18
+
19
+ UNKNOWN with no original result cannot use this operation or obtain a new provider dispatch. New cm-ai/fix runs require reconciliation against the original registered invocation and owned-process cleanup evidence. Existing budgets and fresh independent contexts govern any later authorized attempt. Adapter-sent settings and observed text do not establish provider-confirmed model selection.
20
+
21
+ ## Official usage and validation
22
+
23
+ Native Codex/Claude workers capture usage only from validated original CLI terminal events. The existing authoritative logger binds it to the actual invocation claim and deduplicates by that identity. Missing or invalid usage is unavailable. Current-session bridge calls have no invented native usage. Codex cache-read and reasoning counts are subsets, never added to input/output totals; Claude cache fields remain separate components. Optional cache-write and reasoning fields remain unknown when absent. The usage report's `native_components` shows observed and unavailable call counts alongside observed subtotals. Accounting failure cannot retry, complete or alter the workflow.
24
+
25
+ Codex field mapping follows the [official SDK event contract](https://github.com/openai/codex/blob/main/sdk/typescript/src/events.ts). Actual CLI availability varies by version; the adapter preserves missing fields rather than inferring counts. A terminal's official counters are not a provider-confirmed model receipt.
26
+
27
+ Run the controlled fixtures with `node --test scripts/cm-efficiency-*.test.mjs`, then the affected host/driver, recovery, worker, review, logger and compatibility regressions. Python usage fixtures are `python3 scripts/test-cm-native-usage.py` and `python3 scripts/test-cm-usage-report.py`. Native sandbox and parallel preflight checks additionally require the existing local environment facilities.
28
+
29
+ ## Offline experiment and rollback
30
+
31
+ `node scripts/cm-efficiency-offline.mjs` uses fixed synthetic evidence and local checks, verifies exact round-trip preservation and reports actual prompt bytes and physical check executions, including fresh final checks. It makes zero model calls. Bytes are not model tokens, and this experiment establishes no production cost, latency or quality savings. Dynamic recommendations and background monitoring are outside the final feature scope. Live A/B measurement and paid model evaluation require a separately approved budget and protocol.
32
+
33
+ For a source rollback, restore only this increment's files from the saved pre-edit baseline and remove only its newly added paths. Preserve all earlier user changes. No installation is needed to review or test the source; applying it to an installed plugin is a separate operation. A future-run rollback omits the flag; an already frozen run continues under its original policy and compatible source.
@@ -0,0 +1,114 @@
1
+ # 外部模型配置(第一阶段,显式启用)
2
+
3
+ 当前宿主会话继续使用客户端当前模型;CM 不切换该会话。独立外部 CLI 调用按 provider
4
+ 保存一组模型及可选推理强度。同一个 provider 的外部开发、独立审查共用这组参数,
5
+ 审查仍使用新上下文和原逐轮授权。项目的 coder/reviewer runtime 路由保持原规则。
6
+
7
+ ## 配置一次
8
+
9
+ 在源码或已安装插件根目录运行:
10
+
11
+ ```bash
12
+ node scripts/cm-model-setup.mjs configure --provider codex
13
+ node scripts/cm-model-setup.mjs configure --provider claude
14
+ node scripts/cm-model-setup.mjs show
15
+ ```
16
+
17
+ 向导只问模型 ID、可选强度及保存确认。只配置实际会调用的 provider。
18
+ 没有固定默认模型、六用途菜单、模型排名或后台发现。模型留空会拒绝保存。
19
+ 非交互配置用 `configure --provider codex --model {明确模型ID} --effort high --yes`。
20
+ 取消不写文件,确认期间配置被其他进程修改也拒绝覆盖。
21
+ 安全保存要求 POSIX 平台及 `/usr/bin/python3`;原生 Windows 明确返回
22
+ `model_secure_write_unavailable`,本阶段未做 Windows/Linux 实机验收。
23
+
24
+ 配置位于 `~/.cm-workflow/external-models-v1.json`;`CM_WORKFLOW_HOME` 可指定隔离目录:
25
+
26
+ ```json
27
+ {
28
+ "schemaVersion": 1,
29
+ "providers": {
30
+ "codex": {"model": "YOUR_EXPLICIT_MODEL_ID", "effort": "high"},
31
+ "claude": {"model": "YOUR_EXPLICIT_MODEL_ID", "effort": null}
32
+ }
33
+ }
34
+ ```
35
+
36
+ Codex 强度支持 `none/minimal/low/medium/high/xhigh`,省略时沿用适配器 `high`。
37
+ Claude 支持 `low/medium/high/xhigh/max`,省略或 `null` 时不发送强度参数。
38
+ 这些是本版本适配器的参数合同,不能证明账号实际可用的模型/强度;不支持的参数明确报错。
39
+ 实际生效模型保持 `unknown`,不会把配置、参数或预检冒充 provider 确认。
40
+
41
+ ## 在运行中启用
42
+
43
+ 本阶段接入 `cm-ai-host.mjs`/`cm-ai-drive.mjs`、batch host/driver 与 cm-fix host/driver。
44
+ 在已有合法 PLAN 的 `permissions` 增加 `--external-models`;可同时增加
45
+ `--external-models-config {配置路径}` 为本次新 run 明确选择整组 provider 参数。
46
+ 批次在首个成员启动前冻结整组参数,后续尚未创建的成员也读取同一批次快照。cm-fix
47
+ 在原生运行配置中冻结审查 pair,根因和最终审查共用参数、各自使用新上下文。QA 修复
48
+ 子运行从父运行冻结参数继承,不能替换已有 legacy 子运行配置。cm-prd 仍使用原合同。
49
+ 新模式 cm-fix 创建时必须提供与 pair 匹配的 `--review-config`,实际调用仍需原逐步授权。
50
+
51
+ 独立审查仍需原 preflight 和 `--review-config`;预检本身会调用外部 CLI,因此在真实账号上
52
+ 可能收费,须遵守本次调用预算和授权。先生成与这组参数匹配的审查配置:
53
+
54
+ ```bash
55
+ node scripts/cm-ai-host.mjs preflight --config {RUN.json} --external-provider codex > {REVIEW.json}
56
+ ```
57
+
58
+ 自定义配置时同时传 `--external-models-config {配置路径}`。审查和 provider 开发配置中的
59
+ 显式 model/effort 必须与选中 pair 一致;冲突拒绝启动。受保护开发仍需
60
+ `--protected-config` 和 `--allow-provider-development-attempt`,检查配置可省略 model/effort,
61
+ 原检查命令与权限不变。当前会话开发使用原工具桥,不产生一次额外模型调用。
62
+
63
+ 新 run 冻结实际需要的 provider pair,外部开发和审查的参数、预检指纹及运行指纹一致。
64
+ `resume` 自动读取原快照,不读取新的用户默认值,禁止传入新配置文件或把旧 run 改成新模式。
65
+ 以下命令只读展示运行状态、快照和逐次审查记录:
66
+
67
+ ```bash
68
+ node scripts/cm-model-setup.mjs inspect-run --input {RUN.json}
69
+ ```
70
+
71
+ ## 中断与兼容边界
72
+
73
+ 新模式按代码根持有现有 SQLite lease,并首次把代码根绑定到唯一规格根。
74
+ 并行 batch 成员各自绑定隔离工作树,未完成的阻断成员保持原工作树及 run,不走第二代 fallback。
75
+ 同一候选执行器不能用换 runId、关闭新旗标、supersede 或换规格根绕过未知调用;
76
+ 尚无可信终态的外部开发取消也不能作为重派依据。只读核对原调用,不改旧记录。
77
+ 旧二进制不理解这些保护,因此不要混用旧执行器在同一代码根创建新运行。
78
+
79
+ 未成功观测的外部审查先停为 `unknown`。worker 只在核对原 provider 线程、实际终态、
80
+ 独立审查包及拥有的 POSIX 子进程组已关闭后提供收据。宿主把收据绑定到原 run 的
81
+ registered/started/result 记录,再由显式 `reconcile_review` 接纳;调用方只传原 invocationId,
82
+ 不能上传收据。仅 process close、错误线程/包、缺终态或清理不确定均不能对账,零重派。
83
+
84
+ 驾驶员原 PLAN 改 `mode` 为 `resume`,增加原 `invocationId`,运行:
85
+
86
+ ```bash
87
+ node scripts/cm-ai-drive.mjs --plan {PLAN.json} reconcile_review
88
+ node scripts/cm-ai-batch-drive.mjs --plan {BATCH_PLAN.json} reconcile_review
89
+ node scripts/cm-fix-drive.mjs --plan {FIX_PLAN.json} reconcile_review
90
+ ```
91
+
92
+ batch PLAN 还需原 `taskKey`。QA 子运行沿原 `fix_action`,`fixOperation: reconcile_review`
93
+ 及原 `invocationId`,仍核对父子关联。对账不签新 review grant、不启动模型或预检。
94
+ 可信迟到合法结果恢复原审查状态;cm-ai 可信 provider failure 对账后允许原一次预算内、
95
+ 新授权与新上下文重试。cm-fix 对账失败只进入 `review_provider_failed` 明确阻断,未提供
96
+ 重试出口。无可信证据时禁止人工 abandon/recover 与自动重派。合法 `changes_requested`
97
+ 保留原第二轮预算。旧无新快照的 run 保留原恢复合同,未迁移旧 run。
98
+
99
+ 旧六用途设置及 task/project/global 文件只读预览,比较有效开发与审查选择,包括旧部分配置
100
+ 继承的历史默认。它们不会参与新 run 自动选型:
101
+
102
+ ```bash
103
+ node scripts/cm-model-setup.mjs legacy-preview --input {旧设置.json} --project {旧项目覆盖.json}
104
+ node scripts/cm-model-setup.mjs legacy-run-preview --input {旧模型运行快照.json}
105
+ ```
106
+
107
+ 选择相同且仅有同目录旧设置来源时,可以显式 `adopt-legacy --provider codex --input {旧设置.json}`
108
+ 确认后写新文件。冲突或多来源必须用 `configure` 明确选一个 pair,不自动合并或覆写旧文件。
109
+ 历史 experimental-model-v1/model-policy-v2 快照只检查快照及选择摘要,不验证执行归属;
110
+ 恢复它们须使用原冻结执行器。没有迁移任何现有 run。
111
+
112
+ 动态推荐已从当前范围移除;没有在线目录、付费评测、自动能力发现或后台监控。配置更改仅影响未来显式启用的
113
+ 新 run。回滚时移除新 run 计划的旗标并使用原安装;已创建的新 run 继续用创建它的执行器及快照,
114
+ 保留绑定和 lease 文件供核对,不删除它们来规避未结调用。
@@ -0,0 +1,7 @@
1
+ # Independent review: bootstrap unchanged-target recovery
2
+
3
+ Verdict: approved.
4
+
5
+ The independent reviewer found two material gaps before approval. An attempt-2 rule restored to the original task baseline must appear in `unchangedScope` even though its current-attempt before SHA differs; the validator and a CI-collected regression test now cover this. The original recovery integration test was in a fixture excluded from CI; its runner/entry append-and-replay test now runs from `scripts/cm-bootstrap-review-recovery.test.mjs`. The reviewer also checked the standard driver route, explicit permission and reason, handoff binding, fail-closed drift behavior, project lesson, and operator documentation. No remaining blocking findings.
6
+
7
+ Verification reviewed: CI-collected focused suite 8/8, bootstrap end-to-end fixture 9/9 before fixture extraction and 8/8 after moving the recovery case, and `git diff --check`. The main executor additionally ran the affected driver/entry suite (59/59), `cm-check-runtime.sh`, public repository validation, and safety scan.
@@ -0,0 +1,9 @@
1
+ # Independent review: oversized develop delivery recovery
2
+
3
+ Verdict: approved.
4
+
5
+ Earlier review rounds found and resolved four material boundary gaps: instruction bootstrap could have inherited a developer redispatch, generic `limit_exceeded` results could have been mistaken for review-material failures, legacy attempt-2 evidence was not uniquely attributable to the current effect, and paths containing parentheses did not match the historical diagnostic. A later review also found a personal absolute path in the incident note that failed the public-safety gate; the note now uses a relative evidence path.
6
+
7
+ The final independent reviewer found no actionable regressions in the staged, unstaged, or untracked changes. It inspected the live transition, journal replay projection, retry budget, instruction-bootstrap boundary, documentation and project lesson. Verification reviewed: focused suite 62/62, `./scripts/cm-check-runtime.sh`, `python3 scripts/validate-public-repo.py`, `python3 scripts/scan-public-safety.py`, and `git diff --check`, all passing.
8
+
9
+ Residual risk: old attempt-2 `unknown/limit_exceeded` checkpoints remain conservative because their stored checks cannot be proven to belong to the current effect. They keep the existing reconcile path rather than gaining a replay migration.
@@ -0,0 +1,22 @@
1
+ # Bootstrap 规则刷新误判为冲突
2
+
3
+ ## 现象与复现
4
+
5
+ 同一已批准 bootstrap feature 的 T-002 已生成并完成规则文件。后续 T-010 以相同固定目标执行规则刷新时,首轮 `advance` 在 `init_generate` 之前抛出 `bootstrap_instruction_conflict`,运行落入 `unknown/execution_error`,无开发派发或文件写入。
6
+
7
+ 复现尝试:T-002 完成且六个目标已提交、T-010 待执行 → T-010 首轮开发 → 旧实现把已存在规则视为无本任务证据的冲突。新增 `scripts/cm-ai-bootstrap-merge.test.mjs` 的刷新与提交基准用例在修复前失败,修复后通过。
8
+
9
+ ## 根因与修法
10
+
11
+ 原规则通道只认空目标、仅含 `## 项目教训` 的 `AGENTS.md`,或同一任务先前 attempt 的写入证据。它没有后续任务的可信基准。宿主又在 develop effect 内才检查目标,所以可预判的冲突被归为执行异常。
12
+
13
+ 后续规则任务现在要求同一 bootstrap feature 中已有完成的规则任务,绑定代码项目 HEAD 的固定目标原始 blob 摘要,并在派发前核对暂存区和工作文件。草稿可刷新规则正文,但 `AGENTS.md` 的项目教训段必须逐字保留,仍经核验与独立 Review。基准不符时进入可回放的 `blocked/bootstrap_instruction_conflict`,不派发、不写入;还原目标及暂存区后可在原 run 恢复。若 HEAD 改变,须新建 run 绑定新提交。生成后发生的并发漂移仍保留原 `unknown` 语义。
14
+
15
+ 未另建规则刷新入口:现有已批准 bootstrap 任务和固定目标合同足以表达该操作,新入口会复制审批与审查边界。旧 `unknown` 运行不会被自动改写;核实旧 writer 已关闭后,用新 runId 按现有 reviewed-evidence supersession 流程重建。
16
+
17
+ ## 波及面与验证
18
+
19
+ - `host-bootstrap`、`task-runner` 和 journal replay:后续任务基准、派发前 blocked、回放。
20
+ - 规则驾驶员:同一提交基准的启动预检与合入逻辑。
21
+ - 回归:首次规则生成、后续刷新、暂存区/工作文件漂移、blocked 后原 run 恢复、生成后漂移、项目教训保留。
22
+ - 测试:`scripts/cm-ai-bootstrap-merge.test.mjs`、`scripts/cm-ai-bootstrap-flow.test.mjs`、`scripts/cm-ai-bootstrap.test.mjs`、`scripts/cm-ai-drive-bootstrap-rules.test.mjs`;`./scripts/cm-check-runtime.sh`、公开仓库验证与安全扫描。
@@ -0,0 +1,26 @@
1
+ # Bootstrap rule refresh with an unchanged target
2
+
3
+ Status: regression passing; independent review approved.
4
+
5
+ ## Reproduction and cause
6
+
7
+ A later bootstrap task refreshed five of six fixed instruction files. `init_generate`, `init_verify`, and both task checks passed; the sixth file was byte-identical to its input. The handoff correctly listed five `changed_files`, but `validateBootstrapReviewPackage` required all six target paths in `pkg.changes`. The initial regression test failed with `bootstrap_review_mismatch` before the fix.
8
+
9
+ The package contract records actual differences in `changes` and the remaining selected files in `unchangedScope`. The task had already persisted its write evidence, checks, and handoff before package validation, so the old generic failure path checkpointed `unknown/execution_error` with no reviewable package. Re-dispatching development would discard the original review baseline for the five written files.
10
+
11
+ ## Repair
12
+
13
+ - Validate changed targets against their final SHA and unchanged targets against `unchangedScope` and its SHA. Attempt 1 also checks the write's before SHA; attempt 2 may start from attempt 1's artifact or restore the original baseline.
14
+ - Classify a new `bootstrap_review_mismatch` as `blocked` with a recovery hint.
15
+ - Add a one-use, resume-only `bootstrap_review_recover` operation. It accepts only a completed bootstrap develop checkpoint with a successful developer call, retained passing checks, write evidence, and no pending effect or package. It verifies the final files, Learning handoff, changed-file set, implementation digest, and reconstructed package before appending a replayable recovery record and moving the original run to `awaiting_review`. It does not run a developer, checks, or reviewer.
16
+ - Expose the operation through the host and standard single-step driver with an explicit permission flag and reason. A changed handoff or file is rejected without a journal append.
17
+
18
+ ## Evidence
19
+
20
+ - Focused red: `scripts/cm-ai-bootstrap-merge.test.mjs` failed on the unchanged target with `bootstrap_review_mismatch` before the validator fix.
21
+ - Synthetic end-to-end: a persisted legacy `unknown/execution_error` checkpoint recovered to the same package digest, then independently reviewed and completed with no second developer call. A deliberately mismatched handoff was rejected without appending.
22
+ - CI-collected tests: `scripts/cm-ai-bootstrap-merge.test.mjs`, `scripts/cm-bootstrap-review-recovery.test.mjs`, and `scripts/cm-ai-drive.test.mjs`.
23
+ - Additional bootstrap fixture: `scripts/cm-ai-bootstrap.test.mjs` covers the same-feature refresh, attempt-2 retries, and fail-closed recovery.
24
+ - Independent review: `docs/fixes/.reviews/20260929-bootstrap-unchanged-review-r1.md` (approved after two findings were fixed).
25
+
26
+ The observed external run remains untouched while its host configuration and writer state are checked. Recovery must resume its original run ID and keep its existing handoff; do not supersede it while the five rule changes are unreviewed.
@@ -0,0 +1,65 @@
1
+ # 超大开发交付的可重试恢复
2
+
3
+ ## 现象与现场
4
+
5
+ `bootstrap-T-008` 通过当前 Claude 会话直连 `cm-ai-host.mjs serve --mode create`,未经过
6
+ `cm-ai-drive.mjs` 的启动前大小预检。开发调用交付 70 个文件后,5 项检查全部通过;生成
7
+ 审查包时,scope、requirements 与 `AGENTS.md` 材料累计超过 2 MiB。旧实现把异常写成
8
+ `unknown/limit_exceeded`、`pendingAction: reconcile`,与 `js-host.md` 承诺的
9
+ `blocked/develop_package_too_large` 不一致,原 run 没有恢复入口。
10
+
11
+ 保留现场位于 `<specs-root>/.reviews/.execution/bootstrap-T-008/state.json`。
12
+ 修复前只读核对确认最后一个 develop checkpoint 的调用成功、检查全过、审查包为空,错误为
13
+ `limit_exceeded`;代码项目中的第一次交付保持未提交。
14
+
15
+ ## 红灯与根因
16
+
17
+ 新增真实单宿主用例,直接调用 host 并写入三个各 750 KiB 的文件,绕过驾驶员预检。修复前
18
+ 两项回归均失败:新交付仍以 exit 1 的 `unknown/limit_exceeded` 结束;旧 journal 无法
19
+ `resume`。
20
+
21
+ `task-runner.mjs` 在 `createReviewPackage` 抛出大小异常后进入最外层通用 catch;通用分支把
22
+ 除少数已列明门禁外的异常全部归为 `unknown`。后续用于处理 1 MiB 存档预算的检查只在
23
+ `awaiting_review` 后执行,因此无法接住审查包构建阶段的 2 MiB 材料上限。即使修正新状态,
24
+ 旧 journal 回放仍会保留历史 `unknown`,所以只改 live 分支不足以恢复现场。
25
+
26
+ ## 修法与边界
27
+
28
+ - 在审查材料构建的本地门禁处把 `limit_exceeded` 归一为可重试的
29
+ `blocked/develop_package_too_large`,保留有界的原始路径和字节上限说明。
30
+ - 回放旧 `unknown/limit_exceeded` 时,只迁移第 1 轮 develop 调用成功、全部检查通过、没有审查包、
31
+ 没有 review receipt,且 reason 符合审查快照构建器诊断的确定性形状。verification gate 等
32
+ 通用 JSON 上限不满足该来源条件;第 2 轮旧记录无法证明检查来自当前 effect,也不迁移。原
33
+ journal 字节不改写;恢复后的下一条 checkpoint 才携带新投影。
34
+ - instruction bootstrap 保留专用的禁止重派边界,不从该通用状态取得新的 developer effect。
35
+ - 其他 provider、写盘、漂移或检查前的 `limit_exceeded` 继续走原未知语义,不扩大重试权限。
36
+ - 1 MiB checkpoint 预算仍沿用原来的精确预留计算;本修复补齐的是更早发生的 2 MiB 审查
37
+ 材料异常和旧运行恢复。
38
+
39
+ ## 验证
40
+
41
+ - 红灯回归修复后 2/2 通过:直连 host 返回 retryable block;旧 journal 可 `status` 后在原
42
+ attempt 以新 effect id 重做并到达 `awaiting_review`。
43
+ - `node --test scripts/cm-ai-develop-driver-gaps.test.mjs`:60/60 passed,覆盖 2 MiB 材料上限、
44
+ 1 MiB 存档预算、驾驶员预检与直连宿主恢复。
45
+ - `node --test scripts/cm-bootstrap-review-recovery.test.mjs`:2/2 passed,覆盖规则通道不因通用
46
+ package limit 获得 developer redispatch。
47
+ - `node --test experiments/js-orchestration/task-runner.test.mjs`:344/344 passed。
48
+ - `./scripts/cm-check-runtime.sh`:PASSED。
49
+ - `python3 scripts/validate-public-repo.py`、`python3 scripts/scan-public-safety.py`、
50
+ `git diff --check`:PASSED。
51
+ - 用修复后的源码只读打开保留的 `bootstrap-T-008`,得到
52
+ `blocked/develop_package_too_large/pendingAction: resume`;现场 state 文件前后 SHA-256 均为
53
+ `9d87bb9c8239b6080157186d403c9177967c3f42ac63c5a47a7285e2ee6a2702`。
54
+
55
+ ## Learning
56
+
57
+ 新增项目教训:开发调用已成功且检查全过之后,可由宿主本地判定的材料门禁必须在通用异常
58
+ 出口前归一;新增可重试终态时同时验证旧 journal 的唯一恢复路径。该教训与代码、测试和文档
59
+ 一起进入独立 Review。
60
+
61
+ 独立 Review 第 1 轮提出两项 P2:instruction bootstrap 被通用 retry 路径扩大开发权限;旧迁移
62
+ 没有区分 verification gate 的通用 JSON 上限。第 2 轮进一步发现旧 instruction bootstrap 与
63
+ 第 2 轮 develop 的证据形状不够严格,以及带括号路径的历史诊断无法识别;修复后加入专用拒绝、
64
+ 仅第 1 轮迁移和括号路径用例。第 3 轮确认 62/62 针对性用例通过,但指出事故说明含个人绝对路径,
65
+ 公开安全扫描失败;说明已改为相对证据路径。最终 disposition 以修正后的复审记录为准。