mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-05 01:50:27 +08:00
refactor: Update issue queue structure and commands
- Changed queue structure from 'queue' to 'tasks' in various files for clarity. - Updated CLI commands to reflect new task ID usage instead of queue ID. - Enhanced queue management with new delete functionality for historical queues. - Improved metadata handling and task execution tracking. - Updated dashboard and issue manager views to accommodate new task structure. - Bumped version to 6.3.8 in package.json and package-lock.json.
This commit is contained in:
@@ -20,14 +20,7 @@ You are a specialized issue planning agent that combines exploration and plannin
|
||||
```javascript
|
||||
{
|
||||
// Required
|
||||
issues: [
|
||||
{
|
||||
id: string, // Issue ID (e.g., "GH-123")
|
||||
title: string, // Issue title
|
||||
description: string, // Issue description
|
||||
context: string // Additional context from context.md
|
||||
}
|
||||
],
|
||||
issue_ids: string[], // Issue IDs only (e.g., ["GH-123", "GH-124"])
|
||||
project_root: string, // Project root path for ACE search
|
||||
|
||||
// Optional
|
||||
@@ -36,6 +29,8 @@ You are a specialized issue planning agent that combines exploration and plannin
|
||||
}
|
||||
```
|
||||
|
||||
**Note**: Agent receives IDs only. Use `ccw issue status <id> --json` to fetch full details.
|
||||
|
||||
## Schema-Driven Output
|
||||
|
||||
**CRITICAL**: Read the solution schema first to determine output structure:
|
||||
@@ -65,6 +60,31 @@ Phase 4: Validation & Output (15%)
|
||||
|
||||
## Phase 1: Issue Understanding
|
||||
|
||||
### Step 1: Fetch Issue Details via CLI
|
||||
|
||||
For each issue ID received, fetch full details:
|
||||
|
||||
```bash
|
||||
ccw issue status <issue-id> --json
|
||||
```
|
||||
|
||||
Returns:
|
||||
```json
|
||||
{
|
||||
"issue": {
|
||||
"id": "GH-123",
|
||||
"title": "Add authentication",
|
||||
"context": "...",
|
||||
"affected_components": ["auth", "api"],
|
||||
"lifecycle_requirements": { "test_strategy": "unit", "regression_scope": "affected" }
|
||||
},
|
||||
"solutions": [],
|
||||
"bound": null
|
||||
}
|
||||
```
|
||||
|
||||
### Step 2: Analyze Issue
|
||||
|
||||
**Extract from each issue**:
|
||||
- Title and description analysis
|
||||
- Key requirements and constraints
|
||||
@@ -661,6 +681,23 @@ function generateOutput(solutions, conflicts) {
|
||||
}
|
||||
```
|
||||
|
||||
### Solution Registration via CLI
|
||||
|
||||
**IMPORTANT**: Register solutions using CLI instead of direct file writes:
|
||||
|
||||
```bash
|
||||
# 1. Write solution JSON to temp file
|
||||
echo '<solution-json>' > /tmp/sol-{issue-id}.json
|
||||
|
||||
# 2. Register solution via CLI (auto-generates SOL-xxx ID)
|
||||
ccw issue bind {issue-id} --solution /tmp/sol-{issue-id}.json
|
||||
```
|
||||
|
||||
**CLI Output**: Returns registered solution ID for summary:
|
||||
```
|
||||
✓ Solution SOL-20251227-001 registered (5 tasks)
|
||||
```
|
||||
|
||||
### Solution Schema (Closed-Loop Tasks)
|
||||
|
||||
Each task MUST include ALL 5 lifecycle phases:
|
||||
|
||||
@@ -500,35 +500,35 @@ function canRunParallel(taskKey, groupTasks, taskGraph, conflicts) {
|
||||
```javascript
|
||||
function generateQueueItems(orderedTasks, taskGraph, conflicts) {
|
||||
const queueItems = []
|
||||
let queueIdCounter = 1
|
||||
let itemIdCounter = 1
|
||||
|
||||
for (const key of orderedTasks) {
|
||||
const node = taskGraph.get(key)
|
||||
|
||||
queueItems.push({
|
||||
queue_id: `Q-${String(queueIdCounter++).padStart(3, '0')}`,
|
||||
item_id: `T-${itemIdCounter++}`,
|
||||
issue_id: node.issue_id,
|
||||
solution_id: node.solution_id,
|
||||
task_id: node.task.id,
|
||||
status: 'pending',
|
||||
execution_order: node.execution_order,
|
||||
execution_group: node.execution_group,
|
||||
depends_on: mapDependenciesToQueueIds(node, queueItems),
|
||||
depends_on: mapDependenciesToItemIds(node, queueItems),
|
||||
semantic_priority: node.semantic_priority,
|
||||
queued_at: new Date().toISOString()
|
||||
assigned_executor: node.task.executor || 'codex'
|
||||
})
|
||||
}
|
||||
|
||||
return queueItems
|
||||
}
|
||||
|
||||
function mapDependenciesToQueueIds(node, queueItems) {
|
||||
function mapDependenciesToItemIds(node, queueItems) {
|
||||
return (node.task.depends_on || []).map(dep => {
|
||||
const depKey = `${node.issue_id}:${dep}`
|
||||
const queueItem = queueItems.find(q =>
|
||||
q.issue_id === node.issue_id && q.task_id === dep
|
||||
)
|
||||
return queueItem?.queue_id || dep
|
||||
return queueItem?.item_id || dep
|
||||
})
|
||||
}
|
||||
```
|
||||
@@ -538,7 +538,7 @@ function mapDependenciesToQueueIds(node, queueItems) {
|
||||
```javascript
|
||||
function generateOutput(queueItems, conflicts, groups) {
|
||||
return {
|
||||
queue: queueItems,
|
||||
tasks: queueItems,
|
||||
conflicts: conflicts.map(c => ({
|
||||
type: c.type,
|
||||
file: c.file,
|
||||
@@ -652,10 +652,10 @@ function validateOrdering(queueItems, taskGraph) {
|
||||
const node = taskGraph.get(key)
|
||||
|
||||
// Check dependencies come before
|
||||
for (const depQueueId of item.depends_on) {
|
||||
const depItem = queueItems.find(q => q.queue_id === depQueueId)
|
||||
for (const depItemId of item.depends_on) {
|
||||
const depItem = queueItems.find(q => q.item_id === depItemId)
|
||||
if (depItem && depItem.execution_order >= item.execution_order) {
|
||||
errors.push(`${item.queue_id} ordered before dependency ${depQueueId}`)
|
||||
errors.push(`${item.item_id} ordered before dependency ${depItemId}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -690,7 +690,7 @@ function validateOrdering(queueItems, taskGraph) {
|
||||
5. Calculate semantic priority for all tasks
|
||||
6. Validate ordering before output
|
||||
7. Include rationale for conflict resolutions
|
||||
8. Map depends_on to queue_ids in output
|
||||
8. Map depends_on to item_ids in output
|
||||
|
||||
**NEVER**:
|
||||
1. Execute tasks (ordering only)
|
||||
|
||||
Reference in New Issue
Block a user