@aibyzero/cm-workflow 0.17.0 → 0.18.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.
Files changed (372) hide show
  1. package/.codex-plugin/plugin.json +1 -1
  2. package/AGENTS.md +27 -0
  3. package/CHANGELOG.md +230 -1
  4. package/CONTRIBUTING.md +47 -0
  5. package/README.md +21 -3
  6. package/THIRD_PARTY_NOTICES.md +13 -0
  7. package/VERSION +1 -1
  8. package/compat/claude-commands/cm-challenge.md +3 -0
  9. package/docs/architecture.md +40 -13
  10. package/docs/cm-control-policy-v2.md +127 -9
  11. package/docs/fixes/20261013-claude-preinit-ui-invalidate.md +48 -0
  12. package/docs/installation.md +310 -4
  13. package/docs/js-workflow-control.md +153 -16
  14. package/docs/live-evidence-drivers.md +28 -4
  15. package/docs/out-of-scope/README.md +25 -0
  16. package/docs/out-of-scope/background-supervisor.md +32 -0
  17. package/docs/reviewed-integration.md +48 -0
  18. package/docs/user-guide.md +50 -21
  19. package/install-codex.sh +331 -18
  20. package/install.ps1 +28 -2
  21. package/install.sh +321 -17
  22. package/package.json +2 -1
  23. package/runtime/js/cm-ai/batch-location.mjs +55 -0
  24. package/runtime/js/cm-ai/batch-plan.mjs +242 -0
  25. package/runtime/js/cm-ai/checkpoint-package-material.mjs +162 -0
  26. package/runtime/js/cm-ai/claude-developer-proposal.schema.json +55 -1
  27. package/runtime/js/cm-ai/claude-review-stream.mjs +94 -21
  28. package/runtime/js/cm-ai/claude-tool-preview.mjs +11 -9
  29. package/runtime/js/cm-ai/cm-ai-admission.mjs +18 -12
  30. package/runtime/js/cm-ai/cm-ai-conversation-entry.mjs +91 -6
  31. package/runtime/js/cm-ai/cm-ai-qa-log.mjs +5 -1
  32. package/runtime/js/cm-ai/codex-config.mjs +6 -2
  33. package/runtime/js/cm-ai/codex-developer-basic-output.schema.json +3 -2
  34. package/runtime/js/cm-ai/codex-developer-output.schema.json +2 -1
  35. package/runtime/js/cm-ai/codex-reconnect-notice.mjs +6 -0
  36. package/runtime/js/cm-ai/codex-review-adapter.mjs +27 -7
  37. package/runtime/js/cm-ai/control-policy.mjs +24 -6
  38. package/runtime/js/cm-ai/developer-adapter.mjs +19 -5
  39. package/runtime/js/cm-ai/drive-core.mjs +236 -34
  40. package/runtime/js/cm-ai/drive-rate-limit.mjs +105 -0
  41. package/runtime/js/cm-ai/durable-runner-state.mjs +234 -33
  42. package/runtime/js/cm-ai/effect-contract.mjs +11 -2
  43. package/runtime/js/cm-ai/execution-policy.mjs +3 -1
  44. package/runtime/js/cm-ai/execution-snapshot.mjs +4 -2
  45. package/runtime/js/cm-ai/execution-store-limits.mjs +14 -7
  46. package/runtime/js/cm-ai/execution-store.mjs +60 -17
  47. package/runtime/js/cm-ai/fix-code-association.mjs +73 -2
  48. package/runtime/js/cm-ai/host-check.mjs +14 -6
  49. package/runtime/js/cm-ai/host-conversation-execution.mjs +70 -28
  50. package/runtime/js/cm-ai/host-qa-executor.mjs +38 -5
  51. package/runtime/js/cm-ai/host-qa-fix-owner.mjs +2 -2
  52. package/runtime/js/cm-ai/host-qa-policy.mjs +19 -2
  53. package/runtime/js/cm-ai/host-replay.mjs +148 -0
  54. package/runtime/js/cm-ai/host-session.mjs +42 -9
  55. package/runtime/js/cm-ai/host-stage-observer.mjs +26 -0
  56. package/runtime/js/cm-ai/host-tool-bridge.mjs +22 -9
  57. package/runtime/js/cm-ai/host-workflow-capabilities.mjs +19 -2
  58. package/runtime/js/cm-ai/host.mjs +1 -1
  59. package/runtime/js/cm-ai/implicit-qa-decision.mjs +5 -0
  60. package/runtime/js/cm-ai/integration-snapshots.mjs +50 -0
  61. package/runtime/js/cm-ai/live-evidence.mjs +28 -6
  62. package/runtime/js/cm-ai/operator-guidance.mjs +63 -30
  63. package/runtime/js/cm-ai/owned-process-cleanup.mjs +27 -9
  64. package/runtime/js/cm-ai/process-group-exit.mjs +46 -0
  65. package/runtime/js/cm-ai/provider-review-observation.mjs +3 -2
  66. package/runtime/js/cm-ai/qa-attachment.mjs +22 -0
  67. package/runtime/js/cm-ai/qa-config-revision.mjs +7 -2
  68. package/runtime/js/cm-ai/requirement-evidence.mjs +102 -0
  69. package/runtime/js/cm-ai/review-package.mjs +79 -7
  70. package/runtime/js/cm-ai/review-presentation-delta.mjs +166 -0
  71. package/runtime/js/cm-ai/review-presentation.mjs +177 -8
  72. package/runtime/js/cm-ai/reviewed-evidence-supersede.mjs +70 -2
  73. package/runtime/js/cm-ai/reviewed-integration.mjs +260 -0
  74. package/runtime/js/cm-ai/scope-revision.mjs +38 -0
  75. package/runtime/js/cm-ai/specification-material.mjs +2 -2
  76. package/runtime/js/cm-ai/task-runner.mjs +247 -41
  77. package/runtime/js/cm-ai/verification-auto.mjs +38 -0
  78. package/runtime/js/cm-ai/worker-claude-developer.mjs +39 -15
  79. package/runtime/js/cm-ai/worker-claude.mjs +35 -13
  80. package/runtime/js/cm-ai/worker-codex-developer.mjs +43 -17
  81. package/runtime/js/cm-ai/worker-codex.mjs +41 -7
  82. package/runtime/js/cm-fix/cause-invocation.mjs +16 -2
  83. package/runtime/js/cm-fix/cause-package.mjs +46 -1
  84. package/runtime/js/cm-fix/command-correction.mjs +37 -0
  85. package/runtime/js/cm-fix/cooperative.mjs +12 -0
  86. package/runtime/js/cm-fix/dossier.mjs +8 -2
  87. package/runtime/js/cm-fix/execution.mjs +578 -100
  88. package/runtime/js/cm-fix/final-review.mjs +39 -8
  89. package/runtime/js/cm-fix/finish.mjs +15 -11
  90. package/runtime/js/cm-fix/host-review.mjs +65 -10
  91. package/runtime/js/cm-fix/host.mjs +35 -12
  92. package/runtime/js/cm-fix/jest-command-correction.mjs +69 -0
  93. package/runtime/js/cm-fix/metrics.mjs +18 -5
  94. package/runtime/js/cm-fix/regression-evidence.mjs +3 -2
  95. package/runtime/js/cm-fix/regression.mjs +16 -7
  96. package/runtime/js/cm-fix/repair.mjs +29 -8
  97. package/runtime/js/cm-fix/review-verification-command.mjs +135 -0
  98. package/runtime/js/cm-fix/review-verification-contract.mjs +54 -0
  99. package/runtime/js/cm-fix/review-verification-diagnostic.mjs +75 -0
  100. package/runtime/js/cm-fix/review-verification-recovery.mjs +44 -0
  101. package/runtime/js/cm-fix/review-verification-server.mjs +38 -0
  102. package/runtime/js/cm-fix/review-verification.mjs +214 -0
  103. package/runtime/js/cm-fix/source-correction-recovery.mjs +65 -0
  104. package/runtime/js/cm-fix/start.mjs +6 -3
  105. package/runtime/js/cm-fix/test-type-correction.mjs +86 -0
  106. package/runtime/js/cm-fix/test-type-recovery.mjs +51 -0
  107. package/runtime/js/cm-fix/type-import-correction.mjs +89 -0
  108. package/runtime/js/cm-prd/accepted-design.mjs +8 -0
  109. package/runtime/js/cm-prd/analysis.mjs +13 -9
  110. package/runtime/js/cm-prd/change.mjs +37 -16
  111. package/runtime/js/cm-prd/draft-save.mjs +13 -6
  112. package/runtime/js/cm-prd/draft.mjs +31 -3
  113. package/runtime/js/cm-prd/failed-correction.mjs +19 -3
  114. package/runtime/js/cm-prd/inputs-replaced.mjs +3 -0
  115. package/runtime/js/cm-prd/review-correction.mjs +6 -4
  116. package/runtime/js/cm-prd/review-disposition.mjs +7 -1
  117. package/runtime/js/cm-prd/self-check-revision.mjs +2 -2
  118. package/runtime/js/cm-prd/self-check.mjs +125 -6
  119. package/runtime/js/cm-prd/session.mjs +30 -1
  120. package/runtime/js/cm-prd/summary.mjs +38 -17
  121. package/runtime/js/cm-prd/task-scope-record.mjs +97 -0
  122. package/runtime/js/cm-prd/tree-digest.mjs +34 -0
  123. package/runtime/js/cm-prd/validation-reason.mjs +8 -4
  124. package/runtime/js/cm-security/scan.mjs +1 -1
  125. package/runtime/js/commander/decision.mjs +44 -0
  126. package/runtime/js/commander/dispatch-registry.mjs +110 -0
  127. package/runtime/js/commander/ledger.mjs +265 -0
  128. package/runtime/js/commander/preflight.mjs +107 -0
  129. package/runtime/js/notify-later.mjs +13 -0
  130. package/runtime/js/notify-send.mjs +6 -2
  131. package/runtime/js/notify.mjs +570 -63
  132. package/runtime/js/review-findings.mjs +38 -0
  133. package/runtime/js/session-boundary.mjs +56 -0
  134. package/runtime/js/session-handoff.mjs +68 -0
  135. package/runtime/js/spec-task-line.mjs +27 -13
  136. package/runtime/js/specs-status.mjs +1 -1
  137. package/runtime/js/task-scope.mjs +197 -0
  138. package/runtime/logging.md +6 -1
  139. package/runtime/model-efficiency.md +69 -10
  140. package/runtime/orchestration.md +3 -1
  141. package/runtime/project-learning.md +2 -0
  142. package/runtime/review.md +12 -2
  143. package/runtime/test-contract.md +1 -0
  144. package/scripts/ci-test-weights.json +3 -0
  145. package/scripts/cm-ai-admission.mjs +11 -5
  146. package/scripts/cm-ai-admission.test.mjs +23 -2
  147. package/scripts/cm-ai-batch-drive.mjs +79 -18
  148. package/scripts/cm-ai-batch-drive.test.mjs +169 -3
  149. package/scripts/cm-ai-batch-host.mjs +38 -9
  150. package/scripts/cm-ai-batch-host.test.mjs +27 -14
  151. package/scripts/cm-ai-batch-learning-merge.test.mjs +36 -0
  152. package/scripts/cm-ai-batch-location.test.mjs +57 -0
  153. package/scripts/cm-ai-batch-plan.mjs +52 -0
  154. package/scripts/cm-ai-batch-plan.test.mjs +397 -0
  155. package/scripts/cm-ai-batch-run-fixture.mjs +446 -35
  156. package/scripts/cm-ai-batch-run-member-stops.test.mjs +16 -0
  157. package/scripts/cm-ai-batch-run-parallel.test.mjs +28 -1
  158. package/scripts/cm-ai-batch-run.mjs +483 -63
  159. package/scripts/cm-ai-batch-run.test.mjs +23 -4
  160. package/scripts/cm-ai-batch-session-e2e.test.mjs +235 -0
  161. package/scripts/cm-ai-batch-session-member.test.mjs +293 -0
  162. package/scripts/cm-ai-batch-session-recovery.test.mjs +423 -0
  163. package/scripts/cm-ai-check-recheck-cancellation.test.mjs +247 -0
  164. package/scripts/cm-ai-checklist-coverage.test.mjs +4 -2
  165. package/scripts/cm-ai-checkpoint-package-material.test.mjs +221 -0
  166. package/scripts/cm-ai-checkpoint-package-owner.test.mjs +193 -0
  167. package/scripts/cm-ai-control-launch.test.mjs +21 -0
  168. package/scripts/cm-ai-control-policy.test.mjs +82 -0
  169. package/scripts/cm-ai-control-v2-drive.test.mjs +398 -3
  170. package/scripts/cm-ai-control-v2-supersede-race.mjs +25 -0
  171. package/scripts/cm-ai-control-v2-supersede.test.mjs +318 -0
  172. package/scripts/cm-ai-develop-driver-gaps.test.mjs +163 -0
  173. package/scripts/cm-ai-development-rework.test.mjs +423 -0
  174. package/scripts/cm-ai-drive-bootstrap-rules.test.mjs +3 -2
  175. package/scripts/cm-ai-drive.mjs +73 -17
  176. package/scripts/cm-ai-drive.test.mjs +37 -5
  177. package/scripts/cm-ai-execution-store-legacy-probe.test.mjs +84 -0
  178. package/scripts/cm-ai-host-fixture.mjs +9 -6
  179. package/scripts/cm-ai-host-protected.test.mjs +1 -1
  180. package/scripts/cm-ai-host.mjs +60 -19
  181. package/scripts/cm-ai-host.test.mjs +15 -0
  182. package/scripts/cm-ai-integration-adoption.test.mjs +223 -0
  183. package/scripts/cm-ai-integration-independence.test.mjs +23 -0
  184. package/scripts/cm-ai-integration-launch.test.mjs +240 -0
  185. package/scripts/cm-ai-integration-preview.mjs +41 -0
  186. package/scripts/cm-ai-integration-snapshots.test.mjs +197 -0
  187. package/scripts/cm-ai-nested-execution.test.mjs +29 -1
  188. package/scripts/cm-ai-operator-guidance.test.mjs +71 -0
  189. package/scripts/cm-ai-prefinal-delivery.test.mjs +278 -0
  190. package/scripts/cm-ai-project-qa-gate.test.mjs +56 -0
  191. package/scripts/cm-ai-qa-fingerprint-config.test.mjs +28 -0
  192. package/scripts/cm-ai-qa-rerun-timeouts.test.mjs +36 -2
  193. package/scripts/cm-ai-requirement-evidence.test.mjs +65 -0
  194. package/scripts/cm-ai-review-failure.test.mjs +150 -5
  195. package/scripts/cm-ai-review-timeout.test.mjs +20 -0
  196. package/scripts/cm-ai-run.mjs +88 -21
  197. package/scripts/cm-ai-scope-revision.test.mjs +341 -0
  198. package/scripts/cm-ai-spec-rebind.test.mjs +13 -0
  199. package/scripts/cm-ai-supersede.test.mjs +28 -0
  200. package/scripts/cm-ai-verification-auto.test.mjs +99 -0
  201. package/scripts/cm-announce-hook.mjs +35 -8
  202. package/scripts/cm-announce-hook.test.mjs +25 -0
  203. package/scripts/cm-challenge.test.mjs +61 -0
  204. package/scripts/cm-check-drive-files.mjs +2 -2
  205. package/scripts/cm-check-host.test.mjs +1 -1
  206. package/scripts/cm-check-runtime.sh +58 -1
  207. package/scripts/cm-claude-developer-worker.test.mjs +56 -7
  208. package/scripts/cm-claude-install-layout.test.mjs +1 -1
  209. package/scripts/cm-claude-probe.test.mjs +26 -0
  210. package/scripts/cm-claude-review-diagnostics.test.mjs +235 -0
  211. package/scripts/cm-claude-review-stream.test.mjs +49 -0
  212. package/scripts/cm-claude-worker.test.mjs +16 -0
  213. package/scripts/cm-codex-developer-reconnect-notice.test.mjs +98 -0
  214. package/scripts/cm-codex-developer-worker.test.mjs +120 -0
  215. package/scripts/cm-codex-install-local-edit-guard.test.mjs +436 -0
  216. package/scripts/cm-codex-prompt-input.test.mjs +153 -0
  217. package/scripts/cm-codex-reconnect-notice.test.mjs +167 -0
  218. package/scripts/cm-commander-ledger.test.mjs +260 -0
  219. package/scripts/cm-commander-p2.test.mjs +295 -0
  220. package/scripts/cm-commander-preflight.mjs +84 -0
  221. package/scripts/cm-commander.mjs +116 -0
  222. package/scripts/cm-config-lock.mjs +35 -0
  223. package/scripts/cm-controlled-correction.test.mjs +10 -1
  224. package/scripts/cm-developer-failure-code.test.mjs +62 -0
  225. package/scripts/cm-display-task-id.test.mjs +41 -0
  226. package/scripts/cm-drive-liveness.test.mjs +83 -0
  227. package/scripts/cm-efficiency-presentation-delta.test.mjs +218 -0
  228. package/scripts/cm-execution-snapshot-reuse.test.mjs +115 -0
  229. package/scripts/cm-external-batch-host.test.mjs +12 -9
  230. package/scripts/cm-external-process-cleanup.test.mjs +128 -0
  231. package/scripts/cm-external-qa-fix.test.mjs +89 -7
  232. package/scripts/cm-external-review-reconciliation.test.mjs +11 -0
  233. package/scripts/cm-failover.mjs +48 -10
  234. package/scripts/cm-failover.test.mjs +46 -0
  235. package/scripts/cm-fix-cause-invocation.test.mjs +19 -4
  236. package/scripts/cm-fix-command-correction.mjs +17 -0
  237. package/scripts/cm-fix-command-correction.test.mjs +211 -0
  238. package/scripts/cm-fix-cooperative-closeout.test.mjs +87 -0
  239. package/scripts/cm-fix-diagnosis-module-correction.test.mjs +217 -0
  240. package/scripts/cm-fix-drive.mjs +33 -5
  241. package/scripts/cm-fix-drive.test.mjs +49 -0
  242. package/scripts/cm-fix-host-review-assembly.test.mjs +197 -1
  243. package/scripts/cm-fix-host-review.test.mjs +21 -9
  244. package/scripts/cm-fix-host.mjs +26 -8
  245. package/scripts/cm-fix-monorepo-map.test.mjs +92 -0
  246. package/scripts/cm-fix-observation-task-id.test.mjs +122 -0
  247. package/scripts/cm-fix-regression-input-budget.test.mjs +111 -0
  248. package/scripts/cm-fix-repair-input-budget.test.mjs +119 -0
  249. package/scripts/cm-fix-review-file-paging.test.mjs +91 -0
  250. package/scripts/cm-fix-review-preflight.mjs +24 -0
  251. package/scripts/cm-fix-review-storage.test.mjs +233 -0
  252. package/scripts/cm-fix-review-verification-command.test.mjs +242 -0
  253. package/scripts/cm-fix-review-verification-evidence.test.mjs +218 -0
  254. package/scripts/cm-fix-review-verification-integration.test.mjs +81 -0
  255. package/scripts/cm-fix-review-verification-recovery.test.mjs +198 -0
  256. package/scripts/cm-fix-review-verification.test.mjs +146 -0
  257. package/scripts/cm-fix-revision-transport.test.mjs +81 -0
  258. package/scripts/cm-fix-source-correction.test.mjs +296 -0
  259. package/scripts/cm-fix-test-type-correction.mjs +18 -0
  260. package/scripts/cm-fix-test-type-correction.test.mjs +123 -0
  261. package/scripts/cm-fix-test-type-owner.test.mjs +208 -0
  262. package/scripts/cm-fix-test-type-verification-cost.test.mjs +66 -0
  263. package/scripts/cm-fix-type-import-correction.test.mjs +95 -0
  264. package/scripts/cm-fix-verification-diagnostic.test.mjs +200 -0
  265. package/scripts/cm-fix-verification-recovery.mjs +33 -0
  266. package/scripts/cm-host-diagnostic.test.mjs +33 -0
  267. package/scripts/cm-host-liveness.test.mjs +150 -0
  268. package/scripts/cm-host-qa-executor.test.mjs +77 -0
  269. package/scripts/cm-host-replay.test.mjs +176 -0
  270. package/scripts/cm-host-stage-observer.test.mjs +41 -0
  271. package/scripts/cm-install-local-edit-guard.test.mjs +621 -0
  272. package/scripts/cm-install-manifest.sh +351 -0
  273. package/scripts/cm-live-evidence.test.mjs +59 -1
  274. package/scripts/cm-log-event.mjs +61 -10
  275. package/scripts/cm-log-event.test.mjs +121 -1
  276. package/scripts/cm-matt-skills.mjs +576 -0
  277. package/scripts/cm-matt-skills.test.mjs +550 -0
  278. package/scripts/cm-notify-command.test.mjs +42 -10
  279. package/scripts/cm-notify.mjs +14 -10
  280. package/scripts/cm-notify.test.mjs +625 -75
  281. package/scripts/cm-patrol.mjs +4 -1
  282. package/scripts/cm-patrol.test.mjs +23 -5
  283. package/scripts/cm-prd-answer-gaps.test.mjs +2 -2
  284. package/scripts/cm-prd-completion.test.mjs +56 -13
  285. package/scripts/cm-prd-design-phase.test.mjs +78 -8
  286. package/scripts/cm-prd-draft-save.test.mjs +12 -0
  287. package/scripts/cm-prd-draft.test.mjs +1 -1
  288. package/scripts/cm-prd-drive.mjs +13 -6
  289. package/scripts/cm-prd-drive.test.mjs +46 -2
  290. package/scripts/cm-prd-gate-diagnostic.test.mjs +2 -2
  291. package/scripts/cm-prd-host.mjs +10 -5
  292. package/scripts/cm-prd-host.test.mjs +4 -2
  293. package/scripts/cm-prd-inputs-replaced.test.mjs +1 -1
  294. package/scripts/cm-prd-review-disposition.test.mjs +124 -8
  295. package/scripts/cm-prd-revision.test.mjs +1 -1
  296. package/scripts/cm-prd-self-check-revision.test.mjs +16 -1
  297. package/scripts/cm-prd-self-check-rules.test.mjs +239 -0
  298. package/scripts/cm-prd-self-check.test.mjs +105 -5
  299. package/scripts/cm-prd-session-recovery.test.mjs +5 -3
  300. package/scripts/cm-prd-summary.test.mjs +55 -3
  301. package/scripts/cm-prd-task-grouping.test.mjs +6 -6
  302. package/scripts/cm-prd-tree-digest.test.mjs +74 -0
  303. package/scripts/cm-refactor-drive.mjs +2 -1
  304. package/scripts/cm-refactor-drive.test.mjs +9 -0
  305. package/scripts/cm-release-smoke.sh +3 -15
  306. package/scripts/cm-skill-hints-autowire.test.mjs +394 -0
  307. package/scripts/cm-skill-hints-exam.mjs +149 -0
  308. package/scripts/cm-skill-hints-install.test.mjs +168 -0
  309. package/scripts/cm-skill-hints.exam.json +706 -0
  310. package/scripts/cm-skill-hints.json +119 -0
  311. package/scripts/cm-skill-hints.mjs +669 -0
  312. package/scripts/cm-skill-hints.test.mjs +831 -0
  313. package/scripts/cm-skill-judge.mjs +181 -0
  314. package/scripts/cm-skill-judge.test.mjs +255 -0
  315. package/scripts/cm-specs-status.test.mjs +4 -2
  316. package/scripts/cm-start-check.mjs +208 -0
  317. package/scripts/cm-start-check.test.mjs +321 -0
  318. package/scripts/cm-task-gate.mjs +150 -29
  319. package/scripts/cm-task-gate.test.mjs +73 -1
  320. package/scripts/cm-task-id-grammar.test.mjs +66 -0
  321. package/scripts/cm-task-scope.test.mjs +308 -0
  322. package/scripts/cm-test-suite.mjs +109 -0
  323. package/scripts/cm-test-suite.test.mjs +162 -0
  324. package/scripts/cm-upgrade-compat-batch.test.mjs +172 -0
  325. package/scripts/cm-upgrade-compat.test.mjs +239 -0
  326. package/scripts/cm-workflow-config.mjs +12 -2
  327. package/scripts/fixtures/fix-verification-claude.mjs +44 -0
  328. package/scripts/fixtures/host-diagnostic.mjs +33 -0
  329. package/scripts/fixtures/reviewed-integration.mjs +202 -0
  330. package/scripts/scan-public-safety.py +1 -0
  331. package/scripts/session-boundary.test.mjs +170 -0
  332. package/scripts/test-npm-install.py +14 -3
  333. package/scripts/test-shell-compat.sh +2 -0
  334. package/scripts/validate-public-repo.py +1 -0
  335. package/scripts/validate-test-cases.mjs +3 -2
  336. package/skills/cm-ai/SKILL.md +5 -2
  337. package/skills/cm-ai/references/N4-review.md +2 -1
  338. package/skills/cm-ai/references/N6-qa-eval.md +3 -1
  339. package/skills/cm-ai/references/N8-finish.md +22 -0
  340. package/skills/cm-ai/references/js-host-qa-recovery.md +1 -1
  341. package/skills/cm-ai/references/js-host-recovery.md +79 -3
  342. package/skills/cm-ai/references/js-host.md +89 -17
  343. package/skills/cm-challenge/SKILL.md +65 -0
  344. package/skills/cm-challenge/evals/README.md +18 -0
  345. package/skills/cm-challenge/evals/trigger-cases.json +20 -0
  346. package/skills/cm-challenge/evals/trigger-config.json +28 -0
  347. package/skills/cm-challenge/references/examples.md +15 -0
  348. package/skills/cm-check/SKILL.md +5 -0
  349. package/skills/cm-check/references/js-host.md +2 -0
  350. package/skills/cm-fix/SKILL.md +12 -3
  351. package/skills/cm-fix/references/command-correction.md +67 -0
  352. package/skills/cm-fix/references/isolated-review.md +54 -0
  353. package/skills/cm-fix/references/js-host.md +62 -2
  354. package/skills/cm-fix/references/test-type-correction.md +72 -0
  355. package/skills/cm-fix/references/verification-recovery.md +114 -0
  356. package/skills/cm-idea/SKILL.md +2 -0
  357. package/skills/cm-idea/references/js-host.md +2 -0
  358. package/skills/cm-notify/SKILL.md +2 -0
  359. package/skills/cm-prd/SKILL.md +12 -8
  360. package/skills/cm-prd/references/brownfield.md +8 -1
  361. package/skills/cm-prd/references/change-mode.md +6 -0
  362. package/skills/cm-prd/references/greenfield.md +4 -0
  363. package/skills/cm-prd/references/js-host.md +4 -2
  364. package/skills/cm-prd/references/spec-self-check.md +5 -1
  365. package/skills/cm-refactor/SKILL.md +8 -0
  366. package/skills/cm-refactor/references/js-host.md +2 -0
  367. package/skills/cm-test/SKILL.md +4 -0
  368. package/templates/dashboard/dashboard.html +2 -2
  369. package/templates/pixel/cm-pixel.html +1 -1
  370. package/templates/pixel/cm-pixel.sh +1 -1
  371. package/templates/pixel/dev/template.html +1 -1
  372. package/templates/statusline/cm-statusline.sh +1 -1
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import {readLaunchExecutionPolicy} from '../runtime/js/cm-ai/execution-policy.mjs';
3
+ import {assertDeclaredScope} from '../runtime/js/task-scope.mjs';
3
4
  import {readLaunchExternalModels} from '../runtime/js/cm-ai/external-model-launch.mjs';
