feat: 更新队列生成逻辑,使用提供的队列ID并严格限制输出文件

This commit is contained in:
catlog22
2025-12-28 20:20:13 +08:00
parent a33cacfd75
commit 35c7fe28bb
2 changed files with 23 additions and 12 deletions

View File

@@ -148,7 +148,7 @@ function detectConflicts(fileModifications, graph) {
.workflow/issues/queues/index.json # Update with new queue entry
```
Queue ID format: `QUE-YYYYMMDD-HHMMSS` (UTC timestamp)
Queue ID: Use the Queue ID provided in prompt (do NOT generate new one)
Queue Item ID format: `S-N` (S-1, S-2, S-3, ...)
### 3.2 Queue File Schema
@@ -241,10 +241,14 @@ Queue Item ID format: `S-N` (S-1, S-2, S-3, ...)
5. Merge conflicting solutions in parallel group
6. Split tasks from their solution
**OUTPUT**:
1. Write `.workflow/issues/queues/{queue-id}.json`
2. Update `.workflow/issues/queues/index.json`
3. **CRITICAL**: Final return MUST be PURE JSON only (no markdown, no explanation, no prose):
```json
{"queue_id":"QUE-xxx","total_solutions":N,"total_tasks":N,"execution_groups":[...],"conflicts_resolved":N,"issues_queued":["ISS-xxx"]}
```
**OUTPUT** (STRICT - only these 2 files):
```
.workflow/issues/queues/{Queue ID}.json # Use Queue ID from prompt
.workflow/issues/queues/index.json # Update existing index
```
- Use the Queue ID provided in prompt, do NOT generate new one
- Write ONLY the 2 files listed above, NO other files
- Final return: PURE JSON summary (no markdown, no prose):
```json
{"queue_id":"QUE-xxx","total_solutions":N,"total_tasks":N,"execution_groups":[...],"conflicts_resolved":N,"issues_queued":["ISS-xxx"]}
```

View File

@@ -260,10 +260,15 @@ console.log(`Loaded ${allSolutions.length} solutions from ${plannedIssues.length
### Phase 2-4: Agent-Driven Queue Formation
```javascript
// Generate queue-id ONCE here, pass to agent
const now = new Date();
const queueId = `QUE-${now.toISOString().replace(/[-:T]/g, '').slice(0, 14)}`;
// Build minimal prompt - agent orders SOLUTIONS, not tasks
const agentPrompt = `
## Order Solutions
**Queue ID**: ${queueId}
**Solutions**: ${allSolutions.length} from ${plannedIssues.length} issues
**Project Root**: ${process.cwd()}
@@ -293,11 +298,13 @@ ${JSON.stringify(allSolutions, null, 2)}
3. More tasks = higher priority (larger impact)
- **Parallel Safety**: Solutions in same parallel group must have NO file overlaps
- **Queue Item ID Format**: \`S-N\` (S-1, S-2, S-3, ...)
- **Queue ID Format**: \`QUE-YYYYMMDD-HHMMSS\` (UTC timestamp)
- **Queue ID**: Use the provided Queue ID (passed above), do NOT generate new one
### Generate Files
1. \`.workflow/issues/queues/\${queueId}.json\` - Full queue with solutions array
2. \`.workflow/issues/queues/index.json\` - Update with new entry
### Generate Files (STRICT - only these 2)
1. \`.workflow/issues/queues/{Queue ID}.json\` - Use Queue ID from above
2. \`.workflow/issues/queues/index.json\` - Update existing index
Write ONLY these 2 files, using the provided Queue ID.
### Return Summary
\`\`\`json