cc-devflow 4.5.3 → 4.5.4

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 (64) hide show
  1. package/.claude/skills/cc-act/CHANGELOG.md +6 -0
  2. package/.claude/skills/cc-act/PLAYBOOK.md +7 -0
  3. package/.claude/skills/cc-act/SKILL.md +25 -2
  4. package/.claude/skills/cc-act/assets/PR_BRIEF_TEMPLATE.md +29 -0
  5. package/.claude/skills/cc-act/assets/RELEASE_NOTE_TEMPLATE.md +8 -0
  6. package/.claude/skills/cc-check/CHANGELOG.md +6 -0
  7. package/.claude/skills/cc-check/PLAYBOOK.md +4 -0
  8. package/.claude/skills/cc-check/SKILL.md +15 -2
  9. package/.claude/skills/cc-check/assets/REPORT_CARD_TEMPLATE.json +18 -0
  10. package/.claude/skills/cc-do/CHANGELOG.md +6 -0
  11. package/.claude/skills/cc-do/PLAYBOOK.md +6 -4
  12. package/.claude/skills/cc-do/SKILL.md +14 -5
  13. package/.claude/skills/cc-do/references/execution-recovery.md +3 -0
  14. package/.claude/skills/cc-do/references/parallel-dispatch.md +6 -4
  15. package/.claude/skills/cc-do/scripts/detect-file-conflicts.sh +49 -3
  16. package/.claude/skills/cc-investigate/CHANGELOG.md +6 -0
  17. package/.claude/skills/cc-investigate/PLAYBOOK.md +7 -0
  18. package/.claude/skills/cc-investigate/SKILL.md +10 -1
  19. package/.claude/skills/cc-investigate/assets/ANALYSIS_TEMPLATE.md +30 -0
  20. package/.claude/skills/cc-plan/CHANGELOG.md +6 -0
  21. package/.claude/skills/cc-plan/PLAYBOOK.md +16 -10
  22. package/.claude/skills/cc-plan/SKILL.md +11 -4
  23. package/.claude/skills/cc-plan/assets/DESIGN_TEMPLATE.md +41 -0
  24. package/.claude/skills/cc-plan/assets/TASKS_TEMPLATE.md +4 -0
  25. package/.claude/skills/cc-plan/assets/TASK_MANIFEST_TEMPLATE.json +32 -3
  26. package/.claude/skills/cc-plan/assets/TINY_DESIGN_TEMPLATE.md +34 -0
  27. package/.claude/skills/cc-plan/references/planning-contract.md +11 -3
  28. package/CHANGELOG.md +8 -0
  29. package/bin/cc-devflow-cli.js +93 -2
  30. package/docs/examples/example-bindings.json +5 -5
  31. package/docs/examples/full-design-blocked/README.md +1 -1
  32. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/design.md +1 -1
  33. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/tasks.md +1 -1
  34. package/docs/examples/local-handoff/README.md +1 -1
  35. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/design.md +1 -1
  36. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/tasks.md +1 -1
  37. package/docs/examples/pdca-loop/README.md +1 -1
  38. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/design.md +1 -1
  39. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/task-manifest.json +1 -1
  40. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/tasks.md +1 -1
  41. package/docs/get-shit-done-strategy-audit.md +518 -0
  42. package/lib/compiler/__tests__/inventory.test.js +51 -0
  43. package/lib/compiler/inventory.js +78 -0
  44. package/lib/skill-runtime/__tests__/approve.test.js +92 -0
  45. package/lib/skill-runtime/__tests__/autopilot.test.js +4 -0
  46. package/lib/skill-runtime/__tests__/planner.tdd.test.js +20 -0
  47. package/lib/skill-runtime/__tests__/query.test.js +147 -1
  48. package/lib/skill-runtime/__tests__/readiness.test.js +53 -0
  49. package/lib/skill-runtime/__tests__/release.test.js +85 -0
  50. package/lib/skill-runtime/__tests__/runtime.integration.test.js +11 -0
  51. package/lib/skill-runtime/__tests__/schemas.test.js +56 -0
  52. package/lib/skill-runtime/__tests__/worker-run.test.js +29 -0
  53. package/lib/skill-runtime/errors.js +39 -0
  54. package/lib/skill-runtime/index.js +8 -0
  55. package/lib/skill-runtime/operations/approve.js +17 -2
  56. package/lib/skill-runtime/operations/release.js +6 -3
  57. package/lib/skill-runtime/operations/worker-run.js +30 -0
  58. package/lib/skill-runtime/planner.js +10 -2
  59. package/lib/skill-runtime/query-registry.js +101 -0
  60. package/lib/skill-runtime/query.js +159 -91
  61. package/lib/skill-runtime/readiness.js +84 -0
  62. package/lib/skill-runtime/schemas.js +28 -3
  63. package/lib/skill-runtime/trace.js +22 -0
  64. package/package.json +1 -1
