cc-devflow 4.5.11 → 4.5.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/.claude/skills/cc-act/CHANGELOG.md +18 -0
  2. package/.claude/skills/cc-act/PLAYBOOK.md +17 -269
  3. package/.claude/skills/cc-act/SKILL.md +38 -425
  4. package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_INDEX_TEMPLATE.md +2 -13
  5. package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_TEMPLATE.md +1 -9
  6. package/.claude/skills/cc-act/assets/PR_BRIEF_TEMPLATE.md +21 -177
  7. package/.claude/skills/cc-act/references/closure-contract.md +12 -63
  8. package/.claude/skills/cc-act/references/git-commit-guidelines.md +5 -5
  9. package/.claude/skills/cc-act/scripts/cc-act-common.sh +5 -322
  10. package/.claude/skills/cc-act/scripts/detect-ship-target.sh +11 -2
  11. package/.claude/skills/cc-act/scripts/inspect-git-index.sh +58 -0
  12. package/.claude/skills/cc-act/scripts/render-pr-brief.sh +40 -440
  13. package/.claude/skills/cc-act/scripts/verify-act-gate.sh +10 -50
  14. package/.claude/skills/cc-check/CHANGELOG.md +18 -0
  15. package/.claude/skills/cc-check/PLAYBOOK.md +19 -273
  16. package/.claude/skills/cc-check/SKILL.md +33 -456
  17. package/.claude/skills/cc-check/references/review-contract.md +12 -147
  18. package/.claude/skills/cc-dev/CHANGELOG.md +15 -0
  19. package/.claude/skills/cc-dev/PLAYBOOK.md +1 -1
  20. package/.claude/skills/cc-dev/SKILL.md +52 -137
  21. package/.claude/skills/cc-dev/scripts/resolve-cc-devflow.sh +181 -0
  22. package/.claude/skills/cc-do/CHANGELOG.md +11 -0
  23. package/.claude/skills/cc-do/PLAYBOOK.md +19 -113
  24. package/.claude/skills/cc-do/SKILL.md +39 -245
  25. package/.claude/skills/cc-do/references/execution-recovery.md +15 -109
  26. package/.claude/skills/cc-do/scripts/cc-do-common.sh +5 -57
  27. package/.claude/skills/cc-do/scripts/check-task-status.sh +35 -65
  28. package/.claude/skills/cc-do/scripts/mark-task-complete.sh +9 -46
  29. package/.claude/skills/cc-do/scripts/select-ready-tasks.sh +29 -97
  30. package/.claude/skills/cc-investigate/CHANGELOG.md +16 -0
  31. package/.claude/skills/cc-investigate/PLAYBOOK.md +20 -180
  32. package/.claude/skills/cc-investigate/SKILL.md +64 -246
  33. package/.claude/skills/cc-investigate/assets/TASKS_TEMPLATE.md +48 -98
  34. package/.claude/skills/cc-investigate/references/investigation-contract.md +14 -218
  35. package/.claude/skills/cc-next/CHANGELOG.md +6 -0
  36. package/.claude/skills/cc-next/PLAYBOOK.md +12 -8
  37. package/.claude/skills/cc-next/SKILL.md +34 -140
  38. package/.claude/skills/cc-plan/CHANGELOG.md +16 -0
  39. package/.claude/skills/cc-plan/PLAYBOOK.md +22 -161
  40. package/.claude/skills/cc-plan/SKILL.md +45 -295
  41. package/.claude/skills/cc-plan/assets/TASKS_TEMPLATE.md +30 -228
  42. package/.claude/skills/cc-plan/references/planning-contract.md +24 -161
  43. package/.claude/skills/cc-plan/scripts/next-change-key.sh +8 -44
  44. package/.claude/skills/cc-plan/scripts/parse-task-dependencies.js +2 -2
  45. package/.claude/skills/cc-plan/scripts/validate-scope.sh +1 -1
  46. package/.claude/skills/cc-pr-land/SKILL.md +14 -114
  47. package/.claude/skills/cc-pr-review/CHANGELOG.md +4 -0
  48. package/.claude/skills/cc-pr-review/SKILL.md +20 -103
  49. package/.claude/skills/cc-review/CHANGELOG.md +17 -0
  50. package/.claude/skills/cc-review/PLAYBOOK.md +13 -86
  51. package/.claude/skills/cc-review/SKILL.md +53 -241
  52. package/.claude/skills/cc-review/references/e2e-and-plugin-verification.md +2 -2
  53. package/.claude/skills/cc-review/references/implementation-review-branch.md +7 -147
  54. package/.claude/skills/cc-review/references/plan-review-branch.md +5 -147
  55. package/.claude/skills/cc-review/references/review-methods.md +10 -218
  56. package/.claude/skills/cc-review/scripts/collect-review-context.sh +4 -63
  57. package/.claude/skills/cc-roadmap/PLAYBOOK.md +1 -1
  58. package/.claude/skills/cc-roadmap/SKILL.md +3 -3
  59. package/.claude/skills/cc-simplify/CHANGELOG.md +7 -0
  60. package/.claude/skills/cc-simplify/SKILL.md +26 -21
  61. package/.claude/skills/cc-spec-init/PLAYBOOK.md +12 -48
  62. package/.claude/skills/cc-spec-init/SKILL.md +29 -132
  63. package/.claude/skills/cc-spec-init/references/spec-contract.md +8 -17
  64. package/CHANGELOG.md +13 -0
  65. package/bin/cc-devflow-cli.js +20 -260
  66. package/bin/cc-devflow.js +44 -7
  67. package/docs/commands/README.md +1 -1
  68. package/docs/commands/README.zh-CN.md +1 -1
  69. package/docs/examples/README.md +1 -1
  70. package/docs/examples/START-HERE.md +14 -15
  71. package/docs/examples/example-bindings.json +11 -11
  72. package/docs/examples/full-design-blocked/README.md +4 -6
  73. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/{planning/tasks.md → task.md} +20 -15
  74. package/docs/examples/local-handoff/README.md +8 -11
  75. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/pr-brief.md +31 -0
  76. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/{planning/tasks.md → task.md} +18 -13
  77. package/docs/examples/pdca-loop/README.md +6 -9
  78. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/pr-brief.md +9 -11
  79. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/{planning/tasks.md → task.md} +18 -13
  80. package/docs/examples/scripts/check-example-bindings.sh +11 -62
  81. package/docs/guides/artifact-contract.md +10 -40
  82. package/docs/guides/getting-started.md +8 -8
  83. package/docs/guides/getting-started.zh-CN.md +8 -8
  84. package/docs/guides/minimize-artifacts.md +16 -130
  85. package/docs/guides/project-postmortem.md +14 -71
  86. package/lib/compiler/__tests__/skills-registry.test.js +9 -8
  87. package/lib/compiler/resource-copier.js +29 -0
  88. package/lib/skill-runtime/__tests__/archive-change.test.js +2 -2
  89. package/lib/skill-runtime/__tests__/benchmark-skills.test.js +3 -3
  90. package/lib/skill-runtime/__tests__/cli-bootstrap.integration.test.js +14 -4
  91. package/lib/skill-runtime/errors.js +3 -3
  92. package/lib/skill-runtime/index.js +5 -23
  93. package/lib/skill-runtime/paths.js +5 -52
  94. package/lib/skill-runtime/query-registry.js +4 -4
  95. package/lib/skill-runtime/query.js +89 -201
  96. package/lib/skill-runtime/store.js +4 -40
  97. package/lib/skill-runtime/trace.js +2 -2
  98. package/package.json +2 -5
  99. package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_PRINCIPLES_TEMPLATE.md +0 -29
  100. package/.claude/skills/cc-act/assets/RELEASE_NOTE_TEMPLATE.md +0 -54
  101. package/.claude/skills/cc-act/scripts/generate-status-report.sh +0 -92
  102. package/.claude/skills/cc-act/scripts/sync-act-docs.sh +0 -355
  103. package/.claude/skills/cc-check/assets/REPORT_CARD_TEMPLATE.json +0 -234
  104. package/.claude/skills/cc-check/scripts/render-report-card.js +0 -438
  105. package/.claude/skills/cc-check/scripts/verify-gate.sh +0 -85
  106. package/.claude/skills/cc-do/scripts/build-task-context.sh +0 -175
  107. package/.claude/skills/cc-do/scripts/record-review-decision.sh +0 -88
  108. package/.claude/skills/cc-do/scripts/recover-workflow.sh +0 -82
  109. package/.claude/skills/cc-do/scripts/run-problem-analysis.sh +0 -70
  110. package/.claude/skills/cc-do/scripts/verify-task-gates.sh +0 -109
  111. package/.claude/skills/cc-do/scripts/write-task-checkpoint.sh +0 -92
  112. package/.claude/skills/cc-investigate/assets/TASK_MANIFEST_TEMPLATE.json +0 -224
  113. package/.claude/skills/cc-plan/assets/TASK_MANIFEST_TEMPLATE.json +0 -178
  114. package/.claude/skills/cc-spec-init/assets/CHANGE_META_TEMPLATE.json +0 -28
  115. package/.claude/skills/cc-spec-init/scripts/validate-spec-links.sh +0 -45
  116. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/design.md +0 -234
  117. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/task-manifest.json +0 -488
  118. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/review/report-card.json +0 -189
  119. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/resume-index.md +0 -39
  120. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/status.md +0 -29
  121. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/design.md +0 -123
  122. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/task-manifest.json +0 -292
  123. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/review/report-card.json +0 -136
  124. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/status.md +0 -29
  125. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/design.md +0 -124
  126. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/task-manifest.json +0 -292
  127. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/review/report-card.json +0 -136
  128. package/docs/get-shit-done-strategy-audit.md +0 -518
  129. package/docs/skill-runtime-migration.md +0 -46
  130. package/lib/skill-runtime/__tests__/approve.test.js +0 -92
  131. package/lib/skill-runtime/__tests__/autopilot.test.js +0 -253
  132. package/lib/skill-runtime/__tests__/benchmark-artifacts.test.js +0 -165
  133. package/lib/skill-runtime/__tests__/delegation.test.js +0 -97
  134. package/lib/skill-runtime/__tests__/dispatch.test.js +0 -237
  135. package/lib/skill-runtime/__tests__/intent.test.js +0 -203
  136. package/lib/skill-runtime/__tests__/lifecycle.test.js +0 -169
  137. package/lib/skill-runtime/__tests__/planner.tdd.test.js +0 -331
  138. package/lib/skill-runtime/__tests__/prepare-pr.test.js +0 -126
  139. package/lib/skill-runtime/__tests__/query.test.js +0 -860
  140. package/lib/skill-runtime/__tests__/readiness.test.js +0 -53
  141. package/lib/skill-runtime/__tests__/release.test.js +0 -85
  142. package/lib/skill-runtime/__tests__/review-check-integration.test.js +0 -148
  143. package/lib/skill-runtime/__tests__/review-records.test.js +0 -619
  144. package/lib/skill-runtime/__tests__/runtime.integration.test.js +0 -351
  145. package/lib/skill-runtime/__tests__/schemas.test.js +0 -337
  146. package/lib/skill-runtime/__tests__/task-contract-migrate.test.js +0 -137
  147. package/lib/skill-runtime/__tests__/task-contract.test.js +0 -874
  148. package/lib/skill-runtime/__tests__/team-state.test.js +0 -51
  149. package/lib/skill-runtime/__tests__/verify-artifacts.test.js +0 -203
  150. package/lib/skill-runtime/__tests__/worker-run.test.js +0 -275
  151. package/lib/skill-runtime/__tests__/worker.test.js +0 -56
  152. package/lib/skill-runtime/__tests__/workflow-context-legacy-fallback.test.js +0 -31
  153. package/lib/skill-runtime/__tests__/workflow-context.test.js +0 -98
  154. package/lib/skill-runtime/artifacts.js +0 -88
  155. package/lib/skill-runtime/context-index.js +0 -545
  156. package/lib/skill-runtime/delegation.js +0 -533
  157. package/lib/skill-runtime/intent.js +0 -309
  158. package/lib/skill-runtime/lifecycle.js +0 -294
  159. package/lib/skill-runtime/operations/CLAUDE.md +0 -19
  160. package/lib/skill-runtime/operations/approve.js +0 -81
  161. package/lib/skill-runtime/operations/autopilot-core.js +0 -337
  162. package/lib/skill-runtime/operations/autopilot-execution.js +0 -307
  163. package/lib/skill-runtime/operations/autopilot-shared.js +0 -48
  164. package/lib/skill-runtime/operations/autopilot.js +0 -163
  165. package/lib/skill-runtime/operations/dispatch.js +0 -416
  166. package/lib/skill-runtime/operations/init.js +0 -60
  167. package/lib/skill-runtime/operations/janitor.js +0 -61
  168. package/lib/skill-runtime/operations/plan.js +0 -59
  169. package/lib/skill-runtime/operations/prepare-pr.js +0 -25
  170. package/lib/skill-runtime/operations/release.js +0 -99
  171. package/lib/skill-runtime/operations/resume.js +0 -126
  172. package/lib/skill-runtime/operations/review-records.js +0 -265
  173. package/lib/skill-runtime/operations/snapshot.js +0 -45
  174. package/lib/skill-runtime/operations/task-contract.js +0 -593
  175. package/lib/skill-runtime/operations/verify.js +0 -170
  176. package/lib/skill-runtime/operations/worker-run.js +0 -531
  177. package/lib/skill-runtime/operations/worker.js +0 -33
  178. package/lib/skill-runtime/planner.js +0 -539
  179. package/lib/skill-runtime/readiness.js +0 -84
  180. package/lib/skill-runtime/review-records.js +0 -123
  181. package/lib/skill-runtime/review.js +0 -855
  182. package/lib/skill-runtime/schemas.js +0 -746
  183. package/lib/skill-runtime/task-contract.js +0 -188
  184. package/lib/skill-runtime/team-state.js +0 -122
  185. package/lib/skill-runtime/workflow-context.js +0 -748
