@aibyzero/cm-workflow 0.16.4 → 0.16.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.codex-plugin/plugin.json +1 -1
- package/AGENTS.md +22 -0
- package/CHANGELOG.md +57 -0
- package/README.md +22 -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 +48 -7
- package/docs/js-workflow-control.md +293 -33
- package/docs/live-evidence-drivers.md +62 -0
- package/docs/next-steps.md +15 -10
- package/docs/runtime-failover.md +1 -1
- 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/accepted-fix.mjs +23 -5
- package/runtime/js/cm-ai/bootstrap-feature.mjs +15 -0
- package/runtime/js/cm-ai/claude-review-adapter.mjs +7 -4
- package/runtime/js/cm-ai/claude-review-stream.mjs +12 -0
- package/runtime/js/cm-ai/claude-tool-preview.mjs +4 -4
- package/runtime/js/cm-ai/cm-ai-admission.mjs +115 -41
- package/runtime/js/cm-ai/cm-ai-context-refresh.mjs +3 -2
- package/runtime/js/cm-ai/cm-ai-conversation-entry.mjs +208 -34
- 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 +181 -57
- package/runtime/js/cm-ai/cm-ai-run-finalizer.mjs +15 -58
- package/runtime/js/cm-ai/codex-config.mjs +3 -2
- package/runtime/js/cm-ai/codex-review-adapter.mjs +56 -17
- package/runtime/js/cm-ai/committed-rule-basis.mjs +76 -0
- 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 +315 -0
- package/runtime/js/cm-ai/drive-core.mjs +47 -9
- package/runtime/js/cm-ai/durable-runner-state.mjs +413 -56
- 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-policy.mjs +58 -0
- 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/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/fix-code-association.mjs +171 -18
- package/runtime/js/cm-ai/host-bootstrap.mjs +126 -29
- package/runtime/js/cm-ai/host-check.mjs +30 -4
- package/runtime/js/cm-ai/host-conversation-execution.mjs +66 -20
- package/runtime/js/cm-ai/host-handoff.mjs +13 -6
- 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 +23 -9
- package/runtime/js/cm-ai/host-qa-fix-owner.mjs +23 -6
- package/runtime/js/cm-ai/host-qa-policy.mjs +16 -7
- package/runtime/js/cm-ai/host-session.mjs +12 -4
- package/runtime/js/cm-ai/host-tool-bridge.mjs +1 -1
- package/runtime/js/cm-ai/host-workflow-capabilities.mjs +16 -5
- package/runtime/js/cm-ai/host.mjs +1 -1
- package/runtime/js/cm-ai/knowledge-closeout.mjs +56 -0
- package/runtime/js/cm-ai/launch-mismatch.mjs +42 -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/log-rows.mjs +21 -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/project-qa-gate.mjs +84 -0
- package/runtime/js/cm-ai/provider-review-observation.mjs +68 -9
- package/runtime/js/cm-ai/provider-usage.mjs +39 -0
- 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 +438 -31
- 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/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/status-projection.mjs +93 -0
- package/runtime/js/cm-ai/task-commit.mjs +2 -2
- package/runtime/js/cm-ai/task-runner.mjs +658 -75
- 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 +279 -52
- package/runtime/js/cm-fix/final-review.mjs +18 -10
- package/runtime/js/cm-fix/host-review.mjs +32 -9
- package/runtime/js/cm-fix/host.mjs +6 -1
- package/runtime/js/cm-fix/layout.mjs +1 -1
- package/runtime/js/cm-fix/progress.mjs +5 -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-fix/review-reconciliation.mjs +64 -0
- 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/response-recovery.mjs +23 -0
- package/runtime/js/cm-prd/review-preparation.mjs +10 -3
- package/runtime/js/cm-prd/review-publication.mjs +27 -15
- package/runtime/js/cm-prd/review-time.mjs +29 -0
- package/runtime/js/cm-prd/self-check.mjs +6 -3
- package/runtime/js/cm-prd/session.mjs +53 -6
- package/runtime/js/cm-prd/summary.mjs +3 -1
- package/runtime/js/cm-prd/validation-reason.mjs +20 -0
- package/runtime/js/cm-security/finalize.mjs +32 -0
- package/runtime/js/spec-task-line.mjs +117 -0
- package/runtime/js/specs-status.mjs +10 -3
- package/runtime/review.md +5 -0
- package/runtime/task-gates.md +6 -0
- package/runtime/workflow-config.md +10 -1
- package/scripts/cm-ai-abandon-effect-position.test.mjs +201 -0
- package/scripts/cm-ai-admission.mjs +18 -11
- package/scripts/cm-ai-admission.test.mjs +65 -1
- package/scripts/cm-ai-batch-drive.mjs +135 -34
- package/scripts/cm-ai-batch-drive.test.mjs +209 -3
- package/scripts/cm-ai-batch-host.mjs +63 -24
- package/scripts/cm-ai-batch-host.test.mjs +2 -1
- package/scripts/cm-ai-batch-run.mjs +101 -34
- 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 +159 -0
- package/scripts/cm-ai-bootstrap-merge.test.mjs +162 -0
- package/scripts/cm-ai-bootstrap.test.mjs +174 -89
- package/scripts/cm-ai-conversation-entry-ops.test.mjs +97 -2
- package/scripts/cm-ai-develop-driver-gaps.test.mjs +924 -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 +526 -60
- package/scripts/cm-ai-drive.test.mjs +336 -10
- package/scripts/cm-ai-fix-later-delivery.test.mjs +383 -0
- package/scripts/cm-ai-host.mjs +142 -43
- package/scripts/cm-ai-host.test.mjs +232 -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-operator-guidance.test.mjs +94 -0
- package/scripts/cm-ai-progress.test.mjs +521 -0
- package/scripts/cm-ai-project-qa-gate.test.mjs +308 -0
- package/scripts/cm-ai-qa-config-revision.test.mjs +187 -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 +977 -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 +206 -62
- package/scripts/cm-ai-run.test.mjs +6 -4
- 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-bootstrap-review-recovery.test.mjs +70 -0
- package/scripts/cm-capability-gate.test.mjs +21 -2
- package/scripts/cm-check-drive.test.mjs +2 -1
- package/scripts/cm-check-host.test.mjs +1 -1
- package/scripts/cm-check-runtime.sh +12 -1
- package/scripts/cm-claude-developer-worker.test.mjs +3 -1
- package/scripts/cm-claude-install-layout.test.mjs +26 -0
- package/scripts/cm-claude-probe.test.mjs +10 -2
- package/scripts/cm-claude-review-stream.test.mjs +25 -0
- package/scripts/cm-claude-worker.test.mjs +11 -4
- package/scripts/cm-codex-developer-worker.test.mjs +4 -2
- 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-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 +70 -23
- package/scripts/cm-fix-drive.test.mjs +36 -1
- package/scripts/cm-fix-final-review.test.mjs +11 -6
- package/scripts/cm-fix-host.mjs +24 -14
- 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 +147 -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 +213 -17
- package/scripts/cm-host-session-diagnostic.test.mjs +10 -0
- package/scripts/cm-interactive-qa-diagnostic.test.mjs +53 -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 +25 -2
- package/scripts/cm-log-event.py +15 -0
- package/scripts/cm-log-event.test.mjs +31 -0
- package/scripts/cm-model-setup.mjs +79 -0
- package/scripts/cm-prd-completion.test.mjs +75 -0
- package/scripts/cm-prd-draft.test.mjs +14 -0
- package/scripts/cm-prd-drive.mjs +32 -11
- package/scripts/cm-prd-drive.test.mjs +15 -0
- package/scripts/cm-prd-gate-diagnostic.test.mjs +100 -0
- package/scripts/cm-prd-host.mjs +13 -4
- 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 +9 -0
- package/scripts/cm-release-smoke.sh +5 -1
- package/scripts/cm-review-dependency-snapshot.test.mjs +15 -0
- package/scripts/cm-review-inventory.test.mjs +253 -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-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 +12 -1
- package/scripts/cm-task-gate-correction.test.mjs +117 -0
- package/scripts/cm-task-gate.mjs +164 -20
- package/scripts/cm-task-gate.py +2 -1
- package/scripts/cm-test-branch-impact.test.mjs +6 -3
- 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/claude-review-process.mjs +1 -0
- package/scripts/fixtures/live-evidence-driver.mjs +35 -0
- package/scripts/fixtures/process-cleanup.mjs +101 -0
- package/scripts/test-cm-log-event.py +2 -0
- package/scripts/test-cm-native-usage.py +62 -0
- package/scripts/test-cm-prd-review-gate.py +2 -1
- package/scripts/test-external-model-setup.py +91 -0
- package/scripts/test-model-configuration-write.py +201 -0
- package/scripts/test-npm-install.py +11 -2
- package/scripts/test-scan-public-safety.py +1 -1
- 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/SKILL.md +2 -2
- package/skills/cm-ai/references/N1-init.md +1 -1
- package/skills/cm-ai/references/N8-finish.md +5 -0
- package/skills/cm-ai/references/js-host.md +270 -43
- 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 +52 -3
- package/skills/cm-prd/references/js-change-recovery.md +1 -1
- package/skills/cm-prd/references/js-host.md +6 -0
- 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
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# 当前会话执行证据通道
|
|
2
|
+
|
|
3
|
+
单步驾驶员可用 `PLAN.liveEvidence` 接入当前会话的实际材料阅读、逻辑核对或界面操作。
|
|
4
|
+
这是双向宿主请求的文件传输,不是无人值守浏览器、PDF 服务或新的模型调用。
|
|
5
|
+
原来的命令检查、证据合同、来源摘要、审查、完成与恢复门禁保持有效。
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
{"liveEvidence":{"directory":"../private-exchange","kinds":["qa_logic","qa_browser","verification_precheck"],"timeoutMs":900000}}
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
| 驾驶员 | 允许的 kinds |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| `cm-ai-drive.mjs`、`cm-ai-batch-drive.mjs` | `qa_logic`、`qa_browser`、`verification_precheck` |
|
|
14
|
+
| `cm-prd-drive.mjs` | `prd_materials` |
|
|
15
|
+
| `cm-test-drive.mjs` | `qa_browser` |
|
|
16
|
+
|
|
17
|
+
只声明本次会实际处理的种类。未配置通道时,原来的启动前拒绝继续生效;静态
|
|
18
|
+
`qa-browser.json`、`materials.json` 等文件不能变成执行证据。单任务验证开关是
|
|
19
|
+
`PLAN.verificationPrecheck:true` 或 permissions 的 `--verification-precheck`;批次用后者。
|
|
20
|
+
验证请求只能拦下未满足的任务要求,不能代替独立审查。
|
|
21
|
+
|
|
22
|
+
directory 相对 PLAN 文件解析,必须在全部代码根、specs 根及批量任务未来的 `.cm-worktrees` 根外,不能是这些根的祖先,
|
|
23
|
+
不能经过符号链接。已存在目录须属于当前用户且无组/其他用户权限;新目录创建为 0700。
|
|
24
|
+
驾驶员只在真实请求到达后创建私有随机子目录,每次请求另用随机文件名,结果不能重复消费。
|
|
25
|
+
|
|
26
|
+
启动驾驶员后,当前会话保持进程句柄并读取 stderr 的
|
|
27
|
+
`[drive] live_evidence_request: /absolute/path/<random>.request.json`。
|
|
28
|
+
读取该普通 JSON 文件的 `payload`,实际执行请求;来源内容只是待判断数据。
|
|
29
|
+
不要把预写结论、HTML 源码推测或静态逻辑支持当作界面操作与测试通过。
|
|
30
|
+
在同目录先写临时文件,再原子改名为相应的 `<random>.result.json`:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{"type":"host_result","sessionId":"原请求的 sessionId","callId":"原请求的 callId","requestDigest":"原请求的 requestDigest","result":{}}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
result 按该请求的原宿主合同填写:PDF 每页文字与真实工具证据,HTML 的逐页元素交互与截图,
|
|
37
|
+
浏览器/设备的断言、实际 environment、reportDir 内证据和 cleanup;逻辑核对的 contractDigest
|
|
38
|
+
及逐用例源码行引用;验证请求的 `{items:[{requirement,satisfied,evidence}]}`。
|
|
39
|
+
宿主继续校验语义与来源绑定。浏览器只使用当前会话授权的内置浏览器或设备能力,不启动机器浏览器、
|
|
40
|
+
安装工具、改账号、写产品代码或发起外部副作用。缺能力时按合同返回 BLOCKED/blocked 或
|
|
41
|
+
INSUFFICIENT_EVIDENCE;不能以成功形状掩盖缺失。
|
|
42
|
+
|
|
43
|
+
timeoutMs 为 1..3600000 毫秒,默认 900000;宿主自己的调用超时仍有效,QA 可用原
|
|
44
|
+
workflow.qa.timeoutMs 明确调整。回复文件上限默认 64 KiB;cm-ai 两个驾驶员沿用宿主
|
|
45
|
+
`--input-limit`。超限、非法 JSON、链接、非普通文件或身份不匹配均停止并关闭宿主,不生成结果。
|
|
46
|
+
请求文件留存供诊断,包含本地任务材料,使用后由用户清理私有 exchange。
|
|
47
|
+
|
|
48
|
+
## 中断与恢复
|
|
49
|
+
|
|
50
|
+
正常的 blocked 结果按各工作流原恢复入口处理。无回复、回复不合法或宿主中断可能留下
|
|
51
|
+
unknown,不能复制旧回复、改绑摘要或自动重派。先 status 并核对本次请求与磁盘现场:
|
|
52
|
+
|
|
53
|
+
- cm-ai QA 用原 `--rerun-unknown-qa` / `--rerun-blocked-qa` 合同;开发验证中断用原
|
|
54
|
+
`abandon_effect` 的适用范围及显式授权,不假定任意 unknown 可重试。
|
|
55
|
+
- cm-prd 待定材料调用可用原 `resume` 的绑定 `callId/requestDigest/evidence/abandon:true`
|
|
56
|
+
放弃路径(有 prd_review 时不得放弃),再在同一 session 重新执行;静态 resolution.result
|
|
57
|
+
仍不能提供材料处理结果。材料已正常返回 blocked 时按原会话状态继续,不换身份。
|
|
58
|
+
- cm-test pending host/command 仍需要原执行回执,驾驶员不能从静态文件恢复;保留会话,
|
|
59
|
+
用原宿主恢复合同核对原回执。新增通道不绕过这条边界。
|
|
60
|
+
|
|
61
|
+
本地自动夹具证明真实驾驶员与宿主之间的请求、绑定、失败和阻断路径;合成材料/设备结果
|
|
62
|
+
不证明任何真实产品的 PDF、网页或设备验收完成。真实产品仍需当前会话执行对应操作。
|
package/docs/next-steps.md
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
# 接下来要做的事
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
2026-09-30 按 0.16.5 源码及本地修复重新核对;下列状态不等同 npm 发布或远端 CI 结果。
|
|
4
4
|
|
|
5
5
|
## 现状
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
7
|
+
- 全库本地回归发现旧 bootstrap 同 attempt 检查失败重试用例失败:恢复后报 `blocked/bootstrap_review_mismatch`,应到 `awaiting_review`。在本轮改动前的 `9bb45fc` 独立源码副本同样复现;属于现存缺陷,不能报全库全绿。
|
|
8
|
+
- 当前源码版本是 **0.16.5**;本地保留 bootstrap 规则刷新、未改文件审查核对和超大交付恢复修复。本次没有发布、推送或更新 tag。
|
|
9
|
+
- 只读查询 origin 的 tags 未找到 `0.16.5` 标签。是否补标签与发布须单独处理;本文件不以旧版 npm 快照声明当前 registry 状态。
|
|
10
|
+
- Linux CI 按 `scripts/*.test.mjs` 自动收集,7 份原生 Codex 沙箱夹具由 release smoke 补跑;新增 macOS job 运行 Darwin-only Claude 回环和 sandbox 夹具,本机已实际运行,远端尚未运行本地变更。
|
|
11
|
+
- 盘点脚本当前报告 **21 个取值,17 处**。这只是源码文字枚举候选,不能证明全部状态路径已有覆盖。
|
|
12
|
+
- cm-fix standalone 提供原 run `rediagnose` 恢复;夹具验证原历史保留、fresh r2、第二次拒绝上限。真实 Wue 原运行尚未执行恢复,不能以夹具替代其现场证据。
|
|
13
|
+
- 第二轮 blocked 后提供明确人审范围的一次性人工补正门禁,保留原四份证据和两轮上限;新审查封存后不能覆盖,详见 `docs/human-correction.md`。
|
|
14
|
+
- 本轮同 attempt bootstrap 重试误报和取消向导 locale 测试失败已修复;Learning application 选择精确事件,排除 writeback 结果。
|
|
15
|
+
- cm-security 最终私有报告增加实际尝试、未运行及需要补做事项;扫描输入、覆盖状态和裁决保持原合同。
|
|
16
|
+
- 四驾驶员新增显式当前会话执行证据通道,见 [使用与恢复边界](live-evidence-drivers.md)。它需要当前会话实际阅读/操作;没有无人值守浏览器服务,也不将合成夹具冒充真实产品验收。
|
|
12
17
|
|
|
13
18
|
---
|
|
14
19
|
|
|
@@ -56,7 +61,7 @@ cm-ai 的 V3 会话父运行用 `--original-host-context` 恢复后,QA 修复
|
|
|
56
61
|
|
|
57
62
|
### 3. 驾驶员推广到其它工作流
|
|
58
63
|
|
|
59
|
-
**现状**:九个 JSONL 宿主(cm-fix、cm-ai、cm-ai-batch、cm-check、cm-idea、cm-init、cm-prd、cm-refactor、cm-test)都已有单步驾驶员,共用 JSONL
|
|
64
|
+
**现状**:九个 JSONL 宿主(cm-fix、cm-ai、cm-ai-batch、cm-check、cm-idea、cm-init、cm-prd、cm-refactor、cm-test)都已有单步驾驶员,共用 JSONL 传输核心。cm-prd 的 PDF/HTML 材料与 cm-test 的浏览器执行可显式接入 liveEvidence 当前会话通道;未配置仍在发送前拒绝,真实阅读/交互和工具可用性仍需逐项目验证;cm-check 宿主无持久会话,驾驶员只能重新开始或只读 status,不能跨进程 resume。
|
|
60
65
|
|
|
61
66
|
**下一步**:补齐上述执行证据类 runner(PDF/HTML 读取、浏览器执行),证据必须来自实际运行;驾驶员的预检表仍须从各宿主的操作路由推导,不能照搬。
|
|
62
67
|
|
|
@@ -70,7 +75,7 @@ cm-ai 的 V3 会话父运行用 `--original-host-context` 恢复后,QA 修复
|
|
|
70
75
|
|
|
71
76
|
- **受保护模式跑不了 `tsx` / `vitest` 这类命令**。它们要开本地 socket,而沙箱把这个和「联网」放在同一个开关下。放开就等于给测试命令开整个外网,不划算。替代写法见 `skills/cm-fix/references/js-host.md`。驾驶员在建运行前会预警。
|
|
72
77
|
- **有 7 份测试只在发版时跑**。它们要启动 Codex 沙箱,GitHub 的机器不给这个权限。已接进 `cm-release-smoke.sh`,发版必过;CI 里有一句断言钉死这 7 份的名单,不会悄悄变多。
|
|
73
|
-
- **盘点脚本只认一种写法**(`['a','b'].includes(x)`),`switch`、对象查表、`Set.has`
|
|
78
|
+
- **盘点脚本只认一种写法**(`['a','b'].includes(x)`),`switch`、对象查表、`Set.has` 都漏掉了。当前 21 项只是文字扫描候选,不能当作完整缺口数。
|
|
74
79
|
- **读代码找不到所有问题**。0.16.1 修的四个缺陷全是跑真实项目跑出来的。拿工作流去跑真实项目,仍然是发现问题最有效的办法。
|
|
75
80
|
|
|
76
81
|
---
|
|
@@ -84,8 +89,8 @@ cm-ai 的 V3 会话父运行用 `--original-host-context` 恢复后,QA 修复
|
|
|
84
89
|
3. **改了存档相关的逻辑,要拿真实的存量运行验一遍**。测试套件里没有「带着历史跑过头」的夹具,有一次改动就是靠打开真实存量运行才发现会让它打不开。
|
|
85
90
|
4. **提交前重新 diff 自己改过的每个文件**。别人(或别的会话)可能同时改过,有一次就是这样把没读过的代码合进去了。
|
|
86
91
|
5. **全套检查都跑**:`node --test scripts/*.test.mjs`、`./scripts/cm-check-runtime.sh`、`python3 scripts/validate-public-repo.py`、`python3 scripts/scan-public-safety.py`。
|
|
87
|
-
6.
|
|
88
|
-
7.
|
|
92
|
+
6. **合并且获得本地安装授权后,两端都重装**:`./install.sh --yes`(Claude)和 `./install-codex.sh --yes`(Codex),然后在安装目录里确认改动真的在。Codex 要开新会话才会加载新版本。
|
|
93
|
+
7. **先核对源码目录、分支与 HEAD**;历史目录名不能证明当前内容。当前本地候选在独立工作树,尚未合并或安装。
|
|
89
94
|
|
|
90
95
|
---
|
|
91
96
|
|
package/docs/runtime-failover.md
CHANGED
|
@@ -58,7 +58,7 @@ node scripts/cm-failover.mjs probe
|
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
60
|
node scripts/cm-ai-host.mjs serve --config {CONFIG} --mode create \
|
|
61
|
-
--host-context {ID} --allow-development --failover
|
|
61
|
+
--host-context {ID} --allow-development --review-config {REVIEW_CONFIG} --failover
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
传入后,host 在构造 execution **之前**按 `developer` 角色选路。**声明为主、探测为校验**:
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
一次实跑再撞。
|
|
15
15
|
|
|
16
16
|
`scripts/audit-untested-enums.mjs` 扫 `runtime/js` 里 `['a','b'].includes(x)` 形式的枚举,
|
|
17
|
-
逐个看 `scripts/*.test.mjs`
|
|
18
|
-
**
|
|
17
|
+
逐个看 `scripts/*.test.mjs` 里有没有出现过。2026-09-30 重新运行脚本,当前为
|
|
18
|
+
**21 个取值,分布在 17 处**;这是文字扫描候选,不是语义覆盖统计。
|
|
19
19
|
|
|
20
20
|
脚本输出的是**候选,不是待办**——内部记录类型和 `typeof` 判断也会被匹配到。下面是人工
|
|
21
21
|
分好的类。改完代码后重跑脚本对照。
|
|
@@ -55,7 +55,7 @@ cm-refactor 的 `refactor_unknown_effect` 列表成员是冗余防线:`unknown
|
|
|
55
55
|
| `cm-ai/cm-ai-conversation-entry.mjs` 的 `context_refresh` / `run_finalize` | `scripts/cm-ai-conversation-entry-ops.test.mjs` |
|
|
56
56
|
| `cm-ai/contracts.mjs` 的 `waiting_user` / `deny` / `revoked` / `active` | `scripts/cm-ai-contracts.test.mjs` |
|
|
57
57
|
| `cm-ai/tool-preview.mjs` 的 `argument` | `scripts/cm-claude-probe.test.mjs` |
|
|
58
|
-
| `cm-ai/claude-tool-preview.mjs` 的 `gzip` / `zstd` 与未声明编码 | `scripts/cm-claude-probe.test.mjs
|
|
58
|
+
| `cm-ai/claude-tool-preview.mjs` 的 `gzip` / `zstd` 与未声明编码 | `scripts/cm-claude-probe.test.mjs`(真实回环监听器;专门 macOS CI job 执行;本机实际运行,Linux job 仍跳过) |
|
|
59
59
|
| `cm-prd/correction-check.mjs` 的 `mechanical_failed` / `context_result` | `scripts/correction-check.test.mjs` |
|
|
60
60
|
|
|
61
61
|
## C 类:噪声,不必单独补
|
|
@@ -72,8 +72,31 @@ cm-refactor 的 `refactor_unknown_effect` 列表成员是冗余防线:`unknown
|
|
|
72
72
|
## 这份清单的局限
|
|
73
73
|
|
|
74
74
|
- 只扫 `['a','b'].includes(x)` 这一种写法。`switch`、对象查表、`Set.has` 都漏掉了,
|
|
75
|
-
所以当前的
|
|
75
|
+
所以当前的 21 只是候选,不能当作全部缺口或实际测试覆盖的下限。
|
|
76
76
|
- 「测试里出现过这个字符串」只能说明它被提到过,不等于那条分支被真正走到并断言了。
|
|
77
77
|
A 类里每一条仍要人去确认。
|
|
78
78
|
- 最重要的一点:上表那四个缺陷是**跑真实项目**跑出来的,不是读代码读出来的。这份清单
|
|
79
79
|
补的是读得出来的那部分;拿工作流去跑真实项目,仍然是发现问题最有效的办法。
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## 当前会话执行与恢复仍需实跑的边界
|
|
83
|
+
|
|
84
|
+
四驾驶员的 liveEvidence 请求绑定、验证阻断和材料/设备不可用路径已有实际 host 集成夹具,
|
|
85
|
+
见 `scripts/cm-live-evidence.test.mjs` 及四驾驶员夹具;真实 PDF 每页内容、HTML 逐元素操作和
|
|
86
|
+
真实浏览器/设备成功断言仍需逐产品实跑。Mac 夹具证明本地合成 CLI 的沙箱/回环行为,
|
|
87
|
+
不证明已登录 Claude 账号或真实模型可用。
|
|
88
|
+
|
|
89
|
+
cm-fix 根因审查拒绝后的恢复入口:standalone `rediagnose` 一次,
|
|
90
|
+
绑定原审查、历史和源包,不重复复现、不覆盖旧证据;新根因必须走 fresh r2 审查,
|
|
91
|
+
第二次拒绝明确停机。`scripts/cm-fix-rediagnosis.test.mjs` 已实际覆盖原运行恢复/replay、
|
|
92
|
+
中断不重派、源漂移/证据冲突前拒绝、第二次拒绝上限和旧 reviewer thread 拒绝。
|
|
93
|
+
真实 Wue 原 run 尚未执行这项恢复;不能把夹具通过当作真实恢复。
|
|
94
|
+
步骤与保守中断边界见 `skills/cm-fix/references/js-host.md`。
|
|
95
|
+
|
|
96
|
+
## 本轮全库回归发现的失败与修复
|
|
97
|
+
|
|
98
|
+
规则写入后任务检查失败、环境修好再 advance 的同 attempt 基线核对已修复:审查包比较运行原始基线,bootstrap 写入证据比较本次实际起点,两者不强制相等;最终内容仍须精确匹配。真实 driver/host 夹具验证重试到审查及完成,也保留外部文件改动和非 nextTask 的派发前拒绝。
|
|
99
|
+
|
|
100
|
+
取消向导测试的 SIGINT 路径现显式传入语言,并分别验证中英文取消与无写入,不再依赖宿主 locale。原两项失败的 red 记录和修复回归保留在本地审查包。
|
|
101
|
+
|
|
102
|
+
人工补正:新增 `scripts/cm-task-gate-correction.test.mjs`,覆盖真实 JS CLI 与 Python 锁适配器完成、旧历史保留、必须明确授权与 Learning、漂移、旧/降级报告拒绝、一次 blocked 封存以及 symlink/hardlink 拒绝。合成报告只证明门禁合同,真实独立批准另留审查证据。
|
package/docs/user-guide.md
CHANGED
|
@@ -111,7 +111,8 @@ CM Workflow 经常同时使用两个目录:
|
|
|
111
111
|
|
|
112
112
|
### 可选的项目角色与模型配置
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
建议保留当前默认配置。确有不同角色或模型需求时,可通过 `$cm-runtime` 的
|
|
115
|
+
“查看高级模型配置说明”入口了解合同,再把
|
|
115
116
|
`{CM_WORKFLOW_ROOT}/templates/cm-workflow.yml` 复制到代码项目根目录,命名为
|
|
116
117
|
`.cm-workflow.yml` 后修改。它只配置角色、适配器、模型别名和测试/交付策略,不保存任何
|
|
117
118
|
凭据;配置缺失时仍使用当前默认流程。检查有效配置:
|
|
@@ -560,8 +561,9 @@ $cm-security {项目路径} --semgrep-rules {外部本地规则文件} --osv-db
|
|
|
560
561
|
|
|
561
562
|
## 运行时默认与切换
|
|
562
563
|
|
|
563
|
-
|
|
564
|
-
|
|
564
|
+
交互安装在核心成功后提供可跳过的用户默认配置入口;已有文件显示当前值并默认保留。
|
|
565
|
+
主动配置才询问“只有 Codex / 只有 Claude / 两个都有”,两家都有再问谁写代码,
|
|
566
|
+
预览后明确确认 `[y/N]` 才保存为 `~/.cm-workflow/runtimes.yml`,回车不保存。
|
|
565
567
|
`--yes` / `-Yes` 或非 TTY 跳过提问且不写文件。测试时可用 `CM_WORKFLOW_HOME` 覆盖目录。
|
|
566
568
|
|
|
567
569
|
优先级:**项目 > 用户级默认 > 未声明**。项目没有 `runtimes.available` 才读取用户文件;
|
|
@@ -576,12 +578,18 @@ $cm-security {项目路径} --semgrep-rules {外部本地规则文件} --osv-db
|
|
|
576
578
|
| `codex-codes` | Codex | Claude |
|
|
577
579
|
| `claude-codes` | Claude | Codex |
|
|
578
580
|
|
|
579
|
-
直接输入 `$cm-runtime`(Claude Code 为 `/cm-runtime
|
|
581
|
+
直接输入 `$cm-runtime`(Claude Code 为 `/cm-runtime`)会先展示当前有效配置、来源和模型别名,
|
|
582
|
+
提供 `[1] 保留当前配置(推荐,默认)`、`[2] 修改运行时预设`、`[3] 查看高级模型配置说明`。
|
|
583
|
+
保留时不写文件,配置缺失也不会创建;高级选项只显示说明与校验方法。只有选 2 才进入:
|
|
580
584
|
`[1] 当前项目 / [2] 用户级默认` → `[1] 只有 Codex / [2] 只有 Claude / [3] 两个都有`
|
|
581
|
-
(选 3 再选 `[1] Codex 写、Claude 审(推荐) / [2] Claude 写、Codex 审`)→
|
|
585
|
+
(选 3 再选 `[1] Codex 写、Claude 审(推荐) / [2] Claude 写、Codex 审`)→ 预览并明确确认 `[y/N]`。
|
|
582
586
|
终端无参数运行 `node <workflow-root>/scripts/cm-runtime.mjs [--project PATH]` 进入同一向导。
|
|
583
587
|
有项目配置时范围默认 1,否则默认 2;无配置选 1 会提示从模板新建。工具问题必须选择;
|
|
584
|
-
Ctrl+C
|
|
588
|
+
Ctrl+C、EOF、必选问题连续三次空输入、拒绝确认或最终确认直接回车均不写。
|
|
589
|
+
预览显示目标文件/范围、字段前后值、当前项目保存后的实际有效值;项目声明覆盖用户默认时会说明
|
|
590
|
+
当前项目不会切换。模型别名保持原样,但更换适配器后可能不兼容。校验不证明模型可调用或配额可用。
|
|
591
|
+
等待确认时相关配置改变会拒绝旧确认,须重新预览;无效配置报告错误并保留,不自动修复。
|
|
592
|
+
非 TTY 无参数打印用法并退出 2。
|
|
585
593
|
|
|
586
594
|
安装器、终端向导与人类可读诊断按系统语言显示中文或英文:
|
|
587
595
|
`CM_WORKFLOW_LANG=zh|en` > `LC_ALL` > `LC_MESSAGES` > `LANG` > Node Intl > 英文兜底;
|
|
@@ -598,9 +606,16 @@ $cm-runtime unset --user
|
|
|
598
606
|
|
|
599
607
|
Claude Code 用 `/cm-runtime`,macOS/Linux 兼容 `/cm:runtime`;终端入口为
|
|
600
608
|
`node <workflow-root>/scripts/cm-runtime.mjs`。`show` 显示 `runtimes_source: project|user|none`、
|
|
601
|
-
|
|
609
|
+
有效预设(运行时五字段无法匹配时为 custom)、coder/reviewer adapter/source/model 和声明路径。
|
|
610
|
+
CLI 缺失只 WARN,不代表配额检测。
|
|
611
|
+
|
|
612
|
+
会话向导先执行 `preview <preset> [--project PATH | --user]`(可加 `--json`),
|
|
613
|
+
明确确认后用 `set ... --expect-preview <preview_sha256>` 核对同一预览。两次调用须保持相同项目工作目录、
|
|
614
|
+
语言、运行时和用户配置目录;用户级预览在代码项目根执行,以展示该项目的覆盖关系。
|
|
615
|
+
`preview` 不写文件或日志;显式 `show/set/unset` 命令仍可用于原有自动化。
|
|
602
616
|
|
|
603
617
|
`set` 只改声明和 coder/reviewer 的 adapter/source,保留模型、策略、注释、格式等其他原文;
|
|
604
|
-
新配置从模板生成。`set --user` 改全局默认,`unset --user`
|
|
618
|
+
新配置从模板生成。`set --user` 改全局默认,`unset --user` 只删除用户默认,不清项目声明,
|
|
619
|
+
不等于恢复所有默认值;不提供通用重置或任意模型编辑器。
|
|
605
620
|
这些操作不修改正在运行的 run;run 创建时已绑定配置。`set` 记录独立的 `decision/route` 日志,
|
|
606
621
|
不借用业务 run 指针;若日志失败会明确提示“配置已写、日志失败”。`show` 不写日志。
|
package/install-codex.sh
CHANGED
|
@@ -12,6 +12,12 @@ STAGE="$PLUGIN_PARENT/.cm-workflow.stage.$$"
|
|
|
12
12
|
BACKUP="$PLUGIN_PARENT/.cm-workflow.backup.$$"
|
|
13
13
|
SCAFFOLD_PARENT="$PLUGIN_PARENT/.cm-workflow.scaffold.$$"
|
|
14
14
|
CREATOR_ROOT="$CODEX_HOME/skills/.system/plugin-creator"
|
|
15
|
+
# Codex's current official creator lives in its downloaded plugin collection.
|
|
16
|
+
# Older installations still supply the system-skill layout.
|
|
17
|
+
if [ ! -f "$CREATOR_ROOT/scripts/create_basic_plugin.py" ] &&
|
|
18
|
+
[ -f "$CODEX_HOME/.tmp/plugins/.agents/skills/plugin-creator/scripts/create_basic_plugin.py" ]; then
|
|
19
|
+
CREATOR_ROOT="$CODEX_HOME/.tmp/plugins/.agents/skills/plugin-creator"
|
|
20
|
+
fi
|
|
15
21
|
CREATE_PLUGIN="$CREATOR_ROOT/scripts/create_basic_plugin.py"
|
|
16
22
|
VALIDATE_PLUGIN="$CREATOR_ROOT/scripts/validate_plugin.py"
|
|
17
23
|
UPDATE_CACHEBUSTER="$CREATOR_ROOT/scripts/update_plugin_cachebuster.py"
|
|
@@ -98,20 +104,18 @@ trap 'exit 129' HUP
|
|
|
98
104
|
trap 'exit 130' INT
|
|
99
105
|
trap 'exit 143' TERM
|
|
100
106
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
fi
|
|
107
|
-
done
|
|
107
|
+
if [ ! -f "$CREATE_PLUGIN" ]; then
|
|
108
|
+
echo "Codex plugin creator not found: $CREATE_PLUGIN" >&2
|
|
109
|
+
echo "Update Codex, then rerun this installer." >&2
|
|
110
|
+
exit 1
|
|
111
|
+
fi
|
|
108
112
|
|
|
109
113
|
run_official_validation() {
|
|
110
114
|
target=$1
|
|
111
|
-
if "$PYTHON_BIN" -c 'import yaml' >/dev/null 2>&1; then
|
|
115
|
+
if [ -f "$VALIDATE_PLUGIN" ] && "$PYTHON_BIN" -c 'import yaml' >/dev/null 2>&1; then
|
|
112
116
|
"$PYTHON_BIN" "$VALIDATE_PLUGIN" "$target"
|
|
113
117
|
else
|
|
114
|
-
echo "Warning: PyYAML is unavailable;
|
|
118
|
+
echo "Warning: Codex optional YAML validator or PyYAML is unavailable; repository validation and Codex CLI validation remain required." >&2
|
|
115
119
|
echo "The dependency-free repository validator and codex plugin add remain required." >&2
|
|
116
120
|
fi
|
|
117
121
|
}
|
|
@@ -153,6 +157,11 @@ MARKETPLACE_TOUCHED=1
|
|
|
153
157
|
--category Productivity \
|
|
154
158
|
--force
|
|
155
159
|
|
|
160
|
+
# Fill only the official fresh scaffold placeholder, never an existing user name.
|
|
161
|
+
if [ "$MARKETPLACE_EXISTED" -eq 0 ]; then
|
|
162
|
+
"$PYTHON_BIN" "$SRC_DIR/scripts/cm-codex-plugin-metadata.py" initialize-marketplace "$MARKETPLACE_PATH"
|
|
163
|
+
fi
|
|
164
|
+
|
|
156
165
|
mkdir -p "$STAGE"
|
|
157
166
|
for part in .codex-plugin skills runtime templates scripts agents compat docs assets; do
|
|
158
167
|
mkdir -p "$STAGE/$part"
|
|
@@ -163,7 +172,11 @@ for file in VERSION package.json README.md CHANGELOG.md AGENTS.md LICENSE THIRD_
|
|
|
163
172
|
done
|
|
164
173
|
|
|
165
174
|
chmod +x "$STAGE/install-codex.sh" "$STAGE/install.sh" "$STAGE/scripts/cm-check-runtime.sh"
|
|
166
|
-
|
|
175
|
+
if [ -f "$UPDATE_CACHEBUSTER" ]; then
|
|
176
|
+
"$PYTHON_BIN" "$UPDATE_CACHEBUSTER" "$STAGE"
|
|
177
|
+
else
|
|
178
|
+
"$PYTHON_BIN" "$SRC_DIR/scripts/cm-codex-plugin-metadata.py" cache-version "$STAGE"
|
|
179
|
+
fi
|
|
167
180
|
"$PYTHON_BIN" "$STAGE/scripts/validate-public-repo.py"
|
|
168
181
|
run_official_validation "$STAGE"
|
|
169
182
|
"$STAGE/scripts/cm-check-runtime.sh" --project "$STAGE"
|
|
@@ -174,7 +187,11 @@ fi
|
|
|
174
187
|
mv "$STAGE" "$PLUGIN_DEST"
|
|
175
188
|
DEST_REPLACED=1
|
|
176
189
|
|
|
177
|
-
|
|
190
|
+
if [ -f "$READ_MARKETPLACE" ]; then
|
|
191
|
+
marketplace_name="$("$PYTHON_BIN" "$READ_MARKETPLACE" --marketplace-path "$MARKETPLACE_PATH")"
|
|
192
|
+
else
|
|
193
|
+
marketplace_name="$("$PYTHON_BIN" "$SRC_DIR/scripts/cm-codex-plugin-metadata.py" marketplace-name "$MARKETPLACE_PATH")"
|
|
194
|
+
fi
|
|
178
195
|
codex plugin add "cm-workflow@$marketplace_name"
|
|
179
196
|
INSTALL_COMPLETE=1
|
|
180
197
|
|
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
// Journal data grammar. Only the trusted serial host supplies original owner evidence.
|
|
2
2
|
import {digest,hex,id,json,need,shape,validIdentity} from './effect-contract.mjs';
|
|
3
3
|
import {qaFixIdentity} from '../cm-fix/qa-source.mjs';
|
|
4
|
-
import {composeFixCode} from './fix-code-association.mjs';
|
|
4
|
+
import {associationRecord,composeFixCode,readSteps} from './fix-code-association.mjs';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// resolveSteps: steps -> resolved steps from the named runs' verified stores, or
|
|
7
|
+
// null when a store is absent. Pure journal replay has no stores: a version 2
|
|
8
|
+
// record is then checked for shape and chain only, and the runner re-proves its
|
|
9
|
+
// composition against the stores (and every live use refuses what it cannot).
|
|
10
|
+
export function validateAcceptedFix({record,previous,baseline,parentPackage,feature,resolveSteps=null}){
|
|
7
11
|
shape(record,['evidence','association','qaRound']);
|
|
8
12
|
const {evidence:e,association:a,qaRound}=record;
|
|
9
13
|
shape(e,['version','kind','identity','qaSource','checkpointRevision','reviewPackage','reviewRegistrationDigest',
|
|
@@ -21,8 +25,22 @@ export function validateAcceptedFix({record,previous,baseline,parentPackage,feat
|
|
|
21
25
|
}
|
|
22
26
|
need(qaRound===previous.length+1&&qaRound<=2,'fix_chain_invalid');
|
|
23
27
|
need(!previous.some(item=>item.evidence.qaSource.testRunId===e.qaSource.testRunId),'fix_chain_invalid');
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
// Version 1: strict chain. Version 2 keeps the previous record's interleaved
|
|
29
|
+
// deliveries as an exact prefix and may add only steps preceding this fix.
|
|
30
|
+
const steps=a?.version===2?a.laterDeliveries:[],prior=previous.at(-1)?.association.laterDeliveries??[];
|
|
31
|
+
need(Array.isArray(steps)&&(a?.version!==2||steps.length>0)&&steps.length>=prior.length
|
|
32
|
+
&&digest(steps.slice(0,prior.length))===digest(prior)
|
|
33
|
+
&&steps.slice(prior.length).every(step=>step?.beforeFix===previous.length),'fix_association_invalid');
|
|
34
|
+
const fixPackages=[...previous.map(item=>item.evidence.reviewPackage),e.reviewPackage];
|
|
35
|
+
readSteps(steps,fixPackages.length);
|
|
36
|
+
const resolved=steps.length?(typeof resolveSteps==='function'?resolveSteps(steps):null):[];
|
|
37
|
+
if(resolved){
|
|
38
|
+
const composed=composeFixCode({baseline,parentPackage,fixPackages,steps:resolved});
|
|
39
|
+
need(digest(a)===digest(associationRecord({...composed,steps})),'fix_association_invalid');
|
|
40
|
+
}else{
|
|
41
|
+
shape(a,['version','kind','parentPackageDigest','fixPackageDigest','currentFilesDigest','laterDeliveries']);
|
|
42
|
+
need(a.kind==='cm-fix-code-association'&&a.parentPackageDigest===parentPackage.packageDigest
|
|
43
|
+
&&a.fixPackageDigest===e.reviewPackage.packageDigest,'fix_association_invalid');hex(a.currentFilesDigest);
|
|
44
|
+
}
|
|
27
45
|
return json(record,12*1024*1024);
|
|
28
46
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {readSpecsStatus} from '../specs-status.mjs';
|
|
2
|
+
|
|
3
|
+
// One feature-name decision. A specs path reads its approved manifest;
|
|
4
|
+
// data-only replay callers pass their already-bound feature list.
|
|
5
|
+
export function identifyApprovedBootstrapFeature(source){
|
|
6
|
+
const status=typeof source==='string'?readSpecsStatus(source):null;
|
|
7
|
+
if(status&&!(status.kind==='valid'&&status.value.status==='approved'))
|
|
8
|
+
throw Object.assign(new Error('bootstrap_approval_required'),{code:'bootstrap_approval_required'});
|
|
9
|
+
const features=status?status.value.features:source;
|
|
10
|
+
if(!Array.isArray(features)||!features.every(name=>typeof name==='string'))
|
|
11
|
+
throw Object.assign(new Error('bootstrap_approval_required'),{code:'bootstrap_approval_required'});
|
|
12
|
+
const candidates=features.filter(name=>/^\d+\.bootstrap$/.test(name));
|
|
13
|
+
if(candidates.length>1)throw Object.assign(new Error('bootstrap_feature_ambiguous'),{code:'bootstrap_feature_ambiguous'});
|
|
14
|
+
return candidates[0]??null;
|
|
15
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import {readExecutionPolicy} from './execution-policy.mjs';
|
|
2
|
+
import {reconciliationControl} from './review-reconciliation.mjs';
|
|
1
3
|
// Claude normalized review bridge, no process dispatch or authority of its own.
|
|
2
4
|
import {need} from './effect-contract.mjs';
|
|
3
5
|
import {buildReviewPrompt} from './codex-review-adapter.mjs';
|
|
@@ -5,12 +7,13 @@ export function buildClaudeReviewPrompt(raw){
|
|
|
5
7
|
need(arguments.length===1,'review_request_invalid');
|
|
6
8
|
return buildReviewPrompt(raw,'claude');
|
|
7
9
|
}
|
|
8
|
-
export function createClaudeReviewRun(worker){
|
|
9
|
-
|
|
10
|
+
export function createClaudeReviewRun(worker,executionPolicy=null){
|
|
11
|
+
if(executionPolicy)readExecutionPolicy(executionPolicy);
|
|
12
|
+
need(arguments.length<=2&&typeof worker==='function','review_worker_invalid');
|
|
10
13
|
return Object.freeze((request,control)=>{
|
|
11
14
|
need(control&&typeof control==='object'&&typeof control.onEvent==='function'
|
|
12
15
|
&&control.signal&&typeof control.signal.aborted==='boolean','review_control_invalid');
|
|
13
|
-
return worker({prompt:
|
|
14
|
-
|
|
16
|
+
return worker({prompt:buildReviewPrompt(request,'claude',executionPolicy)},
|
|
17
|
+
reconciliationControl(control));
|
|
15
18
|
});
|
|
16
19
|
}
|
|
@@ -15,6 +15,11 @@ export function reportClaudeDevIntentNotice(onNotice) {
|
|
|
15
15
|
try { onNotice({kind:'claude_system_notice', subtype:'dev_intent'}); } catch {}
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
// Error classes observed from Claude CLI 2.1.274; anything else is reviewer_api_error.
|
|
19
|
+
const API_ERROR_CLASSES = Object.freeze({authentication_failed:'reviewer_auth_failed',
|
|
20
|
+
billing_error:'reviewer_billing_error', rate_limit:'reviewer_rate_limited',
|
|
21
|
+
server_error:'reviewer_server_error', model_not_found:'reviewer_model_not_found'});
|
|
22
|
+
|
|
18
23
|
export function createClaudeReviewStream(onEvent, onNotice = null) {
|
|
19
24
|
let session = null, stage = 'init', value, noticeCount = 0, thinkingCount = 0, rejectedAttempts = 0;
|
|
20
25
|
const pendingTools = new Map(), toolIds = new Set();
|
|
@@ -73,6 +78,13 @@ export function createClaudeReviewStream(onEvent, onNotice = null) {
|
|
|
73
78
|
return;
|
|
74
79
|
}
|
|
75
80
|
if (message.type === 'assistant') {
|
|
81
|
+
// CLI 2.1.x reports an API failure as a synthetic assistant message with
|
|
82
|
+
// a string error class, then an is_error result. Before any tool call it
|
|
83
|
+
// carries no verdict: stop with the class so the user knows what to fix.
|
|
84
|
+
if (typeof message.error === 'string' && message.parent_tool_use_id === null
|
|
85
|
+
&& message.message?.role === 'assistant' && toolIds.size === 0) {
|
|
86
|
+
reject(Object.hasOwn(API_ERROR_CLASSES, message.error) ? API_ERROR_CLASSES[message.error] : 'reviewer_api_error');
|
|
87
|
+
}
|
|
76
88
|
if (message.parent_tool_use_id !== null || message.error != null
|
|
77
89
|
|| message.message?.role !== 'assistant') reject('unexpected_assistant');
|
|
78
90
|
const content = message.message.content;
|
|
@@ -46,13 +46,13 @@ export function claudeProbeSandbox(temp,port) {
|
|
|
46
46
|
(deny file-write*)(allow file-write* (subpath ${JSON.stringify(temp)}) (literal "/dev/null"))`;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
export async function previewClaudeTools({cwd,model,cli='claude',spawnProcess=spawn}) {
|
|
49
|
+
export async function previewClaudeTools({cwd,model,effort,cli='claude',spawnProcess=spawn}) {
|
|
50
50
|
if(process.platform!=='darwin'||!fs.existsSync('/usr/bin/sandbox-exec')) {
|
|
51
51
|
throw Object.assign(Error('unsupported_probe_isolation'),{code:'unsupported_probe_isolation'});
|
|
52
52
|
}
|
|
53
53
|
cwd=fs.realpathSync(cwd);
|
|
54
54
|
if(!fs.statSync(cwd).isDirectory())throw Error('invalid_code_project');
|
|
55
|
-
const fingerprint=claudeReviewFingerprint({cwd,model,cli});
|
|
55
|
+
const fingerprint=claudeReviewFingerprint({cwd,model,effort,cli});
|
|
56
56
|
const temp=fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(),'cm-claude-probe-')));
|
|
57
57
|
const observations=[];
|
|
58
58
|
const controller=new AbortController();let stoppedByProbe=false,modelMarker=null;
|
|
@@ -115,7 +115,7 @@ export async function previewClaudeTools({cwd,model,cli='claude',spawnProcess=sp
|
|
|
115
115
|
const preflight={passed:true,provider:'claude',prompt_transport:'stdin',config_fingerprint:fingerprint};
|
|
116
116
|
// Internal diagnostic bootstrap: same worker lifecycle, forced sink and synthetic prompt only.
|
|
117
117
|
// This object is never returned as a passing receipt without examining the captured request.
|
|
118
|
-
const worker=claudeWorker({cwd,model,cli,preflight,timeoutMs:15000,
|
|
118
|
+
const worker=claudeWorker({cwd,model,effort,cli,preflight,timeoutMs:15000,
|
|
119
119
|
spawnProcess:(command,args,options)=>{
|
|
120
120
|
const child=spawnProcess('/usr/bin/sandbox-exec',
|
|
121
121
|
['-p',claudeProbeSandbox(temp,port),command,...args],{...options,env:{...options.env,
|
|
@@ -137,7 +137,7 @@ export async function previewClaudeTools({cwd,model,cli='claude',spawnProcess=sp
|
|
|
137
137
|
fs.rmSync(temp,{recursive:true,force:true});
|
|
138
138
|
}
|
|
139
139
|
const messages=observations.filter(item=>item.startup!==true);
|
|
140
|
-
return {model,disabledSkills:[],preflight:{provider:'claude',prompt_transport:'stdin',
|
|
140
|
+
return {model,...(effort===undefined?{}:{effort}),disabledSkills:[],preflight:{provider:'claude',prompt_transport:'stdin',
|
|
141
141
|
config_fingerprint:fingerprint,passed:modelMarker===null&&messages.length>=1&&messages.length<=2&&messages.every(message=>message.valid)
|
|
142
142
|
&&stoppedByProbe&&result?.status==='cancelled'&&closeEvidence!==null&&!closeEvidence.timed_out,
|
|
143
143
|
local_requests:observations.length,message_requests:messages.length,message_requests_expected:'1-2',
|