@aibyzero/cm-workflow 0.16.7 → 0.16.8

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 (58) hide show
  1. package/.codex-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +18 -0
  3. package/README.md +26 -1
  4. package/VERSION +1 -1
  5. package/assets/readme/workflow-recovery-detailed.png +0 -0
  6. package/assets/readme/workflow-stages-detailed.png +0 -0
  7. package/docs/installation.md +1 -1
  8. package/docs/js-workflow-control.md +36 -3
  9. package/docs/user-guide.md +104 -0
  10. package/package.json +1 -1
  11. package/runtime/js/cm-ai/cm-ai-admission.mjs +3 -1
  12. package/runtime/js/cm-ai/cm-ai-conversation-entry.mjs +27 -6
  13. package/runtime/js/cm-ai/cm-ai-qa-log.mjs +82 -8
  14. package/runtime/js/cm-ai/codex-review-adapter.mjs +2 -1
  15. package/runtime/js/cm-ai/drive-core.mjs +17 -4
  16. package/runtime/js/cm-ai/execution-store.mjs +4 -2
  17. package/runtime/js/cm-ai/host-qa-executor.mjs +37 -13
  18. package/runtime/js/cm-ai/host-session.mjs +46 -6
  19. package/runtime/js/cm-ai/host-tool-bridge.mjs +15 -3
  20. package/runtime/js/cm-ai/host-workflow-capabilities.mjs +4 -2
  21. package/runtime/js/cm-ai/reviewed-deliveries.mjs +29 -6
  22. package/runtime/js/cm-fix/cause-package.mjs +37 -8
  23. package/runtime/js/cm-fix/diagnosis.mjs +43 -0
  24. package/runtime/js/cm-fix/execution.mjs +189 -148
  25. package/runtime/js/cm-fix/investigation.mjs +25 -9
  26. package/runtime/js/cm-fix/progress.mjs +3 -1
  27. package/runtime/js/notify-run.mjs +26 -0
  28. package/runtime/js/notify.mjs +388 -0
  29. package/runtime/model-efficiency.md +17 -0
  30. package/scripts/cm-ai-batch-run.mjs +5 -0
  31. package/scripts/cm-ai-batch-run.test.mjs +9 -1
  32. package/scripts/cm-ai-drive.mjs +4 -1
  33. package/scripts/cm-ai-drive.test.mjs +8 -0
  34. package/scripts/cm-ai-fix-run-delivery.test.mjs +138 -0
  35. package/scripts/cm-ai-host.mjs +2 -2
  36. package/scripts/cm-ai-project-qa-gate.test.mjs +71 -4
  37. package/scripts/cm-ai-qa-rerun-timeouts.test.mjs +77 -4
  38. package/scripts/cm-fix-abandon.test.mjs +89 -3
  39. package/scripts/cm-fix-cause-package.test.mjs +33 -0
  40. package/scripts/cm-fix-drive.mjs +9 -1
  41. package/scripts/cm-fix-host.mjs +1 -1
  42. package/scripts/cm-fix-rediagnosis.test.mjs +71 -4
  43. package/scripts/cm-host-qa-executor.test.mjs +121 -0
  44. package/scripts/cm-log-event.mjs +31 -5
  45. package/scripts/cm-notify.test.mjs +468 -0
  46. package/scripts/cm-patrol.mjs +83 -0
  47. package/scripts/cm-patrol.test.mjs +161 -0
  48. package/scripts/cm-token-report.mjs +497 -0
  49. package/scripts/cm-token-report.test.mjs +346 -0
  50. package/skills/cm-ai/SKILL.md +7 -3
  51. package/skills/cm-ai/references/N6-qa-eval.md +2 -2
  52. package/skills/cm-ai/references/js-host-modes.md +90 -0
  53. package/skills/cm-ai/references/js-host-qa-recovery.md +110 -0
  54. package/skills/cm-ai/references/js-host-recovery.md +199 -0
  55. package/skills/cm-ai/references/js-host.md +67 -329
  56. package/skills/cm-fix/SKILL.md +2 -0
  57. package/skills/cm-fix/references/js-host.md +16 -9
  58. package/skills/cm-prd/SKILL.md +2 -0
