cc-devflow 4.5.8 → 4.5.10
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 +33 -0
- package/.claude/skills/cc-act/PLAYBOOK.md +9 -4
- package/.claude/skills/cc-act/SKILL.md +73 -12
- package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_INDEX_TEMPLATE.md +30 -0
- package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_PRINCIPLES_TEMPLATE.md +29 -0
- package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_TEMPLATE.md +103 -0
- package/.claude/skills/cc-act/assets/PR_BRIEF_TEMPLATE.md +61 -5
- package/.claude/skills/cc-act/references/closure-contract.md +4 -1
- package/.claude/skills/cc-act/references/git-commit-guidelines.md +342 -37
- package/.claude/skills/cc-act/scripts/cc-act-common.sh +29 -1
- package/.claude/skills/cc-act/scripts/render-pr-brief.sh +164 -0
- package/.claude/skills/cc-act/scripts/sync-act-docs.sh +1 -1
- package/.claude/skills/cc-check/CHANGELOG.md +17 -0
- package/.claude/skills/cc-check/PLAYBOOK.md +1 -0
- package/.claude/skills/cc-check/SKILL.md +9 -5
- package/.claude/skills/cc-check/references/review-contract.md +7 -0
- package/.claude/skills/cc-check/scripts/render-report-card.js +6 -1
- package/.claude/skills/cc-dev/CHANGELOG.md +5 -0
- package/.claude/skills/cc-dev/SKILL.md +26 -1
- package/.claude/skills/cc-do/CHANGELOG.md +23 -0
- package/.claude/skills/cc-do/PLAYBOOK.md +7 -7
- package/.claude/skills/cc-do/SKILL.md +49 -45
- package/.claude/skills/cc-do/references/execution-recovery.md +18 -13
- package/.claude/skills/cc-do/scripts/build-task-context.sh +13 -22
- package/.claude/skills/cc-do/scripts/mark-task-complete.sh +0 -6
- package/.claude/skills/cc-do/scripts/record-review-decision.sh +4 -5
- package/.claude/skills/cc-do/scripts/recover-workflow.sh +9 -11
- package/.claude/skills/cc-do/scripts/verify-task-gates.sh +12 -10
- package/.claude/skills/cc-do/scripts/write-task-checkpoint.sh +7 -29
- package/.claude/skills/cc-investigate/CHANGELOG.md +34 -0
- package/.claude/skills/cc-investigate/PLAYBOOK.md +21 -5
- package/.claude/skills/cc-investigate/SKILL.md +97 -40
- package/.claude/skills/cc-investigate/assets/TASKS_TEMPLATE.md +66 -4
- package/.claude/skills/cc-investigate/assets/TASK_MANIFEST_TEMPLATE.json +30 -59
- package/.claude/skills/cc-investigate/assets/{ANALYSIS_TEMPLATE.md → legacy/ANALYSIS_TEMPLATE.md} +48 -0
- package/.claude/skills/cc-investigate/references/investigation-contract.md +16 -2
- package/.claude/skills/cc-investigate/scripts/bootstrap-analysis.sh +1 -1
- package/.claude/skills/cc-next/CHANGELOG.md +6 -0
- package/.claude/skills/cc-next/PLAYBOOK.md +26 -4
- package/.claude/skills/cc-next/SKILL.md +39 -4
- package/.claude/skills/cc-plan/CHANGELOG.md +38 -0
- package/.claude/skills/cc-plan/PLAYBOOK.md +60 -53
- package/.claude/skills/cc-plan/SKILL.md +164 -87
- package/.claude/skills/cc-plan/assets/TASKS_TEMPLATE.md +101 -9
- package/.claude/skills/cc-plan/assets/TASK_MANIFEST_TEMPLATE.json +58 -229
- package/.claude/skills/cc-plan/assets/{DESIGN_TEMPLATE.md → legacy/DESIGN_TEMPLATE.md} +68 -0
- package/.claude/skills/cc-plan/assets/{TINY_DESIGN_TEMPLATE.md → legacy/TINY_DESIGN_TEMPLATE.md} +47 -1
- package/.claude/skills/cc-plan/references/planning-contract.md +48 -33
- package/.claude/skills/cc-review/CHANGELOG.md +6 -0
- package/.claude/skills/cc-review/PLAYBOOK.md +9 -11
- package/.claude/skills/cc-review/SKILL.md +37 -61
- package/.claude/skills/cc-review/references/e2e-and-plugin-verification.md +1 -1
- package/.claude/skills/cc-review/references/implementation-review-branch.md +5 -5
- package/.claude/skills/cc-review/references/plan-review-branch.md +1 -1
- package/.claude/skills/cc-review/references/review-methods.md +4 -4
- package/.claude/skills/cc-review/scripts/collect-review-context.sh +14 -7
- package/.claude/skills/cc-roadmap/CHANGELOG.md +6 -0
- package/.claude/skills/cc-roadmap/PLAYBOOK.md +30 -0
- package/.claude/skills/cc-roadmap/SKILL.md +45 -8
- package/.claude/skills/cc-roadmap/assets/BACKLOG_TEMPLATE.md +8 -0
- package/.claude/skills/cc-roadmap/assets/ROADMAP_TEMPLATE.md +22 -0
- package/.claude/skills/cc-roadmap/assets/TRACKING_TEMPLATE.json +32 -1
- package/.claude/skills/cc-roadmap/references/roadmap-dialogue.md +14 -14
- package/CHANGELOG.md +28 -0
- package/CONTRIBUTING.md +40 -4
- package/CONTRIBUTING.zh-CN.md +40 -4
- package/README.md +57 -43
- package/README.zh-CN.md +57 -43
- package/bin/cc-devflow-cli.js +293 -36
- package/docs/examples/START-HERE.md +5 -4
- package/docs/examples/example-bindings.json +10 -10
- package/docs/examples/full-design-blocked/BACKLOG.md +1 -1
- package/docs/examples/full-design-blocked/README.md +2 -2
- package/docs/examples/full-design-blocked/ROADMAP.md +1 -1
- package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/design.md +2 -1
- package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/task-manifest.json +29 -312
- package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/tasks.md +11 -8
- package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/review/report-card.json +4 -4
- package/docs/examples/full-design-blocked/roadmap.json +1 -1
- package/docs/examples/local-handoff/BACKLOG.md +1 -1
- package/docs/examples/local-handoff/README.md +2 -2
- package/docs/examples/local-handoff/ROADMAP.md +1 -1
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/design.md +2 -1
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/task-manifest.json +27 -210
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/tasks.md +9 -6
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/review/report-card.json +1 -1
- package/docs/examples/local-handoff/roadmap.json +1 -1
- package/docs/examples/pdca-loop/BACKLOG.md +1 -1
- package/docs/examples/pdca-loop/README.md +2 -2
- package/docs/examples/pdca-loop/ROADMAP.md +1 -1
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/pr-brief.md +65 -1
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/design.md +2 -1
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/task-manifest.json +26 -228
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/tasks.md +9 -6
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/review/report-card.json +1 -1
- package/docs/examples/pdca-loop/roadmap.json +1 -1
- package/docs/examples/scripts/check-example-bindings.sh +11 -5
- package/docs/get-shit-done-strategy-audit.md +22 -22
- package/docs/guides/artifact-contract.md +44 -0
- package/docs/guides/getting-started.md +10 -8
- package/docs/guides/getting-started.zh-CN.md +10 -8
- package/docs/guides/minimize-artifacts.md +123 -0
- package/docs/guides/project-postmortem.md +78 -0
- package/lib/compiler/__tests__/skills-registry.test.js +2 -2
- package/lib/skill-runtime/CLAUDE.md +1 -1
- package/lib/skill-runtime/__tests__/autopilot.test.js +42 -6
- package/lib/skill-runtime/__tests__/benchmark-artifacts.test.js +165 -0
- package/lib/skill-runtime/__tests__/cli-bootstrap.integration.test.js +2 -2
- package/lib/skill-runtime/__tests__/dispatch.test.js +8 -38
- package/lib/skill-runtime/__tests__/intent.test.js +4 -20
- package/lib/skill-runtime/__tests__/lifecycle.test.js +1 -1
- package/lib/skill-runtime/__tests__/paths.test.js +7 -1
- package/lib/skill-runtime/__tests__/planner.tdd.test.js +63 -2
- package/lib/skill-runtime/__tests__/prepare-pr.test.js +3 -16
- package/lib/skill-runtime/__tests__/query.test.js +388 -7
- package/lib/skill-runtime/__tests__/review-check-integration.test.js +148 -0
- package/lib/skill-runtime/__tests__/review-records.test.js +619 -0
- package/lib/skill-runtime/__tests__/runtime.integration.test.js +64 -23
- package/lib/skill-runtime/__tests__/schemas.test.js +76 -2
- package/lib/skill-runtime/__tests__/task-contract-migrate.test.js +137 -0
- package/lib/skill-runtime/__tests__/task-contract.test.js +783 -0
- package/lib/skill-runtime/__tests__/verify-artifacts.test.js +203 -0
- package/lib/skill-runtime/__tests__/worker-run.test.js +4 -11
- package/lib/skill-runtime/__tests__/workflow-context-legacy-fallback.test.js +31 -0
- package/lib/skill-runtime/__tests__/workflow-context.test.js +98 -0
- package/lib/skill-runtime/artifacts.js +0 -5
- package/lib/skill-runtime/context-index.js +545 -0
- package/lib/skill-runtime/intent.js +9 -33
- package/lib/skill-runtime/lifecycle.js +1 -1
- package/lib/skill-runtime/operations/CLAUDE.md +2 -2
- package/lib/skill-runtime/operations/dispatch.js +4 -42
- package/lib/skill-runtime/operations/init.js +2 -6
- package/lib/skill-runtime/operations/janitor.js +2 -18
- package/lib/skill-runtime/operations/resume.js +21 -38
- package/lib/skill-runtime/operations/review-records.js +265 -0
- package/lib/skill-runtime/operations/snapshot.js +1 -1
- package/lib/skill-runtime/operations/task-contract.js +524 -0
- package/lib/skill-runtime/operations/worker-run.js +2 -30
- package/lib/skill-runtime/paths.js +4 -4
- package/lib/skill-runtime/planner.js +25 -13
- package/lib/skill-runtime/query-registry.js +2 -2
- package/lib/skill-runtime/query.js +16 -3
- package/lib/skill-runtime/review-records.js +123 -0
- package/lib/skill-runtime/review.js +246 -11
- package/lib/skill-runtime/schemas.js +179 -15
- package/lib/skill-runtime/store.js +0 -10
- package/lib/skill-runtime/task-contract.js +187 -0
- package/lib/skill-runtime/workflow-context.js +748 -0
- package/package.json +7 -4
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
set -euo pipefail
|
|
4
4
|
|
|
5
5
|
# ------------------------------------------------------------
|
|
6
|
-
# 记录 spec / code review 结论,并同步
|
|
6
|
+
# 记录 spec / code review 结论,并同步 manifest;失败时保留 CLI 事件
|
|
7
7
|
# ------------------------------------------------------------
|
|
8
8
|
|
|
9
9
|
usage() {
|
|
@@ -46,12 +46,9 @@ fi
|
|
|
46
46
|
CHANGE_DIR="$(req_do_resolve_change_dir "$REQ_DIR")"
|
|
47
47
|
manifest="$(req_do_manifest_path "$CHANGE_DIR")"
|
|
48
48
|
change_id="$(jq -r '.changeId // .requirementId // "REQ-UNKNOWN"' "$manifest" 2>/dev/null || basename "$CHANGE_DIR")"
|
|
49
|
-
runtime_task_dir="$(req_do_task_runtime_dir "$CHANGE_DIR" "$TASK_ID")"
|
|
50
49
|
timestamp="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
|
|
51
50
|
event_name="${GATE}_review_${VERDICT}"
|
|
52
51
|
|
|
53
|
-
mkdir -p "$runtime_task_dir"
|
|
54
|
-
|
|
55
52
|
if [[ -f "$manifest" ]]; then
|
|
56
53
|
tmp_manifest="$(mktemp)"
|
|
57
54
|
jq --arg task "$TASK_ID" --arg gate "$GATE" --arg verdict "$VERDICT" '
|
|
@@ -66,7 +63,9 @@ if [[ -f "$manifest" ]]; then
|
|
|
66
63
|
mv "$tmp_manifest" "$manifest"
|
|
67
64
|
fi
|
|
68
65
|
|
|
69
|
-
if [[
|
|
66
|
+
if [[ "$VERDICT" != "pass" ]]; then
|
|
67
|
+
runtime_task_dir="$(req_do_task_runtime_dir "$CHANGE_DIR" "$TASK_ID")"
|
|
68
|
+
mkdir -p "$runtime_task_dir"
|
|
70
69
|
jq -nc \
|
|
71
70
|
--arg type "$event_name" \
|
|
72
71
|
--arg changeId "$change_id" \
|
|
@@ -68,17 +68,15 @@ if [[ -f "$report" ]]; then
|
|
|
68
68
|
echo "- Latest check verdict: $verdict"
|
|
69
69
|
fi
|
|
70
70
|
|
|
71
|
-
if [[ -
|
|
72
|
-
|
|
71
|
+
if [[ -f "$manifest" ]]; then
|
|
72
|
+
echo
|
|
73
|
+
echo "## Task Status"
|
|
74
|
+
jq -r '.tasks[]? | "- " + .id + ": " + (.status // "pending") + (if .lastError then " - " + .lastError else "" end)' "$manifest" 2>/dev/null || true
|
|
73
75
|
fi
|
|
74
76
|
|
|
75
|
-
if
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
checkpoint_status="$(jq -r '.status // "unknown"' "$checkpoint_path" 2>/dev/null || echo unknown)"
|
|
81
|
-
checkpoint_summary="$(jq -r '.summary // ""' "$checkpoint_path" 2>/dev/null || echo "")"
|
|
82
|
-
echo "- Checkpoint $task_id: $checkpoint_status ${checkpoint_summary:+- $checkpoint_summary}"
|
|
83
|
-
done < <(find "$runtime_dir" -name checkpoint.json | sort)
|
|
77
|
+
if git -C "$CHANGE_DIR" rev-parse --show-toplevel >/dev/null 2>&1; then
|
|
78
|
+
repo_root="$(git -C "$CHANGE_DIR" rev-parse --show-toplevel)"
|
|
79
|
+
echo
|
|
80
|
+
echo "## Git State"
|
|
81
|
+
git -C "$repo_root" status --short
|
|
84
82
|
fi
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
set -euo pipefail
|
|
4
4
|
|
|
5
5
|
# ------------------------------------------------------------
|
|
6
|
-
#
|
|
6
|
+
# 校验任务状态、依赖和可选 CLI 事件顺序
|
|
7
7
|
# ------------------------------------------------------------
|
|
8
8
|
|
|
9
9
|
usage() {
|
|
@@ -36,19 +36,21 @@ CHANGE_DIR="$(req_do_resolve_change_dir "$REQ_DIR")"
|
|
|
36
36
|
manifest="$(req_do_manifest_path "$CHANGE_DIR")"
|
|
37
37
|
runtime_task_dir="$(req_do_task_runtime_dir "$CHANGE_DIR" "$TASK_ID")"
|
|
38
38
|
events_file="$runtime_task_dir/events.jsonl"
|
|
39
|
-
checkpoint_file="$runtime_task_dir/checkpoint.json"
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
fi
|
|
45
|
-
|
|
46
|
-
checkpoint_status="$(jq -r '.status // "unknown"' "$checkpoint_file" 2>/dev/null || echo unknown)"
|
|
47
|
-
[[ "$checkpoint_status" == "passed" ]] || {
|
|
48
|
-
echo "Task $TASK_ID checkpoint status is not passed" >&2
|
|
40
|
+
task_json="$(jq -c --arg task "$TASK_ID" '.tasks[] | select(.id == $task)' "$manifest" 2>/dev/null || true)"
|
|
41
|
+
[[ -n "$task_json" ]] || {
|
|
42
|
+
echo "Task $TASK_ID not found in manifest" >&2
|
|
49
43
|
exit 1
|
|
50
44
|
}
|
|
51
45
|
|
|
46
|
+
while IFS= read -r dependency; do
|
|
47
|
+
dep_status="$(jq -r --arg dep "$dependency" '.tasks[] | select(.id == $dep) | .status // "pending"' "$manifest" 2>/dev/null || echo pending)"
|
|
48
|
+
[[ "$dep_status" == "passed" || "$dep_status" == "completed" || "$dep_status" == "done" || "$dep_status" == "verified" ]] || {
|
|
49
|
+
echo "Task $TASK_ID dependency $dependency is not complete" >&2
|
|
50
|
+
exit 1
|
|
51
|
+
}
|
|
52
|
+
done < <(jq -r '(.dependsOn // [])[]?' <<<"$task_json")
|
|
53
|
+
|
|
52
54
|
spec_verdict="$(jq -r --arg task "$TASK_ID" '.tasks[] | select(.id == $task) | .reviews.spec // "pending"' "$manifest" 2>/dev/null || echo pending)"
|
|
53
55
|
code_verdict="$(jq -r --arg task "$TASK_ID" '.tasks[] | select(.id == $task) | .reviews.code // "pending"' "$manifest" 2>/dev/null || echo pending)"
|
|
54
56
|
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
set -euo pipefail
|
|
4
4
|
|
|
5
5
|
# ------------------------------------------------------------
|
|
6
|
-
#
|
|
6
|
+
# 兼容旧入口:只写必要的 CLI 事件,不再生成 checkpoint.json
|
|
7
7
|
# ------------------------------------------------------------
|
|
8
8
|
|
|
9
9
|
usage() {
|
|
10
10
|
cat <<'EOF'
|
|
11
11
|
Usage:
|
|
12
|
-
write-task-checkpoint.sh --dir path/to/change --task T001 --status pending|running|passed|failed|skipped --summary "..." [--event context_ready] [--attempt 0] [--session session-id] [--next-action "..."] [--tdd-json '{"red":...}']
|
|
12
|
+
write-task-checkpoint.sh --dir path/to/change --task T001 --status pending|running|passed|failed|skipped [--summary "..."] [--event context_ready] [--attempt 0] [--session session-id] [--next-action "..."] [--tdd-json '{"red":...}']
|
|
13
13
|
EOF
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -41,7 +41,7 @@ while [[ $# -gt 0 ]]; do
|
|
|
41
41
|
esac
|
|
42
42
|
done
|
|
43
43
|
|
|
44
|
-
if [[ -z "$REQ_DIR" || -z "$TASK_ID" || -z "$STATUS"
|
|
44
|
+
if [[ -z "$REQ_DIR" || -z "$TASK_ID" || -z "$STATUS" ]]; then
|
|
45
45
|
usage
|
|
46
46
|
exit 1
|
|
47
47
|
fi
|
|
@@ -49,12 +49,9 @@ fi
|
|
|
49
49
|
CHANGE_DIR="$(req_do_resolve_change_dir "$REQ_DIR")"
|
|
50
50
|
manifest="$(req_do_manifest_path "$CHANGE_DIR")"
|
|
51
51
|
change_id="$(jq -r '.changeId // .requirementId // "REQ-UNKNOWN"' "$manifest" 2>/dev/null || basename "$REQ_DIR")"
|
|
52
|
-
plan_version="$(jq -r '.metadata.planVersion // 1' "$manifest" 2>/dev/null || echo 1)"
|
|
53
52
|
timestamp="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
|
|
54
53
|
runtime_task_dir="$(req_do_task_runtime_dir "$CHANGE_DIR" "$TASK_ID")"
|
|
55
54
|
|
|
56
|
-
mkdir -p "$runtime_task_dir"
|
|
57
|
-
|
|
58
55
|
if [[ -z "$SESSION_ID" ]]; then
|
|
59
56
|
SESSION_ID="${TASK_ID}-$(date -u +%s)"
|
|
60
57
|
fi
|
|
@@ -68,28 +65,8 @@ if [[ -n "$TDD_JSON" ]]; then
|
|
|
68
65
|
fi
|
|
69
66
|
fi
|
|
70
67
|
|
|
71
|
-
jq -nc \
|
|
72
|
-
--arg changeId "$change_id" \
|
|
73
|
-
--arg taskId "$TASK_ID" \
|
|
74
|
-
--arg sessionId "$SESSION_ID" \
|
|
75
|
-
--arg planVersion "$plan_version" \
|
|
76
|
-
--arg status "$STATUS" \
|
|
77
|
-
--arg summary "$SUMMARY" \
|
|
78
|
-
--arg timestamp "$timestamp" \
|
|
79
|
-
--arg attempt "$ATTEMPT" \
|
|
80
|
-
--argjson tdd "$tdd_payload" \
|
|
81
|
-
'{
|
|
82
|
-
changeId: $changeId,
|
|
83
|
-
taskId: $taskId,
|
|
84
|
-
sessionId: $sessionId,
|
|
85
|
-
planVersion: ($planVersion | tonumber),
|
|
86
|
-
status: $status,
|
|
87
|
-
summary: $summary,
|
|
88
|
-
timestamp: $timestamp,
|
|
89
|
-
attempt: ($attempt | tonumber)
|
|
90
|
-
} + (if $tdd == null then {} else {tdd: $tdd} end)' > "$runtime_task_dir/checkpoint.json"
|
|
91
|
-
|
|
92
68
|
if [[ -n "$EVENT_TYPE" || "$STATUS" == "failed" ]]; then
|
|
69
|
+
mkdir -p "$runtime_task_dir"
|
|
93
70
|
jq -nc \
|
|
94
71
|
--arg type "${EVENT_TYPE:-status_$STATUS}" \
|
|
95
72
|
--arg changeId "$change_id" \
|
|
@@ -99,6 +76,7 @@ if [[ -n "$EVENT_TYPE" || "$STATUS" == "failed" ]]; then
|
|
|
99
76
|
--arg summary "$SUMMARY" \
|
|
100
77
|
--arg nextAction "$NEXT_ACTION" \
|
|
101
78
|
--arg timestamp "$timestamp" \
|
|
79
|
+
--argjson tdd "$tdd_payload" \
|
|
102
80
|
'{
|
|
103
81
|
type: $type,
|
|
104
82
|
changeId: $changeId,
|
|
@@ -108,7 +86,7 @@ if [[ -n "$EVENT_TYPE" || "$STATUS" == "failed" ]]; then
|
|
|
108
86
|
summary: $summary,
|
|
109
87
|
nextAction: $nextAction,
|
|
110
88
|
timestamp: $timestamp
|
|
111
|
-
}' >> "$runtime_task_dir/events.jsonl"
|
|
89
|
+
} + (if $tdd == null then {} else {tdd: $tdd} end)' >> "$runtime_task_dir/events.jsonl"
|
|
112
90
|
fi
|
|
113
91
|
|
|
114
|
-
echo "
|
|
92
|
+
echo "No checkpoint written; task truth lives in planning/tasks.md and planning/task-manifest.json"
|
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# CC-Investigate Skill Changelog
|
|
2
2
|
|
|
3
|
+
## v1.5.0 - 2026-05-13
|
|
4
|
+
|
|
5
|
+
- collapse default investigation output to `planning/tasks.md` plus CLI-generated `task-manifest.json` and `change-meta.json`
|
|
6
|
+
- move root-cause truth into `planning/tasks.md#Root Cause Contract` so `planning/analysis.md` is legacy fallback only
|
|
7
|
+
- archive the legacy analysis template under `assets/legacy/` and keep repair handoffs rooted in `assets/TASKS_TEMPLATE.md`
|
|
8
|
+
|
|
9
|
+
## v1.4.3 - 2026-05-13
|
|
10
|
+
|
|
11
|
+
- add the Worktree Branch Contract so new `FIX` investigations anchor detached worktrees to `FIX/<task>` before artifacts are written
|
|
12
|
+
- treat investigations on `main` / the default branch as a setup blocker instead of allowing the main checkout to accumulate repair state
|
|
13
|
+
- require analysis, tasks, and change metadata to record the canonical work branch for downstream `cc-do`
|
|
14
|
+
|
|
15
|
+
## v1.4.2 - 2026-05-12
|
|
16
|
+
|
|
17
|
+
- require IDCA repair handoffs to be consumable by `cc-devflow query workflow-context`
|
|
18
|
+
- add the compact runtime reset to investigation task templates so `cc-do`, `cc-check`, and `cc-act` continue from the frozen root-cause packet instead of chat history
|
|
19
|
+
|
|
20
|
+
## v1.4.1 - 2026-05-11
|
|
21
|
+
|
|
22
|
+
- add the Project Postmortem Recall Gate so investigations search `devflow/postmortems` before final hypotheses are frozen
|
|
23
|
+
- update analysis and repair-task templates to connect similar incidents, principles, Git evidence, and model-risk lessons to the current root-cause table
|
|
24
|
+
- require recurring or same-root-cause findings to be classified explicitly instead of treated as novel bugs
|
|
25
|
+
|
|
26
|
+
## v1.4.0 - 2026-05-11
|
|
27
|
+
|
|
28
|
+
- add the Root Cause Proof Ladder so investigations must prove symptom site, first bad state, violated contract, original trigger, counterfactual proof, and escape reason before repair tasks are generated
|
|
29
|
+
- upgrade `planning/analysis.md`, `planning/tasks.md`, and `task-manifest.json` templates so downstream `cc-do` inherits the root-cause proof instead of re-deciding from chat
|
|
30
|
+
- require investigations that cannot prove first bad state, original trigger, or counterfactual proof to stop at evidence request or reroute instead of producing symptom patches
|
|
31
|
+
|
|
32
|
+
## v1.3.1 - 2026-05-11
|
|
33
|
+
|
|
34
|
+
- slim investigation task manifests so roadmap/spec status stays owned by `change-meta.json` and `devflow/roadmap.json`
|
|
35
|
+
- remove duplicate design/review/status mirrors from the investigation manifest template while keeping root-cause evidence in `planning/analysis.md`
|
|
36
|
+
|
|
3
37
|
## v1.3.0 - 2026-05-09
|
|
4
38
|
|
|
5
39
|
- FIX change key assignment now uses `cc-devflow next-change-key` instead of prose instructions
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
`cc-investigate -> cc-do -> cc-check`
|
|
6
6
|
|
|
7
7
|
- Enter from: a bug, regression, or broken requirement whose root cause is still unclear.
|
|
8
|
-
- Stay in: `cc-investigate` until `planning/
|
|
8
|
+
- Stay in: `cc-investigate` until `planning/tasks.md#Root Cause Contract` and the repair handoff are both frozen.
|
|
9
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
|
|
|
@@ -16,13 +16,15 @@
|
|
|
16
16
|
3. 先确认 loop 复现的是用户报告的同一个失败。
|
|
17
17
|
4. 先看最近变化,再决定是不是 regression。
|
|
18
18
|
5. 先证伪假设,再冻结根因。
|
|
19
|
-
6. `planning/
|
|
19
|
+
6. `planning/tasks.md` 必须足够让 `cc-do` 脱离当前会话继续工作。
|
|
20
20
|
7. 调查失败三次后先重建入口,不准继续乱补。
|
|
21
21
|
8. 没有 frozen root-cause contract,不准进入 repair task。
|
|
22
22
|
9. 多组件、深层调用、flaky 问题必须先补边界探针、反向追踪或条件等待证据。
|
|
23
23
|
10. diagnose-only 只能输出根因、owner、风险和 next action,不能把未修复状态标成完成。
|
|
24
24
|
11. workflow forensics 先分类 artifact / git / state / tool / permission / process failure,再决定是否进入修复。
|
|
25
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。
|
|
26
28
|
|
|
27
29
|
## Iron Law
|
|
28
30
|
|
|
@@ -32,9 +34,21 @@ NO REPAIR WITHOUT A FROZEN ROOT-CAUSE CONTRACT
|
|
|
32
34
|
|
|
33
35
|
root-cause contract 至少包含:稳定复现或缩小后的可验证症状、被破坏的代码 / 配置 / 数据 / 依赖契约、已证伪假设、最小修复边界。
|
|
34
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` 时,`analysis.md` 只能写 `needs-more-evidence`、`Evidence Request` 或 reroute,不能生成 `cc-do` repair task。
|
|
49
|
+
|
|
35
50
|
## Required Outputs
|
|
36
51
|
|
|
37
|
-
- `planning/analysis.md`
|
|
38
52
|
- `planning/tasks.md`
|
|
39
53
|
- `planning/task-manifest.json`
|
|
40
54
|
- `change-meta.json`
|
|
@@ -91,6 +105,7 @@ root-cause contract 至少包含:稳定复现或缩小后的可验证症状、
|
|
|
91
105
|
|
|
92
106
|
- Boundary Probe Matrix:component boundary、input observed、output observed、config/env observed、state observed、verdict
|
|
93
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
|
|
94
109
|
- Reference Comparison:similar working example、broken path、differences accepted / ruled out
|
|
95
110
|
- Diagnostic Instrumentation Plan:probe tag、probe location、question answered、command、expected signal、cleanup requirement
|
|
96
111
|
- Feedback Loop Contract:loop type、command、expected / actual signal、symptom match、runtime、determinism、failure rate、sharpening plan
|
|
@@ -158,14 +173,15 @@ root-cause contract 至少包含:稳定复现或缩小后的可验证症状、
|
|
|
158
173
|
|
|
159
174
|
## Local Kit
|
|
160
175
|
|
|
161
|
-
-
|
|
176
|
+
- 默认模板在 `assets/TASKS_TEMPLATE.md` 和 `assets/TASK_MANIFEST_TEMPLATE.json`
|
|
177
|
+
- 旧分析模板在 `assets/legacy/`,只用于 legacy fallback / migration
|
|
162
178
|
- 调查契约在 `references/investigation-contract.md`
|
|
163
179
|
- 需要分析骨架时用 `scripts/bootstrap-analysis.sh`
|
|
164
180
|
- Roadmap 回写使用 `../cc-roadmap/scripts/locate-roadmap-item.sh` 和 `../cc-roadmap/scripts/sync-roadmap-progress.sh`
|
|
165
181
|
|
|
166
182
|
## Exit Rule
|
|
167
183
|
|
|
168
|
-
只有当下一位执行者读完 `planning/
|
|
184
|
+
只有当下一位执行者读完 `planning/tasks.md`、`planning/task-manifest.json` 就知道:
|
|
169
185
|
|
|
170
186
|
- 为什么坏
|
|
171
187
|
- 该修什么
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cc-investigate
|
|
3
|
-
version: 1.
|
|
3
|
+
version: 1.5.0
|
|
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"
|
|
@@ -14,15 +14,12 @@ reads:
|
|
|
14
14
|
- "PLAYBOOK.md"
|
|
15
15
|
- "CHANGELOG.md"
|
|
16
16
|
- "references/investigation-contract.md"
|
|
17
|
-
- "
|
|
17
|
+
- "docs/guides/project-postmortem.md"
|
|
18
18
|
- "assets/TASKS_TEMPLATE.md"
|
|
19
19
|
- "assets/TASK_MANIFEST_TEMPLATE.json"
|
|
20
20
|
- "../cc-roadmap/scripts/locate-roadmap-item.sh"
|
|
21
21
|
- "../cc-roadmap/scripts/sync-roadmap-progress.sh"
|
|
22
22
|
writes:
|
|
23
|
-
- path: "devflow/changes/<change-key>/planning/analysis.md"
|
|
24
|
-
durability: "durable"
|
|
25
|
-
required: true
|
|
26
23
|
- path: "devflow/changes/<change-key>/planning/tasks.md"
|
|
27
24
|
durability: "durable"
|
|
28
25
|
required: true
|
|
@@ -37,19 +34,26 @@ effects:
|
|
|
37
34
|
entry_gate:
|
|
38
35
|
- "Read the current bug report, existing requirement artifacts, relevant code, tests, and recent history before forming any hypothesis."
|
|
39
36
|
- "Assign the change key by running `cc-devflow next-change-key --prefix FIX --description \"<short bug name>\"`. Use both output lines: first is changeId for task-manifest, second is the full changeKey for the directory."
|
|
37
|
+
- "Immediately after assigning the change key and before writing durable artifacts, enforce the Worktree Branch Contract: if the current worktree is detached, create or switch to the canonical `FIX/<task>` branch derived from the change key; if the current branch is the default branch (`main` / `master` / origin HEAD), stop with a setup blocker instead of investigating on main."
|
|
40
38
|
- "Build a runnable feedback loop, confirm it matches the reported symptom, then freeze the evidence chain before proposing repair tasks."
|
|
41
39
|
- "Record persistent debug session state: active hypothesis, probes, cleanup status, and next evidence action."
|
|
42
40
|
- "Search prior investigations, TODO/backlog signals, and recent fixes in the affected area before declaring the bug novel."
|
|
41
|
+
- "Search project postmortems before forming final hypotheses: check `devflow/postmortems/INDEX.md`, `principles.md`, and matching `incidents/*.md` for similar symptoms, modules, failure classes, Git patterns, and model-risk lessons."
|
|
43
42
|
- "For multi-component, deep-stack, or flaky symptoms, record boundary probes, backward trace, or condition-wait evidence before declaring the root cause."
|
|
43
|
+
- "Run the Root Cause Proof Ladder before generating repair tasks: symptom site, first bad state, violated contract, original trigger, counterfactual proof, and escape reason must all be explicit."
|
|
44
44
|
- "For performance regressions, collect a baseline or profile signal before treating logs as evidence."
|
|
45
|
-
- "Do not write production code here; this stage ends with planning/
|
|
45
|
+
- "Do not write production code here; this stage ends with planning/tasks.md#Root Cause Contract plus executable repair tasks for cc-do."
|
|
46
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."
|
|
47
47
|
exit_criteria:
|
|
48
|
-
- "planning/
|
|
48
|
+
- "planning/tasks.md contains `## Root Cause Contract` with symptom, reproduction, evidence chain, boundary probes or backward trace when applicable, pattern analysis, tested hypotheses, confirmed root cause, and repair boundary."
|
|
49
|
+
- "planning/tasks.md#Root Cause Contract proves the first bad state and original trigger, not only the visible error site."
|
|
50
|
+
- "planning/tasks.md#Root Cause Contract records the Project Postmortem Recall result, including matching incidents/principles or an explicit no-history verdict."
|
|
49
51
|
- "diagnose-only outcomes clearly stop before implementation while preserving root cause, owner, and next action."
|
|
50
52
|
- "workflow forensics classify artifact, git, state, or tool failures before repair tasks are generated."
|
|
51
53
|
- "planning/tasks.md and planning/task-manifest.json are explicit enough that cc-do can repair the bug without chat memory."
|
|
52
|
-
- "
|
|
54
|
+
- "planning/tasks.md and change-meta.json record the canonical work branch or the explicit reason no branch mutation was valid."
|
|
55
|
+
- "`cc-devflow query workflow-context` can derive the IDCA next action, packet digests, default section refs, repair task, trusted commands, and deep-open triggers from the frozen investigation artifacts."
|
|
56
|
+
- "The source roadmap item has been synchronized with the investigation outcome, or `planning/tasks.md` and `change-meta.json` record why no roadmap update is valid."
|
|
53
57
|
- "The honest next step is cc-do, cc-plan, or roadmap."
|
|
54
58
|
reroutes:
|
|
55
59
|
- when: "The issue is actually a new feature, a scope redesign, or a product decision instead of a bug investigation."
|
|
@@ -64,7 +68,7 @@ recovery_modes:
|
|
|
64
68
|
action: "Drop the narrative, rebuild the reproduction from canonical artifacts and fresh output, then restate the symptom before testing hypotheses."
|
|
65
69
|
- name: "re-open-investigation"
|
|
66
70
|
when: "New execution evidence disproves the current root-cause contract or widens the suspected blast radius."
|
|
67
|
-
action: "Reopen planning/
|
|
71
|
+
action: "Reopen planning/tasks.md#Root Cause Contract, update the evidence chain, and regenerate machine records only after the new root cause is frozen."
|
|
68
72
|
tool_budget:
|
|
69
73
|
read_files: 11
|
|
70
74
|
search_steps: 6
|
|
@@ -95,18 +99,35 @@ tool_budget:
|
|
|
95
99
|
|
|
96
100
|
写入任何 durable Markdown 或 JSON metadata 前,先运行 `cc-devflow config resolve --format policy`。
|
|
97
101
|
|
|
98
|
-
- `Output language` 是机器约束,`planning/
|
|
102
|
+
- `Output language` 是机器约束,`planning/tasks.md` 和 `change-meta.json` 必须记录并遵守它。
|
|
99
103
|
- `agent_preferences` 是用户偏好建议,只影响表达方式和结构选择,不覆盖本 Skill 的工作流边界。
|
|
100
104
|
- 如果配置解析失败,先修配置或向用户说明阻塞,不要用默认语言继续生成正式文档。
|
|
101
105
|
|
|
106
|
+
## Worktree Branch Contract
|
|
107
|
+
|
|
108
|
+
每个新的 `FIX` 默认拥有一个同名工作分支。主项目 checkout 的 `main` 只服务同步、审查和 parity proof,不承载调查产物或修复实现。
|
|
109
|
+
|
|
110
|
+
分支锚定顺序固定:
|
|
111
|
+
|
|
112
|
+
1. 先运行 `cc-devflow next-change-key --prefix FIX --description "<short bug name>"`,得到 `changeId` 和完整 `changeKey`。
|
|
113
|
+
2. 计算 canonical work branch:`FIX/<task>`,其中 `<task>` 是去掉 `FIX-` 前缀后的 change key 尾部。例如 `FIX-014-auth-race` -> `FIX/014-auth-race`。
|
|
114
|
+
3. 立即检查 `git branch --show-current`:
|
|
115
|
+
- 为空:当前是 detached worktree,立刻 `git switch -c <canonical-work-branch>`;如果分支已存在且指向当前 HEAD,可以 `git switch <canonical-work-branch>`。
|
|
116
|
+
- 等于 default branch(`main` / `master` / `origin/HEAD` 指向的分支):停止并报告 setup blocker;不要在主分支写 investigation artifacts。
|
|
117
|
+
- 等于 canonical work branch:继续。
|
|
118
|
+
- 其它分支:只有它已经明确绑定同一个 `changeKey` 时才继续;否则停止并让用户确认是否切换或新开 worktree。
|
|
119
|
+
4. 在 `planning/tasks.md` 和 `change-meta.json` 记录 work branch。没有记录 work branch 的 repair handoff 不能进入 `cc-do`。
|
|
120
|
+
|
|
121
|
+
这不是发布前补救动作。`cc-act` 的 detached HEAD rescue 只处理历史遗留;新的 `cc-investigate` 必须在入口阶段就把 worktree 绑定到 `FIX/<task>`。
|
|
122
|
+
|
|
102
123
|
## Read First
|
|
103
124
|
|
|
104
125
|
1. `PLAYBOOK.md`
|
|
105
126
|
2. `CHANGELOG.md`
|
|
106
127
|
3. `references/investigation-contract.md`
|
|
107
|
-
4. `assets/
|
|
108
|
-
5. `assets/
|
|
109
|
-
6. `
|
|
128
|
+
4. `assets/TASKS_TEMPLATE.md`
|
|
129
|
+
5. `assets/TASK_MANIFEST_TEMPLATE.json`
|
|
130
|
+
6. `docs/guides/project-postmortem.md`
|
|
110
131
|
|
|
111
132
|
## Use This Skill When
|
|
112
133
|
|
|
@@ -133,6 +154,27 @@ NO REPAIR WITHOUT A FROZEN ROOT-CAUSE CONTRACT
|
|
|
133
154
|
3. 哪些假设被证伪,为什么不是它们。
|
|
134
155
|
4. 最小修复边界在哪里,哪些文件明确不该动。
|
|
135
156
|
|
|
157
|
+
## Root Cause Proof Ladder
|
|
158
|
+
|
|
159
|
+
`cc-investigate` 的根因不是“报错点在哪里”,而是“坏状态第一次被制造在哪里”。任何只修 symptom site 的结论默认不合格,除非已经证明 symptom site 就是 original trigger。
|
|
160
|
+
|
|
161
|
+
每次调查必须爬完这 6 层,无法爬完就不能生成 repair task:
|
|
162
|
+
|
|
163
|
+
1. `L1 Symptom Site`:用户看见的错误、失败命令、UI 状态、日志或坏 artifact。
|
|
164
|
+
2. `L2 First Bad State`:第一个可观察到状态从正确变成错误的位置;可以是文件、字段、缓存、队列消息、API 响应、配置或内存对象。
|
|
165
|
+
3. `L3 Violated Contract`:被破坏的 schema、capability invariant、API contract、state transition、权限边界或时序条件。
|
|
166
|
+
4. `L4 Original Trigger`:哪个用户动作、命令、事件、recent diff、配置变化或外部响应制造了 first bad state。
|
|
167
|
+
5. `L5 Counterfactual Proof`:如果恢复该 contract、替换输入、回滚 diff、固定配置或断言边界,症状应如何变化;必须记录实际观察。
|
|
168
|
+
6. `L6 Escape Reason`:为什么现有测试、类型、验证、监控、review 或 artifact gate 没提前挡住它。
|
|
169
|
+
|
|
170
|
+
硬规则:
|
|
171
|
+
|
|
172
|
+
- `First bad state` 为空时,root cause 只能是 `needs-more-evidence`。
|
|
173
|
+
- `Original trigger` 为空时,不能把下游 guard 写成根因修复。
|
|
174
|
+
- `Counterfactual proof` 为空时,假设只能停在 candidate,不准进入 confirmed root cause。
|
|
175
|
+
- `Escape reason` 不能写成人工提醒;必须变成 regression test、artifact guard、capability invariant、operator check 或明确的 follow-up。
|
|
176
|
+
- 如果 ladder 指向 spec 缺失或路线假设错误,停止生成修复任务,reroute 到 `cc-plan` 或 `roadmap`。
|
|
177
|
+
|
|
136
178
|
## Quick Start
|
|
137
179
|
|
|
138
180
|
先判断你面对的是哪一类调查现实:
|
|
@@ -157,44 +199,55 @@ NO REPAIR WITHOUT A FROZEN ROOT-CAUSE CONTRACT
|
|
|
157
199
|
|
|
158
200
|
## Harness Contract
|
|
159
201
|
|
|
160
|
-
- Allowed actions: reproduce, collect evidence, trace code paths, test hypotheses, freeze root cause, write `planning/
|
|
202
|
+
- Allowed actions: reproduce, collect evidence, trace code paths, test hypotheses, freeze root cause, write `planning/tasks.md`, generate `planning/task-manifest.json` / `change-meta.json`, then run the final roadmap progress sync for the source RM.
|
|
161
203
|
- Forbidden actions: writing production code, disguising guesses as root cause, or skipping directly from symptoms to repair.
|
|
162
204
|
- Required evidence: every root-cause claim must point to reproduction evidence, code facts, recent history, or explicit user confirmation.
|
|
163
205
|
- Reroute rule: product/scope changes go to `cc-plan`; strategy questions go to `roadmap`; only confirmed repair handoff goes to `cc-do`.
|
|
164
206
|
|
|
207
|
+
## Project Postmortem Recall Gate
|
|
208
|
+
|
|
209
|
+
`cc-investigate` 必须先查项目级 AI 尸检报告,再宣称 bug 是新问题。历史不是权威结论,但它能暴露模型容易重复的错判。
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
rg -n "<symptom|module|boundary|failure-class|model-risk>" devflow/postmortems
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
执行规则:
|
|
216
|
+
|
|
217
|
+
1. `devflow/postmortems/` 不存在时,在 `planning/tasks.md#Root Cause Contract` 记录 `no-project-postmortems-yet`。
|
|
218
|
+
2. 有命中时,先读 `INDEX.md` / `principles.md`,再打开最相关的 1-2 个 incident。
|
|
219
|
+
3. 相关 incident 必须进入假设表或反证表:同根因、相似症状不同根因、已知模型陷阱、或明确不相关。
|
|
220
|
+
4. 如果本次确认是重复根因,`Root Cause` 的 `Prior history relationship` 必须标成 `recurring` 或 `same-root-cause`。
|
|
221
|
+
|
|
165
222
|
## Output Model
|
|
166
223
|
|
|
167
|
-
`cc-investigate`
|
|
168
|
-
|
|
169
|
-
1. `planning/
|
|
170
|
-
-
|
|
171
|
-
-
|
|
172
|
-
-
|
|
173
|
-
-
|
|
174
|
-
|
|
175
|
-
- 修复边界
|
|
176
|
-
2. `planning/tasks.md`
|
|
177
|
-
- 只保留真正要执行的修复任务
|
|
178
|
-
- 顶部明确 canonical contract 是 `planning/analysis.md`
|
|
179
|
-
3. `planning/task-manifest.json`
|
|
224
|
+
`cc-investigate` 默认只允许产出 3 个主文件:
|
|
225
|
+
|
|
226
|
+
1. `planning/tasks.md`
|
|
227
|
+
- 唯一默认 human-authored Markdown
|
|
228
|
+
- `## Root Cause Contract` 记录现象、复现、证据链、假设表、已确认根因和修复边界
|
|
229
|
+
- 后续区块只保留真正要执行的修复任务
|
|
230
|
+
- 顶部明确 canonical contract 是 `planning/tasks.md#Root Cause Contract`
|
|
231
|
+
2. `planning/task-manifest.json`
|
|
180
232
|
- 机器真相源
|
|
181
233
|
- 标记当前任务、依赖、验证命令、调查版本链
|
|
182
|
-
|
|
234
|
+
3. `change-meta.json`
|
|
183
235
|
- 标记当前 bug 是实现偏离 spec、spec 本身缺失,还是 roadmap 假设错误
|
|
184
236
|
- 记录这次修复会如何影响 capability truth
|
|
185
237
|
|
|
186
238
|
`cc-investigate` 不写生产代码,不在这里偷跑 `cc-do`。
|
|
187
239
|
|
|
188
|
-
diagnose-only 仍然写 `planning/
|
|
240
|
+
diagnose-only 仍然写 `planning/tasks.md#Root Cause Contract`,但 task blocks 只能包含证据交接、
|
|
189
241
|
监控、人工动作或明确的 `reroute`;不能把“已经诊断”伪装成“已经修复”。
|
|
190
242
|
|
|
191
243
|
## Entry Gate
|
|
192
244
|
|
|
193
245
|
1. 先确认当前对象仍然属于一个 requirement,而不是整个项目级故障。
|
|
194
|
-
2.
|
|
195
|
-
3.
|
|
196
|
-
4.
|
|
197
|
-
5.
|
|
246
|
+
2. 先分配 canonical `FIX-*` change key,并执行 Worktree Branch Contract;detached worktree 必须先挂到 `FIX/<task>`,主分支必须停止。
|
|
247
|
+
3. 先收症状事实:错误、触发条件、影响面、复现路径。
|
|
248
|
+
4. 先读现有 change 目录里的 `planning/design.md` / `planning/analysis.md` / `planning/tasks.md` / `planning/task-manifest.json`,不要假设自己是第一位调查者。
|
|
249
|
+
5. 先读代码、测试、日志、相关 capability spec 和最近提交,再下任何假设。
|
|
250
|
+
6. 如果复现都不稳定,先不要写根因。
|
|
198
251
|
|
|
199
252
|
## Investigation Loop
|
|
200
253
|
|
|
@@ -234,13 +287,15 @@ diagnose-only 仍然写 `planning/analysis.md`,但 `planning/tasks.md` 只能
|
|
|
234
287
|
- debug 日志必须带唯一前缀,例如 `[DEBUG-FIX123-a4f2]`,进入 `cc-do` 前用前缀 grep 清理或转正
|
|
235
288
|
- 三次假设都失败,就停下进入 escalation decision
|
|
236
289
|
7. **Freeze repair contract**
|
|
237
|
-
-
|
|
290
|
+
- 先填写 `Root Cause Proof Ladder`:symptom site、first bad state、violated contract、original trigger、counterfactual proof、escape reason
|
|
291
|
+
- 如果 first bad state、original trigger 或 counterfactual proof 缺失,只能写 `Evidence Request` 或 reroute,不能生成 repair task
|
|
292
|
+
- 根因确认后,写进 `planning/tasks.md#Root Cause Contract`
|
|
238
293
|
- 只保留最小修复边界
|
|
239
294
|
- 写清正确测试缝隙:测试是否覆盖真实触发链;如果没有正确 seam,这本身就是需要记录的架构事实
|
|
240
295
|
- 写明 affected module、allowed files、forbidden files、blast radius estimate;超过 5 个文件默认拆分或 reroute
|
|
241
296
|
- 输出 `planning/tasks.md` + `planning/task-manifest.json` + `change-meta.json`
|
|
242
297
|
8. **Roadmap sync**
|
|
243
|
-
- 用 `locate-roadmap-item.sh` 定位 source RM;找不到时在 `
|
|
298
|
+
- 用 `locate-roadmap-item.sh` 定位 source RM;找不到时在 `planning/tasks.md#Root Cause Contract` 和 `change-meta.json.roadmapSync` 写 `no-source-rm`
|
|
244
299
|
- `implementation drift`:回写 source RM 为 `Repair planned` 或等价调查完成状态,绑定 `FIX-*`,进度保持在可执行修复前的真实百分比
|
|
245
300
|
- `missing spec truth`:回写 source RM 的 expected spec delta 或 follow-up,必要时 reroute 到 `cc-plan`
|
|
246
301
|
- `roadmap mismatch`:不要直接进入修复;先把 mismatch 写回 roadmap / backlog,下一步写 `roadmap` 或 `cc-plan`
|
|
@@ -284,7 +339,7 @@ diagnose-only 仍然写 `planning/analysis.md`,但 `planning/tasks.md` 只能
|
|
|
284
339
|
|
|
285
340
|
## Backward Trace Chain
|
|
286
341
|
|
|
287
|
-
报错点很深时,不准只在 symptom site 加 guard。`
|
|
342
|
+
报错点很深时,不准只在 symptom site 加 guard。`planning/tasks.md#Root Cause Contract` 必须追到:
|
|
288
343
|
|
|
289
344
|
- immediate failure site
|
|
290
345
|
- direct caller
|
|
@@ -383,7 +438,7 @@ flaky bug 的目标不是立刻 100% 复现,而是提高复现率直到可调
|
|
|
383
438
|
4. 既有 `report-card.json` finding 和 `planning/analysis.md`
|
|
384
439
|
5. 可用时,查询项目记忆或历史调查摘要
|
|
385
440
|
|
|
386
|
-
如果命中过往调查,写入 `
|
|
441
|
+
如果命中过往调查,写入 `planning/tasks.md#Root Cause Contract` 的 `Prior Investigations`,包括是否复发、根因是否同类、这次是否说明结构问题。
|
|
387
442
|
|
|
388
443
|
## External Research Hygiene
|
|
389
444
|
|
|
@@ -423,7 +478,7 @@ flaky bug 的目标不是立刻 100% 复现,而是提高复现率直到可调
|
|
|
423
478
|
|
|
424
479
|
## Escalation Decision
|
|
425
480
|
|
|
426
|
-
三次假设失败后,不准继续硬猜。`
|
|
481
|
+
三次假设失败后,不准继续硬猜。`planning/tasks.md#Root Cause Contract` 必须写:
|
|
427
482
|
|
|
428
483
|
- failedHypothesisCount
|
|
429
484
|
- what was attempted
|
|
@@ -436,6 +491,7 @@ flaky bug 的目标不是立刻 100% 复现,而是提高复现率直到可调
|
|
|
436
491
|
|
|
437
492
|
- 看完第一屏就知道 bug 是什么、怎么复现、为什么会坏
|
|
438
493
|
- 根因不是感觉,而是被证据钉死的具体断点
|
|
494
|
+
- 根因证明追到 first bad state 和 original trigger,而不是停在 symptom site
|
|
439
495
|
- 假设不是列表装饰,而是带证伪方法和实际观察
|
|
440
496
|
- 历史调查、最近改动、模式分析没有被跳过
|
|
441
497
|
- 修复边界清楚到 `cc-do` 不需要二次调查
|
|
@@ -448,7 +504,7 @@ flaky bug 的目标不是立刻 100% 复现,而是提高复现率直到可调
|
|
|
448
504
|
|
|
449
505
|
- 变更记录:`CHANGELOG.md`
|
|
450
506
|
- 调查契约:`references/investigation-contract.md`
|
|
451
|
-
- 分析模板:`assets/ANALYSIS_TEMPLATE.md`
|
|
507
|
+
- legacy 分析模板:`assets/legacy/ANALYSIS_TEMPLATE.md`
|
|
452
508
|
- 修复任务模板:`assets/TASKS_TEMPLATE.md`
|
|
453
509
|
- manifest 模板:`assets/TASK_MANIFEST_TEMPLATE.json`
|
|
454
510
|
- 分析骨架:`scripts/bootstrap-analysis.sh`
|
|
@@ -468,10 +524,11 @@ flaky bug 的目标不是立刻 100% 复现,而是提高复现率直到可调
|
|
|
468
524
|
9. 修复触点超过 5 个文件时,默认先拆分或 reroute,不把大重构伪装成 bug fix。
|
|
469
525
|
10. 好的调查不是“找了很多可能性”,而是把错误世界缩成一个可信的 repair contract。
|
|
470
526
|
11. Roadmap 相关文件以 `devflow/roadmap.json` 为真相源,`devflow/ROADMAP.md` / `devflow/BACKLOG.md` 只是投影;不要再写旧式 `devflow/roadmap/*` 路径。
|
|
527
|
+
12. 一个 `FIX` 对应一个 canonical work branch;新调查不在 `main` 上落盘,不把 detached worktree 留到 `cc-act` 才补救。
|
|
471
528
|
|
|
472
529
|
## Exit Criteria
|
|
473
530
|
|
|
474
|
-
- `planning/
|
|
531
|
+
- `planning/tasks.md#Root Cause Contract` 已冻结症状、复现、证据链、根因和修复边界
|
|
475
532
|
- `planning/tasks.md` / `planning/task-manifest.json` 可直接交给 `cc-do`
|
|
476
533
|
- Roadmap Sync Gate 已闭合:source RM 已回写调查结果 / reroute,或 no-op reason 已落盘
|
|
477
534
|
- 下一步唯一答案是 `cc-do`、`cc-plan` 或 `roadmap`
|