cc-devflow 4.5.3 → 4.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/.claude/skills/cc-act/CHANGELOG.md +12 -0
  2. package/.claude/skills/cc-act/PLAYBOOK.md +28 -5
  3. package/.claude/skills/cc-act/SKILL.md +45 -12
  4. package/.claude/skills/cc-act/assets/PR_BRIEF_TEMPLATE.md +39 -0
  5. package/.claude/skills/cc-act/assets/RELEASE_NOTE_TEMPLATE.md +16 -0
  6. package/.claude/skills/cc-act/references/closure-contract.md +3 -0
  7. package/.claude/skills/cc-act/scripts/cc-act-common.sh +48 -0
  8. package/.claude/skills/cc-act/scripts/generate-status-report.sh +3 -0
  9. package/.claude/skills/cc-act/scripts/render-pr-brief.sh +6 -0
  10. package/.claude/skills/cc-act/scripts/sync-act-docs.sh +13 -0
  11. package/.claude/skills/cc-check/CHANGELOG.md +6 -0
  12. package/.claude/skills/cc-check/PLAYBOOK.md +4 -0
  13. package/.claude/skills/cc-check/SKILL.md +15 -2
  14. package/.claude/skills/cc-check/assets/REPORT_CARD_TEMPLATE.json +18 -0
  15. package/.claude/skills/cc-do/CHANGELOG.md +12 -0
  16. package/.claude/skills/cc-do/PLAYBOOK.md +13 -10
  17. package/.claude/skills/cc-do/SKILL.md +40 -16
  18. package/.claude/skills/cc-do/references/execution-recovery.md +12 -0
  19. package/.claude/skills/cc-do/references/parallel-dispatch.md +6 -4
  20. package/.claude/skills/cc-do/scripts/detect-file-conflicts.sh +49 -3
  21. package/.claude/skills/cc-investigate/CHANGELOG.md +12 -0
  22. package/.claude/skills/cc-investigate/PLAYBOOK.md +12 -1
  23. package/.claude/skills/cc-investigate/SKILL.md +31 -5
  24. package/.claude/skills/cc-investigate/assets/ANALYSIS_TEMPLATE.md +44 -0
  25. package/.claude/skills/cc-investigate/assets/TASKS_TEMPLATE.md +1 -0
  26. package/.claude/skills/cc-investigate/assets/TASK_MANIFEST_TEMPLATE.json +9 -1
  27. package/.claude/skills/cc-investigate/references/investigation-contract.md +2 -0
  28. package/.claude/skills/cc-plan/CHANGELOG.md +29 -0
  29. package/.claude/skills/cc-plan/PLAYBOOK.md +43 -17
  30. package/.claude/skills/cc-plan/SKILL.md +85 -44
  31. package/.claude/skills/cc-plan/assets/DESIGN_TEMPLATE.md +109 -3
  32. package/.claude/skills/cc-plan/assets/TASKS_TEMPLATE.md +32 -5
  33. package/.claude/skills/cc-plan/assets/TASK_MANIFEST_TEMPLATE.json +85 -4
  34. package/.claude/skills/cc-plan/assets/TINY_DESIGN_TEMPLATE.md +78 -0
  35. package/.claude/skills/cc-plan/references/planning-contract.md +29 -7
  36. package/.claude/skills/cc-roadmap/CHANGELOG.md +12 -0
  37. package/.claude/skills/cc-roadmap/PLAYBOOK.md +15 -9
  38. package/.claude/skills/cc-roadmap/SKILL.md +22 -16
  39. package/.claude/skills/cc-roadmap/assets/BACKLOG_TEMPLATE.md +3 -1
  40. package/.claude/skills/cc-roadmap/assets/ROADMAP_TEMPLATE.md +11 -1
  41. package/.claude/skills/cc-roadmap/assets/TRACKING_TEMPLATE.json +57 -10
  42. package/.claude/skills/cc-roadmap/scripts/lib/roadmap-tracking/markdown.js +68 -3
  43. package/.claude/skills/cc-roadmap/scripts/lib/roadmap-tracking/schema.js +120 -0
  44. package/.claude/skills/cc-roadmap/scripts/lib/roadmap-tracking/store.js +25 -1
  45. package/.claude/skills/cc-roadmap/scripts/locate-roadmap-item.sh +13 -5
  46. package/.claude/skills/cc-roadmap/scripts/roadmap-tracking.js +3 -3
  47. package/.claude/skills/cc-roadmap/scripts/sync-roadmap-progress.sh +3 -3
  48. package/CHANGELOG.md +15 -0
  49. package/README.md +5 -5
  50. package/README.zh-CN.md +5 -5
  51. package/bin/cc-devflow-cli.js +93 -2
  52. package/docs/CLAUDE.md +1 -1
  53. package/docs/examples/START-HERE.md +3 -3
  54. package/docs/examples/example-bindings.json +27 -10
  55. package/docs/examples/full-design-blocked/BACKLOG.md +4 -2
  56. package/docs/examples/full-design-blocked/README.md +4 -4
  57. package/docs/examples/full-design-blocked/ROADMAP.md +16 -2
  58. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/design.md +39 -1
  59. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/task-manifest.json +41 -0
  60. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/tasks.md +8 -1
  61. package/docs/examples/full-design-blocked/roadmap.json +123 -0
  62. package/docs/examples/local-handoff/BACKLOG.md +4 -2
  63. package/docs/examples/local-handoff/README.md +4 -4
  64. package/docs/examples/local-handoff/ROADMAP.md +16 -2
  65. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/design.md +19 -1
  66. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/task-manifest.json +26 -0
  67. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/tasks.md +8 -1
  68. package/docs/examples/local-handoff/roadmap.json +121 -0
  69. package/docs/examples/pdca-loop/BACKLOG.md +4 -2
  70. package/docs/examples/pdca-loop/README.md +4 -4
  71. package/docs/examples/pdca-loop/ROADMAP.md +16 -2
  72. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/design.md +19 -1
  73. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/task-manifest.json +22 -3
  74. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/tasks.md +8 -1
  75. package/docs/examples/pdca-loop/roadmap.json +191 -0
  76. package/docs/examples/scripts/check-example-bindings.sh +7 -4
  77. package/docs/get-shit-done-strategy-audit.md +518 -0
  78. package/docs/guides/getting-started.md +2 -2
  79. package/docs/guides/getting-started.zh-CN.md +2 -2
  80. package/lib/compiler/__tests__/inventory.test.js +51 -0
  81. package/lib/compiler/__tests__/skills-registry.test.js +17 -3
  82. package/lib/compiler/inventory.js +78 -0
  83. package/lib/skill-runtime/__tests__/approve.test.js +92 -0
  84. package/lib/skill-runtime/__tests__/autopilot.test.js +4 -0
  85. package/lib/skill-runtime/__tests__/cli-bootstrap.integration.test.js +9 -1
  86. package/lib/skill-runtime/__tests__/planner.tdd.test.js +20 -0
  87. package/lib/skill-runtime/__tests__/query.test.js +147 -1
  88. package/lib/skill-runtime/__tests__/readiness.test.js +53 -0
  89. package/lib/skill-runtime/__tests__/release.test.js +85 -0
  90. package/lib/skill-runtime/__tests__/runtime.integration.test.js +11 -0
  91. package/lib/skill-runtime/__tests__/schemas.test.js +56 -0
  92. package/lib/skill-runtime/__tests__/worker-run.test.js +29 -0
  93. package/lib/skill-runtime/errors.js +39 -0
  94. package/lib/skill-runtime/index.js +8 -0
  95. package/lib/skill-runtime/operations/approve.js +17 -2
  96. package/lib/skill-runtime/operations/release.js +6 -3
  97. package/lib/skill-runtime/operations/worker-run.js +30 -0
  98. package/lib/skill-runtime/planner.js +10 -2
  99. package/lib/skill-runtime/query-registry.js +101 -0
  100. package/lib/skill-runtime/query.js +159 -91
  101. package/lib/skill-runtime/readiness.js +84 -0
  102. package/lib/skill-runtime/schemas.js +28 -3
  103. package/lib/skill-runtime/trace.js +22 -0
  104. package/package.json +1 -1
