fix(issue-plan-agent): Update acceptance criteria terminology and enhance issue loading process with metadata

This commit is contained in:
catlog22
2025-12-27 23:51:30 +08:00
parent 0992d27523
commit a061fc1428
3 changed files with 96 additions and 31 deletions

View File

@@ -26,7 +26,7 @@ color: green
- Dependency DAG validation
- Auto-bind for single solution, return for selection on multiple
**Key Principle**: Generate tasks conforming to schema with quantified delivery_criteria.
**Key Principle**: Generate tasks conforming to schema with quantified acceptance criteria.
---
@@ -71,11 +71,17 @@ function analyzeIssue(issue) {
issue_id: issue.id,
requirements: extractRequirements(issue.description),
scope: inferScope(issue.title, issue.description),
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 | Files | Tasks |
|------------|-------|-------|
@@ -147,18 +153,29 @@ Generate multiple candidate solutions when:
```javascript
function decomposeTasks(issue, exploration) {
return groups.map(group => ({
id: `TASK-${String(taskId++).padStart(3, '0')}`,
id: `T${taskId++}`, // Pattern: ^T[0-9]+$
title: group.title,
type: inferType(group), // feature | bug | refactor | test | chore | docs
scope: inferScope(group), // Module path
action: inferAction(group), // Create | Update | Implement | ...
description: group.description,
file_context: group.files,
modification_points: mapModificationPoints(group),
implementation: generateSteps(group), // Step-by-step guide
test: {
unit: generateUnitTests(group),
commands: ['npm test']
},
acceptance: {
criteria: generateCriteria(group), // Quantified checklist
verification: generateVerification(group)
},
commit: {
type: inferCommitType(group), // feat | fix | refactor | ...
scope: inferScope(group),
message_template: generateCommitMsg(group)
},
depends_on: inferDependencies(group, tasks),
delivery_criteria: generateDeliveryCriteria(group), // Quantified checklist
pause_criteria: identifyBlockers(group),
status: 'pending',
current_phase: 'analyze',
executor: inferExecutor(group),
priority: calculatePriority(group)
priority: calculatePriority(group) // 1-5 (1=highest)
}))
}
```

View File

@@ -126,6 +126,16 @@ function detectConflicts(fileModifications, graph) {
### 2.4 Semantic Priority
**Base Priority Mapping** (task.priority 1-5 → base score):
| task.priority | Base Score | Meaning |
|---------------|------------|---------|
| 1 | 0.8 | Highest |
| 2 | 0.65 | High |
| 3 | 0.5 | Medium |
| 4 | 0.35 | Low |
| 5 | 0.2 | Lowest |
**Action-based Boost** (applied to base score):
| Factor | Boost |
|--------|-------|
| Create action | +0.2 |
@@ -138,6 +148,8 @@ function detectConflicts(fileModifications, graph) {
| Test action | -0.1 |
| Delete action | -0.15 |
**Formula**: `semantic_priority = clamp(baseScore + sum(boosts), 0.0, 1.0)`
### 2.5 Group Assignment
- **Parallel (P*)**: Tasks with no dependencies or conflicts between them