claude-code-workflow 6.3.13 → 6.3.16
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/agents/issue-plan-agent.md +57 -103
- package/.claude/agents/issue-queue-agent.md +69 -120
- package/.claude/commands/issue/new.md +217 -473
- package/.claude/commands/issue/plan.md +76 -154
- package/.claude/commands/issue/queue.md +208 -259
- package/.claude/skills/issue-manage/SKILL.md +63 -22
- package/.claude/workflows/cli-templates/schemas/discovery-finding-schema.json +3 -3
- package/.claude/workflows/cli-templates/schemas/issues-jsonl-schema.json +3 -3
- package/.claude/workflows/cli-templates/schemas/queue-schema.json +0 -5
- package/.codex/prompts/issue-plan.md +16 -19
- package/.codex/prompts/issue-queue.md +0 -1
- package/README.md +1 -0
- package/ccw/dist/cli.d.ts.map +1 -1
- package/ccw/dist/cli.js +4 -1
- package/ccw/dist/cli.js.map +1 -1
- package/ccw/dist/commands/cli.d.ts +1 -0
- package/ccw/dist/commands/cli.d.ts.map +1 -1
- package/ccw/dist/commands/cli.js +59 -6
- package/ccw/dist/commands/cli.js.map +1 -1
- package/ccw/dist/commands/issue.d.ts +3 -1
- package/ccw/dist/commands/issue.d.ts.map +1 -1
- package/ccw/dist/commands/issue.js +383 -30
- package/ccw/dist/commands/issue.js.map +1 -1
- package/ccw/dist/core/routes/issue-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/issue-routes.js +77 -16
- package/ccw/dist/core/routes/issue-routes.js.map +1 -1
- package/ccw/dist/tools/cli-executor.d.ts.map +1 -1
- package/ccw/dist/tools/cli-executor.js +119 -4
- package/ccw/dist/tools/cli-executor.js.map +1 -1
- package/ccw/dist/tools/litellm-executor.d.ts +4 -0
- package/ccw/dist/tools/litellm-executor.d.ts.map +1 -1
- package/ccw/dist/tools/litellm-executor.js +54 -1
- package/ccw/dist/tools/litellm-executor.js.map +1 -1
- package/ccw/dist/tools/ui-generate-preview.d.ts +18 -0
- package/ccw/dist/tools/ui-generate-preview.d.ts.map +1 -1
- package/ccw/dist/tools/ui-generate-preview.js +26 -10
- package/ccw/dist/tools/ui-generate-preview.js.map +1 -1
- package/ccw/src/cli.ts +4 -1
- package/ccw/src/commands/cli.ts +64 -6
- package/ccw/src/commands/issue.ts +442 -34
- package/ccw/src/core/routes/issue-routes.ts +82 -16
- package/ccw/src/tools/cli-executor.ts +127 -4
- package/ccw/src/tools/litellm-executor.ts +107 -24
- package/ccw/src/tools/ui-generate-preview.js +60 -37
- package/codex-lens/src/codexlens/__pycache__/config.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/__pycache__/entities.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/config.py +25 -2
- package/codex-lens/src/codexlens/entities.py +5 -1
- package/codex-lens/src/codexlens/indexing/__pycache__/symbol_extractor.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/indexing/symbol_extractor.py +243 -243
- package/codex-lens/src/codexlens/parsers/__pycache__/factory.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/parsers/__pycache__/treesitter_parser.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/parsers/factory.py +256 -256
- package/codex-lens/src/codexlens/parsers/treesitter_parser.py +335 -335
- package/codex-lens/src/codexlens/search/__pycache__/chain_search.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/__pycache__/hybrid_search.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/__pycache__/ranking.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/chain_search.py +30 -1
- package/codex-lens/src/codexlens/semantic/__pycache__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/__pycache__/embedder.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/__pycache__/reranker.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/__pycache__/vector_store.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/embedder.py +6 -9
- package/codex-lens/src/codexlens/semantic/vector_store.py +271 -200
- package/codex-lens/src/codexlens/storage/__pycache__/dir_index.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/__pycache__/index_tree.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/__pycache__/sqlite_store.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/sqlite_store.py +184 -108
- package/package.json +6 -1
- package/.claude/commands/issue/manage.md +0 -113
|
@@ -3,14 +3,6 @@ name: issue-plan-agent
|
|
|
3
3
|
description: |
|
|
4
4
|
Closed-loop issue planning agent combining ACE exploration and solution generation.
|
|
5
5
|
Receives issue IDs, explores codebase, generates executable solutions with 5-phase tasks.
|
|
6
|
-
|
|
7
|
-
Examples:
|
|
8
|
-
- Context: Single issue planning
|
|
9
|
-
user: "Plan GH-123"
|
|
10
|
-
assistant: "I'll fetch issue details, explore codebase, and generate solution"
|
|
11
|
-
- Context: Batch planning
|
|
12
|
-
user: "Plan GH-123,GH-124,GH-125"
|
|
13
|
-
assistant: "I'll plan 3 issues, detect conflicts, and register solutions"
|
|
14
6
|
color: green
|
|
15
7
|
---
|
|
16
8
|
|
|
@@ -22,7 +14,7 @@ color: green
|
|
|
22
14
|
- ACE semantic search for intelligent code discovery
|
|
23
15
|
- Batch processing (1-3 issues per invocation)
|
|
24
16
|
- 5-phase task lifecycle (analyze → implement → test → optimize → commit)
|
|
25
|
-
-
|
|
17
|
+
- Conflict-aware planning (isolate file modifications across issues)
|
|
26
18
|
- Dependency DAG validation
|
|
27
19
|
- Auto-bind for single solution, return for selection on multiple
|
|
28
20
|
|
|
@@ -47,16 +39,14 @@ color: green
|
|
|
47
39
|
### 1.2 Execution Flow
|
|
48
40
|
|
|
49
41
|
```
|
|
50
|
-
Phase 1: Issue Understanding (
|
|
42
|
+
Phase 1: Issue Understanding (10%)
|
|
51
43
|
↓ Fetch details, extract requirements, determine complexity
|
|
52
|
-
Phase 2: ACE Exploration (
|
|
44
|
+
Phase 2: ACE Exploration (30%)
|
|
53
45
|
↓ Semantic search, pattern discovery, dependency mapping
|
|
54
46
|
Phase 3: Solution Planning (45%)
|
|
55
47
|
↓ Task decomposition, 5-phase lifecycle, acceptance criteria
|
|
56
|
-
Phase 4: Validation & Output (
|
|
57
|
-
↓ DAG validation,
|
|
58
|
-
Phase 5: Conflict Analysis (15%)
|
|
59
|
-
↓ Gemini CLI multi-solution conflict detection
|
|
48
|
+
Phase 4: Validation & Output (15%)
|
|
49
|
+
↓ DAG validation, solution registration, binding
|
|
60
50
|
```
|
|
61
51
|
|
|
62
52
|
#### Phase 1: Issue Understanding
|
|
@@ -180,87 +170,53 @@ function decomposeTasks(issue, exploration) {
|
|
|
180
170
|
**Validation**:
|
|
181
171
|
- DAG validation (no circular dependencies)
|
|
182
172
|
- Task validation (all 5 phases present)
|
|
183
|
-
-
|
|
173
|
+
- File isolation check (ensure minimal overlap across issues in batch)
|
|
184
174
|
|
|
185
|
-
**Solution Registration** (
|
|
186
|
-
```javascript
|
|
187
|
-
for (const issue of issues) {
|
|
188
|
-
const solutions = generatedSolutions[issue.id];
|
|
189
|
-
|
|
190
|
-
if (solutions.length === 1) {
|
|
191
|
-
// Single solution → auto-bind
|
|
192
|
-
Bash(`ccw issue bind ${issue.id} --solution ${solutions[0].file}`);
|
|
193
|
-
bound.push({ issue_id: issue.id, solution_id: solutions[0].id, task_count: solutions[0].tasks.length });
|
|
194
|
-
} else {
|
|
195
|
-
// Multiple solutions → DO NOT BIND, return for user selection
|
|
196
|
-
pending_selection.push({
|
|
197
|
-
issue_id: issue.id,
|
|
198
|
-
solutions: solutions.map(s => ({ id: s.id, description: s.description, task_count: s.tasks.length }))
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
```
|
|
175
|
+
**Solution Registration** (via file write):
|
|
203
176
|
|
|
204
|
-
|
|
177
|
+
**Step 1: Create solution files**
|
|
205
178
|
|
|
206
|
-
|
|
179
|
+
Write solution JSON to JSONL file (one line per solution):
|
|
207
180
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
3. **Data Model Conflicts**: Schema changes
|
|
212
|
-
4. **Dependency Conflicts**: Package version conflicts
|
|
213
|
-
5. **Architecture Conflicts**: Pattern violations
|
|
181
|
+
```
|
|
182
|
+
.workflow/issues/solutions/{issue-id}.jsonl
|
|
183
|
+
```
|
|
214
184
|
|
|
215
|
-
**
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
files_modified: extractFilesFromTasks(sol.tasks),
|
|
224
|
-
api_changes: extractApiChanges(sol.tasks),
|
|
225
|
-
data_changes: extractDataChanges(sol.tasks)
|
|
226
|
-
}));
|
|
227
|
-
|
|
228
|
-
const prompt = `
|
|
229
|
-
PURPOSE: Detect conflicts between solution implementations; identify all conflict types; provide resolution recommendations
|
|
230
|
-
TASK: • Analyze file overlaps • Check API breaking changes • Detect schema conflicts • Find dependency conflicts • Identify architecture violations
|
|
231
|
-
MODE: analysis
|
|
232
|
-
CONTEXT: Solution summaries
|
|
233
|
-
EXPECTED: JSON conflict report with type, severity, solutions_affected, resolution_strategy
|
|
234
|
-
RULES: $(cat ~/.claude/workflows/cli-templates/protocols/analysis-protocol.md) | Mark severity (high/medium/low) | Provide recommended_order
|
|
235
|
-
|
|
236
|
-
SOLUTIONS:
|
|
237
|
-
${JSON.stringify(solutionSummaries, null, 2)}
|
|
238
|
-
|
|
239
|
-
OUTPUT FORMAT:
|
|
185
|
+
**File Format** (JSONL - each line is a complete solution):
|
|
186
|
+
```
|
|
187
|
+
{"id":"SOL-GH-123-1","description":"...","approach":"...","analysis":{...},"score":0.85,"tasks":[...]}
|
|
188
|
+
{"id":"SOL-GH-123-2","description":"...","approach":"...","analysis":{...},"score":0.75,"tasks":[...]}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
**Solution Schema** (must match CLI `Solution` interface):
|
|
192
|
+
```typescript
|
|
240
193
|
{
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
"rationale": "why this order"
|
|
249
|
-
}],
|
|
250
|
-
"safe_parallel": [["SOL-GH-124-1", "SOL-GH-125-1"]]
|
|
251
|
-
}
|
|
252
|
-
`;
|
|
253
|
-
|
|
254
|
-
const taskId = Bash({
|
|
255
|
-
command: `ccw cli -p "${prompt}" --tool gemini --mode analysis --cd "${projectRoot}"`,
|
|
256
|
-
run_in_background: true, timeout: 900000
|
|
257
|
-
});
|
|
258
|
-
const output = TaskOutput({ task_id: taskId, block: true });
|
|
259
|
-
return JSON.parse(extractJsonFromMarkdown(output));
|
|
194
|
+
id: string; // Format: SOL-{issue-id}-{N}
|
|
195
|
+
description?: string;
|
|
196
|
+
approach?: string;
|
|
197
|
+
tasks: SolutionTask[];
|
|
198
|
+
analysis?: { risk, impact, complexity };
|
|
199
|
+
score?: number;
|
|
200
|
+
// Note: is_bound, created_at are added by CLI on read
|
|
260
201
|
}
|
|
261
202
|
```
|
|
262
203
|
|
|
263
|
-
**
|
|
204
|
+
**Write Operation**:
|
|
205
|
+
```javascript
|
|
206
|
+
// Append solution to JSONL file (one line per solution)
|
|
207
|
+
const solutionId = `SOL-${issueId}-${seq}`;
|
|
208
|
+
const solutionLine = JSON.stringify({ id: solutionId, ...solution });
|
|
209
|
+
|
|
210
|
+
// Read existing, append new line, write back
|
|
211
|
+
const filePath = `.workflow/issues/solutions/${issueId}.jsonl`;
|
|
212
|
+
const existing = existsSync(filePath) ? readFileSync(filePath) : '';
|
|
213
|
+
const newContent = existing.trimEnd() + (existing ? '\n' : '') + solutionLine + '\n';
|
|
214
|
+
Write({ file_path: filePath, content: newContent })
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**Step 2: Bind decision**
|
|
218
|
+
- **Single solution** → Auto-bind: `ccw issue bind <issue-id> <solution-id>`
|
|
219
|
+
- **Multiple solutions** → Return for user selection (no bind)
|
|
264
220
|
|
|
265
221
|
---
|
|
266
222
|
|
|
@@ -279,7 +235,7 @@ Each line is a solution JSON containing tasks. Schema: `cat .claude/workflows/cl
|
|
|
279
235
|
|
|
280
236
|
| Scenario | Action |
|
|
281
237
|
|----------|--------|
|
|
282
|
-
| Single solution | `ccw issue bind <id>
|
|
238
|
+
| Single solution | `ccw issue bind <issue-id> <solution-id>` (auto) |
|
|
283
239
|
| Multiple solutions | Register only, return for selection |
|
|
284
240
|
|
|
285
241
|
### 2.3 Return Summary
|
|
@@ -287,17 +243,7 @@ Each line is a solution JSON containing tasks. Schema: `cat .claude/workflows/cl
|
|
|
287
243
|
```json
|
|
288
244
|
{
|
|
289
245
|
"bound": [{ "issue_id": "...", "solution_id": "...", "task_count": N }],
|
|
290
|
-
"pending_selection": [{ "issue_id": "GH-123", "solutions": [{ "id": "SOL-GH-123-1", "description": "...", "task_count": N }] }]
|
|
291
|
-
"conflicts": [{
|
|
292
|
-
"type": "file_conflict|api_conflict|data_conflict|dependency_conflict|architecture_conflict",
|
|
293
|
-
"severity": "high|medium|low",
|
|
294
|
-
"solutions_affected": ["SOL-GH-123-1", "SOL-GH-123-2"],
|
|
295
|
-
"summary": "brief description",
|
|
296
|
-
"resolution_strategy": "sequential|parallel_with_coordination",
|
|
297
|
-
"recommended_order": ["SOL-GH-123-1", "SOL-GH-123-2"],
|
|
298
|
-
"recommended_resolution": "Use sequential execution: SOL-GH-123-1 first",
|
|
299
|
-
"resolution_options": [{ "strategy": "...", "rationale": "..." }]
|
|
300
|
-
}]
|
|
246
|
+
"pending_selection": [{ "issue_id": "GH-123", "solutions": [{ "id": "SOL-GH-123-1", "description": "...", "task_count": N }] }]
|
|
301
247
|
}
|
|
302
248
|
```
|
|
303
249
|
|
|
@@ -332,8 +278,16 @@ Each line is a solution JSON containing tasks. Schema: `cat .claude/workflows/cl
|
|
|
332
278
|
4. Quantify acceptance.criteria with testable conditions
|
|
333
279
|
5. Validate DAG before output
|
|
334
280
|
6. Evaluate each solution with `analysis` and `score`
|
|
335
|
-
7.
|
|
281
|
+
7. Write solutions to `.workflow/issues/solutions/{issue-id}.jsonl` (append mode)
|
|
336
282
|
8. For HIGH complexity: generate 2-3 candidate solutions
|
|
283
|
+
9. **Solution ID format**: `SOL-{issue-id}-{N}` (e.g., `SOL-GH-123-1`, `SOL-GH-123-2`)
|
|
284
|
+
|
|
285
|
+
**CONFLICT AVOIDANCE** (for batch processing of similar issues):
|
|
286
|
+
1. **File isolation**: Each issue's solution should target distinct files when possible
|
|
287
|
+
2. **Module boundaries**: Prefer solutions that modify different modules/directories
|
|
288
|
+
3. **Multiple solutions**: When file overlap is unavoidable, generate alternative solutions with different file targets
|
|
289
|
+
4. **Dependency ordering**: If issues must touch same files, encode execution order via `depends_on`
|
|
290
|
+
5. **Scope minimization**: Prefer smaller, focused modifications over broad refactoring
|
|
337
291
|
|
|
338
292
|
**NEVER**:
|
|
339
293
|
1. Execute implementation (return plan only)
|
|
@@ -343,6 +297,6 @@ Each line is a solution JSON containing tasks. Schema: `cat .claude/workflows/cl
|
|
|
343
297
|
5. **Bind when multiple solutions exist** - MUST check `solutions.length === 1` before calling `ccw issue bind`
|
|
344
298
|
|
|
345
299
|
**OUTPUT**:
|
|
346
|
-
1.
|
|
347
|
-
2.
|
|
348
|
-
3.
|
|
300
|
+
1. Write solutions to `.workflow/issues/solutions/{issue-id}.jsonl` (JSONL format)
|
|
301
|
+
2. Single solution → `ccw issue bind <issue-id> <solution-id>`; Multiple → return only
|
|
302
|
+
3. Return JSON with `bound`, `pending_selection`
|
|
@@ -1,26 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: issue-queue-agent
|
|
3
3
|
description: |
|
|
4
|
-
Solution ordering agent for queue formation with
|
|
5
|
-
Receives solutions from bound issues,
|
|
6
|
-
|
|
7
|
-
Examples:
|
|
8
|
-
- Context: Single issue queue
|
|
9
|
-
user: "Order solutions for GH-123"
|
|
10
|
-
assistant: "I'll analyze dependencies and generate execution queue"
|
|
11
|
-
- Context: Multi-issue queue with conflicts
|
|
12
|
-
user: "Order solutions for GH-123, GH-124"
|
|
13
|
-
assistant: "I'll detect file conflicts between solutions, resolve ordering, and assign groups"
|
|
4
|
+
Solution ordering agent for queue formation with Gemini CLI conflict analysis.
|
|
5
|
+
Receives solutions from bound issues, uses Gemini for intelligent conflict detection, produces ordered execution queue.
|
|
14
6
|
color: orange
|
|
15
7
|
---
|
|
16
8
|
|
|
17
9
|
## Overview
|
|
18
10
|
|
|
19
|
-
**Agent Role**: Queue formation agent that transforms solutions from bound issues into an ordered execution queue.
|
|
11
|
+
**Agent Role**: Queue formation agent that transforms solutions from bound issues into an ordered execution queue. Uses Gemini CLI for intelligent conflict detection, resolves ordering, and assigns parallel/sequential groups.
|
|
20
12
|
|
|
21
13
|
**Core Capabilities**:
|
|
22
14
|
- Inter-solution dependency DAG construction
|
|
23
|
-
-
|
|
15
|
+
- Gemini CLI conflict analysis (5 types: file, API, data, dependency, architecture)
|
|
24
16
|
- Conflict resolution with semantic ordering rules
|
|
25
17
|
- Priority calculation (0.0-1.0) per solution
|
|
26
18
|
- Parallel/Sequential group assignment for solutions
|
|
@@ -70,84 +62,50 @@ Phase 4: Ordering & Grouping (25%)
|
|
|
70
62
|
|
|
71
63
|
### 2.1 Dependency Graph
|
|
72
64
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
65
|
+
**Build DAG from solutions**:
|
|
66
|
+
1. Create node for each solution with `inDegree: 0` and `outEdges: []`
|
|
67
|
+
2. Build file→solutions mapping from `files_touched`
|
|
68
|
+
3. For files touched by multiple solutions → potential conflict edges
|
|
69
|
+
|
|
70
|
+
**Graph Structure**:
|
|
71
|
+
- Nodes: Solutions (keyed by `solution_id`)
|
|
72
|
+
- Edges: Dependency relationships (added during conflict resolution)
|
|
73
|
+
- Properties: `inDegree` (incoming edges), `outEdges` (outgoing dependencies)
|
|
74
|
+
|
|
75
|
+
### 2.2 Conflict Detection (Gemini CLI)
|
|
76
|
+
|
|
77
|
+
Use Gemini CLI for intelligent conflict analysis across all solutions:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
ccw cli -p "
|
|
81
|
+
PURPOSE: Analyze solutions for conflicts across 5 dimensions
|
|
82
|
+
TASK: • Detect file conflicts (same file modified by multiple solutions)
|
|
83
|
+
• Detect API conflicts (breaking interface changes)
|
|
84
|
+
• Detect data conflicts (schema changes to same model)
|
|
85
|
+
• Detect dependency conflicts (package version mismatches)
|
|
86
|
+
• Detect architecture conflicts (pattern violations)
|
|
87
|
+
MODE: analysis
|
|
88
|
+
CONTEXT: @.workflow/issues/solutions/**/*.jsonl | Solution data: \${SOLUTIONS_JSON}
|
|
89
|
+
EXPECTED: JSON array of conflicts with type, severity, solutions, recommended_order
|
|
90
|
+
RULES: $(cat ~/.claude/workflows/cli-templates/protocols/analysis-protocol.md) | Severity: high (API/data) > medium (file/dependency) > low (architecture)
|
|
91
|
+
" --tool gemini --mode analysis --cd .workflow/issues
|
|
89
92
|
```
|
|
90
93
|
|
|
91
|
-
|
|
94
|
+
**Placeholder**: `${SOLUTIONS_JSON}` = serialized solutions array from bound issues
|
|
92
95
|
|
|
93
|
-
|
|
94
|
-
```javascript
|
|
95
|
-
function detectConflicts(solutions, graph) {
|
|
96
|
-
const conflicts = [];
|
|
97
|
-
const fileModifications = buildFileModificationMap(solutions);
|
|
98
|
-
|
|
99
|
-
// 1. File conflicts (multiple solutions modify same file)
|
|
100
|
-
for (const [file, solIds] of fileModifications.entries()) {
|
|
101
|
-
if (solIds.length > 1) {
|
|
102
|
-
conflicts.push({
|
|
103
|
-
type: 'file_conflict', severity: 'medium',
|
|
104
|
-
file, solutions: solIds, resolved: false
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// 2. API conflicts (breaking interface changes)
|
|
110
|
-
const apiChanges = extractApiChangesFromAllSolutions(solutions);
|
|
111
|
-
for (const [api, changes] of apiChanges.entries()) {
|
|
112
|
-
if (changes.some(c => c.breaking)) {
|
|
113
|
-
conflicts.push({
|
|
114
|
-
type: 'api_conflict', severity: 'high',
|
|
115
|
-
api, solutions: changes.map(c => c.solution_id), resolved: false
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// 3. Data model conflicts (schema changes to same model)
|
|
121
|
-
const dataChanges = extractDataChangesFromAllSolutions(solutions);
|
|
122
|
-
for (const [model, changes] of dataChanges.entries()) {
|
|
123
|
-
if (changes.length > 1) {
|
|
124
|
-
conflicts.push({
|
|
125
|
-
type: 'data_conflict', severity: 'high',
|
|
126
|
-
model, solutions: changes.map(c => c.solution_id), resolved: false
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// 4. Dependency conflicts (package version conflicts)
|
|
132
|
-
const depChanges = extractDependencyChanges(solutions);
|
|
133
|
-
for (const [pkg, versions] of depChanges.entries()) {
|
|
134
|
-
if (versions.length > 1 && !versionsCompatible(versions)) {
|
|
135
|
-
conflicts.push({
|
|
136
|
-
type: 'dependency_conflict', severity: 'medium',
|
|
137
|
-
package: pkg, solutions: versions.map(v => v.solution_id), resolved: false
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
}
|
|
96
|
+
**Conflict Types & Severity**:
|
|
141
97
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
98
|
+
| Type | Severity | Trigger |
|
|
99
|
+
|------|----------|---------|
|
|
100
|
+
| `file_conflict` | medium | Multiple solutions modify same file |
|
|
101
|
+
| `api_conflict` | high | Breaking interface changes |
|
|
102
|
+
| `data_conflict` | high | Schema changes to same model |
|
|
103
|
+
| `dependency_conflict` | medium | Package version mismatches |
|
|
104
|
+
| `architecture_conflict` | low | Pattern violations |
|
|
148
105
|
|
|
149
|
-
|
|
150
|
-
|
|
106
|
+
**Output per conflict**:
|
|
107
|
+
```json
|
|
108
|
+
{ "type": "...", "severity": "...", "solutions": [...], "recommended_order": [...], "rationale": "..." }
|
|
151
109
|
```
|
|
152
110
|
|
|
153
111
|
### 2.2.5 Clarification (BLOCKING)
|
|
@@ -155,37 +113,22 @@ function detectConflicts(solutions, graph) {
|
|
|
155
113
|
**Purpose**: Surface ambiguous dependencies for user/system clarification
|
|
156
114
|
|
|
157
115
|
**Trigger Conditions**:
|
|
158
|
-
- High severity conflicts
|
|
116
|
+
- High severity conflicts without `recommended_order` from Gemini analysis
|
|
159
117
|
- Circular dependencies detected
|
|
160
118
|
- Multiple valid resolution strategies
|
|
161
119
|
|
|
162
|
-
**Clarification
|
|
163
|
-
```javascript
|
|
164
|
-
function generateClarifications(conflicts, solutions) {
|
|
165
|
-
const clarifications = [];
|
|
166
|
-
|
|
167
|
-
for (const conflict of conflicts) {
|
|
168
|
-
if (conflict.severity === 'high' && !conflict.recommended_order) {
|
|
169
|
-
clarifications.push({
|
|
170
|
-
conflict_id: `CFT-${clarifications.length + 1}`,
|
|
171
|
-
question: `${conflict.type}: Which solution should execute first?`,
|
|
172
|
-
options: conflict.solutions.map(solId => ({
|
|
173
|
-
value: solId,
|
|
174
|
-
label: getSolutionSummary(solId, solutions)
|
|
175
|
-
})),
|
|
176
|
-
requires_user_input: true
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
}
|
|
120
|
+
**Clarification Generation**:
|
|
180
121
|
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
|
|
122
|
+
For each unresolved high-severity conflict:
|
|
123
|
+
1. Generate conflict ID: `CFT-{N}`
|
|
124
|
+
2. Build question: `"{type}: Which solution should execute first?"`
|
|
125
|
+
3. List options with solution summaries (issue title + task count)
|
|
126
|
+
4. Mark `requires_user_input: true`
|
|
184
127
|
|
|
185
|
-
**Blocking Behavior**:
|
|
128
|
+
**Blocking Behavior**:
|
|
186
129
|
- Return `clarifications` array in output
|
|
187
130
|
- Main agent presents to user via AskUserQuestion
|
|
188
|
-
- Agent
|
|
131
|
+
- Agent BLOCKS until all clarifications resolved
|
|
189
132
|
- No best-guess fallback - explicit user decision required
|
|
190
133
|
|
|
191
134
|
### 2.3 Resolution Rules
|
|
@@ -253,7 +196,6 @@ Queue Item ID format: `S-N` (S-1, S-2, S-3, ...)
|
|
|
253
196
|
"execution_group": "P1",
|
|
254
197
|
"depends_on": [],
|
|
255
198
|
"semantic_priority": 0.8,
|
|
256
|
-
"assigned_executor": "codex",
|
|
257
199
|
"files_touched": ["src/auth.ts", "src/utils.ts"],
|
|
258
200
|
"task_count": 3
|
|
259
201
|
}
|
|
@@ -345,14 +287,21 @@ Return brief summaries; full conflict details in separate files:
|
|
|
345
287
|
5. Merge conflicting solutions in parallel group
|
|
346
288
|
6. Split tasks from their solution
|
|
347
289
|
|
|
348
|
-
**
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
290
|
+
**WRITE** (exactly 2 files):
|
|
291
|
+
- `.workflow/issues/queues/{Queue ID}.json` - Full queue with solutions, groups
|
|
292
|
+
- `.workflow/issues/queues/index.json` - Update with new queue entry
|
|
293
|
+
- Use Queue ID from prompt, do NOT generate new one
|
|
294
|
+
|
|
295
|
+
**RETURN** (summary + unresolved conflicts):
|
|
296
|
+
```json
|
|
297
|
+
{
|
|
298
|
+
"queue_id": "QUE-xxx",
|
|
299
|
+
"total_solutions": N,
|
|
300
|
+
"total_tasks": N,
|
|
301
|
+
"execution_groups": [{"id": "P1", "type": "parallel", "count": N}],
|
|
302
|
+
"issues_queued": ["ISS-xxx"],
|
|
303
|
+
"clarifications": [{"conflict_id": "CFT-1", "question": "...", "options": [...]}]
|
|
304
|
+
}
|
|
352
305
|
```
|
|
353
|
-
-
|
|
354
|
-
-
|
|
355
|
-
- Final return: PURE JSON summary (no markdown, no prose):
|
|
356
|
-
```json
|
|
357
|
-
{"queue_id":"QUE-xxx","total_solutions":N,"total_tasks":N,"execution_groups":[...],"conflicts_resolved":N,"issues_queued":["ISS-xxx"]}
|
|
358
|
-
```
|
|
306
|
+
- `clarifications`: Only present if unresolved high-severity conflicts exist
|
|
307
|
+
- No markdown, no prose - PURE JSON only
|