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.
- package/.claude/skills/cc-act/CHANGELOG.md +18 -0
- package/.claude/skills/cc-act/PLAYBOOK.md +17 -269
- package/.claude/skills/cc-act/SKILL.md +38 -425
- package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_INDEX_TEMPLATE.md +2 -13
- package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_TEMPLATE.md +1 -9
- package/.claude/skills/cc-act/assets/PR_BRIEF_TEMPLATE.md +21 -177
- package/.claude/skills/cc-act/references/closure-contract.md +12 -63
- package/.claude/skills/cc-act/references/git-commit-guidelines.md +5 -5
- package/.claude/skills/cc-act/scripts/cc-act-common.sh +5 -322
- package/.claude/skills/cc-act/scripts/detect-ship-target.sh +11 -2
- package/.claude/skills/cc-act/scripts/inspect-git-index.sh +58 -0
- package/.claude/skills/cc-act/scripts/render-pr-brief.sh +40 -440
- package/.claude/skills/cc-act/scripts/verify-act-gate.sh +10 -50
- package/.claude/skills/cc-check/CHANGELOG.md +18 -0
- package/.claude/skills/cc-check/PLAYBOOK.md +19 -273
- package/.claude/skills/cc-check/SKILL.md +33 -456
- package/.claude/skills/cc-check/references/review-contract.md +12 -147
- package/.claude/skills/cc-dev/CHANGELOG.md +15 -0
- package/.claude/skills/cc-dev/PLAYBOOK.md +1 -1
- package/.claude/skills/cc-dev/SKILL.md +52 -137
- package/.claude/skills/cc-dev/scripts/resolve-cc-devflow.sh +181 -0
- package/.claude/skills/cc-do/CHANGELOG.md +11 -0
- package/.claude/skills/cc-do/PLAYBOOK.md +19 -113
- package/.claude/skills/cc-do/SKILL.md +39 -245
- package/.claude/skills/cc-do/references/execution-recovery.md +15 -109
- package/.claude/skills/cc-do/scripts/cc-do-common.sh +5 -57
- package/.claude/skills/cc-do/scripts/check-task-status.sh +35 -65
- package/.claude/skills/cc-do/scripts/mark-task-complete.sh +9 -46
- package/.claude/skills/cc-do/scripts/select-ready-tasks.sh +29 -97
- package/.claude/skills/cc-investigate/CHANGELOG.md +16 -0
- package/.claude/skills/cc-investigate/PLAYBOOK.md +20 -180
- package/.claude/skills/cc-investigate/SKILL.md +64 -246
- package/.claude/skills/cc-investigate/assets/TASKS_TEMPLATE.md +48 -98
- package/.claude/skills/cc-investigate/references/investigation-contract.md +14 -218
- package/.claude/skills/cc-next/CHANGELOG.md +6 -0
- package/.claude/skills/cc-next/PLAYBOOK.md +12 -8
- package/.claude/skills/cc-next/SKILL.md +34 -140
- package/.claude/skills/cc-plan/CHANGELOG.md +16 -0
- package/.claude/skills/cc-plan/PLAYBOOK.md +22 -161
- package/.claude/skills/cc-plan/SKILL.md +45 -295
- package/.claude/skills/cc-plan/assets/TASKS_TEMPLATE.md +30 -228
- package/.claude/skills/cc-plan/references/planning-contract.md +24 -161
- package/.claude/skills/cc-plan/scripts/next-change-key.sh +8 -44
- package/.claude/skills/cc-plan/scripts/parse-task-dependencies.js +2 -2
- package/.claude/skills/cc-plan/scripts/validate-scope.sh +1 -1
- package/.claude/skills/cc-pr-land/SKILL.md +14 -114
- package/.claude/skills/cc-pr-review/CHANGELOG.md +4 -0
- package/.claude/skills/cc-pr-review/SKILL.md +20 -103
- package/.claude/skills/cc-review/CHANGELOG.md +17 -0
- package/.claude/skills/cc-review/PLAYBOOK.md +13 -86
- package/.claude/skills/cc-review/SKILL.md +53 -241
- package/.claude/skills/cc-review/references/e2e-and-plugin-verification.md +2 -2
- package/.claude/skills/cc-review/references/implementation-review-branch.md +7 -147
- package/.claude/skills/cc-review/references/plan-review-branch.md +5 -147
- package/.claude/skills/cc-review/references/review-methods.md +10 -218
- package/.claude/skills/cc-review/scripts/collect-review-context.sh +4 -63
- package/.claude/skills/cc-roadmap/PLAYBOOK.md +1 -1
- package/.claude/skills/cc-roadmap/SKILL.md +3 -3
- package/.claude/skills/cc-simplify/CHANGELOG.md +7 -0
- package/.claude/skills/cc-simplify/SKILL.md +26 -21
- package/.claude/skills/cc-spec-init/PLAYBOOK.md +12 -48
- package/.claude/skills/cc-spec-init/SKILL.md +29 -132
- package/.claude/skills/cc-spec-init/references/spec-contract.md +8 -17
- package/CHANGELOG.md +13 -0
- package/bin/cc-devflow-cli.js +20 -260
- package/bin/cc-devflow.js +44 -7
- package/docs/commands/README.md +1 -1
- package/docs/commands/README.zh-CN.md +1 -1
- package/docs/examples/README.md +1 -1
- package/docs/examples/START-HERE.md +14 -15
- package/docs/examples/example-bindings.json +11 -11
- package/docs/examples/full-design-blocked/README.md +4 -6
- package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/{planning/tasks.md → task.md} +20 -15
- package/docs/examples/local-handoff/README.md +8 -11
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/pr-brief.md +31 -0
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/{planning/tasks.md → task.md} +18 -13
- package/docs/examples/pdca-loop/README.md +6 -9
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/pr-brief.md +9 -11
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/{planning/tasks.md → task.md} +18 -13
- package/docs/examples/scripts/check-example-bindings.sh +11 -62
- package/docs/guides/artifact-contract.md +10 -40
- package/docs/guides/getting-started.md +8 -8
- package/docs/guides/getting-started.zh-CN.md +8 -8
- package/docs/guides/minimize-artifacts.md +16 -130
- package/docs/guides/project-postmortem.md +14 -71
- package/lib/compiler/__tests__/skills-registry.test.js +9 -8
- package/lib/compiler/resource-copier.js +29 -0
- package/lib/skill-runtime/__tests__/archive-change.test.js +2 -2
- package/lib/skill-runtime/__tests__/benchmark-skills.test.js +3 -3
- package/lib/skill-runtime/__tests__/cli-bootstrap.integration.test.js +14 -4
- package/lib/skill-runtime/errors.js +3 -3
- package/lib/skill-runtime/index.js +5 -23
- package/lib/skill-runtime/paths.js +5 -52
- package/lib/skill-runtime/query-registry.js +4 -4
- package/lib/skill-runtime/query.js +89 -201
- package/lib/skill-runtime/store.js +4 -40
- package/lib/skill-runtime/trace.js +2 -2
- package/package.json +2 -5
- package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_PRINCIPLES_TEMPLATE.md +0 -29
- package/.claude/skills/cc-act/assets/RELEASE_NOTE_TEMPLATE.md +0 -54
- package/.claude/skills/cc-act/scripts/generate-status-report.sh +0 -92
- package/.claude/skills/cc-act/scripts/sync-act-docs.sh +0 -355
- package/.claude/skills/cc-check/assets/REPORT_CARD_TEMPLATE.json +0 -234
- package/.claude/skills/cc-check/scripts/render-report-card.js +0 -438
- package/.claude/skills/cc-check/scripts/verify-gate.sh +0 -85
- package/.claude/skills/cc-do/scripts/build-task-context.sh +0 -175
- package/.claude/skills/cc-do/scripts/record-review-decision.sh +0 -88
- package/.claude/skills/cc-do/scripts/recover-workflow.sh +0 -82
- package/.claude/skills/cc-do/scripts/run-problem-analysis.sh +0 -70
- package/.claude/skills/cc-do/scripts/verify-task-gates.sh +0 -109
- package/.claude/skills/cc-do/scripts/write-task-checkpoint.sh +0 -92
- package/.claude/skills/cc-investigate/assets/TASK_MANIFEST_TEMPLATE.json +0 -224
- package/.claude/skills/cc-plan/assets/TASK_MANIFEST_TEMPLATE.json +0 -178
- package/.claude/skills/cc-spec-init/assets/CHANGE_META_TEMPLATE.json +0 -28
- package/.claude/skills/cc-spec-init/scripts/validate-spec-links.sh +0 -45
- package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/design.md +0 -234
- package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/task-manifest.json +0 -488
- package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/review/report-card.json +0 -189
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/resume-index.md +0 -39
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/status.md +0 -29
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/design.md +0 -123
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/task-manifest.json +0 -292
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/review/report-card.json +0 -136
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/status.md +0 -29
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/design.md +0 -124
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/task-manifest.json +0 -292
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/review/report-card.json +0 -136
- package/docs/get-shit-done-strategy-audit.md +0 -518
- package/docs/skill-runtime-migration.md +0 -46
- package/lib/skill-runtime/__tests__/approve.test.js +0 -92
- package/lib/skill-runtime/__tests__/autopilot.test.js +0 -253
- package/lib/skill-runtime/__tests__/benchmark-artifacts.test.js +0 -165
- package/lib/skill-runtime/__tests__/delegation.test.js +0 -97
- package/lib/skill-runtime/__tests__/dispatch.test.js +0 -237
- package/lib/skill-runtime/__tests__/intent.test.js +0 -203
- package/lib/skill-runtime/__tests__/lifecycle.test.js +0 -169
- package/lib/skill-runtime/__tests__/planner.tdd.test.js +0 -331
- package/lib/skill-runtime/__tests__/prepare-pr.test.js +0 -126
- package/lib/skill-runtime/__tests__/query.test.js +0 -860
- package/lib/skill-runtime/__tests__/readiness.test.js +0 -53
- package/lib/skill-runtime/__tests__/release.test.js +0 -85
- package/lib/skill-runtime/__tests__/review-check-integration.test.js +0 -148
- package/lib/skill-runtime/__tests__/review-records.test.js +0 -619
- package/lib/skill-runtime/__tests__/runtime.integration.test.js +0 -351
- package/lib/skill-runtime/__tests__/schemas.test.js +0 -337
- package/lib/skill-runtime/__tests__/task-contract-migrate.test.js +0 -137
- package/lib/skill-runtime/__tests__/task-contract.test.js +0 -874
- package/lib/skill-runtime/__tests__/team-state.test.js +0 -51
- package/lib/skill-runtime/__tests__/verify-artifacts.test.js +0 -203
- package/lib/skill-runtime/__tests__/worker-run.test.js +0 -275
- package/lib/skill-runtime/__tests__/worker.test.js +0 -56
- package/lib/skill-runtime/__tests__/workflow-context-legacy-fallback.test.js +0 -31
- package/lib/skill-runtime/__tests__/workflow-context.test.js +0 -98
- package/lib/skill-runtime/artifacts.js +0 -88
- package/lib/skill-runtime/context-index.js +0 -545
- package/lib/skill-runtime/delegation.js +0 -533
- package/lib/skill-runtime/intent.js +0 -309
- package/lib/skill-runtime/lifecycle.js +0 -294
- package/lib/skill-runtime/operations/CLAUDE.md +0 -19
- package/lib/skill-runtime/operations/approve.js +0 -81
- package/lib/skill-runtime/operations/autopilot-core.js +0 -337
- package/lib/skill-runtime/operations/autopilot-execution.js +0 -307
- package/lib/skill-runtime/operations/autopilot-shared.js +0 -48
- package/lib/skill-runtime/operations/autopilot.js +0 -163
- package/lib/skill-runtime/operations/dispatch.js +0 -416
- package/lib/skill-runtime/operations/init.js +0 -60
- package/lib/skill-runtime/operations/janitor.js +0 -61
- package/lib/skill-runtime/operations/plan.js +0 -59
- package/lib/skill-runtime/operations/prepare-pr.js +0 -25
- package/lib/skill-runtime/operations/release.js +0 -99
- package/lib/skill-runtime/operations/resume.js +0 -126
- package/lib/skill-runtime/operations/review-records.js +0 -265
- package/lib/skill-runtime/operations/snapshot.js +0 -45
- package/lib/skill-runtime/operations/task-contract.js +0 -593
- package/lib/skill-runtime/operations/verify.js +0 -170
- package/lib/skill-runtime/operations/worker-run.js +0 -531
- package/lib/skill-runtime/operations/worker.js +0 -33
- package/lib/skill-runtime/planner.js +0 -539
- package/lib/skill-runtime/readiness.js +0 -84
- package/lib/skill-runtime/review-records.js +0 -123
- package/lib/skill-runtime/review.js +0 -855
- package/lib/skill-runtime/schemas.js +0 -746
- package/lib/skill-runtime/task-contract.js +0 -188
- package/lib/skill-runtime/team-state.js +0 -122
- package/lib/skill-runtime/workflow-context.js +0 -748
|
@@ -1,192 +1,32 @@
|
|
|
1
1
|
# CC-Investigate Playbook
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## State Machine
|
|
4
4
|
|
|
5
5
|
`cc-investigate -> cc-do -> cc-check`
|
|
6
6
|
|
|
7
|
-
- Enter
|
|
8
|
-
- Stay
|
|
9
|
-
- Exit
|
|
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
|
-
##
|
|
11
|
+
## Rules
|
|
13
12
|
|
|
14
|
-
1.
|
|
15
|
-
2.
|
|
16
|
-
3.
|
|
17
|
-
4.
|
|
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
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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.
|
|
4
|
-
description:
|
|
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
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
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
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
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:
|
|
24
|
-
durability:
|
|
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
|
-
-
|
|
25
|
+
- roadmap progress sync when a source item exists
|
|
26
|
+
- Git commit after the Investigate stage is complete
|
|
34
27
|
entry_gate:
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
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
|
-
- "`
|
|
48
|
-
- "`
|
|
49
|
-
- "
|
|
50
|
-
- "
|
|
51
|
-
- "
|
|
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:
|
|
58
|
-
target:
|
|
59
|
-
- when:
|
|
60
|
-
target:
|
|
61
|
-
- when:
|
|
62
|
-
target:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
`
|
|
58
|
+
- `devflow/changes/<change-key>/task.md`
|
|
157
59
|
|
|
158
|
-
|
|
60
|
+
不要生成额外过程文件或 JSON 文档。Git commit 是阶段历史,`task.md` 是根因合同。
|
|
159
61
|
|
|
160
|
-
|
|
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.
|
|
180
|
-
2.
|
|
181
|
-
3.
|
|
182
|
-
4.
|
|
183
|
-
5.
|
|
184
|
-
6.
|
|
185
|
-
7.
|
|
186
|
-
8. **Sync**:定位 source RM,回写调查结果或记录 no-op reason。
|
|
72
|
+
1. Classify:复现优先、diff trace、boundary probe、flaky、performance、workflow forensics 或 diagnose-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
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
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
|
-
-
|
|
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
|
-
|
|
93
|
+
退出时只说清:
|
|
278
94
|
|
|
279
|
-
-
|
|
280
|
-
-
|
|
281
|
-
-
|
|
95
|
+
- change key 和分支
|
|
96
|
+
- `task.md` 路径
|
|
97
|
+
- 复现 / 证据命令
|
|
98
|
+
- Investigate commit hash
|
|
99
|
+
- 下一步 `cc-do` 或 reroute
|