@@ -1,5 +1,11 @@
1
1
  # CC-Act Skill Changelog
2
2
 
3
+ ## v1.8.1 - 2026-04-29
4
+
5
+ - add structured ship preflight fields with `ShipPreflightError` rescue actions
6
+ - require rollback guards before publish, merge, PR update, or release note handoff
7
+ - add PR branch hygiene and learning extraction targets to delivery templates
8
+
3
9
  ## v1.8.0 - 2026-04-28
4
10
 
5
11
  - add remote state consistency rules for issue, PR, tracker, `needs-info`, and `ready-for-agent` closeout handoffs
@@ -84,6 +84,9 @@ Ship 必须属于这 4 种模式之一:
84
84
  4. 如果有 WIP commit,只能用非破坏性 rebase / fixup 处理,不允许盲目 soft reset。
85
85
  5. push 前比较 local / remote HEAD;PR 前检查是否已有打开 PR / MR。
86
86
  6. 生成 readiness dashboard:review freshness、review quality、QA coverage、browser QA、feedback loop、behavior evidence、failure ownership、documentation release、PR body accuracy。
87
+ 7. 生成 ship preflight:branch/base/remote/auth/clean tree/review freshness/ship mode。
88
+ 8. preflight 失败必须命名为 `ShipPreflightError`,并写明 rescue action 或切到 `local-handoff`。
89
+ 9. 发布、合并、PR 更新或 release note 前必须写 rollback guard。
87
90
 
88
91
  ## Phase 3: Build Delivery Pack
89
92
 
@@ -115,6 +118,8 @@ Ship 必须属于这 4 种模式之一:
115
118
  - review packet path / summary
116
119
  - finding triage summary
117
120
  - QA / claim evidence summary
121
+ - ship preflight and `ShipPreflightError` rescue if any
122
+ - rollback guard
118
123
  - QA behavior evidence and feedback-loop quality
119
124
  - readiness dashboard
120
125
  - PR body accuracy check
@@ -207,6 +212,8 @@ Ship 必须属于这 4 种模式之一:
207
212
  5. PR body / release note / handoff / changelog 说的是不是同一套现实?
208
213
  6. readiness dashboard 有没有 blocker 或 stale warning?
209
214
  7. follow-up 是不是行为契约,而不是“改某文件某行”的易腐烂 TODO?
215
+ 8. ship preflight failure 是否有 `ShipPreflightError`、artifact ref 和 rescue action?
216
+ 9. rollback guard 是否足够让下一位维护者不靠聊天记录回退?
210
217
 
211
218
  如果第 1 或第 3 题答案不是“能”,说明 `cc-act` 仍然太重或太糊。
212
219
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cc-act
3
- version: 1.8.0
3
+ version: 1.8.1
4
4
  description: 'Use when verified work must be shipped or handed off with a clear landing path: run simplify and required tests, create or update a PR, prepare a local handoff, close out merged work, sync docs, write release notes, and fold follow-ups back into backlog or roadmap.'
