@boyingliu01/xp-gate 0.7.0 → 0.8.0
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/bin/xp-gate.js +4 -9
- package/lib/__tests__/audit-log.test.ts +107 -0
- package/lib/__tests__/detect-deps.test.js +212 -42
- package/lib/__tests__/doctor.test.js +1 -0
- package/lib/__tests__/gate-audit.test.ts +59 -0
- package/lib/__tests__/init.test.js +47 -1
- package/lib/__tests__/install-skill.test.js +1 -45
- package/lib/__tests__/ui-detector.test.ts +186 -26
- package/lib/__tests__/ui-review.test.ts +119 -0
- package/lib/__tests__/uninstall.test.js +1 -0
- package/lib/detect-deps.js +180 -37
- package/lib/doctor.js +7 -9
- package/lib/gate-audit.ts +26 -42
- package/lib/init.js +42 -13
- package/lib/install-skill.js +20 -48
- package/lib/rollback.js +1 -16
- package/lib/shared-paths.js +30 -0
- package/lib/shared-utils.js +25 -0
- package/lib/ui-detector.ts +20 -14
- package/lib/ui-review.ts +58 -53
- package/lib/uninstall.js +8 -9
- package/package.json +1 -1
- package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-code/skills/admin-template-guidelines/SKILL.md +904 -0
- package/plugins/claude-code/skills/delphi-review/.delphi-config.json.example +45 -0
- package/plugins/claude-code/skills/delphi-review/AGENTS.md +66 -0
- package/plugins/claude-code/skills/delphi-review/INSTALL.md +152 -0
- package/plugins/claude-code/skills/delphi-review/SKILL.md +454 -0
- package/plugins/claude-code/skills/delphi-review/opencode.json.delphi.example +56 -0
- package/plugins/claude-code/skills/delphi-review/references/code-walkthrough.md +486 -0
- package/plugins/claude-code/skills/improve-codebase-architecture/SKILL.md +156 -0
- package/plugins/claude-code/skills/ralph-loop/SKILL.md +501 -0
- package/plugins/claude-code/skills/ralph-loop/references/components/memory.md +55 -0
- package/plugins/claude-code/skills/ralph-loop/references/components/middleware.md +54 -0
- package/plugins/claude-code/skills/ralph-loop/references/components/skill-invocations.md +39 -0
- package/plugins/claude-code/skills/ralph-loop/references/components/system-prompt.md +24 -0
- package/plugins/claude-code/skills/ralph-loop/references/components/tool-descriptions.md +32 -0
- package/plugins/claude-code/skills/ralph-loop/references/phase-2-build-ralph.md +89 -0
- package/plugins/claude-code/skills/ralph-loop/templates/progress-log.md +36 -0
- package/plugins/claude-code/skills/sprint-flow/AGENTS.md +68 -0
- package/plugins/claude-code/skills/sprint-flow/SKILL.md +1248 -0
- package/plugins/claude-code/skills/sprint-flow/references/components/memory.md +87 -0
- package/plugins/claude-code/skills/sprint-flow/references/components/middleware.md +72 -0
- package/plugins/claude-code/skills/sprint-flow/references/components/skill-invocations.md +104 -0
- package/plugins/claude-code/skills/sprint-flow/references/components/system-prompt.md +27 -0
- package/plugins/claude-code/skills/sprint-flow/references/components/tool-descriptions.md +96 -0
- package/plugins/claude-code/skills/sprint-flow/references/force-levels.md +203 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-0-think.md +115 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-1-plan.md +178 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-2-build.md +198 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-3-review.md +213 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-4-uat.md +125 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-5-feedback.md +100 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-6-ship.md +193 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-7-land.md +140 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-8-cleanup.md +192 -0
- package/plugins/claude-code/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +257 -0
- package/plugins/claude-code/skills/sprint-flow/templates/auto-estimate-learning-log.md +136 -0
- package/plugins/claude-code/skills/sprint-flow/templates/auto-estimate-output-template.md +132 -0
- package/plugins/claude-code/skills/sprint-flow/templates/emergent-issues-template.md +120 -0
- package/plugins/claude-code/skills/sprint-flow/templates/pain-document-template.md +115 -0
- package/plugins/claude-code/skills/sprint-flow/templates/sprint-progress-template.md +151 -0
- package/plugins/claude-code/skills/sprint-flow/templates/sprint-summary-template.md +120 -0
- package/plugins/claude-code/skills/test-driven-development/SKILL.md +71 -0
- package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +56 -0
- package/plugins/claude-code/skills/test-specification-alignment/SKILL.md +702 -0
- package/plugins/claude-code/skills/test-specification-alignment/references/alignment-verification-algorithm.md +493 -0
- package/plugins/claude-code/skills/test-specification-alignment/references/phase2-constraint-enforcement.md +431 -0
- package/plugins/claude-code/skills/test-specification-alignment/references/specification-format.md +348 -0
- package/plugins/claude-code/skills/to-issues/SKILL.md +277 -0
- package/plugins/opencode/README.md +38 -0
- package/plugins/opencode/index.ts +85 -0
- package/plugins/opencode/package.json +18 -0
- package/plugins/opencode/skills/admin-template-guidelines/SKILL.md +904 -0
- package/plugins/opencode/skills/delphi-review/.delphi-config.json.example +45 -0
- package/plugins/opencode/skills/delphi-review/AGENTS.md +66 -0
- package/plugins/opencode/skills/delphi-review/INSTALL.md +152 -0
- package/plugins/opencode/skills/delphi-review/SKILL.md +454 -0
- package/plugins/opencode/skills/delphi-review/opencode.json.delphi.example +56 -0
- package/plugins/opencode/skills/delphi-review/references/code-walkthrough.md +486 -0
- package/plugins/opencode/skills/improve-codebase-architecture/SKILL.md +156 -0
- package/plugins/opencode/skills/ralph-loop/SKILL.md +501 -0
- package/plugins/opencode/skills/ralph-loop/references/components/memory.md +55 -0
- package/plugins/opencode/skills/ralph-loop/references/components/middleware.md +54 -0
- package/plugins/opencode/skills/ralph-loop/references/components/skill-invocations.md +39 -0
- package/plugins/opencode/skills/ralph-loop/references/components/system-prompt.md +24 -0
- package/plugins/opencode/skills/ralph-loop/references/components/tool-descriptions.md +32 -0
- package/plugins/opencode/skills/ralph-loop/references/phase-2-build-ralph.md +89 -0
- package/plugins/opencode/skills/ralph-loop/templates/progress-log.md +36 -0
- package/plugins/opencode/skills/sprint-flow/AGENTS.md +68 -0
- package/plugins/opencode/skills/sprint-flow/SKILL.md +1248 -0
- package/plugins/opencode/skills/sprint-flow/references/components/memory.md +87 -0
- package/plugins/opencode/skills/sprint-flow/references/components/middleware.md +72 -0
- package/plugins/opencode/skills/sprint-flow/references/components/skill-invocations.md +104 -0
- package/plugins/opencode/skills/sprint-flow/references/components/system-prompt.md +27 -0
- package/plugins/opencode/skills/sprint-flow/references/components/tool-descriptions.md +96 -0
- package/plugins/opencode/skills/sprint-flow/references/force-levels.md +203 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-0-think.md +115 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-1-plan.md +178 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-2-build.md +198 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-3-review.md +213 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-4-uat.md +125 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-5-feedback.md +100 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-6-ship.md +193 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-7-land.md +140 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-8-cleanup.md +192 -0
- package/plugins/opencode/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +257 -0
- package/plugins/opencode/skills/sprint-flow/templates/auto-estimate-learning-log.md +136 -0
- package/plugins/opencode/skills/sprint-flow/templates/auto-estimate-output-template.md +132 -0
- package/plugins/opencode/skills/sprint-flow/templates/emergent-issues-template.md +120 -0
- package/plugins/opencode/skills/sprint-flow/templates/pain-document-template.md +115 -0
- package/plugins/opencode/skills/sprint-flow/templates/sprint-progress-template.md +151 -0
- package/plugins/opencode/skills/sprint-flow/templates/sprint-summary-template.md +120 -0
- package/plugins/opencode/skills/test-driven-development/SKILL.md +71 -0
- package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +56 -0
- package/plugins/opencode/skills/test-specification-alignment/SKILL.md +702 -0
- package/plugins/opencode/skills/test-specification-alignment/references/alignment-verification-algorithm.md +493 -0
- package/plugins/opencode/skills/test-specification-alignment/references/phase2-constraint-enforcement.md +431 -0
- package/plugins/opencode/skills/test-specification-alignment/references/specification-format.md +348 -0
- package/plugins/opencode/skills/to-issues/SKILL.md +277 -0
- package/plugins/opencode/tsconfig.json +15 -0
- package/plugins/qoder/skills/admin-template-guidelines/SKILL.md +904 -0
- package/plugins/qoder/skills/delphi-review/.delphi-config.json.example +45 -0
- package/plugins/qoder/skills/delphi-review/AGENTS.md +66 -0
- package/plugins/qoder/skills/delphi-review/INSTALL.md +152 -0
- package/plugins/qoder/skills/delphi-review/SKILL.md +454 -0
- package/plugins/qoder/skills/delphi-review/opencode.json.delphi.example +56 -0
- package/plugins/qoder/skills/delphi-review/references/code-walkthrough.md +486 -0
- package/plugins/qoder/skills/improve-codebase-architecture/SKILL.md +156 -0
- package/plugins/qoder/skills/ralph-loop/SKILL.md +501 -0
- package/plugins/qoder/skills/ralph-loop/references/components/memory.md +55 -0
- package/plugins/qoder/skills/ralph-loop/references/components/middleware.md +54 -0
- package/plugins/qoder/skills/ralph-loop/references/components/skill-invocations.md +39 -0
- package/plugins/qoder/skills/ralph-loop/references/components/system-prompt.md +24 -0
- package/plugins/qoder/skills/ralph-loop/references/components/tool-descriptions.md +32 -0
- package/plugins/qoder/skills/ralph-loop/references/phase-2-build-ralph.md +89 -0
- package/plugins/qoder/skills/ralph-loop/templates/progress-log.md +36 -0
- package/plugins/qoder/skills/sprint-flow/AGENTS.md +68 -0
- package/plugins/qoder/skills/sprint-flow/SKILL.md +1248 -0
- package/plugins/qoder/skills/sprint-flow/references/components/memory.md +87 -0
- package/plugins/qoder/skills/sprint-flow/references/components/middleware.md +72 -0
- package/plugins/qoder/skills/sprint-flow/references/components/skill-invocations.md +104 -0
- package/plugins/qoder/skills/sprint-flow/references/components/system-prompt.md +27 -0
- package/plugins/qoder/skills/sprint-flow/references/components/tool-descriptions.md +96 -0
- package/plugins/qoder/skills/sprint-flow/references/force-levels.md +203 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-0-think.md +115 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-1-plan.md +178 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-2-build.md +198 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-3-review.md +213 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-4-uat.md +125 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-5-feedback.md +100 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-6-ship.md +193 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-7-land.md +140 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-8-cleanup.md +192 -0
- package/plugins/qoder/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +257 -0
- package/plugins/qoder/skills/sprint-flow/templates/auto-estimate-learning-log.md +136 -0
- package/plugins/qoder/skills/sprint-flow/templates/auto-estimate-output-template.md +132 -0
- package/plugins/qoder/skills/sprint-flow/templates/emergent-issues-template.md +120 -0
- package/plugins/qoder/skills/sprint-flow/templates/pain-document-template.md +115 -0
- package/plugins/qoder/skills/sprint-flow/templates/sprint-progress-template.md +151 -0
- package/plugins/qoder/skills/sprint-flow/templates/sprint-summary-template.md +120 -0
- package/plugins/qoder/skills/test-driven-development/SKILL.md +71 -0
- package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +56 -0
- package/plugins/qoder/skills/test-specification-alignment/SKILL.md +702 -0
- package/plugins/qoder/skills/test-specification-alignment/references/alignment-verification-algorithm.md +493 -0
- package/plugins/qoder/skills/test-specification-alignment/references/phase2-constraint-enforcement.md +431 -0
- package/plugins/qoder/skills/test-specification-alignment/references/specification-format.md +348 -0
- package/plugins/qoder/skills/to-issues/SKILL.md +277 -0
- package/skills/admin-template-guidelines/SKILL.md +904 -0
- package/skills/delphi-review/SKILL.md +112 -77
- package/skills/improve-codebase-architecture/SKILL.md +156 -0
- package/skills/ralph-loop/SKILL.md +165 -34
- package/skills/sprint-flow/SKILL.md +448 -107
- package/skills/sprint-flow/references/components/skill-invocations.md +1 -1
- package/skills/sprint-flow/references/components/tool-descriptions.md +1 -1
- package/skills/sprint-flow/references/force-levels.md +203 -0
- package/skills/sprint-flow/references/phase-1-plan.md +4 -4
- package/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +20 -1
- package/skills/sprint-flow/templates/auto-estimate-output-template.md +7 -5
- package/skills/sprint-flow/templates/sprint-progress-template.md +151 -0
- package/skills/test-driven-development/SKILL.md +71 -0
- package/skills/test-specification-alignment/SKILL.md +98 -24
- package/skills/to-issues/SKILL.md +277 -0
- package/plugins/qoder/AGENTS.md +0 -93
- package/plugins/qoder/README.md +0 -87
- package/plugins/qoder/widgets/quality-report.html +0 -163
- package/plugins/qoder/widgets/sprint-dashboard.html +0 -172
- package/skills/delphi-review/evals/evals.json +0 -82
- package/skills/delphi-review/references/qoder-multi-model.md +0 -191
- package/skills/ralph-loop/evals/evals.json +0 -311
- package/skills/ralph-loop/evolution-history.json +0 -59
- package/skills/ralph-loop/evolution-log.md +0 -16
- package/skills/sprint-flow/evals/evals.json +0 -130
- package/skills/sprint-flow/evolution-history.json +0 -39
- package/skills/sprint-flow/evolution-log.md +0 -23
- package/skills/sprint-flow/references/qoder-adaptation.md +0 -173
- package/skills/test-specification-alignment/evals/evals.json +0 -75
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# Phase 8: CLEANUP(清理 + 总结)
|
|
2
|
+
|
|
3
|
+
## 目标
|
|
4
|
+
|
|
5
|
+
自动清理 worktree、更新 sprint-state.json、输出 Sprint Summary、处理 emergent issues。
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 输入
|
|
10
|
+
|
|
11
|
+
- Phase 7 LAND 完成后的部署状态
|
|
12
|
+
- 或 Phase 6 Option 1(本地 Merge)后的完成状态
|
|
13
|
+
- `.sprint-state/sprint-state.json`(包含 worktree 路径信息)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 执行步骤
|
|
18
|
+
|
|
19
|
+
### Step 1: 检测 worktree 是否存在
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Read worktree path from sprint-state.json
|
|
23
|
+
WORKTREE_PATH=$(node -e "const fs=require('fs'); const state=JSON.parse(fs.readFileSync('.sprint-state/sprint-state.json','utf8')); console.log(state.isolation?.worktree_path || '')" 2>/dev/null)
|
|
24
|
+
|
|
25
|
+
if [ -z "$WORKTREE_PATH" ]; then
|
|
26
|
+
echo "[CLEANUP] No worktree path found in sprint-state.json — skipping cleanup"
|
|
27
|
+
exit 0
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
if [ ! -d "$WORKTREE_PATH" ]; then
|
|
31
|
+
echo "[CLEANUP] Worktree already removed: $WORKTREE_PATH"
|
|
32
|
+
HAS_WORKTREE=false
|
|
33
|
+
else
|
|
34
|
+
HAS_WORKTREE=true
|
|
35
|
+
fi
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**跳过**: `--no-isolate` 路径(无 worktree 可清理)或 worktree 已不存在
|
|
39
|
+
|
|
40
|
+
**存在**: 进入 Step 2
|
|
41
|
+
|
|
42
|
+
### Step 2: 删除 worktree(带重试机制)
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
MAX_RETRIES=3
|
|
46
|
+
RETRY_COUNT=0
|
|
47
|
+
REMOVED=false
|
|
48
|
+
|
|
49
|
+
while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
|
|
50
|
+
if git worktree remove "$WORKTREE_PATH" 2>/dev/null; then
|
|
51
|
+
REMOVED=true
|
|
52
|
+
echo "[CLEANUP] ✅ Worktree removed: $WORKTREE_PATH"
|
|
53
|
+
break
|
|
54
|
+
else
|
|
55
|
+
RETRY_COUNT=$((RETRY_COUNT + 1))
|
|
56
|
+
if [ $RETRY_COUNT -lt $MAX_RETRIES ]; then
|
|
57
|
+
echo "[WARN] Worktree remove failed, retry $RETRY_COUNT/$MAX_RETRIES in 1s..."
|
|
58
|
+
sleep 1
|
|
59
|
+
fi
|
|
60
|
+
fi
|
|
61
|
+
done
|
|
62
|
+
|
|
63
|
+
if [ "$REMOVED" = "false" ]; then
|
|
64
|
+
echo "[WARN] Failed to remove worktree after $MAX_RETRIES attempts."
|
|
65
|
+
echo "[WARN] Please manually run: git worktree remove $WORKTREE_PATH"
|
|
66
|
+
fi
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**成功**: 进入 Step 3
|
|
70
|
+
|
|
71
|
+
**失败**: 输出警告 + 手动命令提示 → 进入 Step 3
|
|
72
|
+
|
|
73
|
+
### Step 3: 检测残留目录
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
if [ -d "$WORKTREE_PATH" ]; then
|
|
77
|
+
echo "[WARN] ⚠️ Residual worktree directory detected: $WORKTREE_PATH"
|
|
78
|
+
echo "[WARN] Please manually remove it if needed"
|
|
79
|
+
else
|
|
80
|
+
echo "[CLEANUP] ✅ No residual directory detected"
|
|
81
|
+
fi
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**残留**: 输出警告
|
|
85
|
+
|
|
86
|
+
**干净**: 输出成功消息 → 进入 Step 4
|
|
87
|
+
|
|
88
|
+
### Step 4: 更新 sprint-state.json
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
node -e "
|
|
92
|
+
const fs = require('fs');
|
|
93
|
+
const statePath = '.sprint-state/sprint-state.json';
|
|
94
|
+
const state = JSON.parse(fs.readFileSync(statePath, 'utf8'));
|
|
95
|
+
state.phase = 8;
|
|
96
|
+
state.status = 'merged';
|
|
97
|
+
if (!state.metrics) state.metrics = {};
|
|
98
|
+
state.metrics.completed_at = new Date().toISOString();
|
|
99
|
+
fs.writeFileSync(statePath, JSON.stringify(state, null, 2) + '\n');
|
|
100
|
+
console.log('[CLEANUP] sprint-state.json updated → phase: 8, status: merged');
|
|
101
|
+
"
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Step 5: 输出 Sprint Summary
|
|
105
|
+
|
|
106
|
+
根据 `.sprint-state/phase-outputs/sprint-summary-template.md` 生成总结:
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
110
|
+
SPRINT SUMMARY
|
|
111
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
112
|
+
Sprint ID: sprint-2026-05-28-01
|
|
113
|
+
Status: merged
|
|
114
|
+
Phase: 8 (CLEANUP complete)
|
|
115
|
+
|
|
116
|
+
Timeline:
|
|
117
|
+
- Phase -1 ISOLATE: ✅
|
|
118
|
+
- Phase 0 THINK: ✅
|
|
119
|
+
- Phase 1 PLAN: ✅
|
|
120
|
+
- Phase 2 BUILD: ✅
|
|
121
|
+
- Phase 3 REVIEW: ✅
|
|
122
|
+
- Phase 4 ACCEPTANCE: ✅
|
|
123
|
+
- Phase 5 FEEDBACK: ✅
|
|
124
|
+
- Phase 6 SHIP: ✅
|
|
125
|
+
- Phase 7 LAND: ✅ (deploy: success/failure/skipped)
|
|
126
|
+
- Phase 8 CLEANUP: ✅ (worktree: clean/residual)
|
|
127
|
+
|
|
128
|
+
Emergent Issues: <N> found
|
|
129
|
+
- IF Critical → Sprint 2 auto-triggered
|
|
130
|
+
- IF Major/Minor → Ask user
|
|
131
|
+
|
|
132
|
+
Worktree cleaned: <yes/no/manual>
|
|
133
|
+
PR merged: <PR_URL>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Step 6: 处理 Emergent Issues
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# Check for emergent issues file
|
|
140
|
+
if [ -f ".sprint-state/phase-outputs/emergent-issues.md" ]; then
|
|
141
|
+
ISSUE_COUNT=$(grep -c "^## " ".sprint-state/phase-outputs/emergent-issues.md" 2>/dev/null || echo "0")
|
|
142
|
+
|
|
143
|
+
if [ "$ISSUE_COUNT" -gt 0 ]; then
|
|
144
|
+
HAS_CRITICAL=$(grep -i "critical" ".sprint-state/phase-outputs/emergent-issues.md" 2>/dev/null || echo "")
|
|
145
|
+
|
|
146
|
+
if [ -n "$HAS_CRITICAL" ]; then
|
|
147
|
+
echo ""
|
|
148
|
+
echo "⚠️ Critical emergent issues detected — auto-triggering Sprint 2"
|
|
149
|
+
echo "Sprint 2 Pain Document will be generated from emergent-issues.md"
|
|
150
|
+
# Auto-trigger Sprint 2
|
|
151
|
+
else
|
|
152
|
+
echo ""
|
|
153
|
+
echo "ℹ️ $ISSUE_COUNT emergent issue(s) found — ask user about Sprint 2"
|
|
154
|
+
fi
|
|
155
|
+
else
|
|
156
|
+
echo ""
|
|
157
|
+
echo "✅ No emergent issues — sprint completed successfully"
|
|
158
|
+
fi
|
|
159
|
+
else
|
|
160
|
+
echo ""
|
|
161
|
+
echo "✅ No emergent issues — sprint completed successfully"
|
|
162
|
+
fi
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## 输出
|
|
168
|
+
|
|
169
|
+
- Cleanup Report:
|
|
170
|
+
- Worktree removed: ✅ / ⚠️ residual / ❌ manual required
|
|
171
|
+
- sprint-state.json: phase 8, status merged
|
|
172
|
+
- Sprint Summary
|
|
173
|
+
- IF emergent issues with Critical → Sprint 2 auto-trigger
|
|
174
|
+
- IF emergent issues without Critical → ask user
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## 暂停点
|
|
179
|
+
|
|
180
|
+
- **Worktree 手动清理**: 用户确认已手动清理或保留残留
|
|
181
|
+
- **Sprint 2 决策**: 用户确认是否开始 Sprint 2(仅 Major/Minor issues 时)
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## 错误处理
|
|
186
|
+
|
|
187
|
+
| 错误场景 | 处理 |
|
|
188
|
+
|---------|------|
|
|
189
|
+
| worktree 路径不存在于 sprint-state.json | 跳过清理,输出警告 |
|
|
190
|
+
| `git worktree remove` 失败 | 重试 3 次 → 输出手动命令提示 |
|
|
191
|
+
| 残留目录检测 | 输出警告,用户决策 |
|
|
192
|
+
| sprint-state.json 更新失败 | 输出错误,不影响最终完成状态 |
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
# Phase -0.5: AUTO-ESTIMATE(自动化规模评估与流程路由)
|
|
2
|
+
|
|
3
|
+
**执行时机**: Phase -1 ISOLATE 完成后、Phase 0 THINK 之前。**自动执行**。
|
|
4
|
+
|
|
5
|
+
**目的**: 自动评估需求规模,匹配适度流程,避免小需求走重量级流程造成资源浪费。
|
|
6
|
+
|
|
7
|
+
**核心原则**:
|
|
8
|
+
- **客观指标 > 主观判断**:依赖代码结构分析,不依赖人/AI 的主观直觉
|
|
9
|
+
- **显式告知**:用户看到客观指标,不是 AI 主观结论
|
|
10
|
+
- **可纠偏**:用户可接受/修改/取消
|
|
11
|
+
- **学习闭环**:记录用户 override,优化阈值
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 执行流程
|
|
16
|
+
|
|
17
|
+
### 步骤 1: 识别需求类型
|
|
18
|
+
|
|
19
|
+
分析用户输入的需求描述,判定变更类型:
|
|
20
|
+
|
|
21
|
+
| 关键词模式 | 变更类型 | AUTO-ESTIMATE 时机 |
|
|
22
|
+
|-----------|---------|-------------------|
|
|
23
|
+
| 删除、移除、去掉、砍掉、清理 + 已有模块名 | 删除已存在代码 | 立即执行 |
|
|
24
|
+
| 修改、改、调整、重构、优化 + 已有模块名 | 修改已存在代码 | 立即执行 |
|
|
25
|
+
| 新增、添加、开发、实现、创建 + 新模块名 | 新增功能 | brainstorming 后执行 |
|
|
26
|
+
| 修复、fix、bug | Bug 修复 | 立即执行 |
|
|
27
|
+
| 无法判断 | 询问用户 | — |
|
|
28
|
+
|
|
29
|
+
**IF 新增功能**: 跳过当前 AUTO-ESTIMATE,先执行 Phase 0 brainstorming,brainstorming 完成后以设计文档为输入重新执行 AUTO-ESTIMATE。
|
|
30
|
+
|
|
31
|
+
**IF 删除/修改/Bug 修复**: 继续执行以下步骤。
|
|
32
|
+
|
|
33
|
+
### 步骤 2: 收集指标
|
|
34
|
+
|
|
35
|
+
#### 2.1 引用计数
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# 从用户输入中提取目标关键词(模块名、函数名、类名)
|
|
39
|
+
# 示例:删除平面维护界面 → target="plane", "平面"
|
|
40
|
+
grep -rn "{target_pattern}" --include="*.{ext}" . | grep -v node_modules | grep -v .git | wc -l
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**阈值**:
|
|
44
|
+
- ≤3: 轻量
|
|
45
|
+
- 4-10: 标准
|
|
46
|
+
- >10: 复杂
|
|
47
|
+
|
|
48
|
+
#### 2.2 跨模块依赖
|
|
49
|
+
|
|
50
|
+
分析引用出现的目录分布:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# 提取引用所在的目录(取前两级目录)
|
|
54
|
+
grep -rn "{target_pattern}" --include="*.{ext}" . | grep -v node_modules | grep -v .git | \
|
|
55
|
+
awk -F: '{print $1}' | sed 's|/[^/]*$||' | sort -u
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**阈值**:
|
|
59
|
+
- 1 个目录: 轻量
|
|
60
|
+
- 2 个目录: 标准
|
|
61
|
+
- 3+ 个目录: 复杂
|
|
62
|
+
|
|
63
|
+
#### 2.3 循环依赖检测
|
|
64
|
+
|
|
65
|
+
简单检查:如果 A 引用 B 且 B 引用 A,则存在循环依赖。
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# 简化检测:检查目标是否导入其调用者
|
|
69
|
+
# 这需要根据具体语言调整。对于 TS/JS:
|
|
70
|
+
grep -rn "import.*{target}" --include="*.ts" --include="*.tsx" .
|
|
71
|
+
grep -rn "import.*{caller}" --include="*.ts" --include="*.tsx" {target_dir}/
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**阈值**:
|
|
75
|
+
- 无: 正常
|
|
76
|
+
- 存在: 高风险 → 无论如何输出风险警告
|
|
77
|
+
|
|
78
|
+
#### 2.4 Public API 暴露
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# 统计目标模块中 export 的数量
|
|
82
|
+
grep -rn "^export " {target_dir}/ --include="*.ts" | wc -l
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**阈值**:
|
|
86
|
+
- ≤2: 低影响
|
|
87
|
+
- 3-5: 中影响
|
|
88
|
+
- >5: 高影响 → 输出风险警告
|
|
89
|
+
|
|
90
|
+
#### 2.5 相关测试文件
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# 统计与目标相关的测试文件数
|
|
94
|
+
find . -name "*{target}*.test.*" -o -name "*{target}*.spec.*" | grep -v node_modules | wc -l
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**阈值**:
|
|
98
|
+
- 0: 无测试覆盖(风险提示)
|
|
99
|
+
- 1-2: 正常
|
|
100
|
+
- >3: 重构工作量大 → 提示
|
|
101
|
+
|
|
102
|
+
### 步骤 3: 汇总评估
|
|
103
|
+
|
|
104
|
+
根据各指标得分,汇总整体评估结果:
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
总分计算:
|
|
108
|
+
- 引用计数:轻量=1, 标准=2, 复杂=3
|
|
109
|
+
- 跨模块:轻量=1, 标准=2, 复杂=3
|
|
110
|
+
- 循环依赖:无=0, 存在=5(强制复杂)
|
|
111
|
+
- Public API:低=0, 中=1, 高=2
|
|
112
|
+
- 测试文件:正常=0, 多=1
|
|
113
|
+
|
|
114
|
+
总分:1-3 = 轻量 | 4-6 = 标准 | 7+ 或 循环依赖存在 = 复杂
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### 步骤 4: 输出评估结果
|
|
118
|
+
|
|
119
|
+
使用 `templates/auto-estimate-output-template.md` 的标准格式向用户展示评估结果。
|
|
120
|
+
|
|
121
|
+
**MUST** 遵循模板格式,包含:
|
|
122
|
+
- 需求描述 + 变更类型
|
|
123
|
+
- 影响级别标识
|
|
124
|
+
- 各项指标的具体数值
|
|
125
|
+
- 建议流程
|
|
126
|
+
- 风险警告(如有)
|
|
127
|
+
- 用户操作选项
|
|
128
|
+
|
|
129
|
+
### 步骤 5: 处理用户选择
|
|
130
|
+
|
|
131
|
+
#### 用户选择「接受建议」
|
|
132
|
+
|
|
133
|
+
> 按推荐流程执行。保存评估结果到 sprint-state.json。
|
|
134
|
+
|
|
135
|
+
```json
|
|
136
|
+
{
|
|
137
|
+
"auto_estimate": {
|
|
138
|
+
"change_type": "删除已存在代码",
|
|
139
|
+
"metrics": {
|
|
140
|
+
"ref_count": 12,
|
|
141
|
+
"cross_module_count": 3,
|
|
142
|
+
"modules": ["auth", "user", "admin"],
|
|
143
|
+
"circular_dep": true,
|
|
144
|
+
"public_api_count": 5,
|
|
145
|
+
"test_file_count": 4
|
|
146
|
+
},
|
|
147
|
+
"estimated_level": "复杂",
|
|
148
|
+
"recommended_flow": "完整 Sprint Flow (Phase 0-8)",
|
|
149
|
+
"risk_warnings": ["循环依赖: user ↔ plane"],
|
|
150
|
+
"user_decision": "accepted"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
#### 用户选择「修改流程」
|
|
156
|
+
|
|
157
|
+
> 展示修改流程子菜单(3 个选项:轻量/标准/完整)。
|
|
158
|
+
> 要求用户输入修改原因(必填)。
|
|
159
|
+
|
|
160
|
+
记录到学习日志:
|
|
161
|
+
```json
|
|
162
|
+
{
|
|
163
|
+
"sprint_id": "{sprint_id}",
|
|
164
|
+
"task_description": "{需求描述}",
|
|
165
|
+
"estimated_level": "标准",
|
|
166
|
+
"user_override_level": "轻量",
|
|
167
|
+
"override_reason": "{用户输入原因}",
|
|
168
|
+
"timestamp": "{当前时间}"
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
数据写入 `.sprint-state/auto-estimate-learning.json`(追加模式)。
|
|
173
|
+
|
|
174
|
+
#### 用户选择「取消」
|
|
175
|
+
|
|
176
|
+
> 停止本次 sprint。
|
|
177
|
+
> 输出:`[CANCELLED] 用户取消 Sprint,AUTO-ESTIMATE 评估结果为 {estimated_level}`。
|
|
178
|
+
|
|
179
|
+
### 步骤 6: 路由执行
|
|
180
|
+
|
|
181
|
+
根据最终确定的流程级别,进入对应 Phase:
|
|
182
|
+
|
|
183
|
+
| 流程级别 | 路由 |
|
|
184
|
+
|---------|------|
|
|
185
|
+
| **轻量** | → Phase 0 THINK(reduced-intensity 流程,见 references/force-levels.md) |
|
|
186
|
+
| **标准** | → Phase 0 THINK(正常流程) |
|
|
187
|
+
| **复杂** | → Phase 0 THINK(完整流程 + 风险警告提示) |
|
|
188
|
+
|
|
189
|
+
**DELPHI-GATE invariant**: 所有流程级别(轻量/标准/复杂)的 Phase 2 BUILD 启动前,**必须**检查 `.sprint-state/delphi-reviewed.json` 的 verdict 为 `APPROVED`。未通过 delphi-review 直接路由到 BUILD 属于严重违规。
|
|
190
|
+
|
|
191
|
+
**轻量级的正确理解**: 轻量级意味着 reduced-intensity 的 delphi-review(**2 专家、1 轮、2/2 APPROVED、较短上下文**),**不是**跳过 delphi-review,**不是** 1 专家评审。见 references/force-levels.md 的轻量级流程定义。
|
|
192
|
+
|
|
193
|
+
**自动 escalation 规则**(检测到以下情况时,自动提升流程级别):
|
|
194
|
+
|
|
195
|
+
| 触发条件 | 原级别 | 提升级别 | 理由 |
|
|
196
|
+
|---------|--------|---------|------|
|
|
197
|
+
| 风险警告(循环依赖、Public API > 5) | 轻量 | 标准 | 技术风险需要标准流程 |
|
|
198
|
+
| 多位专家 disagreement 或 REQUEST_CHANGES | 轻量/标准 | 复杂 | 意见分歧需要更全面评审 |
|
|
199
|
+
| 涉及文件数 > 10 或 LOC > 500 | 轻量 | 标准 | 超出轻量级预算 |
|
|
200
|
+
| 修改公共 API(export 接口) | 轻量/标准 | 复杂 | API 变更影响范围广 |
|
|
201
|
+
| 检测到循环依赖 | 任何级别 | 复杂 | 架构风险强制复杂流程 |
|
|
202
|
+
| 相关测试文件缺失或覆盖率 < 80% | 轻量/标准 | 标准 | 需要补充测试 |
|
|
203
|
+
|
|
204
|
+
**跨参考**: 详见 references/force-levels.md 的各级别流程定义和强制规则。
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## 特殊场景处理
|
|
209
|
+
|
|
210
|
+
### 场景 1: 小改动(总计 < 20 行新增/删除代码)
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
# 检查预估改动量
|
|
214
|
+
git diff --stat HEAD 2>/dev/null # 如果有局部修改
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**处理**: 如果预估改动 < 20 行且涉及 ≤ 2 个文件,自动判定为「轻量」并告知用户,不强制展示完整 AUTO-ESTIMATE 面板。
|
|
218
|
+
|
|
219
|
+
**注意**: 轻量级仍需要完整的 Sprint Flow 流程(包括 delphi-review),只是 reduced-intensity。见 references/force-levels.md 的轻量级定义。**不会**绕过 DELPHI-GATE 直接路由到 BUILD。
|
|
220
|
+
|
|
221
|
+
### 场景 2: 无法提取目标关键词
|
|
222
|
+
|
|
223
|
+
**处理**: 询问用户「无法自动识别目标模块,请指定要分析的关键词(函数名/类名/模块名):」
|
|
224
|
+
|
|
225
|
+
### 场景 3: 用户输入包含多个独立需求
|
|
226
|
+
|
|
227
|
+
**处理**: 提示用户「检测到多个独立需求,建议分别执行 sprint。是否拆分?」→ 等待确认
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## 与学习循环的集成
|
|
232
|
+
|
|
233
|
+
### 数据收集
|
|
234
|
+
|
|
235
|
+
每次 sprint 完成(Phase 8 CLEANUP)后,将以下数据记录到 `.sprint-state/auto-estimate-learning.json`:
|
|
236
|
+
|
|
237
|
+
```json
|
|
238
|
+
{
|
|
239
|
+
"entries": [
|
|
240
|
+
{
|
|
241
|
+
"sprint_id": "sprint-YYYY-MM-DD-NN",
|
|
242
|
+
"estimated_level": "标准",
|
|
243
|
+
"user_decision": "accepted",
|
|
244
|
+
"actual_effort_phase_count": 5,
|
|
245
|
+
"actual_duration_minutes": 45,
|
|
246
|
+
"was_accurate": true
|
|
247
|
+
}
|
|
248
|
+
]
|
|
249
|
+
}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### 阈值优化
|
|
253
|
+
|
|
254
|
+
当积累 ≥ 20 条记录后,提示用户可以运行阈值分析:
|
|
255
|
+
|
|
256
|
+
> 已积累 {n} 条 AUTO-ESTIMATE 记录。是否运行阈值优化分析?
|
|
257
|
+
> 分析会检查:过度估计(建议标准但实际轻量)、低估(建议轻量但实际复杂),并推荐阈值调整。
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# AUTO-ESTIMATE 学习日志
|
|
2
|
+
|
|
3
|
+
本文件记录 AUTO-ESTIMATE 的用户纠偏历史和完成数据,用于阈值迭代优化。
|
|
4
|
+
|
|
5
|
+
## 文件位置
|
|
6
|
+
|
|
7
|
+
`.sprint-state/auto-estimate-learning.json`
|
|
8
|
+
|
|
9
|
+
## JSON Schema
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"entries": [
|
|
14
|
+
{
|
|
15
|
+
"sprint_id": "sprint-2026-06-01-14",
|
|
16
|
+
"task_description": "实现issue92 auto-estimate",
|
|
17
|
+
"change_type": "新增功能",
|
|
18
|
+
"estimated_level": "标准",
|
|
19
|
+
"estimated_metrics": {
|
|
20
|
+
"ref_count": null,
|
|
21
|
+
"cross_module_count": 2,
|
|
22
|
+
"circular_dep": false,
|
|
23
|
+
"public_api_count": 0,
|
|
24
|
+
"test_file_count": 0
|
|
25
|
+
},
|
|
26
|
+
"user_decision": "accepted",
|
|
27
|
+
"override_reason": null,
|
|
28
|
+
"actual_outcome": {
|
|
29
|
+
"phase_count": 3,
|
|
30
|
+
"duration_estimate": "30-45min",
|
|
31
|
+
"was_accurate": true,
|
|
32
|
+
"notes": "纯文档修改,实际确实为标准级别"
|
|
33
|
+
},
|
|
34
|
+
"timestamp": "2026-06-01T23:35:00+08:00"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"summary": {
|
|
38
|
+
"total_entries": 1,
|
|
39
|
+
"accepted_count": 1,
|
|
40
|
+
"overridden_count": 0,
|
|
41
|
+
"accurate_count": 1,
|
|
42
|
+
"over_estimate_count": 0,
|
|
43
|
+
"under_estimate_count": 0,
|
|
44
|
+
"last_updated": "2026-06-01T23:35:00+08:00"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## 字段说明
|
|
50
|
+
|
|
51
|
+
### Entry 级别
|
|
52
|
+
|
|
53
|
+
| 字段 | 类型 | 必填 | 说明 |
|
|
54
|
+
|------|------|------|------|
|
|
55
|
+
| `sprint_id` | string | ✅ | Sprint 标识符 |
|
|
56
|
+
| `task_description` | string | ✅ | 需求描述 |
|
|
57
|
+
| `change_type` | string | ✅ | 变更类型:`删除已存在代码` / `修改已存在代码` / `新增功能` / `Bug修复` |
|
|
58
|
+
| `estimated_level` | string | ✅ | 评估级别:`轻量` / `标准` / `复杂` |
|
|
59
|
+
| `estimated_metrics` | object | ✅ | 评估时的指标数据 |
|
|
60
|
+
| `user_decision` | string | ✅ | 用户决定:`accepted` / `overridden` / `cancelled` |
|
|
61
|
+
| `override_reason` | string | 条件 | 当 `user_decision` 为 `overridden` 时必填 |
|
|
62
|
+
| `actual_outcome` | object | 条件 | Sprint 完成后回填 |
|
|
63
|
+
| `timestamp` | string | ✅ | ISO 8601 时间戳 |
|
|
64
|
+
|
|
65
|
+
### actual_outcome 级别
|
|
66
|
+
|
|
67
|
+
| 字段 | 类型 | 必填 | 说明 |
|
|
68
|
+
|------|------|------|------|
|
|
69
|
+
| `phase_count` | number | ✅ | 实际执行的 phase 数 |
|
|
70
|
+
| `duration_estimate` | string | 推荐 | 实际耗时估算 |
|
|
71
|
+
| `was_accurate` | boolean | ✅ | 评估是否准确 |
|
|
72
|
+
| `notes` | string | 推荐 | 备注说明 |
|
|
73
|
+
|
|
74
|
+
### summary 级别
|
|
75
|
+
|
|
76
|
+
| 字段 | 类型 | 说明 |
|
|
77
|
+
|------|------|------|
|
|
78
|
+
| `total_entries` | number | 总条目数 |
|
|
79
|
+
| `accepted_count` | number | 接受建议数 |
|
|
80
|
+
| `overridden_count` | number | 用户修改数 |
|
|
81
|
+
| `accurate_count` | number | 评估准确数 |
|
|
82
|
+
| `over_estimate_count` | number | 高估数(建议标准但实际轻量) |
|
|
83
|
+
| `under_estimate_count` | number | 低估数(建议轻量但实际复杂) |
|
|
84
|
+
|
|
85
|
+
## 初始化
|
|
86
|
+
|
|
87
|
+
新 sprint 创建时,自动创建 `.sprint-state/auto-estimate-learning.json`:
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"entries": [],
|
|
92
|
+
"summary": {
|
|
93
|
+
"total_entries": 0,
|
|
94
|
+
"accepted_count": 0,
|
|
95
|
+
"overridden_count": 0,
|
|
96
|
+
"accurate_count": 0,
|
|
97
|
+
"over_estimate_count": 0,
|
|
98
|
+
"under_estimate_count": 0,
|
|
99
|
+
"last_updated": null
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## 阈值优化触发
|
|
105
|
+
|
|
106
|
+
当 `total_entries >= 20` 时,在 Phase 8 CLEANUP 阶段提示用户:
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
已积累 20 条 AUTO-ESTIMATE 记录。是否运行阈值优化分析?
|
|
110
|
+
|
|
111
|
+
当前准确率:{accurate_count / total_entries * 100}%
|
|
112
|
+
高估率:{over_estimate_count / total_entries * 100}%
|
|
113
|
+
低估率:{under_estimate_count / total_entries * 100}%
|
|
114
|
+
|
|
115
|
+
[运行分析] [跳过]
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## 阈值优化规则
|
|
119
|
+
|
|
120
|
+
### 高估模式检测
|
|
121
|
+
|
|
122
|
+
IF `over_estimate_count / total_entries > 30%`:
|
|
123
|
+
→ 建议降低「标准」→「复杂」的引用计数阈值(当前 >10)
|
|
124
|
+
→ 分析高估的共性:是否某个指标权重过高?
|
|
125
|
+
|
|
126
|
+
### 低估模式检测
|
|
127
|
+
|
|
128
|
+
IF `under_estimate_count / total_entries > 20%`:
|
|
129
|
+
→ 建议增加额外检查项(如循环依赖、测试文件数)
|
|
130
|
+
→ 分析低估的共性:是否遗漏了关键复杂度信号?
|
|
131
|
+
|
|
132
|
+
### 纠偏频率检测
|
|
133
|
+
|
|
134
|
+
IF `overridden_count / total_entries > 30%`:
|
|
135
|
+
→ 用户频繁修改建议 → 阈值体系可能有问题
|
|
136
|
+
→ 建议全面阈值校准
|