mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-11 02:33:51 +08:00
refactor(issue): Simplify issue and task structures by removing unused fields
This commit is contained in:
@@ -69,19 +69,13 @@ ccw issue status <issue-id> --json
|
|||||||
function analyzeIssue(issue) {
|
function analyzeIssue(issue) {
|
||||||
return {
|
return {
|
||||||
issue_id: issue.id,
|
issue_id: issue.id,
|
||||||
requirements: extractRequirements(issue.description),
|
requirements: extractRequirements(issue.context),
|
||||||
scope: inferScope(issue.title, issue.description),
|
scope: inferScope(issue.title, issue.context),
|
||||||
complexity: determineComplexity(issue), // Low | Medium | High
|
complexity: determineComplexity(issue) // Low | Medium | High
|
||||||
lifecycle: issue.lifecycle_requirements // User preferences for test/commit
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
**Step 3**: Apply lifecycle requirements to tasks
|
|
||||||
- `lifecycle.test_strategy` → Configure `test.unit`, `test.commands`
|
|
||||||
- `lifecycle.commit_strategy` → Configure `commit.type`, `commit.scope`
|
|
||||||
- `lifecycle.regression_scope` → Configure `regression` array
|
|
||||||
|
|
||||||
**Complexity Rules**:
|
**Complexity Rules**:
|
||||||
| Complexity | Files | Tasks |
|
| Complexity | Files | Tasks |
|
||||||
|------------|-------|-------|
|
|------------|-------|-------|
|
||||||
@@ -174,7 +168,6 @@ function decomposeTasks(issue, exploration) {
|
|||||||
message_template: generateCommitMsg(group)
|
message_template: generateCommitMsg(group)
|
||||||
},
|
},
|
||||||
depends_on: inferDependencies(group, tasks),
|
depends_on: inferDependencies(group, tasks),
|
||||||
executor: inferExecutor(group),
|
|
||||||
priority: calculatePriority(group) // 1-5 (1=highest)
|
priority: calculatePriority(group) // 1-5 (1=highest)
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,20 +3,20 @@
|
|||||||
"title": "Issue Solution Schema",
|
"title": "Issue Solution Schema",
|
||||||
"description": "Schema for solution registered to an issue",
|
"description": "Schema for solution registered to an issue",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": ["id", "issue_id", "tasks", "status", "created_at"],
|
"required": ["id", "tasks", "is_bound", "created_at"],
|
||||||
"properties": {
|
"properties": {
|
||||||
"id": {
|
"id": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Unique solution identifier",
|
"description": "Unique solution identifier",
|
||||||
"pattern": "^SOL-[0-9]+$"
|
"pattern": "^SOL-[0-9]+$"
|
||||||
},
|
},
|
||||||
"issue_id": {
|
"description": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Parent issue ID"
|
"description": "High-level summary of the solution"
|
||||||
},
|
},
|
||||||
"plan_session_id": {
|
"approach": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Planning session that created this solution"
|
"description": "Technical approach or strategy"
|
||||||
},
|
},
|
||||||
"tasks": {
|
"tasks": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
@@ -106,26 +106,9 @@
|
|||||||
"type": "integer",
|
"type": "integer",
|
||||||
"description": "Estimated time to complete"
|
"description": "Estimated time to complete"
|
||||||
},
|
},
|
||||||
"executor": {
|
|
||||||
"type": "string",
|
|
||||||
"enum": ["codex", "gemini", "agent", "auto"],
|
|
||||||
"default": "auto"
|
|
||||||
},
|
|
||||||
"lifecycle_status": {
|
|
||||||
"type": "object",
|
|
||||||
"description": "Lifecycle phase tracking",
|
|
||||||
"properties": {
|
|
||||||
"implemented": { "type": "boolean" },
|
|
||||||
"tested": { "type": "boolean" },
|
|
||||||
"regression_passed": { "type": "boolean" },
|
|
||||||
"accepted": { "type": "boolean" },
|
|
||||||
"committed": { "type": "boolean" }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"status": {
|
"status": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": ["pending", "ready", "executing", "completed", "failed", "blocked"],
|
"description": "Task status (optional, for tracking)"
|
||||||
"default": "pending"
|
|
||||||
},
|
},
|
||||||
"priority": {
|
"priority": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
@@ -164,11 +147,6 @@
|
|||||||
"maximum": 1,
|
"maximum": 1,
|
||||||
"description": "Solution quality score (0.0-1.0)"
|
"description": "Solution quality score (0.0-1.0)"
|
||||||
},
|
},
|
||||||
"status": {
|
|
||||||
"type": "string",
|
|
||||||
"enum": ["draft", "candidate", "bound", "queued", "executing", "completed", "failed"],
|
|
||||||
"default": "draft"
|
|
||||||
},
|
|
||||||
"is_bound": {
|
"is_bound": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": false,
|
"default": false,
|
||||||
|
|||||||
@@ -26,20 +26,6 @@ interface Issue {
|
|||||||
context: string;
|
context: string;
|
||||||
bound_solution_id: string | null;
|
bound_solution_id: string | null;
|
||||||
solution_count: number;
|
solution_count: number;
|
||||||
source?: string;
|
|
||||||
source_url?: string;
|
|
||||||
labels?: string[];
|
|
||||||
// Agent workflow fields
|
|
||||||
affected_components?: string[];
|
|
||||||
lifecycle_requirements?: {
|
|
||||||
test_strategy?: 'unit' | 'integration' | 'e2e' | 'auto';
|
|
||||||
regression_scope?: 'full' | 'related' | 'affected';
|
|
||||||
commit_strategy?: 'per-task' | 'atomic' | 'squash';
|
|
||||||
};
|
|
||||||
problem_statement?: string;
|
|
||||||
expected_behavior?: string;
|
|
||||||
actual_behavior?: string;
|
|
||||||
reproduction_steps?: string[];
|
|
||||||
// Timestamps
|
// Timestamps
|
||||||
created_at: string;
|
created_at: string;
|
||||||
updated_at: string;
|
updated_at: string;
|
||||||
@@ -85,16 +71,6 @@ interface SolutionTask {
|
|||||||
|
|
||||||
depends_on: string[];
|
depends_on: string[];
|
||||||
estimated_minutes?: number;
|
estimated_minutes?: number;
|
||||||
executor: 'codex' | 'gemini' | 'agent' | 'auto';
|
|
||||||
|
|
||||||
// Lifecycle status tracking
|
|
||||||
lifecycle_status?: {
|
|
||||||
implemented: boolean;
|
|
||||||
tested: boolean;
|
|
||||||
regression_passed: boolean;
|
|
||||||
accepted: boolean;
|
|
||||||
committed: boolean;
|
|
||||||
};
|
|
||||||
status?: string;
|
status?: string;
|
||||||
priority?: number;
|
priority?: number;
|
||||||
}
|
}
|
||||||
@@ -117,7 +93,6 @@ interface QueueItem {
|
|||||||
issue_id: string;
|
issue_id: string;
|
||||||
solution_id: string;
|
solution_id: string;
|
||||||
task_id?: string; // Only for task-level queues
|
task_id?: string; // Only for task-level queues
|
||||||
title?: string;
|
|
||||||
status: 'pending' | 'ready' | 'executing' | 'completed' | 'failed' | 'blocked';
|
status: 'pending' | 'ready' | 'executing' | 'completed' | 'failed' | 'blocked';
|
||||||
execution_order: number;
|
execution_order: number;
|
||||||
execution_group: string;
|
execution_group: string;
|
||||||
@@ -126,6 +101,7 @@ interface QueueItem {
|
|||||||
assigned_executor: 'codex' | 'gemini' | 'agent';
|
assigned_executor: 'codex' | 'gemini' | 'agent';
|
||||||
task_count?: number; // For solution-level queues
|
task_count?: number; // For solution-level queues
|
||||||
files_touched?: string[]; // For solution-level queues
|
files_touched?: string[]; // For solution-level queues
|
||||||
|
queued_at?: string;
|
||||||
started_at?: string;
|
started_at?: string;
|
||||||
completed_at?: string;
|
completed_at?: string;
|
||||||
result?: Record<string, any>;
|
result?: Record<string, any>;
|
||||||
@@ -134,7 +110,8 @@ interface QueueItem {
|
|||||||
|
|
||||||
interface QueueConflict {
|
interface QueueConflict {
|
||||||
type: 'file_conflict' | 'dependency_conflict' | 'resource_conflict';
|
type: 'file_conflict' | 'dependency_conflict' | 'resource_conflict';
|
||||||
tasks: string[]; // Item IDs involved in conflict
|
tasks?: string[]; // Task IDs involved (task-level queues)
|
||||||
|
solutions?: string[]; // Solution IDs involved (solution-level queues)
|
||||||
file?: string; // Conflicting file path
|
file?: string; // Conflicting file path
|
||||||
resolution: 'sequential' | 'merge' | 'manual';
|
resolution: 'sequential' | 'merge' | 'manual';
|
||||||
resolution_order?: string[];
|
resolution_order?: string[];
|
||||||
@@ -173,7 +150,6 @@ interface Queue {
|
|||||||
|
|
||||||
interface QueueIndex {
|
interface QueueIndex {
|
||||||
active_queue_id: string | null;
|
active_queue_id: string | null;
|
||||||
active_item_id: string | null;
|
|
||||||
queues: {
|
queues: {
|
||||||
id: string;
|
id: string;
|
||||||
status: string;
|
status: string;
|
||||||
@@ -316,7 +292,7 @@ function ensureQueuesDir(): void {
|
|||||||
function readQueueIndex(): QueueIndex {
|
function readQueueIndex(): QueueIndex {
|
||||||
const path = join(getQueuesDir(), 'index.json');
|
const path = join(getQueuesDir(), 'index.json');
|
||||||
if (!existsSync(path)) {
|
if (!existsSync(path)) {
|
||||||
return { active_queue_id: null, active_item_id: null, queues: [] };
|
return { active_queue_id: null, queues: [] };
|
||||||
}
|
}
|
||||||
return JSON.parse(readFileSync(path, 'utf-8'));
|
return JSON.parse(readFileSync(path, 'utf-8'));
|
||||||
}
|
}
|
||||||
@@ -665,7 +641,6 @@ async function taskAction(issueId: string | undefined, taskId: string | undefine
|
|||||||
|
|
||||||
if (options.title) solution.tasks[taskIdx].title = options.title;
|
if (options.title) solution.tasks[taskIdx].title = options.title;
|
||||||
if (options.status) solution.tasks[taskIdx].status = options.status;
|
if (options.status) solution.tasks[taskIdx].status = options.status;
|
||||||
if (options.executor) solution.tasks[taskIdx].executor = options.executor as any;
|
|
||||||
|
|
||||||
writeSolutions(issueId, solutions);
|
writeSolutions(issueId, solutions);
|
||||||
console.log(chalk.green(`✓ Task ${taskId} updated`));
|
console.log(chalk.green(`✓ Task ${taskId} updated`));
|
||||||
@@ -698,8 +673,7 @@ async function taskAction(issueId: string | undefined, taskId: string | undefine
|
|||||||
scope: 'core',
|
scope: 'core',
|
||||||
message_template: `feat(core): ${options.title}`
|
message_template: `feat(core): ${options.title}`
|
||||||
},
|
},
|
||||||
depends_on: [],
|
depends_on: []
|
||||||
executor: (options.executor as any) || 'auto'
|
|
||||||
};
|
};
|
||||||
|
|
||||||
solution.tasks.push(newTask);
|
solution.tasks.push(newTask);
|
||||||
@@ -1076,7 +1050,7 @@ async function queueAction(subAction: string | undefined, issueId: string | unde
|
|||||||
return depItem?.item_id || dep;
|
return depItem?.item_id || dep;
|
||||||
}),
|
}),
|
||||||
semantic_priority: 0.5,
|
semantic_priority: 0.5,
|
||||||
assigned_executor: task.executor === 'auto' ? 'codex' : task.executor as any
|
assigned_executor: 'codex'
|
||||||
});
|
});
|
||||||
added++;
|
added++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user