5
5
  triggers:
6
6
  - 准备提 PR
@@ -37,7 +37,7 @@ effects:
37
37
  - roadmap or backlog follow-up updates when needed
38
38
  entry_gate:
39
39
  - Accept only a passing review/report-card.json with reroute=none and specSyncReady=true.
40
- - Freeze current branch, PR, and ship-mode facts before writing delivery materials.
40
+ - Freeze current branch, PR, ship-mode, auth, clean-tree, and rollback facts before writing delivery materials.
41
41
  - If simplify, tests, or act changes code or verification scope, return to cc-check immediately.
42
42
  exit_criteria:
43
43
  - The ship mode is explicit, delivery materials match that mode, and the next maintainer has one clear entry point.
@@ -218,6 +218,29 @@ tool_budget:
218
218
  11. Remote state consistency:如果本次 closeout 触碰 GitHub issue / PR / tracker,必须记录当前 state、目标 state、允许转换、已保留事实和下一位 owner;`needs-info` 必须保留已确认事实和具体问题,`ready-for-agent` 必须有可执行 brief。
219
219
  12. Tooling smoke:如果本次改动影响 hook、pre-commit、lint、publish、adapt 或验证脚本,必须跑真实入口或最接近真实入口的 smoke;只读配置文件不等于工具链可用。
220
220
 
221
+ ## Ship Preflight And Rescue
222
+
223
+ ship preflight 必须结构化记录:
224
+
225
+ - `branch`: 当前分支、base、remote、local/remote HEAD 关系
226
+ - `auth`: `gh` / registry / deploy / package publish 等权限是否可用
227
+ - `workspace`: clean tree、staged files、未跟踪文件和相关 stash
228
+ - `reviewFreshness`: `cc-check` 审查范围是否仍绑定当前 HEAD
229
+ - `shipMode`: `create-pr` / `update-pr` / `local-handoff` / `post-merge-closeout`
230
+
231
+ 任何 preflight failure 都必须命名为 `ShipPreflightError`,并写清 rescue action。
232
+ 不能用“工具不可用”当作模糊失败;要明确切 `local-handoff`、补 auth、刷新 review,
233
+ 还是返回 `cc-check`。
234
+
235
+ rollback guard 必须在 publish、merge、PR 更新或 release note 前写清:
236
+
237
+ - safe state
238
+ - rollback command 或人工回退步骤
239
+ - data / migration / package / remote side effect
240
+ - owner
241
+
242
+ 没有 rollback guard 的 release 只能停在 handoff,不准发布。
243
+
221
244
  ## Readiness Dashboard
222
245
 
223
246
  PR / handoff 之前必须把 readiness 压成一屏事实:
@@ -24,6 +24,27 @@
24
24
  - Base branch:
25
25
  - PR / MR:
26
26
 
27
+ ## Ship Preflight
28
+
29
+ - Branch:
30
+ - Base:
31
+ - Remote:
32
+ - Local / remote HEAD:
33
+ - Auth:
34
+ - Clean tree:
35
+ - Review freshness:
36
+ - Ship mode:
37
+ - `ShipPreflightError`:
38
+ - Rescue action:
39
+
40
+ ## PR Branch Hygiene
41
+
42
+ - Existing PR / MR:
43
+ - Duplicate PR risk:
44
+ - Commit split:
45
+ - Push idempotency:
46
+ - Body source:
47
+
27
48
  ## Review Range
28
49
 
29
50
  - Reviewed base SHA:
@@ -59,6 +80,13 @@
59
80
  - Fresh evidence:
60
81
  - Merged-result verification:
61
82
 
83
+ ## Rollback Guard
84
+
85
+ - Safe state:
86
+ - Rollback command / manual steps:
87
+ - Side effects:
88
+ - Owner:
89
+
62
90
  ## QA Behavior Evidence
