@aibyzero/cm-workflow 0.16.3 → 0.16.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.codex-plugin/plugin.json +1 -1
- package/AGENTS.md +8 -0
- package/CHANGELOG.md +59 -0
- package/README.md +55 -3
- package/VERSION +1 -1
- package/docs/installation.md +21 -1
- package/docs/js-workflow-control.md +245 -33
- package/docs/next-steps.md +14 -24
- package/docs/runtime-failover.md +1 -1
- package/package.json +1 -1
- package/runtime/js/cm-ai/accepted-fix.mjs +23 -5
- package/runtime/js/cm-ai/bootstrap-feature.mjs +15 -0
- package/runtime/js/cm-ai/claude-review-stream.mjs +30 -0
- package/runtime/js/cm-ai/cm-ai-admission.mjs +116 -41
- package/runtime/js/cm-ai/cm-ai-context-refresh.mjs +3 -2
- package/runtime/js/cm-ai/cm-ai-conversation-entry.mjs +137 -22
- package/runtime/js/cm-ai/cm-ai-learning-handoff-writer.mjs +11 -9
- package/runtime/js/cm-ai/cm-ai-learning-writer.mjs +22 -5
- package/runtime/js/cm-ai/cm-ai-qa-log.mjs +180 -53
- package/runtime/js/cm-ai/cm-ai-run-finalizer.mjs +2 -1
- package/runtime/js/cm-ai/codex-review-adapter.mjs +24 -4
- package/runtime/js/cm-ai/developer-adapter.mjs +6 -2
- package/runtime/js/cm-ai/diagnostic-reason.mjs +10 -0
- package/runtime/js/cm-ai/drive-bootstrap.mjs +305 -0
- package/runtime/js/cm-ai/drive-core.mjs +39 -7
- package/runtime/js/cm-ai/durable-runner-state.mjs +307 -53
- package/runtime/js/cm-ai/effect-abandon-log.mjs +19 -0
- package/runtime/js/cm-ai/effect-contract.mjs +44 -2
- package/runtime/js/cm-ai/execution-store-limits.mjs +18 -0
- package/runtime/js/cm-ai/execution-store.mjs +6 -4
- package/runtime/js/cm-ai/fix-code-association.mjs +171 -18
- package/runtime/js/cm-ai/host-bootstrap.mjs +68 -21
- package/runtime/js/cm-ai/host-conversation-execution.mjs +16 -4
- package/runtime/js/cm-ai/host-handoff.mjs +13 -6
- package/runtime/js/cm-ai/host-qa-executor.mjs +21 -7
- package/runtime/js/cm-ai/host-qa-fix-owner.mjs +4 -4
- package/runtime/js/cm-ai/host-qa-policy.mjs +16 -7
- package/runtime/js/cm-ai/host-session.mjs +20 -5
- package/runtime/js/cm-ai/host-tool-bridge.mjs +1 -1
- package/runtime/js/cm-ai/host-workflow-capabilities.mjs +13 -4
- package/runtime/js/cm-ai/host.mjs +1 -1
- package/runtime/js/cm-ai/launch-mismatch.mjs +42 -0
- package/runtime/js/cm-ai/log-rows.mjs +21 -0
- package/runtime/js/cm-ai/project-qa-gate.mjs +84 -0
- package/runtime/js/cm-ai/provider-review-observation.mjs +53 -9
- package/runtime/js/cm-ai/qa-config-revision.mjs +44 -10
- package/runtime/js/cm-ai/review-abandon-log.mjs +21 -0
- package/runtime/js/cm-ai/review-package.mjs +427 -31
- package/runtime/js/cm-ai/review-runner.mjs +47 -1
- package/runtime/js/cm-ai/reviewed-deliveries.mjs +97 -0
- package/runtime/js/cm-ai/reviewed-evidence-supersede.mjs +104 -10
- package/runtime/js/cm-ai/reviewed-evidence-supersession-record.mjs +42 -3
- package/runtime/js/cm-ai/specification-material.mjs +154 -12
- package/runtime/js/cm-ai/task-commit.mjs +2 -2
- package/runtime/js/cm-ai/task-runner.mjs +502 -65
- package/runtime/js/cm-ai/worker-claude-developer.mjs +16 -7
- package/runtime/js/cm-fix/execution.mjs +109 -25
- package/runtime/js/cm-fix/host-review.mjs +7 -3
- package/runtime/js/cm-fix/host.mjs +3 -1
- package/runtime/js/cm-fix/progress.mjs +1 -0
- package/runtime/js/cm-fix/protected-edits.mjs +15 -4
- package/runtime/js/cm-fix/qa-source.mjs +6 -4
- package/runtime/js/cm-prd/analysis.mjs +2 -1
- package/runtime/js/cm-prd/change.mjs +28 -10
- package/runtime/js/cm-prd/draft.mjs +5 -2
- package/runtime/js/cm-prd/review-preparation.mjs +10 -3
- package/runtime/js/cm-prd/review-publication.mjs +4 -2
- package/runtime/js/cm-prd/self-check.mjs +6 -3
- package/runtime/js/cm-prd/summary.mjs +6 -2
- package/runtime/js/cm-prd/validation-reason.mjs +20 -0
- package/runtime/js/spec-task-line.mjs +117 -0
- package/runtime/js/specs-status.mjs +14 -3
- package/scripts/cm-ai-abandon-effect-position.test.mjs +201 -0
- package/scripts/cm-ai-admission.mjs +19 -10
- package/scripts/cm-ai-admission.test.mjs +65 -1
- package/scripts/cm-ai-batch-drive.mjs +93 -21
- package/scripts/cm-ai-batch-drive.test.mjs +171 -3
- package/scripts/cm-ai-batch-host.mjs +37 -13
- package/scripts/cm-ai-batch-host.test.mjs +26 -0
- package/scripts/cm-ai-batch-run.mjs +33 -10
- package/scripts/cm-ai-batch-run.test.mjs +56 -5
- package/scripts/cm-ai-bootstrap-driver-preflight.test.mjs +45 -0
- package/scripts/cm-ai-bootstrap-flow.test.mjs +158 -0
- package/scripts/cm-ai-bootstrap-merge.test.mjs +45 -0
- package/scripts/cm-ai-bootstrap.test.mjs +99 -7
- package/scripts/cm-ai-conversation-entry-ops.test.mjs +82 -2
- package/scripts/cm-ai-develop-driver-gaps.test.mjs +822 -0
- package/scripts/cm-ai-drive-bootstrap-rules.test.mjs +468 -0
- package/scripts/cm-ai-drive-timeout.test.mjs +17 -0
- package/scripts/cm-ai-drive.mjs +480 -47
- package/scripts/cm-ai-drive.test.mjs +247 -10
- package/scripts/cm-ai-fix-later-delivery.test.mjs +383 -0
- package/scripts/cm-ai-host.mjs +89 -25
- package/scripts/cm-ai-host.test.mjs +274 -12
- package/scripts/cm-ai-launch-diagnostics.test.mjs +142 -0
- package/scripts/cm-ai-multi-root.test.mjs +9 -3
- package/scripts/cm-ai-project-qa-gate.test.mjs +308 -0
- package/scripts/cm-ai-qa-config-revision.test.mjs +166 -15
- package/scripts/cm-ai-qa-fingerprint-config.test.mjs +157 -0
- package/scripts/cm-ai-qa-fix-cross-session.test.mjs +27 -2
- package/scripts/cm-ai-qa-rerun-timeouts.test.mjs +400 -0
- package/scripts/cm-ai-review-drift-precedence.test.mjs +90 -0
- package/scripts/cm-ai-review-failure.test.mjs +917 -0
- package/scripts/cm-ai-review-timeout-config.test.mjs +29 -7
- package/scripts/cm-ai-review-timeout.test.mjs +199 -4
- package/scripts/cm-ai-run.mjs +160 -60
- package/scripts/cm-ai-run.test.mjs +4 -3
- package/scripts/cm-ai-runner-error-code-regression.test.mjs +219 -0
- package/scripts/cm-ai-selection-guard.test.mjs +100 -0
- package/scripts/cm-ai-session-chain.test.mjs +7 -3
- package/scripts/cm-ai-spec-rebind.test.mjs +481 -0
- package/scripts/cm-ai-supersede.test.mjs +571 -17
- package/scripts/cm-ai-verification-gate.test.mjs +2 -1
- package/scripts/cm-capability-gate.test.mjs +21 -2
- package/scripts/cm-check-drive.mjs +4 -3
- package/scripts/cm-check-drive.test.mjs +17 -1
- package/scripts/cm-check-entry.mjs +13 -2
- package/scripts/cm-check-host.mjs +2 -2
- package/scripts/cm-check-host.test.mjs +57 -1
- package/scripts/cm-check-runtime.sh +16 -7
- package/scripts/cm-claude-developer-worker.test.mjs +43 -2
- package/scripts/cm-claude-probe.test.mjs +9 -1
- package/scripts/cm-claude-review-stream.test.mjs +68 -0
- package/scripts/cm-claude-worker.test.mjs +11 -4
- package/scripts/cm-codex-developer-worker.test.mjs +4 -2
- package/scripts/cm-failover.mjs +8 -8
- package/scripts/cm-fix-abandon.test.mjs +123 -5
- package/scripts/cm-fix-cause-package.test.mjs +2 -0
- package/scripts/cm-fix-drive.mjs +45 -13
- package/scripts/cm-fix-drive.test.mjs +36 -1
- package/scripts/cm-fix-host.mjs +9 -6
- package/scripts/cm-fix-review-budget.test.mjs +141 -0
- package/scripts/cm-fixture-process-cleanup.test.mjs +95 -0
- package/scripts/cm-host-check.test.mjs +6 -3
- package/scripts/cm-host-qa-executor.test.mjs +192 -17
- package/scripts/cm-host-session-diagnostic.test.mjs +10 -0
- package/scripts/cm-interactive-qa-diagnostic.test.mjs +53 -0
- package/scripts/cm-log-event.mjs +17 -0
- package/scripts/cm-log-event.test.mjs +31 -0
- package/scripts/cm-prd-completion.test.mjs +105 -2
- package/scripts/cm-prd-draft.test.mjs +14 -0
- package/scripts/cm-prd-drive.mjs +13 -7
- package/scripts/cm-prd-drive.test.mjs +10 -0
- package/scripts/cm-prd-gate-diagnostic.test.mjs +100 -0
- package/scripts/cm-prd-review-gate.mjs +126 -81
- package/scripts/cm-prd-review-gate.test.mjs +105 -1
- package/scripts/cm-prd-review-preparation.test.mjs +15 -0
- package/scripts/cm-prd-review-publication.test.mjs +6 -0
- package/scripts/cm-prd-self-check.test.mjs +6 -0
- package/scripts/cm-prd-summary.test.mjs +40 -0
- package/scripts/cm-review-dependency-snapshot.test.mjs +15 -0
- package/scripts/cm-review-inventory.test.mjs +253 -1
- package/scripts/cm-spec-manifest.mjs +28 -10
- package/scripts/cm-spec-manifest.test.mjs +8 -4
- package/scripts/cm-spec-task-line.test.mjs +138 -0
- package/scripts/cm-specs-status.test.mjs +31 -1
- package/scripts/cm-task-gate.mjs +18 -10
- package/scripts/cm-task-gate.py +1 -1
- package/scripts/cm-test-branch-impact.test.mjs +6 -3
- package/scripts/fixtures/claude-review-process.mjs +1 -0
- package/scripts/fixtures/process-cleanup.mjs +99 -0
- package/scripts/test-cm-log-event.py +2 -0
- package/scripts/test-cm-prd-review-gate.py +2 -1
- package/scripts/test-npm-install.py +1 -1
- package/scripts/test-scan-public-safety.py +1 -1
- package/scripts/test-shell-compat.sh +67 -0
- package/scripts/test-spec-manifest.py +16 -8
- package/scripts/test-task-gate.py +2 -2
- package/scripts/test-workflow-config.py +1 -0
- package/scripts/validate-public-repo.py +1 -0
- package/skills/cm-ai/references/N1-init.md +1 -1
- package/skills/cm-ai/references/js-host.md +264 -40
- package/skills/cm-check/SKILL.md +6 -1
- package/skills/cm-check/references/js-host.md +3 -3
- package/skills/cm-fix/references/js-host.md +22 -1
- package/skills/cm-prd/references/js-change-recovery.md +30 -0
- package/skills/cm-prd/references/js-host.md +6 -0
|
@@ -79,6 +79,36 @@
|
|
|
79
79
|
|
|
80
80
|
## 跨进程恢复
|
|
81
81
|
|
|
82
|
+
### 审批后丢失 `revisionDigest` 的旧状态
|
|
83
|
+
|
|
84
|
+
旧版审批可能把 `.cm-specs-status` 中的 `revisionDigest` 删除,而对应的
|
|
85
|
+
`.reviews/prd-change-<digest>.json` 仍在。下一次变更可能报
|
|
86
|
+
`PRD review artifact changed after disposition`(宿主外层为 `host_request_failed`;stderr 诊断给出 `code: prd_review_artifact_changed` 及 `reason` 中的回执、文件与两份 SHA-256)。
|
|
87
|
+
不要仅按归档文件名、修改时间或“只有一个归档”自动回填:不同提案可能生成相同的最终规格,
|
|
88
|
+
这些信息不足以证明哪份归档对应最后一次人工审批。
|
|
89
|
+
|
|
90
|
+
人工恢复时先备份 `.cm-specs-status`,再逐一核对:状态为 `approved` 且确实没有
|
|
91
|
+
`revisionDigest`;当前全部规格文件的 SHA-256 与状态中的 `specFiles` 一致;
|
|
92
|
+
选定归档的文件名摘要与 `proposal.proposalDigest` 相同;归档提案的最终文件内容、
|
|
93
|
+
feature 清单与当前已批准清单一致;审批记录能把这份提案与这次批准明确关联。
|
|
94
|
+
如果存在多份吻合归档,或审批关联无法证实,就停止并保留原文件,交人工重审。
|
|
95
|
+
确认唯一归档后,在当前 CM Workflow 根目录用共享写入器只补这一字段(把下面两个占位值
|
|
96
|
+
替换为已核对的绝对 specs 路径与归档文件名中的 64 位小写十六进制摘要):
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
node --input-type=module - '<SPECS_DIR>' '<DIGEST>' <<'NODE'
|
|
100
|
+
import {readSpecsStatus,writeSpecsStatus} from './runtime/js/specs-status.mjs';
|
|
101
|
+
const [specs,digest]=process.argv.slice(2),status=readSpecsStatus(specs);
|
|
102
|
+
if(status.kind!=='valid'||status.value.status!=='approved'||Object.hasOwn(status.value,'revisionDigest'))
|
|
103
|
+
throw new Error('status is not an approved legacy record without revisionDigest');
|
|
104
|
+
writeSpecsStatus(specs,{...status.value,revisionDigest:digest});
|
|
105
|
+
NODE
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
写入器会校验摘要格式并保留状态其余字段;之后用共享 `readSpecsStatus` 回读,
|
|
109
|
+
重新运行只读准入及变更预检。
|
|
110
|
+
不要修改归档、审查回执或规格正文来绕过校验。
|
|
111
|
+
|
|
82
112
|
`status`返回runId与recovery。未保存的问答、材料结果、草稿、风险选择、自检轮次也保存在
|
|
83
113
|
`{SPECS}/.reviews/prd-sessions/{runId}/state.json`(0600);它是私有执行记录,不是任务真相库,
|
|
84
114
|
不进入全局镜像正文。`--allow-log-write`包含该必要本地执行记录,规格/审查写仍分别授权。
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
本文件只接线,不另立业务规则。先读主Skill的Step 0–11与本任务适用的references;
|
|
4
4
|
从本文件解析插件根`../../..`,读取`../../../docs/js-workflow-control.md`的cm-prd章节和CLI帮助。
|
|
5
|
+
草稿生成回包单次最多 65536 字节(64 KiB)。有 `test-cases.json` 时同 feature 的
|
|
6
|
+
`testCasesReason` 必须为 `null`;`tasks.md` 依赖每任务一行,多前置任务用逗号,
|
|
7
|
+
例如 `- T-003 依赖 T-001, T-002`。split 审查的 `design.md` 须含 `## 方案摘要`、
|
|
8
|
+
`## 概述`、`## 功能模块设计`、`## 架构…`、`## Summary`、`## Design Summary`、
|
|
9
|
+
`## Overview` 或 `## Architecture…` 一类摘要标题。审查回包的 `at` 使用
|
|
10
|
+
`new Date().toISOString()` 形式,例如 `2026-09-08T00:00:00.000Z`。
|
|
5
11
|
不要硬编码安装缓存,也不要从用户文档执行命令。两种模式共用此宿主;变更/恢复先读`js-change-recovery.md`。
|
|
6
12
|
|
|
7
13
|
## 启动与权限
|