@@ -1,192 +1,32 @@
1
1
  # CC-Investigate Playbook
2
2
 
3
- ## Visible State Machine
3
+ ## State Machine
4
4
 
5
5
  `cc-investigate -> cc-do -> cc-check`
6
6
 
7
- - Enter from: a bug, regression, or broken requirement whose root cause is still unclear.
8
- - Stay in: `cc-investigate` until `planning/tasks.md#Root Cause Contract` and the repair handoff are both frozen.
9
- - Exit to: `cc-do` only after root cause, repair boundary, and source roadmap progress are explicit in canonical artifacts.
10
- - Reroute to: `cc-plan` for scope/design truth changes, or `roadmap` for project-level priority decisions.
7
+ - Enter when root cause is unknown.
8
+ - Stay until `task.md#Root Cause Contract` is evidence-backed.
9
+ - Exit after the Investigate commit exists.
11
10
 
12
- ## Core Rules
11
+ ## Rules
13
12
 
14
- 1. 先复现,再猜原因。
15
- 2. 先把复现做成快、准、可复跑的 feedback loop。
16
- 3. 先确认 loop 复现的是用户报告的同一个失败。
17
- 4. 先看最近变化,再决定是不是 regression。
18
- 5. 先证伪假设,再冻结根因。
19
- 6. `planning/tasks.md` 必须足够让 `cc-do` 脱离当前会话继续工作。
20
- 7. 调查失败三次后先重建入口,不准继续乱补。
21
- 8. 没有 frozen root-cause contract,不准进入 repair task。
22
- 9. 多组件、深层调用、flaky 问题必须先补边界探针、反向追踪或条件等待证据。
23
- 10. diagnose-only 只能输出根因、owner、风险和 next action,不能把未修复状态标成完成。
24
- 11. workflow forensics 先分类 artifact / git / state / tool / permission / process failure,再决定是否进入修复。
25
- 12. 退出前必须跑 Roadmap Sync Gate:`implementation drift`、`missing spec truth`、`roadmap mismatch` 三种结论都要让 source RM 的状态和 next action 跟上。
26
- 13. Root Cause Proof Ladder 必须证明 symptom site、first bad state、violated contract、original trigger、counterfactual proof 和 escape reason。
27
- 14. 分配 `FIX-*` change key 后立刻执行 Worktree Branch Contract:detached worktree 先挂到 `FIX/<task>`;当前在 `main` / default branch 时停止,不写 investigation artifacts。
28
-
29
- ## Iron Law
30
-
31
- ```text
32
- NO REPAIR WITHOUT A FROZEN ROOT-CAUSE CONTRACT
33
- ```
34
-
35
- root-cause contract 至少包含:稳定复现或缩小后的可验证症状、被破坏的代码 / 配置 / 数据 / 依赖契约、已证伪假设、最小修复边界。
36
-
37
- ## Root Cause Proof Ladder
38
-
39
- 根因要从“看到错误的地方”追到“错误第一次被制造的地方”:
40
-
41
- 1. `L1 Symptom Site`:用户看到的失败。
42
- 2. `L2 First Bad State`:第一个坏字段、坏 artifact、坏队列消息、坏配置或坏状态。
43
- 3. `L3 Violated Contract`:被破坏的 schema、invariant、state transition、权限边界或协议。
44
- 4. `L4 Original Trigger`:制造坏状态的用户动作、命令、事件、recent diff、配置或外部响应。
45
- 5. `L5 Counterfactual Proof`:恢复 contract 或替换输入后,症状变化的实际观察。
46
- 6. `L6 Escape Reason`:为什么测试、类型、review、监控或 artifact gate 没挡住。
47
-
48
- 缺 `L2`、`L4` 或 `L5` 时,`planning/tasks.md#Root Cause Contract` 只能写 `needs-more-evidence`、`Evidence Request` 或 reroute,不能生成 `cc-do` repair task。
49
-
50
- ## Required Outputs
51
-
52
- - `planning/tasks.md`
53
- - `planning/task-manifest.json`
54
- - `change-meta.json`
55
-
56
- ## Investigation Standard
57
-
58
- 1. 先收集 symptom、expected、actual、repro。
59
- 2. 先构造 feedback loop:失败测试、HTTP 脚本、CLI fixture、浏览器脚本、trace replay、throwaway harness、fuzz、bisect、differential,最后才是 HITL。
60
- 3. 记录 loop 的运行时间、确定性、失败率、症状匹配证据和 sharpen 计划。
61
- 4. 先查 prior investigations、TODOS/backlog、report-card finding 和最近变更。
62
- 5. 先沿代码路径定位触点和最近变更。
63
- 6. 先做 pattern analysis,再列 3-5 个候选假设并收敛到 1-3 个 active hypotheses。
64
- 7. 每个假设都要写支持证据、反证、证伪方法、预期观察、实际观察。
65
- 8. 只有被证据钉死的根因才能进入 repair contract。
66
- 9. repair contract 只讲最小修复边界,不顺手发明新范围。
13
+ 1. Reproduce before guessing.
14
+ 2. Prove first bad state before naming root cause.
15
+ 3. Write only `task.md`; Git records the stage.
16
+ 4. No process file beyond `task.md`.
17
+ 5. Reroute instead of mixing feature planning into bug investigation.
67
18
 