63
91
 
64
92
  - Feedback loop:
@@ -96,6 +124,7 @@
96
124
  - Key interfaces:
97
125
  - Acceptance criteria:
98
126
  - Out of scope:
127
+ - Learning extraction target:
99
128
 
100
129
  ## Risks
101
130
 
@@ -20,6 +20,13 @@
20
20
 
21
21
  -
22
22
 
23
+ ## Rollback Guard
24
+
25
+ - Safe state:
26
+ - Rollback command / manual steps:
27
+ - Side effects:
28
+ - Owner:
29
+
23
30
  ## QA Behavior Evidence
24
31
 
25
32
  - Feedback loop:
@@ -36,3 +43,4 @@
36
43
  - Desired behavior:
37
44
  - Acceptance criteria:
38
45
  - Out of scope:
46
+ - Learning extraction target:
@@ -1,5 +1,11 @@
1
1
  # CC-Check Skill Changelog
2
2
 
3
+ ## v1.10.1 - 2026-04-29
4
+
5
+ - add named runtime failure fields with artifact references, owners, and rescue actions
6
+ - add human UAT evidence to the report card so manual acceptance can block or reroute honestly
7
+ - require review findings to carry explicit rescue actions instead of vague follow-up text
8
+
3
9
  ## v1.10.0 - 2026-04-28
4
10
 
5
11
  - add test fixture honesty review for partial fixtures, generated stubs, casts, and missing mock payload fields
@@ -63,6 +63,8 @@ NO PASS WITHOUT FRESH EVIDENCE
63
63
  6. 把每个成功声明映射到 `claimEvidence[]`
64
64
  7. 行为变更必须补 `qa` 证据或例外理由
65
65
  8. 失败输出必须写入 `runtime.failureOwnership[]`
66
+ 9. failure ownership 必须包含 named error、artifact refs 和 rescue action
67
+ 10. human UAT 必须 pass、fail、blocked 或带 skip reason;失败不能被测试绿灯覆盖
66
68
 
67
69
  ## Verification Layers
68
70
 
@@ -76,6 +78,8 @@ NO PASS WITHOUT FRESH EVIDENCE
76
78
  8. Review freshness and confidence calibration
77
79
  9. Failure ownership
78
80
  10. Spec alignment and sync readiness
81
+ 11. Human UAT
82
+ 12. Named runtime errors and rescue actions
79
83
 
80
84
  ## Claim Evidence Matrix
81
85
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cc-check
3
- version: 1.10.0
3
+ version: 1.10.1
4
4
  description: Use when a planned or investigated change needs fresh verification evidence, layered gate proof, review truth, and an honest pass fail blocked verdict before entering cc-act.
5
5
  triggers:
6
6
  - 验收这个需求
@@ -25,7 +25,7 @@ entry_gate:
25
25
  - Re-run fresh commands instead of inheriting cc-do narration.
26
26
  - If evidence is stale or missing, reset context and rebuild the verdict from canonical artifacts.
27
27
  exit_criteria:
28
- - review/report-card.json records pass, fail, or blocked using fresh evidence, review freshness, claim evidence, QA coverage and browser evidence, failure ownership, plus spec alignment and sync readiness.
28
+ - review/report-card.json records pass, fail, or blocked using fresh evidence, review freshness, claim evidence, QA coverage and browser evidence, human UAT when applicable, named failure ownership, plus spec alignment and sync readiness.
29
29
  - Task-level review and requirement-level diff review are separated clearly.
30
30
  - 'The next step is unambiguous: cc-act, cc-do, cc-investigate, or cc-plan.'
31
31
  reroutes:
@@ -169,6 +169,12 @@ NO PASS WITHOUT FRESH EVIDENCE
169
169
  10. **Behavior Contract Layer**
170
170
  - expected / actual / reproduction steps 是否用用户和领域语言写清
