@aibyzero/cm-workflow 0.16.5 → 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.
- package/.codex-plugin/plugin.json +1 -1
- package/AGENTS.md +14 -0
- package/CHANGELOG.md +7 -0
- package/README.md +11 -4
- package/THIRD_PARTY_NOTICES.md +9 -0
- package/VERSION +1 -1
- package/docs/architecture.md +43 -0
- package/docs/execution-optimizations.md +33 -0
- package/docs/external-models.md +114 -0
- package/docs/fixes/.reviews/20260929-bootstrap-unchanged-review-r1.md +7 -0
- package/docs/fixes/.reviews/20260930-develop-package-limit-recovery-r4.md +9 -0
- package/docs/fixes/20260929-bootstrap-rule-refresh-conflict.md +22 -0
- package/docs/fixes/20260929-bootstrap-unchanged-review.md +26 -0
- package/docs/fixes/20260930-develop-package-limit-recovery.md +65 -0
- package/docs/human-correction.md +31 -0
- package/docs/installation.md +28 -7
- package/docs/js-workflow-control.md +48 -0
- package/docs/live-evidence-drivers.md +62 -0
- package/docs/next-steps.md +15 -10
- package/docs/untested-branches.md +27 -4
- package/docs/user-guide.md +23 -8
- package/install-codex.sh +28 -11
- package/package.json +1 -1
- package/runtime/js/cm-ai/claude-review-adapter.mjs +7 -4
- package/runtime/js/cm-ai/claude-tool-preview.mjs +4 -4
- package/runtime/js/cm-ai/cm-ai-conversation-entry.mjs +79 -20
- package/runtime/js/cm-ai/cm-ai-qa-log.mjs +1 -4
- package/runtime/js/cm-ai/cm-ai-run-finalizer.mjs +13 -57
- package/runtime/js/cm-ai/codex-config.mjs +3 -2
- package/runtime/js/cm-ai/codex-review-adapter.mjs +34 -15
- package/runtime/js/cm-ai/committed-rule-basis.mjs +76 -0
- package/runtime/js/cm-ai/drive-bootstrap.mjs +20 -10
- package/runtime/js/cm-ai/drive-core.mjs +9 -3
- package/runtime/js/cm-ai/durable-runner-state.mjs +117 -14
- package/runtime/js/cm-ai/effect-contract.mjs +1 -1
- package/runtime/js/cm-ai/execution-policy.mjs +58 -0
- package/runtime/js/cm-ai/external-group-models.mjs +53 -0
- package/runtime/js/cm-ai/external-model-launch.mjs +23 -0
- package/runtime/js/cm-ai/external-models.mjs +52 -0
- package/runtime/js/cm-ai/external-run-guard.mjs +96 -0
- package/runtime/js/cm-ai/host-bootstrap.mjs +70 -20
- package/runtime/js/cm-ai/host-check.mjs +30 -4
- package/runtime/js/cm-ai/host-conversation-execution.mjs +50 -16
- package/runtime/js/cm-ai/host-progress.mjs +80 -0
- package/runtime/js/cm-ai/host-project-execution.mjs +16 -11
- package/runtime/js/cm-ai/host-qa-executor.mjs +2 -2
- package/runtime/js/cm-ai/host-qa-fix-owner.mjs +22 -5
- package/runtime/js/cm-ai/host-session.mjs +1 -1
- package/runtime/js/cm-ai/host-workflow-capabilities.mjs +3 -1
- package/runtime/js/cm-ai/knowledge-closeout.mjs +56 -0
- package/runtime/js/cm-ai/legacy-model-run-preview.mjs +24 -0
- package/runtime/js/cm-ai/legacy-model-settings.mjs +59 -0
- package/runtime/js/cm-ai/live-evidence.mjs +96 -0
- package/runtime/js/cm-ai/model-configuration-file.mjs +63 -0
- package/runtime/js/cm-ai/model_configuration_write.py +214 -0
- package/runtime/js/cm-ai/native-usage-log.mjs +26 -0
- package/runtime/js/cm-ai/operator-guidance.mjs +86 -0
- package/runtime/js/cm-ai/owned-process-cleanup.mjs +22 -0
- package/runtime/js/cm-ai/provider-review-observation.mjs +15 -0
- package/runtime/js/cm-ai/provider-usage.mjs +39 -0
- package/runtime/js/cm-ai/review-package.mjs +11 -0
- package/runtime/js/cm-ai/review-presentation.mjs +45 -0
- package/runtime/js/cm-ai/review-reconciliation.mjs +20 -0
- package/runtime/js/cm-ai/status-projection.mjs +93 -0
- package/runtime/js/cm-ai/task-runner.mjs +171 -25
- package/runtime/js/cm-ai/tool-preview.mjs +8 -4
- package/runtime/js/cm-ai/worker-claude-developer.mjs +16 -7
- package/runtime/js/cm-ai/worker-claude.mjs +63 -19
- package/runtime/js/cm-ai/worker-codex-developer.mjs +15 -9
- package/runtime/js/cm-ai/worker-codex.mjs +45 -19
- package/runtime/js/cm-fix/cause-evidence.mjs +5 -3
- package/runtime/js/cm-fix/cause-invocation.mjs +6 -3
- package/runtime/js/cm-fix/cause-package.mjs +10 -1
- package/runtime/js/cm-fix/execution.mjs +183 -40
- package/runtime/js/cm-fix/final-review.mjs +18 -10
- package/runtime/js/cm-fix/host-review.mjs +25 -6
- package/runtime/js/cm-fix/host.mjs +4 -1
- package/runtime/js/cm-fix/layout.mjs +1 -1
- package/runtime/js/cm-fix/progress.mjs +4 -0
- package/runtime/js/cm-fix/review-reconciliation.mjs +64 -0
- package/runtime/js/cm-prd/response-recovery.mjs +23 -0
- package/runtime/js/cm-prd/review-publication.mjs +23 -13
- package/runtime/js/cm-prd/review-time.mjs +29 -0
- package/runtime/js/cm-prd/session.mjs +53 -6
- package/runtime/js/cm-security/finalize.mjs +32 -0
- package/runtime/review.md +5 -0
- package/runtime/task-gates.md +6 -0
- package/runtime/workflow-config.md +10 -1
- package/scripts/cm-ai-batch-drive.mjs +50 -21
- package/scripts/cm-ai-batch-drive.test.mjs +47 -2
- package/scripts/cm-ai-batch-host.mjs +37 -14
- package/scripts/cm-ai-batch-run.mjs +71 -27
- package/scripts/cm-ai-bootstrap-flow.test.mjs +3 -2
- package/scripts/cm-ai-bootstrap-merge.test.mjs +118 -1
- package/scripts/cm-ai-bootstrap.test.mjs +80 -87
- package/scripts/cm-ai-conversation-entry-ops.test.mjs +15 -0
- package/scripts/cm-ai-develop-driver-gaps.test.mjs +102 -0
- package/scripts/cm-ai-drive-bootstrap-rules.test.mjs +2 -2
- package/scripts/cm-ai-drive.mjs +59 -25
- package/scripts/cm-ai-drive.test.mjs +97 -1
- package/scripts/cm-ai-host.mjs +64 -24
- package/scripts/cm-ai-operator-guidance.test.mjs +94 -0
- package/scripts/cm-ai-progress.test.mjs +521 -0
- package/scripts/cm-ai-qa-config-revision.test.mjs +21 -0
- package/scripts/cm-ai-review-failure.test.mjs +71 -11
- package/scripts/cm-ai-run.mjs +58 -14
- package/scripts/cm-ai-run.test.mjs +2 -1
- package/scripts/cm-bootstrap-review-recovery.test.mjs +70 -0
- package/scripts/cm-check-drive.test.mjs +1 -0
- package/scripts/cm-check-runtime.sh +11 -0
- package/scripts/cm-claude-install-layout.test.mjs +26 -0
- package/scripts/cm-claude-probe.test.mjs +1 -1
- package/scripts/cm-codex-plugin-metadata.py +83 -0
- package/scripts/cm-codex-plugin-metadata.test.mjs +55 -0
- package/scripts/cm-efficiency-checks.test.mjs +37 -0
- package/scripts/cm-efficiency-diagnostics.test.mjs +74 -0
- package/scripts/cm-efficiency-offline.mjs +35 -0
- package/scripts/cm-efficiency-policy.test.mjs +48 -0
- package/scripts/cm-efficiency-presentation.test.mjs +35 -0
- package/scripts/cm-efficiency-response.test.mjs +117 -0
- package/scripts/cm-efficiency-usage.test.mjs +148 -0
- package/scripts/cm-external-batch-host.test.mjs +157 -0
- package/scripts/cm-external-fix-host.test.mjs +281 -0
- package/scripts/cm-external-fix-reconciliation.test.mjs +105 -0
- package/scripts/cm-external-group-models.test.mjs +60 -0
- package/scripts/cm-external-model-host.test.mjs +180 -0
- package/scripts/cm-external-model-recovery.test.mjs +108 -0
- package/scripts/cm-external-models.test.mjs +89 -0
- package/scripts/cm-external-process-cleanup.test.mjs +71 -0
- package/scripts/cm-external-qa-fix.test.mjs +170 -0
- package/scripts/cm-external-review-reconciliation.test.mjs +314 -0
- package/scripts/cm-fix-drive.mjs +28 -13
- package/scripts/cm-fix-final-review.test.mjs +11 -6
- package/scripts/cm-fix-host.mjs +17 -10
- package/scripts/cm-fix-protected-edits.test.mjs +12 -0
- package/scripts/cm-fix-rediagnosis.test.mjs +168 -0
- package/scripts/cm-fix-review-budget.test.mjs +7 -1
- package/scripts/cm-host-qa-executor.test.mjs +21 -0
- package/scripts/cm-knowledge-closeout.test.mjs +160 -0
- package/scripts/cm-live-evidence.test.mjs +64 -0
- package/scripts/cm-log-event.mjs +8 -2
- package/scripts/cm-log-event.py +15 -0
- package/scripts/cm-model-setup.mjs +79 -0
- package/scripts/cm-prd-drive.mjs +32 -11
- package/scripts/cm-prd-drive.test.mjs +15 -0
- package/scripts/cm-prd-host.mjs +13 -4
- package/scripts/cm-release-smoke.sh +5 -1
- package/scripts/cm-runtime-i18n.mjs +15 -4
- package/scripts/cm-runtime-install.mjs +8 -4
- package/scripts/cm-runtime.mjs +116 -23
- package/scripts/cm-runtime.test.mjs +121 -12
- package/scripts/cm-security.test.mjs +32 -0
- package/scripts/cm-task-gate-correction.test.mjs +117 -0
- package/scripts/cm-task-gate.mjs +146 -10
- package/scripts/cm-task-gate.py +1 -0
- package/scripts/cm-test-drive.mjs +10 -4
- package/scripts/cm-test-drive.test.mjs +14 -1
- package/scripts/cm-tool-preview-context.test.mjs +12 -0
- package/scripts/cm-usage-report.py +22 -3
- package/scripts/cm-workflow-config.mjs +10 -1
- package/scripts/fixtures/bootstrap-review-runner.mjs +102 -0
- package/scripts/fixtures/live-evidence-driver.mjs +35 -0
- package/scripts/fixtures/process-cleanup.mjs +3 -1
- package/scripts/test-cm-native-usage.py +62 -0
- package/scripts/test-external-model-setup.py +91 -0
- package/scripts/test-model-configuration-write.py +201 -0
- package/scripts/test-npm-install.py +10 -1
- package/skills/cm-ai/SKILL.md +2 -2
- package/skills/cm-ai/references/N8-finish.md +5 -0
- package/skills/cm-ai/references/js-host.md +13 -5
- package/skills/cm-ai/references/knowledge-closeout.md +90 -0
- package/skills/cm-fix/SKILL.md +1 -1
- package/skills/cm-fix/references/js-host.md +30 -2
- package/skills/cm-runtime/SKILL.md +29 -6
- package/skills/cm-security/SKILL.md +4 -2
- package/skills/cm-security/references/scan-contract.md +1 -0
- package/templates/cm-workflow.yml +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cm-workflow",
|
|
3
|
-
"version": "0.16.
|
|
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,6 +85,9 @@ 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` 的提交基准、漂移与回放用例。[已结构化]
|
|
83
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` 的回放用例。[已结构化]
|
|
84
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` 的预检夹具。[已结构化]
|
|
85
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`。[已结构化]
|
|
@@ -88,3 +96,9 @@ Read the relevant files under `.claude/rules/` when modifying shell scripts, doc
|
|
|
88
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` 的中断、拒绝及回放绑定用例。[已结构化]
|
|
89
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 审查与旧日志恢复用例。[已结构化]
|
|
90
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,13 @@
|
|
|
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
|
+
|
|
10
17
|
## 0.16.5 — 2026-09-29
|
|
11
18
|
|
|
12
19
|
- cm-ai 审查轮次用完(`review_limit`/`review_blocked`)后用 supersede 新建的运行,第 1 轮开发与独立审查会看到上个运行最后一次审查的 findings(标明只是参考、不是结论,不跳过审查、不改轮次),开发不再重犯同样问题;该内容写入新运行记录,回放时不可替换,旧记录照常回放。
|
package/README.md
CHANGED
|
@@ -17,6 +17,13 @@
|
|
|
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
|
+
|
|
20
27
|
**0.16.5**
|
|
21
28
|
|
|
22
29
|
这一版修的都是拿 cm-ai 跑真实项目(AI潮)时撞上的阻断:跑到一半卡死、报错看不懂、只能手改文件才能继续的情况,现在大多有了明确的出口。
|
|
@@ -187,7 +194,7 @@ $cm-check
|
|
|
187
194
|
|
|
188
195
|
仓库直接分发 Skills 和脚本,无需在仓库根目录运行 `npm install` 或构建。完整安装行为、覆盖范围和卸载说明见[安装指南](docs/installation.md)。
|
|
189
196
|
|
|
190
|
-
需要固定版本时可使用 `npx @aibyzero/cm-workflow@0.16.
|
|
197
|
+
需要固定版本时可使用 `npx @aibyzero/cm-workflow@0.16.6 install`,请在 CM Workflow 源码仓库以外的目录执行,例如用户主目录。npm 安装入口复用原安装器,要求与覆盖范围见[安装指南](docs/installation.md#npm-installation-macos-codex)。
|
|
191
198
|
|
|
192
199
|
## 升级旧版本
|
|
193
200
|
|
|
@@ -231,7 +238,7 @@ git pull --ff-only origin main
|
|
|
231
238
|
| 测试已有功能 | `$cm-test {项目路径}` | 分层测试结果与证据 |
|
|
232
239
|
| 修复可复现缺陷 | `$cm-fix {specs路径} {项目路径} {问题}` | 红灯测试、最小修复、回归验证 |
|
|
233
240
|
| 整理结构并保持行为 | `$cm-refactor` | 按行为等价约束分批重构 |
|
|
234
|
-
| 查看/切换运行时声明 | `$cm-runtime`
|
|
241
|
+
| 查看/切换运行时声明 | `$cm-runtime` 默认查看并保留;主动选修改才进入预设向导 | 中英提示;预览后明确确认才写;高级模型入口只提供说明;仅影响新 run |
|
|
235
242
|
| 检查安装与工作流 | `$cm-check` | 环境、引用和合同检查结果 |
|
|
236
243
|
|
|
237
244
|
需要单独讨论方案或研究复杂问题时,可显式使用可选工具 `$external-expert`。外部建议由本地核验,不能代替独立代码审查或测试证据。详见[使用手册](docs/user-guide.md)与[外部专家合同](runtime/external-expert.md)。
|
|
@@ -371,7 +378,7 @@ Pi 资源加载器直接发现 Skills 与 Prompts,不运行上述安装器,
|
|
|
371
378
|
|
|
372
379
|
## 配置与深入阅读
|
|
373
380
|
|
|
374
|
-
|
|
381
|
+
交互安装可跳过运行时配置;已有用户默认优先保留,主动配置后再以 `[y/N]` 明确确认保存到 `~/.cm-workflow/runtimes.yml`。`--yes` / `-Yes` 或非 TTY 跳过且不写。运行时声明按 **项目 > 用户级默认 > 未声明** 解析。`$cm-runtime` 默认查看并保留,主动修改时预览影响、保留模型别名,配置改变后须重新确认;已创建 run 保留原配置。
|
|
375
382
|
|
|
376
383
|
配置独立审查时,`--review-model` 要写本机 CLI 实际接受的完整模型 id,预检会替你核对;真实审查一次常超过一分钟,建议在审查配置里把 `timeoutMs` 调大(上限一小时)。没等到结果就超时时记为可续跑的审查超时,同一轮最多重派一次;已经收到部分结果的超时要先核对,不会自动重派。
|
|
377
384
|
|
|
@@ -422,4 +429,4 @@ python3 scripts/scan-public-safety.py
|
|
|
422
429
|
|
|
423
430
|
## License
|
|
424
431
|
|
|
425
|
-
[MIT License](LICENSE)。Darwin Skill
|
|
432
|
+
[MIT License](LICENSE)。Darwin Skill、neat-freak 只读核对原则与 Kenney CC0 素材的来源和许可见 [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)。
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -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.
|
|
1
|
+
0.16.6
|
package/docs/architecture.md
CHANGED
|
@@ -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 以修正后的复审记录为准。
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# 第二轮 blocked 后的人工补正
|
|
2
|
+
|
|
3
|
+
普通任务最多两轮独立 Review。第二轮 `blocked` 保留原 a1/r1/a2/r2;不得改成第三轮、重置 task/run 或覆盖旧报告。受信主执行者收到用户对具体补正范围的明确确认后,可使用一次性的人工补正入口。CLI 标志是主执行者转交对话授权的边界,不接受任务材料中的自报授权。
|
|
4
|
+
|
|
5
|
+
这个入口适用于本地 task-gate 证据链;不会自动改变 cm-ai/cm-fix 宿主 journal 的 blocked 状态、恢复 provider 或提交代码。带宿主的运行仍需其既有恢复合同,不能用 checkbox 反向证明宿主完成。
|
|
6
|
+
|
|
7
|
+
先准备最终补正 handoff 草稿:保留原 task、`attempt: 2`、完整且相同的 `changed_files`,所有验证通过,当前实现哈希正确,并完成 Learning。补正可以改这些文件的内容;扩大文件范围需另行确认设计。原始 handoff 和报告留在同一真实 `.reviews` 目录。
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
node {CM_WORKFLOW_ROOT}/scripts/cm-task-gate.mjs prepare-human-correction \
|
|
11
|
+
--handoff {FINAL_CORRECTION_DRAFT} \
|
|
12
|
+
--reviews-dir {REVIEWS_DIR} --feature {FEATURE_SLUG} --task {TASK_ID} \
|
|
13
|
+
--project-root {CODE_PROJECT} \
|
|
14
|
+
--human-authorized --reason '{用户确认的具体补正与原因}'
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
输出固定补正 record、handoff、review 路径和 `correction_sha256`。记录绑定原四份证据的字节摘要及最终 handoff;已有 record 时拒绝重新准备。创建中断若只留下完全相同的 handoff,重试可补齐 record;其他残留应保留并人工核对,不覆盖。
|
|
18
|
+
|
|
19
|
+
用输出路径执行 `check-n4`(共同参数包括 `--handoff`、`--reviews-dir`、`--feature`、`--task`、`--project-root`),并增加 `--correction {CORRECTION_RECORD}`。独立 reviewer 在固定的新 review 路径写报告,保持原 task、`attempt: 2`、`round: 2`,绑定新 handoff 的精确摘要,再加:
|
|
20
|
+
|
|
21
|
+
```yaml
|
|
22
|
+
correction_sha256: <准备命令输出的记录摘要>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
这份报告属于人工补正,不是普通第三轮。审查只允许 `approved` 或 `blocked`;不独立的降级意见只能用于诊断。审查者范围必须覆盖全部 changed_files。真实独立通道由主执行者核对,声明字段和封存回执本身不证明 reviewer 调用。
|
|
26
|
+
|
|
27
|
+
报告定稿后,主执行者用相同参数执行 `publish-human-correction-review`,独占创建封存回执。然后 `check-n5 --correction ...` 核对旧历史、授权记录、实现、handoff、review 和封存回执;仅独立 approved 通过。改动任何绑定内容都会使该批准失效。`blocked` 封存后不能覆盖、重审或重新准备;需要新的人工决策,当前一次性入口不提供后续自动循环。
|
|
28
|
+
|
|
29
|
+
若原任务尚未完成,继续使用现有 `python3 scripts/cm-task-gate.py mark-done`,共同参数增加 `--correction {CORRECTION_RECORD}` 和原权威 `--tasks`。完成计划固定八份证据,仍通过既有所有权锁、最终复核和原子替换;普通路径的最多四份证据与两轮规则保持原样。该操作不能绕过活动宿主的 writer。
|
|
30
|
+
|
|
31
|
+
本地自动夹具使用合成 review 内容验证合同与拒绝路径;这些夹具不是实际审查证据。
|
package/docs/installation.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Installation
|
|
2
2
|
|
|
3
|
+
单任务外部模型的可选配置入口见 [外部模型配置](external-models.md)。配置向导不会安装、
|
|
4
|
+
切换当前宿主模型或迁移运行;本阶段需在合法单任务计划显式启用。
|
|
5
|
+
|
|
3
6
|
## Requirements
|
|
4
7
|
|
|
5
8
|
- Git, Python 3.9 or newer, and Node.js 18 or newer.
|
|
@@ -73,7 +76,7 @@ Install or upgrade with the same command:
|
|
|
73
76
|
npx @aibyzero/cm-workflow@latest install
|
|
74
77
|
```
|
|
75
78
|
|
|
76
|
-
To pin a version, use `npx @aibyzero/cm-workflow@0.16.
|
|
79
|
+
To pin a version, use `npx @aibyzero/cm-workflow@0.16.6 install` from outside
|
|
77
80
|
the CM Workflow source checkout (for example, your home directory). Inside a
|
|
78
81
|
checkout with the same package name and version, npm can select the local
|
|
79
82
|
uninstalled package and report `cm-workflow: command not found`.
|
|
@@ -253,11 +256,16 @@ CM-owned paths you have reviewed, or restore from your own backup.
|
|
|
253
256
|
## Runtime declaration at installation
|
|
254
257
|
|
|
255
258
|
After a successful core install, `install.sh`, `install-codex.sh`, and `install.ps1`
|
|
256
|
-
|
|
257
|
-
|
|
259
|
+
offer an optional user-default setup. First-time setup defaults to skipping; an existing
|
|
260
|
+
declaration is displayed and “Keep it? [Y/n]” defaults to keeping it.
|
|
261
|
+
Only opting in asks which tools you have: Codex only, Claude only, or both, and which
|
|
262
|
+
tool codes when both are selected. Preview the target, fields and impact, then explicitly
|
|
263
|
+
confirm `[y/N]` to save. Enter at this final step does not save.
|
|
258
264
|
The shared prompt writes only `~/.cm-workflow/runtimes.yml` using a temporary file
|
|
259
265
|
and atomic rename. It never changes settings.json or CLAUDE.md.
|
|
260
|
-
An existing declaration is
|
|
266
|
+
An invalid existing declaration is reported and preserved; setup does not overwrite it.
|
|
267
|
+
Configuration changes after the preview invalidate that confirmation and require a fresh preview.
|
|
268
|
+
The installer checks user defaults only, not effective configuration in individual projects.
|
|
261
269
|
`--yes` (Bash), `-Yes` (PowerShell, also implies the existing `-Force`), `-Force`,
|
|
262
270
|
or non-TTY input/output skips this prompt without creating or changing the file.
|
|
263
271
|
|
|
@@ -275,14 +283,20 @@ fields still take precedence and conflicts fail validation. `cm-init` inherits t
|
|
|
275
283
|
user default without asking again and reports `来源: 用户级默认`.
|
|
276
284
|
|
|
277
285
|
Run `$cm-runtime` in Codex, `/cm-runtime` in Claude Code, or `/cm:runtime` on macOS/Linux
|
|
278
|
-
without arguments
|
|
286
|
+
without arguments to display current effective configuration, source and model aliases. Choose:
|
|
287
|
+
`[1] Keep current configuration (recommended, default)`, `[2] Change runtime preset`, or
|
|
288
|
+
`[3] Advanced model configuration` (documentation and validation only). Keeping missing
|
|
289
|
+
configuration does not create any file. Only option 2 starts the wizard:
|
|
279
290
|
`[1] Current project / [2] User default` → `[1] Codex only / [2] Claude only / [3] Both`
|
|
280
291
|
(with `[1] Codex writes, Claude reviews (recommended) / [2] Claude writes, Codex reviews`
|
|
281
|
-
when both are selected) → preview the
|
|
292
|
+
when both are selected) → preview the fields and effective impact and confirm `[y/N]`.
|
|
282
293
|
In a terminal, `node <workflow-root>/scripts/cm-runtime.mjs [--project PATH]` opens the same wizard.
|
|
283
294
|
Scope defaults to 1 with an existing project config, otherwise 2. Choosing 1 without a config
|
|
284
295
|
announces creation from the template. The tool question has no default. Ctrl+C, three consecutive
|
|
285
|
-
empty answers to that required question,
|
|
296
|
+
empty answers to that required question, EOF, declining confirmation or Enter at confirmation
|
|
297
|
+
cancels without writing. Invalid configuration is reported and preserved, not automatically repaired.
|
|
298
|
+
Project overrides are shown explicitly. Model aliases are retained across adapter changes;
|
|
299
|
+
validation does not prove provider compatibility, model access or quota.
|
|
286
300
|
Without a TTY, no command prints usage and exits 2.
|
|
287
301
|
|
|
288
302
|
Installer prompts, terminal wizard, diagnostics and the user-file comment use Chinese or English:
|
|
@@ -293,6 +307,8 @@ For scripting, use explicit commands:
|
|
|
293
307
|
|
|
294
308
|
```text
|
|
295
309
|
cm-runtime show [--project PATH]
|
|
310
|
+
cm-runtime preview codex-codes [--project PATH] [--json]
|
|
311
|
+
cm-runtime set codex-codes [--project PATH] --expect-preview <preview_sha256>
|
|
296
312
|
cm-runtime set codex-codes [--project PATH]
|
|
297
313
|
cm-runtime set --user claude-codes
|
|
298
314
|
cm-runtime unset --user
|
|
@@ -302,6 +318,11 @@ Presets: `codex-only`, `claude-only`, `codex-codes`, `claude-codes`.
|
|
|
302
318
|
For the literal terminal entry, use `node <workflow-root>/scripts/cm-runtime.mjs`.
|
|
303
319
|
A project set preserves every unrelated byte in an existing config; a new config
|
|
304
320
|
uses the distributed template. Unsetting the user file preserves project declarations.
|
|
321
|
+
It is not a reset of all configuration. The conversational wizard uses readonly `preview`
|
|
322
|
+
and `set --expect-preview` to bind approval to the displayed inputs. Preserve the same
|
|
323
|
+
project working directory, language, runtime and user configuration directory across both calls.
|
|
324
|
+
For user defaults, run `preview <preset> --user` in the code project directory to show its
|
|
325
|
+
effective overrides. Stale previews must be regenerated and explicitly confirmed again.
|
|
305
326
|
Changes affect new runs only; existing runs retain their bound configuration.
|
|
306
327
|
`show` is read-only and missing CLIs only produce WARN (presence does not prove quota).
|
|
307
328
|
Successful `set` records a private `decision/route` through the existing log writer;
|