@@ -13,10 +13,17 @@
13
13
  "status": "blocked",
14
14
  "failureOwnership": [
15
15
  {
16
+ "errorName": "MissingSpecReviewProof",
16
17
  "failure": "missing spec review proof",
17
18
  "classification": "in-branch",
19
+ "owner": "branch",
18
20
  "touchedByDiff": true,
21
+ "artifactRefs": [
22
+ "planning/task-manifest.json",
23
+ "review/report-card.json"
24
+ ],
19
25
  "evidence": "planning/task-manifest.json tasks[T002].reviews.spec is empty",
26
+ "rescueAction": "record spec review proof for T002 or reroute to cc-do",
20
27
  "action": "reroute-cc-do",
21
28
  "status": "open"
22
29
  }
@@ -107,6 +114,16 @@
107
114
  "issues": [],
108
115
  "skipReason": "template example is not a UI browser QA scenario"
109
116
  },
117
+ "humanUat": {
118
+ "status": "skipped",
119
+ "required": false,
120
+ "scenario": "",
121
+ "tester": "",
122
+ "evidence": [],
123
+ "failure": "",
124
+ "reroute": "none",
125
+ "skipReason": "not required for this template scenario"
126
+ },
110
127
  "architectureFollowUps": [
111
128
  {
112
129
  "summary": "Add the missing public test seam before widening coverage",
@@ -183,6 +200,7 @@
183
200
  "summary": "T002 spec review proof is missing",
184
201
  "evidence": "planning/task-manifest.json tasks[T002].reviews.spec is empty",
185
202
  "action": "reroute-cc-do",
203
+ "rescueAction": "record spec review proof for T002 or return to cc-do",
186
204
  "triageStatus": "clarification-needed",
187
205
  "confidenceScore": 9,
188
206
  "fingerprint": "task-review:T002:missing-spec-review",
@@ -1,5 +1,17 @@
1
1
  # CC-Do Skill Changelog
2
2
 
3
+ ## v1.6.2 - 2026-05-06
4
+
5
+ - absorb the external TDD skill's execution details into native `cc-do`: spec-style test names, one logical behavior per Red, and public verification paths
6
+ - strengthen Green evidence with minimality guards so implementation does not pre-build future unproven behavior
7
+ - expand checkpoint recovery fields with interface-testability proof and concrete refactor candidates such as duplication, long methods, shallow modules, feature envy, primitive obsession, naming, and nested branches
8
+
9
+ ## v1.6.1 - 2026-04-29
10
+
11
+ - reject parent/child touched-path overlaps when selecting parallel execution surfaces
12
+ - report submodule touches separately so unrelated tasks are not serialized by mere `.gitmodules` presence
13
+ - document quick-lane and wave scheduling gates so small tasks still leave checkpoint, verification, and handoff truth
14
+
3
15
  ## v1.6.0 - 2026-04-28
4
16
 
5
17
  - prohibit horizontal TDD execution by requiring one tracer bullet Red/Green/Refactor cycle per observable behavior
@@ -23,14 +23,15 @@
23
23
 
24
24
  ## Execution Loop
25
25
 
26
- 1. 读取 `task-manifest.json`,先用 `scripts/select-ready-tasks.sh` 找出当前 ready tasks。
27
- 2. 如果有多于一个 ready task,要先跑 `scripts/detect-file-conflicts.sh`;有共享触点或依赖关系就退回串行。
26
+ 1. 读取 `task-manifest.json`,先用 `scripts/select-ready-tasks.sh` 找出当前 ready tasks 和当前 wave
27
+ 2. 如果有多于一个 ready task,要先跑 `scripts/detect-file-conflicts.sh`;有共享触点、父子路径触点或依赖关系就退回串行。
28
28
  3. 对每个要执行的 task,先用 `scripts/build-task-context.sh` 从 `planning/design.md`、`planning/tasks.md`、`planning/task-manifest.json` 组装上下文,再开始编码。
29
29
  4. 如果当前任务来自 `cc-investigate`,把 `planning/analysis.md` 当成上游合同,不准一边做一边重开调查。
30
30
  5. 进入 TDD 闭环:先红,再绿,再重构。
31
31
  6. 每个关键节点都写 runtime:失败测试、Green 通过、Refactor、Review 结论、阻塞原因。
32
32
  7. 任务实现后,先过 `spec review`,再过 `code review`,review 不通过就回到实现。
33
33
  8. 两道 review 门都通过后,才能把任务标成完成,并把结果留给 `cc-check`。
34
+ 9. quick lane 只允许减少叙事,不允许减少 current task、checkpoint、verification、handoff 和 review gates。
34
35
 
35
36
  ## Local Kit
36
37
 
@@ -52,10 +53,11 @@
52
53
  2. 确认红灯是预期失败,不是测试写错、fixture 缺失或环境没接上。
53
54
  3. 确认红灯通过公共 seam 证明行为缺失,而不是测私有函数、内部调用次数或临时结构。
54
55
  4. 确认 mock 只发生在系统边界;内部协作者不 mock。
55
- 5. 只写让当前测试转绿的最小实现。
56
- 6. 绿后才允许重构。
57
- 7. 重构后必须保持绿。
58
- 8. 测试没先红过,或红灯不是公共 seam 上的行为失败,就不能宣称这次变更受 TDD 保护。
56
+ 5. 确认测试名像规格说明,一个 Red 只证明一个逻辑行为,结果从公共验证路径读回。
57
+ 6. 只写让当前测试转绿的最小实现,不提前实现未来测试尚未要求的分支、状态或 API。
58
+ 7. 绿后才允许重构。
59
+ 8. 重构后必须保持绿,并说明处理了重复、长方法、浅模块、feature envy、primitive obsession、命名、三层以上分支或其它具体坏味道。
60
+ 9. 测试没先红过,或红灯不是公共 seam 上的行为失败,就不能宣称这次变更受 TDD 保护。
59
61
 
60
62
  ## TDD Exception Rule
61
63
 
@@ -83,9 +85,9 @@
83
85
  3. `red_seam_verified`: 红灯通过公共接口、调用方流程、CLI/API/UI 或真实边界进入系统
84
86
  4. `red_behavior_verified`: 测试断言用户或调用方可观察行为,不断言内部实现细节
85
87
  5. `mock_boundary_verified`: mock 只在系统边界,内部协作者没有被 mock
86
- 6. `green_passed`: 当前任务实现转绿
88
+ 6. `green_passed`: 当前任务实现转绿,且实现只覆盖当前红灯要求的最小行为
87
89
  7. `refactor_done` 或 `refactor_not_needed`
88
- 8. `refactor_green`: 重构后相关测试仍绿
90
+ 8. `refactor_green`: 重构后相关测试仍绿,且没有在 Red 状态做结构清理
89
91
  9. `spec_review_pass`
90
92
  10. `code_review_pass`
91
93
 
@@ -98,8 +100,9 @@
98
100
  1. 任务处于当前 active phase
99
101
  2. `dependsOn` 已全部满足
100
102
  3. 任务显式允许并行,例如 `[P]`
101
- 4. `touches` / `files` 不冲突
102
- 5. 每个 subagent 都拿到了自己的 task context
103
+ 4. `touches` / `files` 不冲突,且父路径 / 子路径也不重叠
104
+ 5. submodule touches 已被标出;触达 submodule 的任务不能默认拿普通 worktree 隔离
105
+ 6. 每个 subagent 都拿到了自己的 task context
103
106
 
104
107
  少一条,都按顺序执行。
105
108
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cc-do
3
- version: 1.6.0
3
+ version: 1.6.2
4
4
  description: Use when implementing planned tasks, resuming interrupted work, applying a frozen investigation handoff, or landing review feedback after cc-plan or cc-investigate.
5
5
  triggers:
6
6
  - 开始做 T003
@@ -27,16 +27,23 @@ writes:
27
27
  durability: durable
28
28
  required: false
29
29
  when: execution mode uses delegated or team workers
30
+ - path: devflow/changes/<change-key>/meta/change-state.json
31
+ durability: durable
32
+ required: false
33
+ when: pause, resume, dispatch, or quick-lane state changes
30
34
  effects:
31
35
  - code changes
32
36
  - test changes
33
37
  - workspace scratch runtime updates
34
38
  entry_gate:
35
39
  - Read planning/design.md or planning/analysis.md, then planning/tasks.md, planning/task-manifest.json, change-meta.json, related capability specs, and the latest checkpoint before changing code.
36
- - Select only ready tasks whose dependencies and file ownership are clear.
40
+ - Select only ready tasks whose dependencies, wave, touched paths, and file ownership are clear.
41
+ - Reject parallel execution when touched paths overlap by exact path or parent/child path; submodule touches must be isolated unless the task explicitly owns that submodule.
37
42
  - If the current task cannot be restated from canonical artifacts, run a context reset before coding.
43
+ - "Validate the current task's TDD shape before coding: spec-style test name, one logical behavior, public verification path, allowed boundary mocks, Green minimality guard, and refactor candidates."
38
44
  exit_criteria:
39
45
  - The current task has red/green evidence, public-seam test quality evidence, review evidence, and a resumable checkpoint trail.
46
+ - Red evidence proves one observable behavior through a public verification path; Green evidence shows only the minimal production change; Refactor evidence names the concrete smell removed or says why none was needed.
40
47
  - Execution leaves the next verifier enough runtime truth to judge the task without chat memory.
41
48
  - The honest next step is cc-check or an explicit reroute.
42
49
  reroutes:
@@ -136,34 +143,43 @@ NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
136
143
 
137
144
  Red 不是形式上的红,而是公共 seam 上的行为缺失证明。测试必须通过公共接口、调用方流程、CLI/API/UI 路径或其它真实边界进入系统;只验证私有函数、内部调用次数、临时数据结构或 mock 自己控制的内部协作者,不算 TDD 证据。
138
145
 
146
+ 一个 Red 只证明一个逻辑行为。测试名要像规格说明,而不是实现步骤;结果要从同一类公共入口读回。直接查数据库、读内部状态、扫描临时文件或绕过 API 来证明行为,只在那个边界本身就是被测对象时成立。
147
+
139
148
  例外只能用于 throwaway prototype、纯生成文件、纯配置改动;例外必须写进 checkpoint 的 `tddException`,包含原因、风险和替代验证命令。测试第一次就绿,说明测试没有证明新行为,必须修测试而不是继续写生产代码。
140
149
 
141
150
  禁止水平切片:不要先写一批测试,再写一批实现。每次只推进一个 tracer bullet:一个可观察行为的 Red -> 让它变绿的最小实现 -> 必要重构 -> 记录证据,然后再进入下一个行为。
142
151
 
143
152
  测试数据也必须诚实。fixture 只提供当前行为需要的最小输入;partial fixture、类型断言、mock payload 或 generated stub 必须写清哪些字段是真实 contract,哪些只是测试填充。不能用 `as`、`any`、双重 cast、缺字段 partial mock 或 test-only method 掩盖 seam 设计问题。
144
153
 
154
+ Green 不是顺手把未来行为都做掉。只写当前红灯要求的最小生产代码;如果需要新接口,优先保持小接口深模块,依赖从调用方传入,外部 boundary adapter 拆成具体操作,而不是用一个 generic fetcher 把复杂条件推给 mock。
155
+
156
+ Refactor 只能发生在 Green 之后。优先处理当前 slice 暴露出的重复、长方法、浅模块、feature envy、primitive obsession、命名混乱、三层以上分支和新代码揭开的旧代码坏味道;没被当前绿色测试保护的扩张性整理,回到 `cc-plan` 或后续任务。
157
+
145
158
  ## Entry Gate
146
159
 
147
160
  1. 先读 `planning/design.md` 或 `planning/analysis.md`,再读 `planning/tasks.md`、`planning/task-manifest.json`;如果是恢复执行,再补读最近 checkpoint 或已有 `handoff/resume-index.md`。
148
161
  2. 先用 `scripts/select-ready-tasks.sh` 判断现在到底哪几个任务真的 ready。
149
- 3. 只锁定当前 ready task,或一组经依赖与触点校验后可并行的 ready tasks。
162
+ 3. 只锁定当前 ready task,或一组经依赖、wave、精确触点与父子路径触点校验后可并行的 ready tasks。
150
163
  4. 如果这次来自 `cc-investigate`,必须把 `planning/analysis.md` 当成 canonical contract,而不是一边实现一边重新调查。
151
164
  5. 没有任务上下文,不准把任务扔给 subagent;先用 `scripts/build-task-context.sh` 从 `planning/design.md` 或 `planning/analysis.md`、`planning/tasks.md`、`planning/task-manifest.json`、`change-meta.json` 与相关 capability spec 组装上下文。
165
+ 6. 如果 `task-manifest.json.metadata.lane == "quick"`,仍然必须有 current task、verification、checkpoint 和 handoff;quick 只缩短文档密度,不跳过证据。
166
+ 7. 如果仓库含 `.gitmodules` 或 manifest 提供 `submodulePaths`,先用 `scripts/detect-file-conflicts.sh` 标出 `submoduleTouches`;只有触达该 submodule 的任务失去默认 worktree 隔离资格,未触达任务不能被无辜串行化。
152
167
 
153
168
  ## Loop
154
169
 
155
170
  1. 读取当前任务,而不是重新发明任务。
156
- 2. 依赖没满足前,不准提前做下游任务。
157
- 3. 没有明确并行资格,不准把多个实现任务同时推进。
171
+ 2. 依赖没满足前,不准提前做下游任务;不同 wave 之间不允许抢跑。
172
+ 3. 没有明确并行资格,不准把多个实现任务同时推进;`touches` 父子路径重叠也算同一执行表面。
158
173
  4. 先 `fail-first`:先写失败测试,先看见预期红,再写生产代码。
159
174
  5. 如果红灯不是预期失败(语法错、fixture 错、测试没连上),先修测试直到它正确失败。
160
175
  6. 如果红灯通过错误 seam 得到,比如私有方法、内部调用次数、mock 内部协作者,先修测试 seam,不准进入 Green。
161
- 7. `Red -> Green -> Refactor` 推进,Green 只允许最小实现。
162
- 8. 如果当前 Red 需要新的 fixture mock,先证明它仍从公共 seam 触发真实行为;fixture 缺字段、类型强转或内部 mock 都要写入 `tdd.testQuality.fixtureRisk` 或先修 seam
163
- 9. Refactor 后必须重跑相关测试,保持 Green
164
- 10. 每次推进都写 task runtime:`events.jsonl` + `checkpoint.json`,并记录 `tdd.testQuality` 或 `tddException`。
165
- 11. 任务实现后,先过 `spec review`,再过 `code review`,两道门都过才算任务收口;这里只验证 spec delta,不回写长期 spec。
166
- 12. 当前任务完成后,把可验证证据留给 `cc-check`。
176
+ 7. 如果红灯只断言实现形状、直接查内部状态或一次证明多个逻辑行为,先改测试,不准进入 Green
177
+ 8. `Red -> Green -> Refactor` 推进,Green 只允许最小实现,不预铺未来测试尚未要求的分支、状态或 API
178
+ 9. 如果当前 Red 需要新的 fixture 或 mock,先证明它仍从公共 seam 触发真实行为;fixture 缺字段、类型强转或内部 mock 都要写入 `tdd.testQuality.fixtureRisk` 或先修 seam
179
+ 10. Refactor 后必须重跑相关测试,保持 Green;Red 状态下不重构。
180
+ 11. 每次推进都写 task runtime:`events.jsonl` + `checkpoint.json`,并记录 `tdd.testQuality`、`tdd.greenMinimality`、`tdd.refactorCandidates` `tddException`。
181
+ 12. 任务实现后,先过 `spec review`,再过 `code review`,两道门都过才算任务收口;这里只验证 spec delta,不回写长期 spec。
182
+ 13. 当前任务完成后,把可验证证据留给 `cc-check`。
167
183
 
168
184
  ## Output
169
185
 
@@ -176,9 +192,14 @@ Red 不是形式上的红,而是公共 seam 上的行为缺失证明。测试
176
192
  ## Good Output
177
193
 
178
194
  - 当前 task 一眼可见,执行者不用从聊天记录里猜目标
195
+ - 当前 wave、ready tasks、parallel candidates、touch conflict verdict 和 submoduleTouches 一眼可见
179
196
  - 至少留下一次明确的 tracer bullet Red/Green/Refactor 证据,且 Red 是公共 seam 上的预期行为失败
197
+ - Red 证据说明测试名、单一行为、公共验证路径和为何不是实现细节测试
198
+ - Green 证据说明 minimality guard:本轮只满足当前红灯,没有提前实现未来分支
199
+ - Refactor 证据说明清掉了哪个具体坏味道,或者为什么当前 slice 不需要 refactor
180
200
  - 测试 fixture 说明真实 contract 字段和测试填充字段,没有用类型欺骗或内部 mock 制造假绿
181
201
  - runtime / checkpoint 足够让下一位接手者无损恢复
202
+ - quick lane 也有 mini manifest、checkpoint、verification 和唯一 next action,不靠聊天记录继续
182
203
  - reviewer 能顺着 review 记录和验证命令复盘这次实现
183
204
 
184
205
  ## Bundled Resources
@@ -205,11 +226,14 @@ Red 不是形式上的红,而是公共 seam 上的行为缺失证明。测试
205
226
  5. 红灯原因必须和目标行为缺失一致;红灯如果只是测试写错,不算 TDD 证据。
206
227
  6. 红灯必须验证公共接口上的行为;实现细节测试、私有方法测试、内部调用次数断言都要先退回 Red 修正。
207
228
  7. Mock 只能放在系统边界;如果必须 mock 内部协作者才能测试,说明 seam 或设计合同有问题。
208
- 8. 先过 `spec review`,再过 `code review`,顺序不能反。
209
- 9. 不在 `cc-do` 里改 capability spec 正文;这里只产出实现证据和 spec 对齐证据。
210
- 10. 失败和阻塞都要留下恢复证据。
211
- 11. subagent 的输入必须包含:当前进度、当前任务全文、依赖状态、必读文件、验收标准、可信命令。
212
- 12. 三次失败修补后必须先质疑调查合同或设计合同,而不是继续堆补丁。
229
+ 8. 一个 Red 只证明一个逻辑行为;bulk Red 或测试名描述实现步骤,都先退回测试设计。
230
+ 9. Green 只写当前红灯需要的最小实现;预铺未来功能、兼容分支或宽接口都算越界。
231
+ 10. Red 时不重构;Refactor 只在相关测试已绿后处理当前 slice 暴露的坏味道。
232
+ 11. 先过 `spec review`,再过 `code review`,顺序不能反。
233
+ 12. 不在 `cc-do` 里改 capability spec 正文;这里只产出实现证据和 spec 对齐证据。
234
+ 13. 失败和阻塞都要留下恢复证据。
235
+ 14. 给 subagent 的输入必须包含:当前进度、当前任务全文、依赖状态、必读文件、验收标准、可信命令。
236
+ 15. 三次失败修补后必须先质疑调查合同或设计合同,而不是继续堆补丁。
213
237
 
214
238
  ## Exit Criteria
215
239
 
@@ -7,6 +7,8 @@
7
7
  - 当前 task status
8
8
  - 当前 active phase
9
9
  - 当前 ready tasks
10
+ - 当前 wave / parallel candidates / touch conflict verdict
11
+ - submoduleTouches(如适用)
10
12
  - 当前 review gates(spec / code)
11
13
  - 已完成证据
12
14
  - 阻塞点
@@ -57,13 +59,22 @@
57
59
  - `red.expectedFailure`
58
60
  - `red.testSeam`
59
61
  - `red.behaviorAsserted`
62
+ - `red.specStyleTestName`
63
+ - `red.oneLogicalBehavior`
64
+ - `red.publicVerificationPath`
60
65
  - `red.allowedMocks`
61
66
  - `red.implementationDetailRisk`
62
67
  - `green.command`
63
68
  - `green.exitStatus`
69
+ - `green.minimalityGuard`
64
70
  - `refactor.status`
71
+ - `refactor.candidates`
72
+ - `refactor.greenCommand`
65
73
  - `testQuality.usesPublicInterface`
66
74
  - `testQuality.describesBehavior`
75
+ - `testQuality.specStyleName`
76
+ - `testQuality.verifiesThroughPublicPath`
77
+ - `testQuality.noBulkRed`
67
78
  - `testQuality.survivesInternalRefactor`
68
79
  - `testQuality.mocksOnlySystemBoundaries`
69
80
  - `review.spec.status`
@@ -95,3 +106,4 @@
95
106
  - 验收标准
96
107
  - 验证命令
97
108
  - 不做项 / 边界
109
+ - quick lane 是否仍有 mini manifest、checkpoint、verification 和唯一 next action
@@ -12,17 +12,18 @@
12
12
 
13
13
  1. 两个任务都在当前 active phase
14
14
  2. `dependsOn` 已满足,且互不依赖
15
- 3. `touches` / `files` 没有交集
15
+ 3. `touches` / `files` 没有交集,且没有父路径 / 子路径重叠
16
16
  4. 不共享同一个可变资源,例如同一 schema、同一公共接口、同一全局状态
17
17
  5. 验证命令可以各自独立运行
18
18
  6. 每个任务都有完整上下文包,不需要靠别人的临场解释补脑
19
+ 7. submodule touches 已经被识别;只有实际触达 submodule 的任务失去普通 worktree 隔离资格
19
20
 
20
21
  ## Must Run Sequentially
21
22
 
22
23
  命中任一条,就必须串行:
23
24
 
24
25
  1. 一个任务依赖另一个任务的输出
25
- 2. 两个任务会改同一个文件或同一抽象边界
26
+ 2. 两个任务会改同一个文件、父子路径或同一抽象边界
26
27
  3. 上游任务在定义契约,下游任务在消费契约
27
28
  4. 一个任务先改 schema / API,另一个任务基于它写实现
28
29
  5. 你还不能清楚说出每个任务各自的验收标准
@@ -50,8 +51,9 @@
50
51
 
51
52
  1. 先选当前 active phase 的 ready tasks
52
53
  2. 在 ready tasks 里优先选 `touches` 不重叠的任务
53
- 3. 在不重叠任务里优先选验证面最小的任务
54
- 4. 如果仍然不确定,退回串行
54
+ 3. 在不重叠任务里排除 submodule-touch 隔离风险
55
+ 4. 在剩余任务里优先选验证面最小的任务
56
+ 5. 如果仍然不确定,退回串行
55
57
 
56
58
  ## Good Example
57
59
 
@@ -30,18 +30,41 @@ const sourceTasks = Array.isArray(parsed)
30
30
  const tasks = sourceTasks.filter((task) => task && task.parallel !== false);
31
31
  const fileConflicts = [];
32
32
  const dependencyConflicts = [];
33
+ const submoduleTouches = [];
33
34
  const conflictedTaskIds = new Set();
34
35
 
35
36
  function touchesOf(task) {
36
- return [...new Set([...(task.touches || []), ...(task.files || [])].filter(Boolean))];
37
+ return [...new Set([...(task.touches || []), ...(task.files || [])].filter(Boolean).map(normalizePath))];
38
+ }
39
+
40
+ function normalizePath(value) {
41
+ return String(value)
42
+ .replace(/\\/g, '/')
43
+ .replace(/\/+/g, '/')
44
+ .replace(/^\.\//, '')
45
+ .replace(/\/$/, '');
46
+ }
47
+
48
+ function overlaps(left, right) {
49
+ if (left === right) return left;
50
+ if (left && right.startsWith(`${left}/`)) return left;
51
+ if (right && left.startsWith(`${right}/`)) return right;
52
+ return '';
37
53
  }
38
54
 
39
55
  for (let index = 0; index < tasks.length; index += 1) {
40
56
  for (let offset = index + 1; offset < tasks.length; offset += 1) {
41
57
  const left = tasks[index];
42
58
  const right = tasks[offset];
43
- const leftTouches = new Set(touchesOf(left));
44
- const sharedTouches = touchesOf(right).filter((touch) => leftTouches.has(touch));
59
+ const leftTouches = touchesOf(left);
60
+ const rightTouches = touchesOf(right);
61
+ const sharedTouches = [
62
+ ...new Set(
63
+ leftTouches.flatMap((leftTouch) =>
64
+ rightTouches.map((rightTouch) => overlaps(leftTouch, rightTouch)).filter(Boolean)
65
+ )
66
+ )
67
+ ];
45
68
 
46
69
  if (sharedTouches.length > 0) {
47
70
  conflictedTaskIds.add(left.id);
@@ -68,6 +91,28 @@ for (let index = 0; index < tasks.length; index += 1) {
68
91
  }
69
92
  }
70
93
 
94
+ const submodulePaths = (parsed.submodulePaths || [])
95
+ .map(normalizePath)
96
+ .filter(Boolean);
97
+
98
+ if (submodulePaths.length > 0) {
99
+ for (const task of tasks) {
100
+ const taskTouches = touchesOf(task);
101
+
102
+ for (const submodulePath of submodulePaths) {
103
+ const matchedTouches = taskTouches.filter((touch) => overlaps(submodulePath, touch));
104
+
105
+ if (matchedTouches.length > 0) {
106
+ submoduleTouches.push({
107
+ task: task.id,
108
+ submodulePath,
109
+ touches: matchedTouches
110
+ });
111
+ }
112
+ }
113
+ }
114
+ }
115
+
71
116
  const safeTaskIds = tasks
72
117
  .map((task) => task.id)
73
118
  .filter((taskId) => !conflictedTaskIds.has(taskId));
@@ -78,6 +123,7 @@ process.stdout.write(
78
123
  hasConflicts: fileConflicts.length > 0 || dependencyConflicts.length > 0,
79
124
  fileConflicts,
80
125
  dependencyConflicts,
126
+ submoduleTouches,
81
127
  safeTaskIds
82
128
  },
83
129
  null,
@@ -1,5 +1,17 @@
1
1
  # CC-Investigate Skill Changelog
2
2
 
3
+ ## v1.2.2 - 2026-05-06
4
+
5
+ - add a Roadmap Sync Gate so frozen investigations must reconcile the source RM before handing off repair work
6
+ - classify roadmap updates by `implementation drift`, `missing spec truth`, and `roadmap mismatch` outcomes
7
+ - update analysis, tasks, and manifest templates with roadmap sync status fields
8
+
9
+ ## v1.2.1 - 2026-04-29
10
+
11
+ - add persistent debug session fields for active hypothesis, probes, cleanup state, and next evidence action
12
+ - add diagnose-only and workflow-forensics modes so root-cause reports do not masquerade as completed repairs
13
+ - update the analysis template with debug session, workflow forensics, and diagnose-only outcome sections
14
+
3
15
  ## v1.2.0 - 2026-04-28
4
16
 
5
17
  - treat feedback loops as investigation products that must be made faster, sharper, and more deterministic before root cause freeze
@@ -6,7 +6,7 @@
6
6
 
7
7
  - Enter from: a bug, regression, or broken requirement whose root cause is still unclear.
8
8
  - Stay in: `cc-investigate` until `planning/analysis.md` and the repair handoff are both frozen.
9
- - Exit to: `cc-do` only after root cause and repair boundary are explicit in canonical artifacts.
9
+ - Exit to: `cc-do` only after root cause, repair boundary, and source roadmap progress are explicit in canonical artifacts.
10
10
  - Reroute to: `cc-plan` for scope/design truth changes, or `roadmap` for project-level priority decisions.
11
11
 
12
12
  ## Core Rules
@@ -20,6 +20,9 @@
20
20
  7. 调查失败三次后先重建入口,不准继续乱补。
21
21
  8. 没有 frozen root-cause contract,不准进入 repair task。
22
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 跟上。
23
26
 
24
27
  ## Iron Law
25
28
 
@@ -34,6 +37,7 @@ root-cause contract 至少包含:稳定复现或缩小后的可验证症状、
34
37
  - `planning/analysis.md`
35
38
  - `planning/tasks.md`
36
39
  - `planning/task-manifest.json`
40
+ - `change-meta.json`
37
41
 
38
42
  ## Investigation Standard
39
43
 
@@ -61,6 +65,8 @@ root-cause contract 至少包含:稳定复现或缩小后的可验证症状、
61
65
  | `history-trace` | 同一区域反复坏 | 查历史 `analysis.md`、TODO、report-card finding |
62
66
  | `pattern-research` | 陌生框架 / 依赖 / 平台错误 | 脱敏后查通用错误类型 |
63
67
  | `contract-check` | 修复边界可能扩大 | 判定 implementation drift / missing spec truth / roadmap mismatch |
68
+ | `diagnose-only` | 用户只要问题解释或现在不能修 | 冻结 root cause、owner、risk、next action,不生成实现完成态 |
69
+ | `workflow-forensics` | devflow artifact、git、状态、权限或工具链断裂 | 分类 failure owner 和 rescue action,再决定 reroute |
64
70
 
65
71
  ## Pattern Analysis
66
72
 
@@ -89,6 +95,9 @@ root-cause contract 至少包含:稳定复现或缩小后的可验证症状、
89
95
  - Diagnostic Instrumentation Plan:probe tag、probe location、question answered、command、expected signal、cleanup requirement
90
96
  - Feedback Loop Contract:loop type、command、expected / actual signal、symptom match、runtime、determinism、failure rate、sharpening plan
91
97
  - Correct Test Seam:test seam、public interface exercised、why it reaches the real trigger chain、why shallow tests are rejected
98
+ - Persistent Debug Session:session id、active hypothesis、completed probes、cleanup state、next evidence action
99
+ - Workflow Forensics:artifact state、git state、runtime state、tool/permission/process failure owner、rescue action
100
+ - Diagnose-Only Outcome:root cause, owner, risk, next action, and explicit no-repair verdict
92
101
 
93
102
  这些字段不是装饰。它们的作用是证明根因位于源头,而不是报错点。
94
103
 
@@ -152,6 +161,7 @@ root-cause contract 至少包含:稳定复现或缩小后的可验证症状、
152
161
  - 模板在 `assets/`
153
162
  - 调查契约在 `references/investigation-contract.md`
154
163
  - 需要分析骨架时用 `scripts/bootstrap-analysis.sh`
164
+ - Roadmap 回写使用 `../cc-roadmap/scripts/locate-roadmap-item.sh` 和 `../cc-roadmap/scripts/sync-roadmap-progress.sh`
155
165
 
156
166
  ## Exit Rule
157
167
 
@@ -163,3 +173,4 @@ root-cause contract 至少包含:稳定复现或缩小后的可验证症状、
163
173
  - 用什么命令证明修好了
164
174
 
165
175
  这次调查才算合格。
176
+ 如果 source RM 仍然停在旧 status、旧 progress 或旧 REQ/FIX 绑定,说明本次 `cc-investigate` 没有真正退出。
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cc-investigate
3
- version: 1.2.0
3
+ version: 1.2.2
4
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."
5
5
  triggers:
6
6
  - "帮我查这个 bug"
@@ -17,6 +17,8 @@ reads:
17
17
  - "assets/ANALYSIS_TEMPLATE.md"
18
18
  - "assets/TASKS_TEMPLATE.md"
19
19
  - "assets/TASK_MANIFEST_TEMPLATE.json"
20
+ - "../cc-roadmap/scripts/locate-roadmap-item.sh"
21
+ - "../cc-roadmap/scripts/sync-roadmap-progress.sh"
20
22
  writes:
21
23
  - path: "devflow/changes/<change-key>/planning/analysis.md"
22
24
  durability: "durable"
@@ -30,17 +32,24 @@ writes:
30
32
  - path: "devflow/changes/<change-key>/change-meta.json"
31
33
  durability: "durable"
32
34
  required: true
35
+ effects:
36
+ - source roadmap progress sync when investigation freezes, reroutes, or diagnoses a roadmap mismatch
33
37
  entry_gate:
34
38
  - "Read the current bug report, existing requirement artifacts, relevant code, tests, and recent history before forming any hypothesis."
35
39
  - "Use a FIX-<number>-<description> change key for new bug-fix investigations."
36
40
  - "Build a runnable feedback loop, confirm it matches the reported symptom, then freeze the evidence chain before proposing repair tasks."
41
+ - "Record persistent debug session state: active hypothesis, probes, cleanup status, and next evidence action."
37
42
  - "Search prior investigations, TODO/backlog signals, and recent fixes in the affected area before declaring the bug novel."
38
43
  - "For multi-component, deep-stack, or flaky symptoms, record boundary probes, backward trace, or condition-wait evidence before declaring the root cause."
39
44
  - "For performance regressions, collect a baseline or profile signal before treating logs as evidence."
40
45
  - "Do not write production code here; this stage ends with planning/analysis.md plus executable repair tasks for cc-do."
46
+ - "Before exit, locate the source RM in `devflow/roadmap.json`, `devflow/ROADMAP.md`, optional `devflow/BACKLOG.md`, or legacy `devflow/roadmap-tracking.json`; the repair handoff must not leave roadmap progress stale."
41
47
  exit_criteria:
42
48
  - "planning/analysis.md records symptom, reproduction, evidence chain, boundary probes or backward trace when applicable, pattern analysis, tested hypotheses, confirmed root cause, and repair boundary."
49
+ - "diagnose-only outcomes clearly stop before implementation while preserving root cause, owner, and next action."
50
+ - "workflow forensics classify artifact, git, state, or tool failures before repair tasks are generated."
43
51
  - "planning/tasks.md and planning/task-manifest.json are explicit enough that cc-do can repair the bug without chat memory."
52
+ - "The source roadmap item has been synchronized with the investigation outcome, or `planning/analysis.md` and `change-meta.json` record why no roadmap update is valid."
44
53
  - "The honest next step is cc-do, cc-plan, or roadmap."
45
54
  reroutes:
46
55
  - when: "The issue is actually a new feature, a scope redesign, or a product decision instead of a bug investigation."
@@ -57,9 +66,9 @@ recovery_modes:
57
66
  when: "New execution evidence disproves the current root-cause contract or widens the suspected blast radius."
58
67
  action: "Reopen planning/analysis.md, update the evidence chain, and regenerate repair tasks only after the new root cause is frozen."
59
68
  tool_budget:
60
- read_files: 10
69
+ read_files: 11
61
70
  search_steps: 6
62
- shell_commands: 6
71
+ shell_commands: 7
63
72
  ---
64
73
 
65
74
  # CC-Investigate
@@ -141,12 +150,14 @@ NO REPAIR WITHOUT A FROZEN ROOT-CAUSE CONTRACT
141
150
  | 错误类型陌生,像框架 / 依赖 / 平台问题 | `pattern-research`,先做脱敏外部调研 |
142
151
  | 同一区域反复坏 | `history-trace`,先查 prior investigations 和最近修复 |
143
152
  | 看起来像 bug,实则是未定义行为或新需求 | 直接 reroute 到 `cc-plan` |
153
+ | 用户只要根因报告、不要求修复 | `diagnose-only`,停止在报告与 next action,不生成完成态实现任务 |
154
+ | 失败来自 workflow / artifact / git / state 断裂 | `workflow-forensics`,先分类坏在文件、状态、工具、权限还是流程 |
144
155
 
145
156
  先说“这是什么类问题”,再说“我要怎么修”。没有分类的 debug,最后都会变成乱打补丁。
146
157
 
147
158
  ## Harness Contract
148
159
 
149
- - Allowed actions: reproduce, collect evidence, trace code paths, test hypotheses, freeze root cause, and write only `planning/analysis.md`, `planning/tasks.md`, `planning/task-manifest.json`, and `change-meta.json`.
160
+ - Allowed actions: reproduce, collect evidence, trace code paths, test hypotheses, freeze root cause, write `planning/analysis.md`, `planning/tasks.md`, `planning/task-manifest.json`, and `change-meta.json`, then run the final roadmap progress sync for the source RM.
150
161
  - Forbidden actions: writing production code, disguising guesses as root cause, or skipping directly from symptoms to repair.
151
162
  - Required evidence: every root-cause claim must point to reproduction evidence, code facts, recent history, or explicit user confirmation.
152
163
  - Reroute rule: product/scope changes go to `cc-plan`; strategy questions go to `roadmap`; only confirmed repair handoff goes to `cc-do`.
@@ -174,6 +185,9 @@ NO REPAIR WITHOUT A FROZEN ROOT-CAUSE CONTRACT
174
185
 
175
186
  `cc-investigate` 不写生产代码,不在这里偷跑 `cc-do`。
176
187
 
188
+ diagnose-only 仍然写 `planning/analysis.md`,但 `planning/tasks.md` 只能包含证据交接、
189
+ 监控、人工动作或明确的 `reroute`;不能把“已经诊断”伪装成“已经修复”。
190
+
177
191
  ## Entry Gate
178
192
 
179
193
  1. 先确认当前对象仍然属于一个 requirement,而不是整个项目级故障。
@@ -225,9 +239,16 @@ NO REPAIR WITHOUT A FROZEN ROOT-CAUSE CONTRACT
225
239
  - 写清正确测试缝隙:测试是否覆盖真实触发链;如果没有正确 seam,这本身就是需要记录的架构事实
226
240
  - 写明 affected module、allowed files、forbidden files、blast radius estimate;超过 5 个文件默认拆分或 reroute
227
241
  - 输出 `planning/tasks.md` + `planning/task-manifest.json` + `change-meta.json`
228
- 8. **Hand off**
242
+ 8. **Roadmap sync**
243
+ - 用 `locate-roadmap-item.sh` 定位 source RM;找不到时在 `analysis.md` 和 `change-meta.json.roadmapSync` 写 `no-source-rm`
244
+ - `implementation drift`:回写 source RM 为 `Repair planned` 或等价调查完成状态,绑定 `FIX-*`,进度保持在可执行修复前的真实百分比
245
+ - `missing spec truth`:回写 source RM 的 expected spec delta 或 follow-up,必要时 reroute 到 `cc-plan`
246
+ - `roadmap mismatch`:不要直接进入修复;先把 mismatch 写回 roadmap / backlog,下一步写 `roadmap` 或 `cc-plan`
247
+ - 使用 `sync-roadmap-progress.sh` 更新 `devflow/roadmap.json`,并重新生成 `devflow/ROADMAP.md` / `devflow/BACKLOG.md`
248
+ 9. **Hand off**
229
249
  - 下一步明确写成 `cc-do`
230
250
  - 如果 repair contract 越过当前 requirement,就 reroute 到 `cc-plan`
251
+ - 如果是 diagnose-only,下一步写成 human action、monitoring、backlog、`cc-plan` 或 `cc-do`,但不得标记实现完成
231
252
 
232
253
  ## Pattern Analysis
233
254
 
@@ -421,6 +442,7 @@ flaky bug 的目标不是立刻 100% 复现,而是提高复现率直到可调
421
442
  - 正确测试缝隙写清楚,不用浅层测试制造假安全
422
443
  - `planning/tasks.md` 只包含修复任务,不夹带新需求
423
444
  - 如果应该回 `cc-plan`,理由写清楚,不假装还能继续 patch
445
+ - Roadmap Sync Gate 必须在 handoff 前闭合:source RM 绑定的 `FIX-*`、调查状态、spec diagnosis 和 next action 不能停留在聊天里。
424
446
 
425
447
  ## Bundled Resources
426
448
 
@@ -430,6 +452,8 @@ flaky bug 的目标不是立刻 100% 复现,而是提高复现率直到可调
430
452
  - 修复任务模板:`assets/TASKS_TEMPLATE.md`
431
453
  - manifest 模板:`assets/TASK_MANIFEST_TEMPLATE.json`
432
454
  - 分析骨架:`scripts/bootstrap-analysis.sh`
455
+ - Roadmap 定位:`../cc-roadmap/scripts/locate-roadmap-item.sh`
456
+ - Roadmap 回写:`../cc-roadmap/scripts/sync-roadmap-progress.sh`
433
457
 
434
458
  ## Working Rules
435
459
 
@@ -443,11 +467,13 @@ flaky bug 的目标不是立刻 100% 复现,而是提高复现率直到可调
443
467
  8. 外部调研必须先脱敏,调研结论必须回到本仓库证据验证。
444
468
  9. 修复触点超过 5 个文件时,默认先拆分或 reroute,不把大重构伪装成 bug fix。
445
469
  10. 好的调查不是“找了很多可能性”,而是把错误世界缩成一个可信的 repair contract。
470
+ 11. Roadmap 相关文件以 `devflow/roadmap.json` 为真相源,`devflow/ROADMAP.md` / `devflow/BACKLOG.md` 只是投影;不要再写旧式 `devflow/roadmap/*` 路径。
446
471
 
447
472
  ## Exit Criteria
448
473
 
449
474
  - `planning/analysis.md` 已冻结症状、复现、证据链、根因和修复边界
450
475
  - `planning/tasks.md` / `planning/task-manifest.json` 可直接交给 `cc-do`
476
+ - Roadmap Sync Gate 已闭合:source RM 已回写调查结果 / reroute,或 no-op reason 已落盘
451
477
  - 下一步唯一答案是 `cc-do`、`cc-plan` 或 `roadmap`
452
478
 
453
479
  ## Do Not