171
171
  - follow-up 是否是行为契约,而不是易腐烂的文件行号 TODO
172
+ 11. **Human UAT Layer**
173
+ - 人工验收是否 required、skipped with reason、pass、fail 或 blocked
174
+ - failed UAT 必须 reroute 到 `cc-do`、`cc-investigate` 或 `cc-plan`
175
+ 12. **Named Error Layer**
176
+ - runtime failure 必须有 `errorName`、artifact refs、failure owner 和 rescue action
177
+ - invalid JSON、stale artifact、missing report 不能变成静默 `blocked`
172
178
 
173
179
  任何一层失真,都不能写 `pass`。
174
180
 
@@ -284,6 +290,13 @@ NO PASS WITHOUT FRESH EVIDENCE
284
290
  4. `environment` 必须记录缺失依赖、权限、服务、密钥或平台约束。
285
291
  5. `pass` 不能带未解释的 `in-branch` 或 `ambiguous` 失败。
286
292
 
293
+ 每条 failure ownership 还必须命名:
294
+
295
+ - `errorName`:可搜索的错误名,例如 `MissingSpecReviewProof`
296
+ - `artifactRefs`:指向 report、manifest、checkpoint、日志或命令输出
297
+ - `rescueAction`:下一步救援动作,不写空泛“检查一下”
298
+ - `owner`:`branch` / `baseline` / `environment` / `external` / `unknown`
299
+
287
300
  ## Entry Gate
288
301
 
289
302
  1. 先读 `planning/design.md` 或 `planning/analysis.md`,再读 `planning/tasks.md`、`planning/task-manifest.json`。
@@ -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,11 @@
1
1
  # CC-Do Skill Changelog
2
2
 
3
+ ## v1.6.1 - 2026-04-29
4
+
5
+ - reject parent/child touched-path overlaps when selecting parallel execution surfaces
6
+ - report submodule touches separately so unrelated tasks are not serialized by mere `.gitmodules` presence
7
+ - document quick-lane and wave scheduling gates so small tasks still leave checkpoint, verification, and handoff truth
8
+
3
9
  ## v1.6.0 - 2026-04-28
4
10
 
5
11
  - 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
 
@@ -98,8 +99,9 @@
98
99
  1. 任务处于当前 active phase
99
100
  2. `dependsOn` 已全部满足
100
101
  3. 任务显式允许并行,例如 `[P]`
101
- 4. `touches` / `files` 不冲突
102
- 5. 每个 subagent 都拿到了自己的 task context
102
+ 4. `touches` / `files` 不冲突,且父路径 / 子路径也不重叠
103
+ 5. submodule touches 已被标出;触达 submodule 的任务不能默认拿普通 worktree 隔离
104
+ 6. 每个 subagent 都拿到了自己的 task context
103
105
 
104
106
  少一条,都按顺序执行。
105
107
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cc-do
3
- version: 1.6.0
3
+ version: 1.6.1
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,13 +27,18 @@ 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.
38
43
  exit_criteria:
39
44
  - The current task has red/green evidence, public-seam test quality evidence, review evidence, and a resumable checkpoint trail.
@@ -146,15 +151,17 @@ Red 不是形式上的红,而是公共 seam 上的行为缺失证明。测试
146
151
 
147
152
  1. 先读 `planning/design.md` 或 `planning/analysis.md`,再读 `planning/tasks.md`、`planning/task-manifest.json`;如果是恢复执行,再补读最近 checkpoint 或已有 `handoff/resume-index.md`。
148
153
  2. 先用 `scripts/select-ready-tasks.sh` 判断现在到底哪几个任务真的 ready。
149
- 3. 只锁定当前 ready task,或一组经依赖与触点校验后可并行的 ready tasks。
154
+ 3. 只锁定当前 ready task,或一组经依赖、wave、精确触点与父子路径触点校验后可并行的 ready tasks。
150
155
  4. 如果这次来自 `cc-investigate`,必须把 `planning/analysis.md` 当成 canonical contract,而不是一边实现一边重新调查。