68
19
  ## Investigation Modes
69
20
 
70
- | Mode | 什么时候用 | 第一动作 |
71
- | --- | --- | --- |
72
- | `reproduce-first` | 症状真实但不稳定 | 缩小复现命令 / 手动路径 |
73
- | `feedback-loop` | 已有复现但信号慢、松、偶然或不确定是否同一 bug | 记录 loop type、命令、runtime、determinism、failure rate 和 symptom match |
74
- | `diff-trace` | 昨天可用、今天坏了 | `git log --oneline -20 -- <affected-files>` |
75
- | `boundary-probe` | API -> service -> DB、CI -> build -> deploy 这类链路断裂 | 记录每层输入、输出、配置和状态 |
76
- | `backward-trace` | 错误出现在深层堆栈或坏值来源不明 | 从 immediate failure site 反追 original trigger |
77
- | `reference-compare` | 同仓库有相似可用路径 | 列出 working / broken 差异并逐项接受或排除 |
78
- | `condition-wait` | flaky、sleep、timeout、重试后消失 | 找真实等待条件,不先加大延时 |
79
- | `history-trace` | 同一区域反复坏 | 查历史 `planning/analysis.md`、TODO、report-card finding |
80
- | `pattern-research` | 陌生框架 / 依赖 / 平台错误 | 脱敏后查通用错误类型 |
81
- | `contract-check` | 修复边界可能扩大 | 判定 implementation drift / missing spec truth / roadmap mismatch |
82
- | `diagnose-only` | 用户只要问题解释或现在不能修 | 冻结 root cause、owner、risk、next action,不生成实现完成态 |
83
- | `workflow-forensics` | devflow artifact、git、状态、权限或工具链断裂 | 分类 failure owner 和 rescue action,再决定 reroute |
84
-
85
- ## Pattern Analysis
86
-
87
- 至少对照这些模式,不要直接猜:
88
-
89
- - race condition:间歇性、时序相关、共享状态
90
- - null propagation:TypeError / undefined / missing guard
91
- - state corruption:数据不一致、部分更新、hook / transaction 顺序
92
- - integration failure:timeout、协议不匹配、外部服务边界
93
- - configuration drift:本地 / CI / 生产表现不同
94
- - stale cache:清缓存后恢复或旧状态复现
95
- - resource leak:OOM、句柄增长、生命周期未释放
96
- - performance regression:变慢、CPU / IO / 查询耗时升高、吞吐下降
97
- - trust boundary drift:外部输入、LLM 输出、用户输入被当成可信
98
- - timing guess / flaky wait:任意 sleep / timeout / setTimeout 掩盖真实条件
99
-
100
- 性能回归先建 baseline、profiler、query plan 或 bisect,不把普通日志当性能证据。
101
-
102
- ## Boundary And Trace Evidence
103
-
104
- 复杂链路必须在 `planning/tasks.md#Root Cause Contract` 写清:
105
-
106
- - Boundary Probe Matrix:component boundary、input observed、output observed、config/env observed、state observed、verdict
107
- - Backward Trace Chain:immediate failure site、caller chain、bad value origin、original trigger、why symptom-site fix is rejected
108
- - Root Cause Proof Ladder:symptom site、first bad state、violated contract、original trigger、counterfactual proof、escape reason
109
- - Reference Comparison:similar working example、broken path、differences accepted / ruled out
110
- - Diagnostic Instrumentation Plan:probe tag、probe location、question answered、command、expected signal、cleanup requirement
111
- - Feedback Loop Contract:loop type、command、expected / actual signal、symptom match、runtime、determinism、failure rate、sharpening plan
112
- - Correct Test Seam:test seam、public interface exercised、why it reaches the real trigger chain、why shallow tests are rejected
113
- - Persistent Debug Session:session id、active hypothesis、completed probes、cleanup state、next evidence action
114
- - Workflow Forensics:artifact state、git state、runtime state、tool/permission/process failure owner、rescue action
115
- - Diagnose-Only Outcome:root cause, owner, risk, next action, and explicit no-repair verdict
116
-
117
- 这些字段不是装饰。它们的作用是证明根因位于源头,而不是报错点。
118
-
119
- ## Prior Investigation History
120
-
121
- 形成根因前至少查:
122
-
123
- 1. `git log --oneline -20 -- <affected-files>`
124
- 2. `rg -n "<error-keyword>|<module>|<capability>" devflow/changes`
125
- 3. `TODOS.md`、backlog、roadmap 中的相关项
126
- 4. 既有 `planning/analysis.md` 和 `review/report-card.json`
127
-
128
- 命中历史时,写入 `planning/tasks.md#Root Cause Contract` 的 `Prior Investigations`,说明这次是复发、同类结构味道,还是无关历史。
129
-
130
- ## Domain And Decision Context
131
-
132
- 优先读取 cc-devflow 原生上下文:`devflow/specs/INDEX.md`、相关 capability specs、roadmap/backlog handoff、历史 `planning/design.md` / `planning/analysis.md`、`change-meta.json`。调查输出里的领域名、假设名、测试名应沿用项目词汇;如果调查结论违反 capability spec、roadmap decision 或历史 design decision,要显式写入 evidence chain,而不是静默覆盖既有设计决策。
133
-
134
- ## External Research Hygiene
135
-
136
- 只有在本地证据不足、错误类型陌生、或像依赖 / 框架 / 平台问题时才做外部调研。
137
-
138
- - 先删除 host、IP、token、customer id、内部路径、SQL、私有 repo 名。
139
- - 只搜错误类别、框架 / 库名、版本、通用组件名。
140
- - 调研结果只能进入候选假设,必须回到本仓库复现或代码证据验证。
141
-
142
- ## No Code Root Cause
143
-
144
- 如果结论是环境、外部服务或时序窗口:
145
-
146
- - 写 `rootCauseClass`: `code` / `config` / `environment` / `external` / `timing`
147
- - 写明为什么不是 code root cause
148
- - 写明需要什么 monitoring / future evidence
149
- - 写明 operator handling,不要把未知外因包装成代码修复
150
-
151
- ## Scope Lock
152
-
153
- 根因假设形成后,写清:
154
-
155
- - affected module
156
- - allowed files
157
- - forbidden files
158
- - blast radius estimate
159
- - if touches >5 files: split / justify / reroute
160
-
161
- 超过 5 个文件默认是调查信号,不是正常 bug-fix 规模。
162
-
163
- ## Escalation
164
-
165
- 三次假设失败后写 `Escalation Decision`:
166
-
167
- - failed hypothesis count
168
- - attempted evidence
169
- - why current entry is suspect
170
- - next option:continue / instrument-and-wait / human-review / reroute-cc-plan
171
- - evidence request:需要可复现环境、HAR、日志 dump、core dump、带时间戳录屏或临时生产探针权限
172
- - recommendation
173
-
174
- ## Local Kit
175
-
176
- - 默认模板在 `assets/TASKS_TEMPLATE.md` 和 `assets/TASK_MANIFEST_TEMPLATE.json`
177
- - 旧分析模板在 `assets/legacy/`,只用于 legacy fallback / migration
178
- - 调查契约在 `references/investigation-contract.md`
179
- - 需要分析骨架时用 `scripts/bootstrap-analysis.sh`
180
- - Roadmap 回写使用 `../cc-roadmap/scripts/locate-roadmap-item.sh` 和 `../cc-roadmap/scripts/sync-roadmap-progress.sh`
181
-
182
- ## Exit Rule
183
-
184
- 只有当下一位执行者读完 `planning/tasks.md`、`planning/task-manifest.json` 就知道:
21
+ - `reproduce-first`
22
+ - `diff-trace`
23
+ - `boundary-probe`
24
+ - `backward-trace`
25
+ - `condition-wait`
26
+ - `reference-compare`
27
+ - `workflow-forensics`
28
+ - `diagnose-only`
185
29
 