4
5
  import {loadExternalModels,externalPair} from '../runtime/js/cm-ai/external-models.mjs';
5
6
  // Current-conversation host. Legacy keeps explicit attempt choices; v2 uses
@@ -24,6 +25,18 @@ import {readControlPolicyFile,withControlPolicyHost,readControlTarget} from '../
24
25
  import {readExecutionSnapshot} from '../runtime/js/cm-ai/execution-snapshot.mjs';
25
26
  import {parseModelJson} from '../runtime/js/cm-ai/model-configuration-file.mjs';
26
27
  export {executionFor as createConversationExecution,reviewConfiguration as readConversationReviewConfiguration,reviewConfigurationValue as readConversationReviewConfigurationValue};
28
+ export function readScopeRevisionFile(file){
29
+ const before=fs.lstatSync(file);
30
+ need(before.isFile()&&!before.isSymbolicLink()&&before.nlink===1&&before.size<=65536,'invalid_input');
31
+ const descriptor=fs.openSync(file,fs.constants.O_RDONLY|fs.constants.O_NOFOLLOW);
32
+ try{
33
+ const bytes=fs.readFileSync(descriptor),after=fs.fstatSync(descriptor),current=fs.lstatSync(file);
34
+ need([after,current].every(info=>['dev','ino','size','mtimeMs','ctimeMs'].every(key=>info[key]===before[key]))
35
+ &&bytes.length===before.size,'snapshot_changed');
36
+ return parseModelJson(new TextDecoder('utf-8',{fatal:true}).decode(bytes));
37
+ }finally{fs.closeSync(descriptor);}
38
+ }
39
+
27
40
  export function readLaunchControlFile(file){
28
41
  const before=fs.lstatSync(file);
29
42
  need(before.isFile()&&!before.isSymbolicLink()&&before.nlink===1&&before.size<=65536,'invalid_input');
@@ -32,7 +45,9 @@ export function readLaunchControlFile(file){
32
45
  const bytes=fs.readFileSync(descriptor),after=fs.fstatSync(descriptor),current=fs.lstatSync(file);
33
46
  need([after,current].every(info=>['dev','ino','size','mtimeMs','ctimeMs'].every(key=>info[key]===before[key]))
34
47
  &&bytes.length===before.size,'snapshot_changed');
35
- return readControlTarget(parseModelJson(new TextDecoder('utf-8',{fatal:true}).decode(bytes)));
48
+ const target=parseModelJson(new TextDecoder('utf-8',{fatal:true}).decode(bytes));
49
+ need(target!==null&&typeof target==='object'&&!Array.isArray(target),'invalid_input');
50
+ return readControlTarget(target);
36
51
  }finally{fs.closeSync(descriptor);}
37
52
  }
38
53
  export function withHandoffDiagnostic(host,error){
@@ -179,10 +194,11 @@ export async function main(argv=process.argv.slice(2),{input=process.stdin,outpu
179
194
  if(argv.length===1&&['--help','-h'].includes(argv[0]))output.write('--hold-revision: 本次启动在第 1 轮审查要求修改后停在 changes_requested(revision_answer_required),不发起第 2 轮开发意图;只缩小本次启动,不写入配置,下次不带它即继续修订。\n');
180
195
  if(argv.length===1&&['--help','-h'].includes(argv[0]))output.write('--allow-develop-redo: resume 原 run 后发送 develop_redo,request.reason 必须是单行且不超过 500 UTF-8 字节。当前会话开发(非受保护)的应答没拿到,或 provider 开发结果不明且存档记有 worker 进程身份(宿主先核对进程组已退出),pendingAction=develop_redo 时可用;操作员先确认会话已停止修改代码,宿主写入 develop-answer-redo 记录,之后 advance 重发本轮开发。旗标只消费一次,不写入配置。\n');
181
196
  if(argv.length===1&&['--help','-h'].includes(argv[0]))output.write('--allow-bootstrap-review-recovery: resume 原 run 后发送 bootstrap_review_recover;只在 bootstrap develop 已完成且审查包构建失败时核对现有文件、handoff 与原始证据,并追加恢复记录,不重新派发开发。\n');
182
- if(argv.length===1&&['--help','-h'].includes(argv[0]))output.write('--supersede-reviewed-evidence --supersede-reason REASON:仅新建同任务运行;旧运行都已终止且 tasks.md 未勾选时,先在新 journal 记授权,再归档旧审查证据。若保留直接前驱运行留下的代码漂移,可额外使用 --accept-superseded-code-drift;漂移文件会作为新运行的已有代码并记录当前 SHA-256。\n');
197
+ if(argv.length===1&&['--help','-h'].includes(argv[0]))output.write('--supersede-reviewed-evidence --supersede-reason REASON:仅新建同任务运行;旧运行都已终止且 tasks.md 未勾选时,先在新 journal 记授权,再归档旧审查证据。若保留直接前驱运行留下的代码漂移,可额外使用 --accept-superseded-code-drift;漂移文件会作为新运行的已有代码并记录当前 SHA-256。新版 --control-config 运行另须 --supersede-target FILE:文件保存旧运行 cm-ai-run.mjs inspect-history 返回的 supersedeTarget;旧运行在预览后变化则拒绝为 snapshot_changed,不自动替换目标。\n');
183
198
  if(argv.length===1&&['--help','-h'].includes(argv[0]))output.write('--rebind-spec-material --spec-rebind-reason REASON:仅 resume。规格经 cm-prd --change 重新批准后,若本任务的描述、验证要求、验收标准、设计摘录与测试用例都未变,只换绑批准哈希并写 specification-rebound 记录,已有开发与审查结论保留;内容有变则拒绝并列出变化。status 的 spec_drift 会说明是否可换绑。\n');
184
199
  if(argv.length===1&&['--help','-h'].includes(argv[0]))output.write('当前会话手动驱动请用 scripts/cm-ai-drive.mjs(批次 cm-ai-batch-drive.mjs;修复 cm-fix-drive.mjs;规格 cm-prd-drive.mjs);详情见 skills/cm-ai/references/js-host.md。\n');
185
200
  if(argv.length===1&&['--help','-h'].includes(argv[0]))output.write('External-model mode freezes one model/effort pair per provider. Unknown or invalid external results require reconciliation; automatic retries and abandonment are disabled. See docs/external-models.md.\n');
201
+ if(argv.length===1&&['--help','-h'].includes(argv[0]))output.write('--integration-evidence FILE --accept-integration-digest HEX:新版 resume 启动时接纳已审集成计划;须提供原 --expected-control FILE。本连接仅允许 status,不执行开发、审查或 QA。\n');
186
202
  if(argv.length===1&&['--help','-h'].includes(argv[0])){output.write(usage+'\nV2: replace --allow-development with --control-config FILE. Explicit resume QA reruns, QA configuration revisions and specification rebinds require --expected-control FILE containing the original status.launchControlTarget; ordinary host recovery uses status.controlTarget.\n');return 0;}
187
203
  let run,bridge;
188
204
  try{
@@ -216,8 +232,8 @@ export async function main(argv=process.argv.slice(2),{input=process.stdin,outpu
216
232
  const extra=new Map();
217
233
  for(let index=controlPolicy?9:8;index<argv.length;index++){
218
234
  const name=argv[index];refuse(!extra.has(name),'invalid_arguments',`参数重复:${name}`);
219
- refuse(['--expected-control','--execution-optimizations','--external-models','--external-models-config','--verification-precheck','--revise-qa-config','--qa-config-revision-reason','--qa-environment-failure','--supersede-reviewed-evidence','--supersede-reason','--accept-superseded-code-drift','--rebind-spec-material','--spec-rebind-reason','--original-host-context','--bootstrap-config','--allow-bootstrap-write','--protected-conversation-config','--protected-config','--allow-provider-development-attempt','--review-config','--allow-abandon-review','--allow-abandon-effect','--allow-bootstrap-review-recovery','--allow-develop-redo','--hold-revision','--workflow-config','--allow-qa','--browser-qa','--rerun-unknown-qa','--rerun-blocked-qa','--runtime','--review-runtime','--feature','--input-limit','--failover','--qa-fix-owner-config','--qa-fix-template-config','--qa-fix-review-config','--qa-fix-final-review-recovery-invocation','--allow-qa-fix-start','--auto-qa-fix',...fixLocalPermissions.keys()].includes(name),'invalid_arguments',`未知参数:${name}`);
220
- if(['--execution-optimizations','--external-models','--verification-precheck','--supersede-reviewed-evidence','--accept-superseded-code-drift','--rebind-spec-material','--allow-bootstrap-write','--allow-qa','--allow-abandon-review','--allow-abandon-effect','--allow-bootstrap-review-recovery','--allow-develop-redo','--hold-revision','--rerun-unknown-qa','--rerun-blocked-qa','--failover','--allow-qa-fix-start','--auto-qa-fix',...fixLocalPermissions.keys()].includes(name))extra.set(name,true);
235
+ refuse(['--integration-evidence','--accept-integration-digest','--revise-scope','--scope-revision-reason','--development-rework','--development-rework-reason','--expected-control','--execution-optimizations','--external-models','--external-models-config','--verification-precheck','--revise-qa-config','--qa-config-revision-reason','--qa-environment-failure','--supersede-reviewed-evidence','--supersede-reason','--supersede-target','--accept-superseded-code-drift','--rebind-spec-material','--spec-rebind-reason','--original-host-context','--bootstrap-config','--allow-bootstrap-write','--protected-conversation-config','--protected-config','--allow-provider-development-attempt','--review-config','--allow-abandon-review','--allow-abandon-effect','--allow-bootstrap-review-recovery','--allow-develop-redo','--hold-revision','--workflow-config','--allow-qa','--browser-qa','--rerun-unknown-qa','--rerun-blocked-qa','--runtime','--review-runtime','--feature','--input-limit','--failover','--qa-fix-owner-config','--qa-fix-template-config','--qa-fix-review-config','--qa-fix-final-review-recovery-invocation','--allow-qa-fix-start','--auto-qa-fix',...fixLocalPermissions.keys()].includes(name),'invalid_arguments',`未知参数:${name}`);
236
+ if(['--development-rework','--execution-optimizations','--external-models','--verification-precheck','--supersede-reviewed-evidence','--accept-superseded-code-drift','--rebind-spec-material','--allow-bootstrap-write','--allow-qa','--allow-abandon-review','--allow-abandon-effect','--allow-bootstrap-review-recovery','--allow-develop-redo','--hold-revision','--rerun-unknown-qa','--rerun-blocked-qa','--failover','--allow-qa-fix-start','--auto-qa-fix',...fixLocalPermissions.keys()].includes(name))extra.set(name,true);
221
237
  else{refuse(typeof argv[index+1]==='string'&&!argv[index+1].startsWith('--'),'invalid_arguments',`${name} 需要一个值`);extra.set(name,argv[++index]);}
222
238
  }
223
239
  if(controlPolicy){
@@ -229,21 +245,42 @@ export async function main(argv=process.argv.slice(2),{input=process.stdin,outpu
229
245
  refuse(controlPolicy.qaFix!=='disabled'||!['--qa-fix-owner-config','--qa-fix-template-config'].some(flag=>extra.has(flag)),
230
246
  'invalid_arguments','加载 QA 修复配置必须选择 manual 或 auto 模式。');
231
247
  refuse(!extra.has('--auto-qa-fix')||controlPolicy.qaFix==='auto','invalid_input','自动 QA 修复需要 qaFix:auto。');
248
+ // V2 supersede binds the predecessor state the operator previewed; it never
249
+ // refreshes the target or archives a run whose state moved after approval.
232
250
  refuse(!['--supersede-reviewed-evidence','--supersede-reason','--accept-superseded-code-drift']
233
- .some(flag=>extra.has(flag)),'supersede_unavailable',
234
- '新版启动入口暂不作废旧运行;保留现场,不自动更新目标后换运行。');
235
- }
251
+ .some(flag=>extra.has(flag))||argv[4]==='create'&&extra.has('--supersede-target'),'supersede_unavailable',
252
+ '新版重开需要 --mode create 与 --supersede-target FILE(保存旧运行 inspect-history 返回的 supersedeTarget);目标变化时先核对,不自动替换。');
253
+ refuse(!extra.has('--supersede-target')||extra.has('--supersede-reviewed-evidence'),'invalid_input',
254
+ '--supersede-target 只与 --supersede-reviewed-evidence、--supersede-reason 一起用于新版 create 重开。');
255
+ }else refuse(!extra.has('--supersede-target'),'invalid_arguments','--supersede-target 只用于新版 --control-config 的 create 重开。');
236
256
  const qaEnabled=controlPolicy?controlPolicy.qa==='run':extra.has('--allow-qa');
237
257
  const fixEnabled=controlPolicy?controlPolicy.qaFix!=='disabled':extra.has('--allow-qa-fix-start');
238
258
  const autoFix=controlPolicy?controlPolicy.qaFix==='auto':extra.has('--auto-qa-fix');
239
259
  const recoveryEnabled=flag=>controlPolicy?argv[4]==='resume':extra.has(flag);
240
- const launchRecovery=['--revise-qa-config','--qa-config-revision-reason','--rerun-unknown-qa','--rerun-blocked-qa',
241
- '--rebind-spec-material','--spec-rebind-reason'].some(flag=>extra.has(flag));
260
+ const launchRecovery=['--integration-evidence','--accept-integration-digest','--revise-qa-config','--qa-config-revision-reason','--rerun-unknown-qa','--rerun-blocked-qa',
261
+ '--rebind-spec-material','--spec-rebind-reason','--revise-scope','--scope-revision-reason','--development-rework','--development-rework-reason'].some(flag=>extra.has(flag));
242
262
  refuse(!extra.has('--expected-control')||(controlPolicy&&launchRecovery&&argv[4]==='resume'),'invalid_input',
243
- '--expected-control 仅用于新版 --mode resume 的显式 QA 恢复、QA 配置修订或规格重绑。');
263
+ '--expected-control 仅用于新版 --mode resume 的显式启动恢复。');
244
264
  if(controlPolicy&&launchRecovery)refuse(argv[4]==='resume'&&extra.has('--expected-control'),'invalid_input',
245
265
  '启动恢复需要 --mode resume 与 --expected-control FILE,文件须保存原 status 的 launchControlTarget;目标变化时先核对,不能自动替换。');
246
266
  const expectedControl=extra.has('--expected-control')?readLaunchControlFile(extra.get('--expected-control')):null;
267
+ const scopeRequested=extra.has('--revise-scope')||extra.has('--scope-revision-reason');
268
+ const reworkRequested=extra.has('--development-rework')||extra.has('--development-rework-reason');
269
+ refuse(!scopeRequested&&!reworkRequested||controlPolicy&&argv[4]==='resume'
270
+ &&(!scopeRequested||extra.has('--revise-scope')&&extra.has('--scope-revision-reason'))
271
+ &&(!reworkRequested||extra.has('--development-rework')&&extra.has('--development-rework-reason')),'invalid_input');
272
+ const scopeRevision=scopeRequested?{scope:readScopeRevisionFile(extra.get('--revise-scope')),reason:extra.get('--scope-revision-reason')}:null;
273
+ const supersedeTarget=extra.has('--supersede-target')?readLaunchControlFile(extra.get('--supersede-target')):null;
274
+ const integrationRequested=extra.has('--integration-evidence')||extra.has('--accept-integration-digest');
275
+ refuse(!integrationRequested||controlPolicy&&argv[4]==='resume'&&extra.has('--integration-evidence')
276
+ &&extra.has('--accept-integration-digest')&&/^[a-f0-9]{64}$/.test(extra.get('--accept-integration-digest'))
277
+ &&!['--revise-scope','--scope-revision-reason','--development-rework','--development-rework-reason',
278
+ '--revise-qa-config','--qa-config-revision-reason','--rerun-unknown-qa','--rerun-blocked-qa','--qa-environment-failure',
279
+ '--rebind-spec-material','--spec-rebind-reason','--supersede-reviewed-evidence','--supersede-reason',
280
+ '--supersede-target','--accept-superseded-code-drift','--hold-revision'].some(flag=>extra.has(flag)),
281
+ 'invalid_input','受控集成接纳需要新版 resume、成对证据与批准摘要及原 launchControlTarget;不得并用其他恢复。');
282
+ const reviewedIntegration=integrationRequested?{evidenceFile:path.resolve(extra.get('--integration-evidence')),
283
+ expectedDigest:extra.get('--accept-integration-digest')}:null;
247
284
  let inputLimit;
248
285
  try{inputLimit=parseHostInputLimit(extra.get('--input-limit'));}
249
286
  catch(error){refuse(error.code!=='invalid_arguments','invalid_arguments','--input-limit 须为 65536–4194304 的整数字节数');throw error;}
@@ -303,7 +340,7 @@ export async function main(argv=process.argv.slice(2),{input=process.stdin,outpu
303
340
  definition={...definition,featureSelection:{version:1,feature:definition.feature}};
304
341
  }
305
342
  // Before any frozen model/policy configuration, execution or journal write.
306
- if(argv[4]==='create'&&bootstrap===null)assertCreatableScope(definition.scope);
343
+ if(argv[4]==='create'&&bootstrap===null){assertCreatableScope(definition.scope);assertDeclaredScope(definition);}
307
344
  const boundRuntime=extra.get('--runtime')??'codex';
308
345
  const routes=extra.has('--protected-config')?resolveProtectedRuntimes(loadConfig({projectRoot:definition.codeProject}),boundRuntime):{reviewerRuntime:boundRuntime};
309
346
  const executionPolicy=readLaunchExecutionPolicy({definition,mode:argv[4],enabled:extra.has('--execution-optimizations')});
@@ -352,10 +389,10 @@ export async function main(argv=process.argv.slice(2),{input=process.stdin,outpu
352
389
  ?await protectedExecutionFor(definition,argv[6],extra,review,argv[4],workflow,bridge,bootstrap,externalModels,executionPolicy,controlPolicy)
353
390
  :executionFor(definition,argv[6],bridge,review,null,workflow,qaEnabled,runtime,
354
391
  {...(controlPolicy?{controlPolicy}:{}),...(extra.has('--review-runtime')?{reviewRuntime:extra.get('--review-runtime')}:{}),...(executionPolicy?{executionPolicy}:{}),...(externalModels?{externalModels}:{}),...(extra.has('--verification-precheck')?{verificationPrecheck:true}:{}),...(extra.has('--original-host-context')?{originalHostContextId:extra.get('--original-host-context')}:{}),...(protection?{protection}:{}),...(bootstrap?{bootstrap:{...bootstrap,allowWrite:(controlPolicy?controlPolicy.bootstrap==='write':extra.has('--allow-bootstrap-write'))}}:{})});
355
- run=await openControlRun(definition,argv[4],execution,{qaConfigRevision,rerunUnknownQa:extra.has('--rerun-unknown-qa'),rerunBlockedQa:extra.has('--rerun-blocked-qa'),qaEnvironmentFailure:extra.get('--qa-environment-failure')??null,supersedeReason:extra.get('--supersede-reason')??null,acceptSupersededCodeDrift:extra.has('--accept-superseded-code-drift'),allowAbandonReview:recoveryEnabled('--allow-abandon-review'),allowAbandonEffect:recoveryEnabled('--allow-abandon-effect'),allowBootstrapReviewRecovery:recoveryEnabled('--allow-bootstrap-review-recovery'),allowDevelopRedo:recoveryEnabled('--allow-develop-redo'),...(extra.has('--hold-revision')?{holdRevision:true}:{}),specRebindReason:extra.get('--spec-rebind-reason')??null,expectedControl});
392
+ run=await openControlRun(definition,argv[4],execution,{reviewedIntegration,qaConfigRevision,rerunUnknownQa:extra.has('--rerun-unknown-qa'),rerunBlockedQa:extra.has('--rerun-blocked-qa'),qaEnvironmentFailure:extra.get('--qa-environment-failure')??null,supersedeReason:extra.get('--supersede-reason')??null,acceptSupersededCodeDrift:extra.has('--accept-superseded-code-drift'),allowAbandonReview:recoveryEnabled('--allow-abandon-review'),allowAbandonEffect:recoveryEnabled('--allow-abandon-effect'),allowBootstrapReviewRecovery:recoveryEnabled('--allow-bootstrap-review-recovery'),allowDevelopRedo:recoveryEnabled('--allow-develop-redo'),...(extra.has('--hold-revision')?{holdRevision:true}:{}),scopeRevision,developmentReworkReason:extra.get('--development-rework-reason')??null,specRebindReason:extra.get('--spec-rebind-reason')??null,expectedControl,supersedeTarget});
356
393
  }
357
394
  if(run.blocked){output.write(JSON.stringify({outcome:'blocked',admission:run.blocked})+'\n');return 1;}
358
- if(hasFix){
395
+ if(hasFix&&reviewedIntegration===null){
359
396
  need(fs.realpathSync(fix.specsRoot)===fs.realpathSync(definition.specsDir)
360
397
  &&fs.realpathSync(fix.configuration.reproduction.cwd)===fs.realpathSync(definition.codeProject)
361
398
  &&(templated?fix.feature:fix.configuration.qaSource.feature)===definition.feature,'qa_fix_source_mismatch');
@@ -364,9 +401,9 @@ export async function main(argv=process.argv.slice(2),{input=process.stdin,outpu
364
401
  let fixPermissions=[...fixLocalPermissions].filter(([flag])=>controlPolicy
365
402
  ?!['test-author','repair','cause-review','final-review'].some(name=>flag.endsWith('-'+name))
366
403
  :extra.has(flag)).map(([,permission])=>permission);
367
- const fixRuntime=fix.configuration.runtime??'codex';
368
- const fixModels=externalModels?selectExternalModels(externalModels,[fixRuntime]):null;
369
- const fixReview=extra.has('--qa-fix-review-config')?reviewConfiguration(extra.get('--qa-fix-review-config'),fixModels?.providers[fixRuntime]??null):null;
404
+ const fixRuntime=fix.configuration.runtime??'codex',fixReviewRuntime=fix.configuration.reviewRuntime??fixRuntime;
405
+ const fixModels=externalModels?selectExternalModels(externalModels,[fixReviewRuntime]):null;
406
+ const fixReview=extra.has('--qa-fix-review-config')?reviewConfiguration(extra.get('--qa-fix-review-config'),fixModels?.providers[fixReviewRuntime]??null):null;
370
407
  if(controlPolicy&&fixReview)fixPermissions.push(...[...fixLocalPermissions]
371
408
  .filter(([flag])=>flag.endsWith('-cause-review')||flag.endsWith('-final-review')
372
409
  ||fix.configuration.testAuthor&&flag.endsWith('-test-author')||fix.configuration.repair&&flag.endsWith('-repair'))
@@ -374,10 +411,10 @@ export async function main(argv=process.argv.slice(2),{input=process.stdin,outpu
374
411
  need(!fixPermissions.includes('--allow-test-author')||(fix.configuration.testAuthor&&fixReview),'test_author_configuration_required');
375
412
  need(!fixPermissions.includes('--allow-repair')||(fix.configuration.repair&&fixReview),'repair_configuration_required');
376
413
  const fixReviewHost=createFixReviewHost({codeProject:definition.codeProject,
377
- hostContextId:argv[6],runtime:fix.configuration.runtime??'codex',
414
+ hostContextId:argv[6],runtime:fixRuntime,reviewRuntime:fix.configuration.reviewRuntime,verification:fix.configuration.reviewVerification??null,
378
415
  review:fixReview,permissions:fixPermissions,externalModels:fixModels,executionPolicy,specsDir:definition.specsDir});
379
416
  if(fixModels||executionPolicy){
380
- if(fixModels&&fix.configuration.causeReview)need(fix.configuration.causeReview.requestedModel===fixModels.providers[fixRuntime].model&&fix.configuration.causeReview.provider===fixRuntime,'external_model_pair_conflict');
417
+ if(fixModels&&fix.configuration.causeReview)need(fix.configuration.causeReview.requestedModel===fixModels.providers[fixReviewRuntime].model&&fix.configuration.causeReview.provider===fixReviewRuntime,'external_model_pair_conflict');
381
418
  if(fixReview){
382
419
  // Preserve explicit reviewer contexts/exclusions; changing them changes the durable run.
383
420
  need(!fix.configuration.causeReview||digest(fix.configuration.causeReview)===digest(fixReviewHost.reviewer),'qa_fix_review_configuration_mismatch');
@@ -397,7 +434,11 @@ export async function main(argv=process.argv.slice(2),{input=process.stdin,outpu
397
434
  const rawMode=input.isTTY&&typeof input.setRawMode==='function';if(rawMode)input.setRawMode(true);
398
435
  const controlled=controlPolicy?withControlPolicyHost(run.host,{identity:definition.identity,
399
436
  snapshot:()=>readExecutionSnapshot({specsRoot:definition.specsDir,identity:{repositoryId:definition.identity.repositoryId,runId:definition.identity.runId}}),launchTarget:controlLaunchTarget}):run.host;
400
- const diagnosticHost=withHandoffDiagnostic(controlled,error);
437
+ const launchHost=reviewedIntegration===null?controlled:{...controlled,async handle(request){
438
+ if(request.operation!=='status')return {outcome:'rejected',code:'integration_launch_status_only'};
439
+ return controlled.handle(request);
440
+ }};
441
+ const diagnosticHost=withHandoffDiagnostic(launchHost,error);
401
442
  try{await serveHostTransport({host:diagnosticHost,input,output,toolBridge:bridge,errorOutput:error},extra.get('--input-limit'));}
402
443
  finally{if(rawMode)input.setRawMode(false);}
403
444
  return 0;
@@ -597,3 +597,18 @@ test('ordinary CLI accepts --review-runtime claude under a Codex host and refuse
597
597
  }finally{fs.rmSync(f.root,{recursive:true,force:true});}
598
598
  }
599
599
  });
600
+
601
+ // Diagnostics must survive a real child startup failure without printing its inputs.
602
+ test('host fixture startup failure retains bounded process diagnostics',async()=>{
603
+ const f=fixture();
604
+ try{
605
+ f.args.push('--synthetic-unknown-option');
606
+ const result=await runCli(f,'normal');
607
+ assert.equal(result.code,1);
608
+ assert.equal(result.diagnostic.exitCode,1);
609
+ assert.equal(result.diagnostic.lastOperation,'advance');
610
+ assert.equal(result.diagnostic.timeoutMs,Number(process.env.CM_TEST_FIXTURE_TIMEOUT_MS??60000));
611
+ assert(result.diagnostic.stderrBytes>0);
612
+ assert(!JSON.stringify(result.diagnostic).includes(f.root));
613
+ }finally{fs.rmSync(f.root,{recursive:true,force:true});}
614
+ });
@@ -0,0 +1,223 @@
1
+ // Synthetic protocol fixtures only: these observations are not an independent
2
+ // review of this change and must never be used as product approval evidence.
3
+ import test,{after} from 'node:test';
4
+ import assert from 'node:assert/strict';
5
+ import fs from 'node:fs';
6
+ import os from 'node:os';
7
+ import path from 'node:path';
8
+ import {digest} from '../runtime/js/cm-ai/effect-contract.mjs';
9
+ import {readRunnerHistory} from '../runtime/js/cm-ai/durable-runner-state.mjs';
10
+ import {readIntegrationPlan,validateIntegrationRecord,previewReviewedIntegration,readIntegrationEvidence,verifyReviewedIntegration}
11
+ from '../runtime/js/cm-ai/reviewed-integration.mjs';
12
+ import {canonical,sha,createReviewedIntegrationFixture,syntheticIntegrationReview} from './fixtures/reviewed-integration.mjs';
13
+
14
+ let shared;
15
+ const cleanup=[];
16
+ const sharedFixture=()=>shared??=(async()=>{
17
+ let timer;
18
+ const deadline=new Promise((_,reject)=>{timer=setTimeout(()=>reject(new Error('Shared fixture preparation exceeded 90000 ms')),90000);});
19
+ try{return await Promise.race([createReviewedIntegrationFixture({after:fn=>cleanup.push(fn)},{unrelated:true,premature:true}),deadline]);}
20
+ finally{clearTimeout(timer);}
21
+ })();
22
+ after(()=>{for(const fn of cleanup.reverse())fn();});
23
+
24
+ const rejectPreview=(input,message)=>{
25
+ const result=previewReviewedIntegration(input);
26
+ assert.equal(result.eligibleForAdoption,false,message??JSON.stringify(result));
27
+ assert.notEqual(result.code,'integration_review_required',message??JSON.stringify(result));
28
+ return result;
29
+ };
30
+ const rejectOwner=action=>{
31
+ let result;
32
+ try{result=action();}catch(error){assert.equal(typeof error.code,'string');return;}
33
+ assert.equal(result?.outcome,'rejected',JSON.stringify(result));
34
+ };
35
+ function reseal(records){
36
+ let previous=null;
37
+ return structuredClone(records).map(row=>{
38
+ const {digest:old,...body}=row;body.previousDigest=previous;
39
+ const result={...body,digest:digest(body)};previous=result.digest;return result;
40
+ });
41
+ }
42
+
43
+ test('a reviewed integration plan retains exact source identities without an alias field',()=>{
44
+ const plan={version:1,kind:'cm-reviewed-integration-v1',author:{provider:'codex',contextId:'synthetic-integration-author'},
45
+ target:{identity:{repositoryId:'oldrepo',runId:'parent-run',taskId:'T-001',attempt:1},
46
+ rootDigest:'a'.repeat(64),baselineDigest:'b'.repeat(64),packageDigest:'c'.repeat(64),recordCount:1,lastDigest:'d'.repeat(64)},
47
+ sources:[{identity:{repositoryId:'oldrepo',runId:'source-run',taskId:'T-002',attempt:1},
48
+ root:fs.realpathSync(os.tmpdir()),revision:'e'.repeat(64),packageDigest:'f'.repeat(64)}],documents:[]};
49
+ assert.deepEqual(readIntegrationPlan(plan),plan);
50
+ assert.throws(()=>readIntegrationPlan({...plan,alias:{oldrepo:'newrepo'}}));
51
+ assert.throws(()=>readIntegrationPlan({...plan,sources:[plan.sources[0],plan.sources[0]]}));
52
+ assert.throws(()=>readIntegrationPlan({...plan,sources:[{...plan.sources[0],identity:plan.target.identity}]}));
53
+ assert.throws(()=>readIntegrationPlan({...plan,sources:[{...plan.sources[0],identity:{...plan.sources[0].identity,attempt:0}}]}));
54
+ assert.throws(()=>readIntegrationPlan({...plan,sources:Array.from({length:65},(_,i)=>({...plan.sources[0],
55
+ identity:{...plan.sources[0].identity,runId:`source-${i}`}}))}));
56
+ for(const name of ['../docs/guide.md','src/guide.md','docs/guide.js','/docs/guide.md']){
57
+ const descriptor={path:name,type:'file',mode:0o644,size:1,sha256:'a'.repeat(64)};
58
+ assert.throws(()=>readIntegrationPlan({...plan,documents:[{path:name,before:descriptor,after:descriptor}]}));
59
+ }
60
+ });
61
+
62
+ // The first fixture user owns the existing 90 s preparation budget plus its
63
+ // original 30 s test-body allowance; product invocation budgets are unchanged.
64
+ test('pure acceptance binds the original prefix and preserves original baseline and package',{timeout:120000},async t=>{
65
+ const f=await sharedFixture(),before=structuredClone(f.input.records);
66
+ const validate=record=>validateIntegrationRecord({record,baseline:f.input.baseline,parentPackage:f.input.parentPackage,records:before});
67
+ assert.doesNotThrow(()=>validate(f.record));assert.deepEqual(f.input.records,before);
68
+ for(const change of [record=>record.plan.target.recordCount++,record=>record.plan.target.lastDigest='0'.repeat(64),
69
+ record=>record.plan.target.baselineDigest='0'.repeat(64),record=>record.plan.target.packageDigest='0'.repeat(64),
70
+ record=>record.plan.target.rootDigest='0'.repeat(64),record=>record.plan.target.identity.attempt++,
71
+ record=>record.reason='',record=>record.reviewFile.sha256='invalid']){
72
+ const record=structuredClone(f.record);change(record);record.planDigest=digest(record.plan);assert.throws(()=>validate(record));
73
+ }
74
+ assert.throws(()=>validate({...f.record,planDigest:'0'.repeat(64)}));
75
+ assert.throws(()=>validateIntegrationRecord({record:f.record,baseline:f.input.baseline,
76
+ parentPackage:f.input.parentPackage,records:before.slice(0,-1)}));
77
+ });
78
+
79
+ test('preview requires review only after the whole mapped tree matches and never changes the run',{timeout:30000},async t=>{
80
+ const f=await sharedFixture(),bytes=fs.readFileSync(f.statePath('parent')),calls={...f.calls};
81
+ const before=previewReviewedIntegration({...f.input,review:null});
82
+ assert.equal(before.eligibleForAdoption,false);assert.equal(before.code,'integration_review_required');
83
+ const ready=previewReviewedIntegration(f.input);
84
+ assert.equal(ready.eligibleForAdoption,true,JSON.stringify(ready));assert.equal(ready.planDigest,digest(f.plan));assert.equal(ready.sourceCount,2);
85
+ assert.doesNotThrow(()=>verifyReviewedIntegration(f.input));
86
+ assert.equal(f.history('parent').saved.records[0].payload.config.developer.provider,'claude');
87
+ assert.equal(f.plan.author.provider,'codex');assert.equal(f.review.registration.request.provider,'claude');
88
+ for(let n=0;n<48;n++)f.write(`extra-${String(n).padStart(2,'0')}.mjs`,'// unreviewed\n');
89
+ const extras=rejectPreview(f.input);assert(extras.paths.includes('extra-47.mjs'),JSON.stringify(extras));
90
+ for(let n=0;n<48;n++)fs.unlinkSync(path.join(f.codeProject,`extra-${String(n).padStart(2,'0')}.mjs`));
91
+ f.write('docs/guide.md',f.documents['docs/guide.md'].after+' ');
92
+ assert(rejectPreview(f.input).paths.includes('docs/guide.md'));
93
+ f.write('docs/guide.md',f.documents['docs/guide.md'].after);
94
+ if(process.platform!=='win32'){
95
+ fs.chmodSync(path.join(f.codeProject,'source.mjs'),0o755);rejectPreview(f.input);fs.chmodSync(path.join(f.codeProject,'source.mjs'),0o644);
96
+ }
97
+ assert.equal(previewReviewedIntegration(f.input).eligibleForAdoption,true);
98
+ assert.deepEqual(fs.readFileSync(f.statePath('parent')),bytes);assert.deepEqual(f.calls,calls);
99
+ });
100
+
101
+ test('sources stay fixed to completed snapshots, exact identity and the original Git repository',{timeout:30000},async t=>{
102
+ const f=await sharedFixture(),base={...f.input,review:null};
103
+ const withSource=source=>({...base,plan:{...f.plan,sources:[source,f.plan.sources[1]]}});
104
+ const source=f.plan.sources[0];
105
+ for(const altered of [{...source,revision:'0'.repeat(64)},{...source,packageDigest:'0'.repeat(64)},
106
+ {...source,identity:{...source.identity,repositoryId:'arbitrary-alias'}},
107
+ {...source,identity:{...source.identity,taskId:'T-other'}},{...source,root:f.codeProject}])rejectPreview(withSource(altered));
108
+ const alias=path.join(f.root,'source-alias');fs.symlinkSync(f.sourceRoot,alias);
109
+ rejectPreview(withSource({...source,root:alias}));
110
+ // Keep the same source path and its real completed snapshot. Remove only its
111
+ // worktree registration, then point .git directly at the target common dir.
112
+ // Root/package/snapshot bindings still match; commonDir equality alone would
113
+ // incorrectly accept this unregistered directory.
114
+ const gitFile=path.join(f.sourceRoot,'.git'),gitBytes=fs.readFileSync(gitFile);
115
+ const admin=fs.realpathSync(path.resolve(f.sourceRoot,gitBytes.toString('utf8').trim().slice('gitdir: '.length)));
116
+ const heldAdmin=path.join(f.root,'held-worktree-admin');fs.renameSync(admin,heldAdmin);
117
+ fs.writeFileSync(gitFile,`gitdir: ${path.join(f.codeProject,'.git')}\n`);
118
+ try{rejectPreview(base,'sharing commonDir without a registered worktree is insufficient');}
119
+ finally{fs.writeFileSync(gitFile,gitBytes);fs.renameSync(heldAdmin,admin);}
120
+ const unrelated=f.makePlan('parent',['unrelated','renamed']);
121
+ rejectPreview({...base,plan:unrelated},'a separately initialized Git repository cannot be mapped by file equality');
122
+ const complete=fs.readFileSync(f.statePath('cross'));
123
+ fs.writeFileSync(f.statePath('cross'),f.approvedBytes.cross);
124
+ const approved=JSON.parse(f.approvedBytes.cross);
125
+ rejectPreview(withSource({...source,revision:approved.revision}),'approved but incomplete is not a delivered source');
126
+ fs.writeFileSync(f.statePath('cross'),complete);
127
+ const renameFile=f.statePath('rename'),held=renameFile+'.held';
128
+ fs.renameSync(renameFile,held);
129
+ try{rejectPreview(base,'new repository identity needs the completed old-name to new-name package');}
130
+ finally{fs.renameSync(held,renameFile);}
131
+ assert.equal(previewReviewedIntegration(f.input).eligibleForAdoption,true);
132
+ });
133
+
134
+ test('a later rename cannot retroactively authorize a source using the new repository identity',{timeout:30000},async t=>{
135
+ const f=await sharedFixture();
136
+ rejectPreview({...f.input,plan:f.makePlan('parent',['cross','premature']),review:null});
137
+ });
138
+
139
+ test('evidence reader rejects links, duplicate keys and noncanonical bytes',{timeout:30000},async t=>{
140
+ const f=await sharedFixture(),original=fs.readFileSync(f.evidenceFile);
141
+ assert.deepEqual(readIntegrationEvidence(f.evidenceFile),{plan:f.plan,review:f.review});
142
+ for(const bytes of [JSON.stringify({plan:f.plan,review:f.review}),JSON.stringify({plan:f.plan,review:f.review},null,2)+'\n',
143
+ canonical({plan:f.plan,review:f.review}).replace('{"plan":','{"plan":null,"plan":')]){
144
+ fs.writeFileSync(f.evidenceFile,bytes);assert.throws(()=>readIntegrationEvidence(f.evidenceFile));
145
+ }
146
+ fs.writeFileSync(f.evidenceFile,original);
147
+ const hardlink=path.join(f.root,'evidence-hardlink.json');fs.linkSync(f.evidenceFile,hardlink);
148
+ assert.throws(()=>readIntegrationEvidence(f.evidenceFile));fs.unlinkSync(hardlink);
149
+ const symlink=path.join(f.root,'evidence-symlink.json');fs.symlinkSync(f.evidenceFile,symlink);
150
+ assert.throws(()=>readIntegrationEvidence(symlink));
151
+ assert.deepEqual(readIntegrationEvidence(f.evidenceFile),{plan:f.plan,review:f.review});
152
+ });
153
+
154
+ test('review binds current author, exact plan bytes, document transforms and mechanical verification',{timeout:30000},async t=>{
155
+ const f=await sharedFixture();
156
+ const stalePlan={...f.plan,target:{...f.plan.target,recordCount:f.plan.target.recordCount+1}};
157
+ const staleReview=await syntheticIntegrationReview(f.root,stalePlan,f.documents);
158
+ rejectPreview({...f.input,review:staleReview},'a valid review of another target cannot authorize this plan');
159
+ const wrongDocuments={'docs/guide.md':{...f.documents['docs/guide.md'],after:'Different reviewed bytes\n'}};
160
+ const wrongReview=await syntheticIntegrationReview(f.root,f.plan,wrongDocuments);
161
+ rejectPreview({...f.input,review:wrongReview},'a separately reviewed document cannot supply different after bytes');
162
+ const legacy=await syntheticIntegrationReview(f.root,f.plan,f.documents,{includeVerification:false});
163
+ rejectPreview({...f.input,review:legacy},'approved without the required isolated verification evidence is insufficient');
164
+ const reused=await syntheticIntegrationReview(f.root,f.plan,f.documents,{threadId:'synthetic-parent-review-thread'});
165
+ rejectPreview({...f.input,review:reused},'a valid observation cannot reuse the historical parent provider thread');
166
+ for(const change of [review=>delete review.result.verification,review=>review.result.verification.packageDigest='0'.repeat(64),
167
+ review=>review.configuration.hostContextId='another-author',review=>review.started='synthetic-parent-review-thread']){
168
+ const review=structuredClone(f.review);change(review);rejectPreview({...f.input,review});
169
+ }
170
+ const sameProviderPlan={...f.plan,author:{...f.plan.author,provider:'claude'}};
171
+ assert.throws(()=>readIntegrationPlan(sameProviderPlan));
172
+ assert.equal(previewReviewedIntegration(f.input).eligibleForAdoption,true);
173
+ });
174
+
175
+ test('original owner accepts once, replay retains all history and live drift blocks without refunding calls',{timeout:30000},async t=>{
176
+ const f=await sharedFixture(),before=f.history('parent'),bytes=fs.readFileSync(f.statePath('parent')),
177
+ tasks=fs.readFileSync(path.join(f.specsDir,f.definitions.parent.feature,'tasks.md')),calls={...f.calls};
178
+ let run=await f.openParent();
179
+ try{
180
+ assert.equal(typeof run.host.acceptReviewedIntegration,'function');
181
+ const args={allowed:true,evidenceFile:f.evidenceFile,expectedDigest:digest(f.plan)};
182
+ rejectOwner(()=>run.host.acceptReviewedIntegration({...args,allowed:false}));
183
+ rejectOwner(()=>run.host.acceptReviewedIntegration({...args,expectedDigest:'0'.repeat(64)}));
184
+ assert.deepEqual(fs.readFileSync(f.statePath('parent')),bytes);
185
+ const accepted=run.host.acceptReviewedIntegration(args);assert.equal(accepted.state,'fixture_completed',JSON.stringify(accepted));
186
+ const after=f.history('parent');
187
+ assert.equal(after.saved.records.length,before.saved.records.length+1);
188
+ assert.deepEqual(after.saved.records.slice(0,-1),before.saved.records);
189
+ assert.deepEqual(after.state,before.state);assert.deepEqual(after.original,before.original);
190
+ assert.deepEqual(after.saved.identity,before.saved.identity);assert.deepEqual(after.saved.fingerprints,before.saved.fingerprints);
191
+ const added=after.saved.records.at(-1);assert.equal(added.payload.type,'reviewed-integration-accepted');
192
+ assert.equal(added.payload.record.reviewFile.sha256,sha(fs.readFileSync(f.evidenceFile)));
193
+ const adopted=fs.readFileSync(f.statePath('parent'));
194
+ assert.equal(run.host.acceptReviewedIntegration(args).state,'fixture_completed');
195
+ assert.deepEqual(fs.readFileSync(f.statePath('parent')),adopted);
196
+ for(const change of [record=>record.plan.target.recordCount++,record=>record.plan.target.lastDigest='0'.repeat(64),
197
+ record=>record.reason='',record=>record.planDigest='0'.repeat(64)]){
198
+ const records=structuredClone(after.saved.records);change(records.at(-1).payload.record);
199
+ assert.throws(()=>readRunnerHistory(reseal(records),records[0].payload.config,3));
200
+ }
201
+ run.close();run=null;
202
+ run=await f.openParent();
203
+ const status=await run.host.handle(f.request('parent','status'));
204
+ assert.equal(status.state,'fixture_completed');assert.equal(status.code,null,JSON.stringify(status));
205
+ assert.deepEqual(fs.readFileSync(f.statePath('parent')),adopted);
206
+ const proof=fs.readFileSync(f.evidenceFile);fs.writeFileSync(f.evidenceFile,Buffer.concat([proof,Buffer.from(' ')]));
207
+ const drift=await run.host.handle(f.request('parent','status'));assert.equal(drift.code,'correction_review_required',JSON.stringify(drift));
208
+ assert.deepEqual(f.history('parent').state,before.state);assert.deepEqual(fs.readFileSync(f.statePath('parent')),adopted);
209
+ fs.writeFileSync(f.evidenceFile,proof);
210
+ const sourceBytes=fs.readFileSync(f.statePath('cross'));fs.writeFileSync(f.statePath('cross'),f.approvedBytes.cross);
211
+ const stale=await run.host.handle(f.request('parent','status'));assert.equal(stale.code,'correction_review_required',JSON.stringify(stale));
212
+ fs.writeFileSync(f.statePath('cross'),sourceBytes);
213
+ assert.deepEqual(fs.readFileSync(f.statePath('parent')),adopted);
214
+ assert.deepEqual(f.calls,calls);assert.deepEqual(fs.readFileSync(path.join(f.specsDir,f.definitions.parent.feature,'tasks.md')),tasks);
215
+ // The accepted parent is not a recursively acceptable source. Without this
216
+ // guard its original parent package would exactly explain these two edits.
217
+ const cross=f.history('cross'),inverse=f.makePlan('cross',['parent'],false);
218
+ fs.writeFileSync(path.join(f.sourceRoot,'parent.mjs'),'export const parent=1;\n');
219
+ fs.writeFileSync(path.join(f.sourceRoot,'docs/guide.md'),f.documents['docs/guide.md'].before);
220
+ rejectPreview({root:f.sourceRoot,specsRoot:f.specsDir,baseline:cross.original,parentPackage:cross.state.reviewPackage,
221
+ records:cross.saved.records,plan:inverse,review:null},'accepted integration sources cannot be recursively adopted');
222
+ }finally{run?.close();}
223
+ });
@@ -0,0 +1,23 @@
1
+ import test from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import {integrationReviewIndependent} from '../runtime/js/cm-ai/reviewed-integration.mjs';
4
+
5
+ const base={reviewRunId:'run-review',targetRunId:'run-target',hostContextId:'ctx-1',authorContextId:'ctx-1',
6
+ reviewerProvider:'claude',authorProvider:'codex',reviewerThreadId:'thread-r',
7
+ previousThreads:['thread-old'],developerThreadId:'thread-dev'};
8
+
9
+ test('integration review independence: different tool passes', ()=>{
10
+ assert.equal(integrationReviewIndependent(base),true);
11
+ });
12
+
13
+ test('integration review independence: same tool as author is rejected', ()=>{
14
+ assert.equal(integrationReviewIndependent({...base,reviewerProvider:'codex'}),false);
15
+ assert.equal(integrationReviewIndependent({...base,reviewerProvider:'claude',authorProvider:'claude'}),false);
16
+ });
17
+
18
+ test('integration review independence: reused run, context or threads are rejected', ()=>{
19
+ assert.equal(integrationReviewIndependent({...base,reviewRunId:'run-target'}),false);
20
+ assert.equal(integrationReviewIndependent({...base,hostContextId:'ctx-2'}),false);
21
+ assert.equal(integrationReviewIndependent({...base,reviewerThreadId:'thread-old'}),false);
22
+ assert.equal(integrationReviewIndependent({...base,reviewerThreadId:'thread-dev'}),false);
23
+ });