151
156
  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 组装上下文。
157
+ 6. 如果 `task-manifest.json.metadata.lane == "quick"`,仍然必须有 current task、verification、checkpoint 和 handoff;quick 只缩短文档密度,不跳过证据。
158
+ 7. 如果仓库含 `.gitmodules` 或 manifest 提供 `submodulePaths`,先用 `scripts/detect-file-conflicts.sh` 标出 `submoduleTouches`;只有触达该 submodule 的任务失去默认 worktree 隔离资格,未触达任务不能被无辜串行化。
152
159
 
153
160
  ## Loop
154
161
 
155
162
  1. 读取当前任务,而不是重新发明任务。
156
- 2. 依赖没满足前,不准提前做下游任务。
157
- 3. 没有明确并行资格,不准把多个实现任务同时推进。
163
+ 2. 依赖没满足前,不准提前做下游任务;不同 wave 之间不允许抢跑。
164
+ 3. 没有明确并行资格,不准把多个实现任务同时推进;`touches` 父子路径重叠也算同一执行表面。
158
165
  4. 先 `fail-first`:先写失败测试,先看见预期红,再写生产代码。
159
166
  5. 如果红灯不是预期失败(语法错、fixture 错、测试没连上),先修测试直到它正确失败。
160
167
  6. 如果红灯通过错误 seam 得到,比如私有方法、内部调用次数、mock 内部协作者,先修测试 seam,不准进入 Green。
@@ -176,9 +183,11 @@ Red 不是形式上的红,而是公共 seam 上的行为缺失证明。测试
176
183
  ## Good Output
177
184
 
178
185
  - 当前 task 一眼可见,执行者不用从聊天记录里猜目标
186
+ - 当前 wave、ready tasks、parallel candidates、touch conflict verdict 和 submoduleTouches 一眼可见
179
187
  - 至少留下一次明确的 tracer bullet Red/Green/Refactor 证据,且 Red 是公共 seam 上的预期行为失败
180
188
  - 测试 fixture 说明真实 contract 字段和测试填充字段,没有用类型欺骗或内部 mock 制造假绿
181
189
  - runtime / checkpoint 足够让下一位接手者无损恢复
190
+ - quick lane 也有 mini manifest、checkpoint、verification 和唯一 next action,不靠聊天记录继续
182
191
  - reviewer 能顺着 review 记录和验证命令复盘这次实现
183
192
 
184
193
  ## Bundled Resources
@@ -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
  - 阻塞点
@@ -95,3 +97,4 @@
95
97
  - 验收标准
96
98
  - 验证命令
97
99
  - 不做项 / 边界
100
+ - 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,11 @@
1
1
  # CC-Investigate Skill Changelog
2
2
 
3
+ ## v1.2.1 - 2026-04-29
4
+
5
+ - add persistent debug session fields for active hypothesis, probes, cleanup state, and next evidence action
6
+ - add diagnose-only and workflow-forensics modes so root-cause reports do not masquerade as completed repairs
7
+ - update the analysis template with debug session, workflow forensics, and diagnose-only outcome sections
8
+
3
9
  ## v1.2.0 - 2026-04-28
4
10
 
5
11
  - treat feedback loops as investigation products that must be made faster, sharper, and more deterministic before root cause freeze
@@ -20,6 +20,8 @@
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,再决定是否进入修复。
23
25
 
24
26
  ## Iron Law
25
27
 
@@ -61,6 +63,8 @@ root-cause contract 至少包含:稳定复现或缩小后的可验证症状、
61
63
  | `history-trace` | 同一区域反复坏 | 查历史 `analysis.md`、TODO、report-card finding |
62
64
  | `pattern-research` | 陌生框架 / 依赖 / 平台错误 | 脱敏后查通用错误类型 |