186
- - 为什么坏
187
- - 该修什么
188
- - 不该扩到哪里
189
- - 用什么命令证明修好了
30
+ ## Exit
190
31
 
191
- 这次调查才算合格。
192
- 如果 source RM 仍然停在旧 status、旧 progress 或旧 REQ/FIX 绑定,说明本次 `cc-investigate` 没有真正退出。
32
+ `task.md` must tell `cc-do` what to fix, what not to touch, and what command proves the repair. Commit the Investigate stage before handing off.
@@ -1,72 +1,48 @@
1
1
  ---
2
2
  name: cc-investigate
3
- version: 1.5.1
4
- description: "Use when a bug, regression, broken task, or unexpected behavior needs root-cause investigation, reproducible evidence, and a frozen repair handoff before cc-do resumes coding."
3
+ version: 1.6.1
4
+ description: Use when a bug, regression, broken task, or unexpected behavior needs root-cause investigation before coding resumes.
5
5
  triggers:
6
- - "帮我查这个 bug"
7
- - "先别修先找根因"
8
- - "debug this bug"
9
- - "investigate this regression"
10
- - "why is this broken"
11
- - "root cause this"
12
- - "先调查再修"
6
+ - 帮我查这个 bug
7
+ - 先别修先找根因
8
+ - debug this bug
9
+ - investigate this regression
10
+ - why is this broken
11
+ - root cause this
13
12
  reads:
14
- - "PLAYBOOK.md"
15
- - "CHANGELOG.md"
16
- - "references/investigation-contract.md"
17
- - "docs/guides/project-postmortem.md"
18
- - "assets/TASKS_TEMPLATE.md"
19
- - "assets/TASK_MANIFEST_TEMPLATE.json"
20
- - "../cc-roadmap/scripts/locate-roadmap-item.sh"
21
- - "../cc-roadmap/scripts/sync-roadmap-progress.sh"
13
+ - PLAYBOOK.md
14
+ - references/investigation-contract.md
15
+ - docs/guides/project-postmortem.md
16
+ - assets/TASKS_TEMPLATE.md
17
+ - ../cc-dev/scripts/resolve-cc-devflow.sh
18
+ - ../cc-roadmap/scripts/locate-roadmap-item.sh
19
+ - ../cc-roadmap/scripts/sync-roadmap-progress.sh
22
20
  writes:
23
- - path: "devflow/changes/<change-key>/planning/tasks.md"
24
- durability: "durable"
25
- required: true
26
- - path: "devflow/changes/<change-key>/planning/task-manifest.json"
27
- durability: "durable"
28
- required: true
29
- - path: "devflow/changes/<change-key>/change-meta.json"
30
- durability: "durable"
21
+ - path: devflow/changes/<change-key>/task.md
22
+ durability: durable
31
23
  required: true
32
24
  effects:
33
- - source roadmap progress sync when investigation freezes, reroutes, or diagnoses a roadmap mismatch
25
+ - roadmap progress sync when a source item exists
26
+ - Git commit after the Investigate stage is complete
34
27
  entry_gate:
35
- - "Read the bug report, existing change artifacts, relevant code/tests/logs, and recent history before forming hypotheses."
36
- - "State assumptions, competing interpretations, and what evidence would change the root-cause route before testing hypotheses."
37
- - "Assign the change key with `cc-devflow next-change-key --prefix FIX --description \"<short bug name>\"`; first output line is `changeId`, second is full `changeKey`."
38
- - "Enforce the Worktree Branch Contract immediately: detached worktrees bind to `FIX/<task>`, default branches stop as setup blockers, unrelated branches need explicit same-change proof."
39
- - "Write root-cause truth in `planning/tasks.md#Root Cause Contract`; machine JSON must be generated or refreshed by `cc-devflow task-contract compile`, not handwritten by the AI."
40
- - "Build a runnable feedback loop that matches the reported symptom before freezing root cause."
41
- - "Search prior investigations, recent fixes, TODO/backlog signals, and project postmortems before declaring the bug novel."
42
- - "Run the Root Cause Proof Ladder: symptom site, first bad state, violated contract, original trigger, counterfactual proof, escape reason."
43
- - "For multi-component, deep-stack, flaky, or performance symptoms, open the matching escalation pack before declaring root cause."
44
- - "Do not write production code here; exit with a frozen repair handoff for cc-do or an explicit reroute."
45
- - "Before exit, sync or explicitly no-op the source roadmap item."
28
+ - Resolve the CLI with `../cc-dev/scripts/resolve-cc-devflow.sh require query workflow-context next-change-key config`.
29
+ - Assign a FIX change key through `next-change-key --prefix FIX --description "<short bug name>"`.
30
+ - Enforce the Worktree Branch Contract before writing `task.md`.
31
+ - Reproduce or build the closest honest feedback loop before naming root cause.
32
+ - Search relevant code, logs, recent history, and project postmortems before declaring the bug novel.
46
33
  exit_criteria:
47
- - "`planning/tasks.md#Root Cause Contract` proves the first bad state and original trigger, not only the visible error site."
48
- - "`planning/tasks.md#Root Cause Contract` records reproduction, feedback loop, evidence chain, tested hypotheses, confirmed root cause, and repair boundary."
49
- - "`planning/tasks.md#Root Cause Contract` records the Project Postmortem Recall result or `no-project-postmortems-yet`."
50
- - "`planning/task-manifest.json` and `change-meta.json` were generated or refreshed by `cc-devflow task-contract compile`, then validated."
51
- - "`planning/tasks.md` and machine artifacts are explicit enough that cc-do can repair without chat memory."
52
- - "`planning/tasks.md` and `change-meta.json` record the canonical work branch or why branch mutation was invalid."
53
- - "`cc-devflow query workflow-context --compact` can derive the IDCA next action, packet digest, current task, trusted commands, and deep-open triggers."
54
- - "Roadmap sync is updated or a no-op reason is recorded."
55
- - "The honest next step is `cc-do`, `cc-plan`, or `roadmap`."
34
+ - "`task.md#Root Cause Contract` proves symptom site, first bad state, violated contract, original trigger, counterfactual proof, and escape reason."
35
+ - "`task.md` contains the repair tasks needed by `cc-do`."
36
+ - "No process file is created beyond `task.md`."
37
+ - "Source roadmap progress is synced or explicitly skipped in the final response."
38
+ - "Investigate-stage changes are committed to Git before handing off to `cc-do`."
56
39
  reroutes:
57
- - when: "The issue is actually a new feature, scope redesign, missing spec truth, or product decision."
58
- target: "cc-plan"
59
- - when: "The discussion expands into project sequencing or roadmap priority."
60
- target: "roadmap"
61
- - when: "Root cause and repair boundary are already frozen."
62
- target: "cc-do"
63
- recovery_modes:
64
- - name: "repro-reset"
65
- when: "The reproduction path is stale, missing, or does not match the reported symptom."
66
- action: "Drop the narrative, rebuild the feedback loop from fresh repo evidence, then restate the symptom before testing hypotheses."
67
- - name: "re-open-investigation"
68
- when: "Execution evidence disproves the current root-cause contract or widens the suspected blast radius."
69
- action: "Reopen `planning/tasks.md#Root Cause Contract`, update evidence, then regenerate machine artifacts only after the contract is stable."
40
+ - when: The issue is actually missing scope, spec truth, or product direction.
41
+ target: cc-plan
42
+ - when: Project priority or sequencing is the real question.
43
+ target: roadmap
44
+ - when: Root cause and repair boundary are already frozen.
45
+ target: cc-do
70
46
  tool_budget:
71
47
  read_files: 8
72
48
  search_steps: 5
@@ -75,207 +51,49 @@ tool_budget:
75
51
 
76
52
  # CC-Investigate
77
53
 
78
- > [PROTOCOL]: 变更时同步更新 `version`、`CHANGELOG.md`、相关模板/脚本引用,然后检查 `CLAUDE.md`
79
-
80
- ## Role
81
-
82
- `cc-investigate` 是 IDCA 的 `Investigate`:把 bug 现象压成证据,把证据压成根因,再把根因压成 `cc-do` 可执行的修复合同。
83
-
84
- 它不写生产代码,不做产品路线图,不制造调试文档农场。新需求走 `cc-plan`;bug / regression 走 `cc-investigate -> cc-do -> cc-check -> cc-act`。
85
-
86
- ## Thin Harness Rule
87
-
88
- 默认相信顶级模型的工程判断。Harness 只守住四件事:
89
-
90
- 1. 分支、change key、roadmap/source truth 不错位。
91
- 2. 根因证明不能停在 symptom site。
92
- 3. 关键结论落到可恢复 artifact,而不是留在聊天里。
93
- 4. 机器态 JSON 必须由 CLI / 模板生成或更新,AI 不手写过程 JSON。
94
-
95
- 不要启动就读完所有 reference。先用本文件闭合常规调查;只有触发升级条件时,才打开 `PLAYBOOK.md` 或 `references/investigation-contract.md` 的对应段落。
96
-
97
- ## Harness Contract
98
-
99
- - Allowed actions: reproduce, collect evidence, trace code paths, test hypotheses, freeze root cause in `planning/tasks.md`, run CLI artifact generation, validate, and sync/no-op roadmap.
100
- - Forbidden actions: production code, guessed root cause, manual JSON authoring, legacy `planning/analysis.md` for new investigations, or symptom patches before root cause proof.
101
- - Required evidence: every root-cause claim points to reproduction output, code facts, recent history, boundary probes, or explicit user confirmation.
102
- - Reroute rule: scope/design truth changes go to `cc-plan`; project priority goes to `roadmap`; confirmed repair handoff goes to `cc-do`.
103
-
104
- ## Investigation Discipline
105
-
106
- - Prefer evidence over speed: no reproduction or feedback loop means no confirmed root cause.
107
- - Use the model for classification and hypothesis ranking; use commands, logs, diffs, and probes for deterministic proof.
108
- - When evidence conflicts, choose the newer or stronger source and record why the other pattern was rejected.
109
- - If the bug is really missing spec truth or roadmap mismatch, reroute instead of averaging bugfix and feature design.
110
- - Any skipped probe, unavailable environment, or stale evidence is an explicit blocker or Evidence Request.
111
-
112
- ## Runtime Output Policy
113
-
114
- 写入 durable Markdown 或 metadata 前,先运行:
115
-
116
- ```bash
117
- cc-devflow config resolve --format policy
118
- ```
119
-
120
- `Output language` 是机器约束,必须记录在 `planning/tasks.md` 和 CLI 生成的 `change-meta.json` 来源字段里。配置解析失败时先修配置或报告阻塞,不用默认语言偷跑。
121
-
122
- ## Read Lazily
123
-
124
- 启动时只读:
125
-
126
- 1. 用户 bug report / failed command / current artifact。
127
- 2. 当前 repo 指令:`CLAUDE.md` / `AGENTS.md` / README 中直接相关部分。
128
- 3. 相关代码、测试、日志、recent diff 的最小证据集。
129
- 4. `assets/TASKS_TEMPLATE.md`。
130
-
131
- 按需再读:
132
-
133
- - `PLAYBOOK.md`:需要完整调查剧本、模式表、边界矩阵、flaky/perf 细则时打开。
134
- - `references/investigation-contract.md`:要校验字段、hard rules、repair boundary 时打开。
135
- - `docs/guides/project-postmortem.md`:仓库存在 `devflow/postmortems/` 且匹配历史失败类时打开。
136
- - `assets/TASK_MANIFEST_TEMPLATE.json`:只在维护模板或对照 CLI 输出结构时打开;普通调查不照抄 JSON。
137
- - `../cc-roadmap/scripts/*`:定位或回写 source RM 时打开。
138
-
139
- ## Change Key And Branch
140
-
141
- 新调查先分配 change key:
142
-
143
- ```bash
144
- cc-devflow next-change-key --prefix FIX --description "short bug name"
145
- ```
146
-
147
- 脚本输出两行:`changeId` 和完整 `changeKey`。直接使用输出,不手动扫描、不心算编号。
148
-
149
- 分支锚定规则:
54
+ `cc-investigate` IDCA `Investigate`。它把 bug 现象压成根因合同,并把修复边界写入同一个 `task.md`。
150
55
 
151
- 1. `FIX-014-auth-race` 对应 `FIX/014-auth-race`。
152
- 2. 当前 detached 时,立刻 `git switch -c <canonical-work-branch>`。
153
- 3. 当前是 `main` / `master` / default branch 时停止,报告 setup blocker。
154
- 4. 当前是其它分支时,只有它已明确绑定同一个 change key 才继续。
56
+ 唯一默认输出:
155
57
 
156
- `planning/tasks.md` 和 `change-meta.json` 必须记录 work branch。
58
+ - `devflow/changes/<change-key>/task.md`
157
59
 
158
- ## Machine Artifact Rule
60
+ 不要生成额外过程文件或 JSON 文档。Git commit 是阶段历史,`task.md` 是根因合同。
159
61
 
160
- AI 只手写默认人类合同:`planning/tasks.md#Root Cause Contract` 和后面的 repair task blocks。
62
+ ## Iron Law
161
63
 
162
- 机器态文件必须由命令生成或更新:
163
-
164
- ```bash
165
- cc-devflow task-contract compile --change <changeId> --change-key <changeKey>
166
- cc-devflow task-contract validate --change <changeId> --change-key <changeKey>
64
+ ```text
65
+ NO REPAIR WITHOUT A FROZEN ROOT-CAUSE CONTRACT
167
66
  ```
168
67
 
169
- 硬规则:
170
-
171
- - 不手写 `planning/task-manifest.json`。
172
- - 不手写 `change-meta.json`。
173
- - 不生成 `planning/analysis.md`、task `context.md`、`checkpoint.json`、review Markdown 或其它 AI 手写过程文件。
174
- - 需要修机器态结构时,改 CLI / 模板 / validator,再重新生成;不要在项目 change 目录里补 JSON。
175
- - legacy `planning/analysis.md` 只能作为读取或 migration 输入。
68
+ 根因不是报错点,而是坏状态第一次被制造的地方。
176
69
 
177
70
  ## Investigation Loop
178
71
 
179
- 1. **Classify**:先说明属于 `reproduce-first`、`feedback-loop`、`diff-trace`、`boundary-probe`、`backward-trace`、`condition-wait`、`workflow-forensics`、`diagnose-only` 还是 reroute
180
- 2. **Reproduce**:构造 agent 可运行的 pass/fail loop;证明它匹配用户看到的同一个失败。
181
- 3. **Trace**:读代码、测试、日志、recent diff、相关 spec / roadmap / history;找到 first bad state,而不是只看报错点。
182
- 4. **Hypothesize**:列 3-5 个候选,收敛到 1-3 个 active hypotheses;每个都写证伪方法、预期观察、实际观察。
183
- 5. **Prove**:爬完 Root Cause Proof Ladder;缺关键层级时只能写 Evidence Request 或 reroute
184
- 6. **Freeze**:把根因、边界、测试缝隙、allowed/forbidden files 写进 `planning/tasks.md#Root Cause Contract`。
185
- 7. **Compile**:运行 `cc-devflow task-contract compile` 生成/刷新 manifest 和 meta,再 validate。
186
- 8. **Sync**:定位 source RM,回写调查结果或记录 no-op reason。
72
+ 1. Classify:复现优先、diff traceboundary probe、flaky、performance、workflow forensicsdiagnose-only。
73
+ 2. Reproduce:用测试、脚本、日志、浏览器路径或最小 harness 证明同一个症状。
74
+ 3. Trace:找到 first bad state,而不是只给 symptom guard。
75
+ 4. Hypothesize:列候选,写证伪方法,逐个打掉。
76
+ 5. Prove:完成 Root Cause Proof Ladder。
77
+ 6. Freeze:把根因、修复边界、测试 seam、allowed/forbidden files 写进 `task.md`。
78
+ 7. Commit:提交 Investigate 阶段,再交给 `cc-do`。
187
79
 
188
80
  ## Root Cause Proof Ladder
189
81
 
190
- 根因不是“报错点在哪里”,而是“坏状态第一次在哪里被制造”。每次调查必须回答:
191
-
192
- 1. `L1 Symptom Site`:用户看见的错误、失败命令、UI 状态、日志或坏 artifact。
193
- 2. `L2 First Bad State`:第一个字段、文件、缓存、队列消息、API 响应、配置或内存对象从正确变坏的位置。
194
- 3. `L3 Violated Contract`:被破坏的 schema、invariant、API contract、state transition、权限边界或时序条件。
195
- 4. `L4 Original Trigger`:制造 first bad state 的用户动作、命令、事件、recent diff、配置变化或外部响应。
196
- 5. `L5 Counterfactual Proof`:恢复 contract、替换输入、回滚 diff、固定配置或断言边界后的实际观察。
197
- 6. `L6 Escape Reason`:为什么测试、类型、验证、监控、review 或 artifact gate 没提前挡住。
198
-
199
- 硬规则:
200
-
201
- - `First bad state` 为空时,root cause 只能是 `needs-more-evidence`。
202
- - `Original trigger` 为空时,不能把下游 guard 写成根因修复。
203
- - `Counterfactual proof` 为空时,假设只能停在 candidate。
204
- - `Escape reason` 必须变成 regression test、artifact guard、capability invariant、operator check 或明确 follow-up。
205
- - ladder 指向 spec 缺失或路线假设错误时,reroute 到 `cc-plan` 或 `roadmap`。
206
-
207
- ## Project Postmortem Recall Gate
208
-
209
- 形成最终假设前先查项目级 postmortem:
210
-
211
- ```bash
212
- rg -n "<symptom|module|boundary|failure-class|model-risk>" devflow/postmortems
213
- ```
214
-
215
- - `devflow/postmortems/` 不存在时,在 Root Cause Contract 记录 `no-project-postmortems-yet`。
216
- - 有命中时读 `INDEX.md` / `principles.md`,再打开最相关的 1-2 个 incident。
217
- - 相关 incident 必须进入假设表或反证表:同根因、相似症状不同根因、已知模型陷阱或明确不相关。
218
- - 重复根因必须标记 `recurring` 或 `same-root-cause`。
219
-
220
- ## Output Model
221
-
222
- 默认 durable 输出只有 3 个:
223
-
224
- 1. `planning/tasks.md`
225
- - 唯一默认 human-authored Markdown。
226
- - `## Root Cause Contract` 记录症状、复现、feedback loop、证据链、Root Cause Proof Ladder、假设、confirmed root cause、repair boundary、correct test seam。
227
- - 后续 task blocks 只保留真正要执行的修复任务。
228
- 2. `planning/task-manifest.json`
229
- - CLI 生成的执行图真相源。
230
- - 不复制调查叙事,不承载 roadmap progress,不手工编辑。
231
- 3. `change-meta.json`
232
- - CLI 生成/更新的 change metadata;记录 spec / roadmap / root-cause 摘要和 work branch。
233
-
234
- diagnose-only 仍写 `Root Cause Contract`,但 task blocks 只能包含证据交接、监控、人工动作或 reroute,不能伪装成已修复。
235
-
236
- ## Escalation Packs
237
-
238
- 只在触发时打开深层规则:
239
-
240
- | Pack | Trigger | Open |
241
- | --- | --- | --- |
242
- | Boundary Probe | 多组件链路、API/service/DB/queue/build/deploy 边界断裂 | `PLAYBOOK.md#Boundary And Trace Evidence` |
243
- | Backward Trace | 报错点很深、坏值来源不明、symptom-site guard 看起来诱人 | `references/investigation-contract.md#Backward Trace Chain` |
244
- | Flaky / Timing | sleep、timeout、重试后消失、低复现率 | `PLAYBOOK.md#Investigation Modes` |
245
- | Performance | 变慢、CPU/IO/query/throughput 回退 | `PLAYBOOK.md#Pattern Analysis` |
246
- | External Research | 陌生框架/依赖/平台错误且本地证据不足 | `references/investigation-contract.md#External Research` |
247
- | No-Code Root Cause | 环境、外部服务、配置或时序窗口 | `references/investigation-contract.md#No Code Root Cause` |
248
- | Escalation | 三次假设失败或 loop 无法构造 | `references/investigation-contract.md#Escalation` |
249
-
250
- 如果没有触发条件,不要打开这些包。
251
-
252
- ## Roadmap Sync
253
-
254
- 退出前定位 source RM:
255
-
256
- ```bash
257
- bash .claude/skills/cc-roadmap/scripts/locate-roadmap-item.sh --id <RM-or-FIX>
258
- ```
259
-
260
- - `implementation drift`:回写 source RM 为 repair planned / investigation frozen,绑定 `FIX-*`。
261
- - `missing spec truth`:写 expected spec delta 或 follow-up,必要时 reroute 到 `cc-plan`。
262
- - `roadmap mismatch`:写回 roadmap / backlog,下一步是 `roadmap` 或 `cc-plan`,不要直接修。
263
- - 找不到 source RM 时,在 `planning/tasks.md#Root Cause Contract` 和 `change-meta.json.roadmapSync` 记录 `no-source-rm`。
264
-
265
- ## Exit Rule
266
-
267
- 调查合格的标准很简单:
82
+ - L1 Symptom Site
83
+ - L2 First Bad State
84
+ - L3 Violated Contract
85
+ - L4 Original Trigger
86
+ - L5 Counterfactual Proof
87
+ - L6 Escape Reason
268
88
 
269
- - 复现 loop 可信,并匹配用户症状。
270
- - First bad state、original trigger、counterfactual proof 已冻结。
271
- - 修复边界清楚到 `cc-do` 不需要二次调查。
272
- - machine artifacts 由 CLI 生成并通过 validate。
273
- - source RM 已同步或 no-op reason 已落盘。
89
+ 缺 L2、L4 或 L5 时,只能写 Evidence Request、diagnose-only reroute。
274
90
 
275
- 如果执行者还要猜“为什么坏、修哪里、不该碰哪里、怎么证明修好了”,调查没完成。
91
+ ## Handoff
276
92
 
277
- ## Companion Files
93
+ 退出时只说清:
278
94
 
279
- - 深入剧本:`PLAYBOOK.md`
280
- - 变更记录:`CHANGELOG.md`
281
- - 调查契约:`references/investigation-contract.md`
95
+ - change key 和分支
96
+ - `task.md` 路径
97
+ - 复现 / 证据命令
98
+ - Investigate commit hash
99
+ - 下一步 `cc-do` 或 reroute