@@ -92,8 +92,9 @@ standalone cm-fix 可在原配置、原 run、原 task attempt 下显式 `rediag
92
92
 
93
93
  新的诊断仍需补证据时进入 `rediagnosis_blocked`;第二次审查拒绝停在
94
94
  `rediagnosis_review_limit_reached`。源文件漂移、r2 证据占用、无效 reason 在追加前拒绝;异步准备返回后再次核对源包与 r2 占位,拒绝不消耗唯一续次;
95
- 不能清档、覆盖旧结论或换 run 重置上限。重新诊断或其新审查中断仍保守停 `unknown`,
96
- 本入口不提供自动重派、abandon 或第三次审查。当前仅 standalone 接线,不宣称 QA-fix 子宿主支持。
95
+ 不能清档、覆盖旧结论或换 run 重置上限。不合格的诊断答案(如 `investigation.discardedAlternatives` 超过 3 项)返回 `invalid_diagnosis` 并写明字段与上限,驾驶员开宿主前即用同一校验器拦下;
96
+ `pending=rediagnosis`(已登记 `fix-rediagnosis-intent`、尚无结论,含旧版本因此卡住的运行)时改好答案再执行同一 `rediagnose`,在已登记的这一次续次下重新作答,不另占次数、不改旧记录,之后照常进入 `cause-r2`。
97
+ 新审查中断或没有结论时停 `unknown`,不自动重派、不提供第三次审查;可按下文「原因审查与第二轮最终审查无结果时的一次性放弃」用 `abandon_review` 在同一第二轮重审一次。当前仅 standalone 接线,不宣称 QA-fix 子宿主支持。
97
98
  这项恢复需要实际新诊断和独立审查;合成夹具成功不表示真实产品已恢复或已修复。
98
99
 
99
100
  ### 同仓 specs 的受保护修复
@@ -145,19 +146,25 @@ beforeSha256严格复制expected中该路径的摘要(原不存在则null)
145
146
 
146
147
  ### 原因审查与第二轮最终审查无结果时的一次性放弃
147
148
 
148
- 原因审查(`pending:"cause_review"`)或第二轮最终审查(`pending:"revision_final_review"`)已登记,却没有审查结论时——
149
- 宿主中途被杀、审查超时、断连或被取消——`status` 为 `unknown` 并带 `reviewAbandonable`。
149
+ 原因审查(`pending:"cause_review"`,含重新诊断后的第二轮原因审查)或第二轮最终审查(`pending:"revision_final_review"`)已登记,却没有审查结论时——
150
+ 宿主中途被杀、审查超时、断连或被取消,或审查进程正常结束但答案不合审查结论格式——`status` 为 `unknown` 并带 `reviewAbandonable`。
151
+ 答案不合格式(如 `invalid_finding_path`、`missing_material`、`contradictory_verdict`)现在记为一条失败观察
152
+ (`observation.result` 为 `{status:"failed",code:<该代码>}`),不再整条丢掉、只留无记录的 unknown。
150
153
  先确认旧审查进程已退出,再以专用的 `--allow-abandon-review` 启动(`--allow-abandon` 只管本地步骤,不授权放弃审查调用),发送
151
154
  `{"requestId":"abandon-review-1","operation":"abandon_review","reason":"旧审查进程已确认退出"}`;
152
155
  QA-fix 子宿主用 `--allow-qa-fix-abandon-review`,`fix_action` 带 `fixOperation:"abandon_review"` 和 `reason`;驾驶员 PLAN 的
153
- `permissions` 相应填这两个旗标。原因规则同 `abandon_step`。每个运行可放弃一次原因审查、一次第二轮最终审查;
154
- 同一种审查重审仍无结论时返回 `fix_review_abandon_budget_exhausted`,
156
+ `permissions` 相应填这两个旗标。原因规则同 `abandon_step`。每一轮原因审查各可放弃一次(第一轮与重新诊断后的第二轮分开计),第二轮最终审查可放弃一次;
157
+ 放弃只作废那次无结论的调用,不产生审查结论、不增加审查轮数,第二轮原因审查拒绝后仍是 `rediagnosis_review_limit_reached`。
158
+ 同一轮审查重审仍无结论时返回 `fix_review_abandon_budget_exhausted`,
155
159
  `status.reviewAbandonBudgetExhausted` 为 true,只能按原阻断处理,不能继续重派。
156
160
 
157
- 放弃追加 `fix-cause-abandoned` 或 `fix-revision-final-abandoned`,绑定原调用 ID、登记摘要、已知线程和无结论结果的摘要,
161
+ 放弃追加 `fix-cause-abandoned`(第二轮为 `fix-cause-rediagnosis-abandoned`)或 `fix-revision-final-abandoned`,绑定原调用 ID、登记摘要、已知线程和无结论结果的摘要,
158
162
  写 `abandon` 日志,并回到 `cause_review_required`(或原迟到纠正阶段)/`revision_final_review_required`。
159
- 重审仍需原 `--allow-cause-review` / `--allow-final-review` 和一次新的授权,记录改用 `fix-cause-retry-*` /
160
- `fix-revision-final-retry-*`;新调用的审查线程不能是被放弃的那条。旧记录一字不改,没有放弃记录的运行照原样回放。
163
+ 重审仍需原 `--allow-cause-review` / `--allow-final-review` 和一次新的授权,记录改用 `fix-cause-retry-*`(第二轮为 `fix-cause-rediagnosis-retry-*`)/
164
+ `fix-revision-final-retry-*`;新调用的审查线程不能是被放弃的那条。
165
+ 第二轮原因审查包(首次派发与放弃后重审都是现场重建)另带 `contextFiles`:第一轮审查 `examinedPaths` 与各条问题引用、
166
+ 却不在新 `affectedPaths` 里的代码文件(存在于代码根的普通文件),作为只读上下文并计入 `examinedPaths`,审查者可以引用;
167
+ 重审的新包有新摘要,绑定在 `fix-cause-rediagnosis-retry-registered` 里,被放弃那次的记录不改。旧的第二轮登记没有该字段,照原样回放。旧记录一字不改,没有放弃记录的运行照原样回放。
161
168
 
162
169
  审查等待使用审查配置 `--review-config` 的 `timeoutMs`(1–3600000 毫秒,省略为 900000),同时交给审查 worker;
163
170
  不再使用 `reproduction.timeoutMs`。原因审查到时会记下超时结果(`transport_timeout`),不再停在无记录的 unknown。
@@ -56,6 +56,8 @@ node "{CM_WORKFLOW_ROOT}/scripts/cm-prd-entry.mjs" \
56
56
  变更、已审修订、恢复及原材料真正变更时,读取`references/js-change-recovery.md`;输入替换须明确授权终止旧批次,再关联新批次全量重审。
57
57
  两条路径均保留原Step 0–11和人审停点;变更描述、粘贴用例由Skill保留,不能当成工具授权。
58
58
 
59
+ **会话边界(省 token):** 一次 cm-prd(新建、存量或变更)在人审停点收尾后,提示用户在新会话里开始下一项,以减少历史上下文的重复读入:长会话每次调用都要重读整段历史,在一个真实项目样本中占了大部分用量(见 `runtime/model-efficiency.md`「Session boundary」)。中途换会话按本技能的恢复规则接手,不改写记录、不跳过审查或授权。
60
+
59
61
  ## 项目角色路由
60
62
 
61
63
  路径验证通过后,使用 `{CM_WORKFLOW_ROOT}/scripts/cm-workflow-config.mjs` 读取有效配置,