63
65
  | `contract-check` | 修复边界可能扩大 | 判定 implementation drift / missing spec truth / roadmap mismatch |
66
+ | `diagnose-only` | 用户只要问题解释或现在不能修 | 冻结 root cause、owner、risk、next action,不生成实现完成态 |
67
+ | `workflow-forensics` | devflow artifact、git、状态、权限或工具链断裂 | 分类 failure owner 和 rescue action,再决定 reroute |
64
68
 
65
69
  ## Pattern Analysis
66
70
 
@@ -89,6 +93,9 @@ root-cause contract 至少包含:稳定复现或缩小后的可验证症状、
89
93
  - Diagnostic Instrumentation Plan:probe tag、probe location、question answered、command、expected signal、cleanup requirement
90
94
  - Feedback Loop Contract:loop type、command、expected / actual signal、symptom match、runtime、determinism、failure rate、sharpening plan
91
95
  - Correct Test Seam:test seam、public interface exercised、why it reaches the real trigger chain、why shallow tests are rejected
96
+ - Persistent Debug Session:session id、active hypothesis、completed probes、cleanup state、next evidence action
97
+ - Workflow Forensics:artifact state、git state、runtime state、tool/permission/process failure owner、rescue action
98
+ - Diagnose-Only Outcome:root cause, owner, risk, next action, and explicit no-repair verdict
92
99
 
93
100
  这些字段不是装饰。它们的作用是证明根因位于源头,而不是报错点。
94
101
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cc-investigate
3
- version: 1.2.0
3
+ version: 1.2.1
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"
@@ -34,12 +34,15 @@ entry_gate:
34
34
  - "Read the current bug report, existing requirement artifacts, relevant code, tests, and recent history before forming any hypothesis."
35
35
  - "Use a FIX-<number>-<description> change key for new bug-fix investigations."
36
36
  - "Build a runnable feedback loop, confirm it matches the reported symptom, then freeze the evidence chain before proposing repair tasks."
37
+ - "Record persistent debug session state: active hypothesis, probes, cleanup status, and next evidence action."
37
38
  - "Search prior investigations, TODO/backlog signals, and recent fixes in the affected area before declaring the bug novel."
38
39
  - "For multi-component, deep-stack, or flaky symptoms, record boundary probes, backward trace, or condition-wait evidence before declaring the root cause."
39
40
  - "For performance regressions, collect a baseline or profile signal before treating logs as evidence."
40
41
  - "Do not write production code here; this stage ends with planning/analysis.md plus executable repair tasks for cc-do."
41
42
  exit_criteria:
42
43
  - "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."
44
+ - "diagnose-only outcomes clearly stop before implementation while preserving root cause, owner, and next action."
45
+ - "workflow forensics classify artifact, git, state, or tool failures before repair tasks are generated."
43
46
  - "planning/tasks.md and planning/task-manifest.json are explicit enough that cc-do can repair the bug without chat memory."
44
47
  - "The honest next step is cc-do, cc-plan, or roadmap."
45
48
  reroutes:
@@ -141,6 +144,8 @@ NO REPAIR WITHOUT A FROZEN ROOT-CAUSE CONTRACT
141
144
  | 错误类型陌生,像框架 / 依赖 / 平台问题 | `pattern-research`,先做脱敏外部调研 |
142
145
  | 同一区域反复坏 | `history-trace`,先查 prior investigations 和最近修复 |
143
146
  | 看起来像 bug,实则是未定义行为或新需求 | 直接 reroute 到 `cc-plan` |
147
+ | 用户只要根因报告、不要求修复 | `diagnose-only`,停止在报告与 next action,不生成完成态实现任务 |
148
+ | 失败来自 workflow / artifact / git / state 断裂 | `workflow-forensics`,先分类坏在文件、状态、工具、权限还是流程 |
144
149
 
145
150
  先说“这是什么类问题”,再说“我要怎么修”。没有分类的 debug,最后都会变成乱打补丁。
146
151
 
@@ -174,6 +179,9 @@ NO REPAIR WITHOUT A FROZEN ROOT-CAUSE CONTRACT
174
179
 
175
180
  `cc-investigate` 不写生产代码,不在这里偷跑 `cc-do`。
176
181
 
182
+ diagnose-only 仍然写 `planning/analysis.md`,但 `planning/tasks.md` 只能包含证据交接、
183
+ 监控、人工动作或明确的 `reroute`;不能把“已经诊断”伪装成“已经修复”。
184
+
177
185
  ## Entry Gate
178
186
 
179
187
  1. 先确认当前对象仍然属于一个 requirement,而不是整个项目级故障。
@@ -228,6 +236,7 @@ NO REPAIR WITHOUT A FROZEN ROOT-CAUSE CONTRACT
228
236
  8. **Hand off**
229
237
  - 下一步明确写成 `cc-do`
230
238
  - 如果 repair contract 越过当前 requirement,就 reroute 到 `cc-plan`
239
+ - 如果是 diagnose-only,下一步写成 human action、monitoring、backlog、`cc-plan` 或 `cc-do`,但不得标记实现完成
231
240
 
232
241
  ## Pattern Analysis
233
242
 
@@ -36,6 +36,17 @@
36
36
  - Sharpening plan:
37
37
  - If no loop, evidence request:
38
38
 
39
+ ## Debug Session
40
+
41
+ - Session ID:
42
+ - Started at:
43
+ - Current mode: `reproduce-first` | `feedback-loop` | `diff-trace` | `boundary-probe` | `backward-trace` | `reference-compare` | `condition-wait` | `history-trace` | `pattern-research` | `contract-check` | `diagnose-only` | `workflow-forensics`
44
+ - Active hypothesis:
45
+ - Completed probes:
46
+ - Open probes:
47
+ - Cleanup status:
48
+ - Next evidence action:
49
+
39
50
  ## Evidence Chain
40
51
 
41
52
  - Logs / stack traces:
@@ -46,6 +57,12 @@
46
57
  - TODO / backlog / report-card signals:
47
58
  - Native domain / decision context:
48
59
 
60
+ ## Workflow Forensics
61
+
62
+ | Failure surface | Observed state | Owner | Rescue action | Evidence |
63
+ | --- | --- | --- | --- | --- |
64
+ | artifact / git / runtime-state / tool / permission / process | | | | |
65
+
49
66
  ## Boundary Probe Matrix
50
67
 
51
68
  | Component boundary | Input observed | Output observed | Config / env observed | State observed | Verdict |
@@ -132,6 +149,16 @@
132
149
  - Operator handling after fix:
133
150
  - Prior history relationship: `new` | `recurring` | `same-root-cause` | `architectural-smell-candidate`
134
151
 
152
+ ## Diagnose-Only Outcome
153
+
154
+ - Applies: `yes` | `no`
155
+ - Why no repair now:
156
+ - Root cause owner:
157
+ - Risk if left unresolved:
158
+ - Monitoring / follow-up evidence:
159
+ - Next action: `human-action` | `monitor` | `backlog` | `reroute-cc-plan` | `handoff-cc-do`
160
+ - Explicit no-repair verdict:
161
+
135
162
  ## Correct Test Seam
136
163
 
137
164
  - Test seam:
@@ -160,6 +187,9 @@
160
187
  - Feedback loop trustworthy:
161
188
  - Symptom match confirmed:
162
189
  - Root cause confirmed:
190
+ - Debug session cleanup complete:
191
+ - Workflow forensics classified:
192
+ - Diagnose-only verdict if applicable:
163
193
  - Correct test seam identified:
164
194
  - Repair scope still belongs to this requirement:
165
195
  - If not, reroute: