feat: Enhance exploration schema and introduce automated review-fix workflow

- Added new fields to the exploration JSON schema: exploration_angle, exploration_index, and total_explorations for better tracking of exploration parameters.
- Created a comprehensive review-fix command documentation to automate code review findings fixing, detailing the workflow, execution flow, agent roles, and error handling.
- Introduced fix-plan-template.json for structured planning output, including execution strategy, group definitions, and risk assessments.
- Added fix-progress-template.json to track progress for each group during the execution phase, ensuring real-time updates and status management.
This commit is contained in:
catlog22
2025-11-25 22:01:01 +08:00
parent 4bd732c4db
commit a6561a7d01
5 changed files with 1644 additions and 11 deletions

View File

@@ -0,0 +1,75 @@
{
"_template_description": "Template for fix planning output. Planning agent reads this template and generates actual fix-plan.json",
"_usage": "Planning agent should follow this structure when analyzing findings and creating fix plan",
"plan_id": "<string: plan-{timestamp}>",
"created_at": "<string: ISO8601 timestamp>",
"total_findings": "<number: total findings to fix>",
"execution_strategy": {
"approach": "<string: hybrid|parallel|serial>",
"parallel_limit": "<number: max concurrent agents, default 3>",
"total_stages": "<number: how many stages in timeline>",
"rationale": "<string: explain why this strategy was chosen>"
},
"groups": [
{
"group_id": "<string: unique group identifier like G1, G2, ...>",
"group_name": "<string: descriptive name for this group>",
"findings": ["<array of finding IDs>"],
"fix_strategy": {
"approach": "<string: high-level fix approach>",
"rationale": "<string: why these findings were grouped together>",
"complexity": "<string: low|medium|high>",
"estimated_duration_minutes": "<number: estimated time>",
"test_pattern": "<string: test file glob pattern like tests/auth/**/*.test.*>",
"rollback_plan": "<string: what to do if fix fails>"
},
"risk_assessment": {
"level": "<string: low|medium|high|critical>",
"concerns": ["<array of strings: potential risks>"],
"mitigation": "<string: how to mitigate risks>"
}
}
],
"timeline": [
{
"stage": "<number: stage number 1-indexed>",
"groups": ["<array of group IDs to execute in this stage>"],
"execution_mode": "<string: parallel|serial>",
"depends_on": ["<optional: array of group IDs this stage depends on>"],
"rationale": "<string: why these groups are in this stage with this mode>"
}
],
"_instructions": {
"grouping_principles": [
"Group findings in the same file with same dimension",
"Group findings with similar root causes (high semantic similarity)",
"Consider file dependencies and execution order",
"Balance group sizes for efficient parallel execution"
],
"execution_strategy_guidelines": [
"Use parallel for independent groups in different files",
"Use serial for dependent changes (e.g., shared utilities)",
"Limit parallelism to 3 concurrent agents to avoid resource contention",
"High-risk groups should be isolated for careful monitoring"
],
"test_strategy_guidelines": [
"Identify test files related to changed code",
"Use specific patterns for faster test execution",
"Ensure test coverage captures all fix impacts",
"Define clear pass criteria (usually 100% pass rate)"
],
"risk_assessment_guidelines": [
"Low: Simple fixes with comprehensive test coverage",
"Medium: Moderate changes affecting multiple components",
"High: Core logic changes or security-critical fixes",
"Critical: Database schema changes or breaking API changes"
]
}
}

View File

@@ -0,0 +1,48 @@
{
"$schema": "fix-progress-template.json",
"$comment": "Template for fix-progress-{N}.json - one per group, initialized by planning agent, updated by execution agent",
"progress_id": "fix-progress-N",
"group_id": "GN",
"group_name": "Group name from fix plan",
"status": "pending",
"phase": "waiting",
"assigned_agent": null,
"started_at": null,
"last_update": "ISO 8601 timestamp",
"findings": [
{
"finding_id": "finding-uuid",
"finding_title": "Finding title from review",
"file": "path/to/file.ts",
"line": 0,
"status": "pending",
"result": null,
"attempts": 0,
"started_at": null,
"completed_at": null,
"commit_hash": null,
"test_passed": null
}
],
"summary": {
"total_findings": 0,
"pending": 0,
"in_progress": 0,
"fixed": 0,
"failed": 0,
"percent_complete": 0.0
},
"current_finding": null,
"flow_control": {
"implementation_approach": [],
"current_step": null
},
"errors": []
}

View File

@@ -80,6 +80,22 @@
"const": "cli-explore-agent",
"description": "Agent that performed exploration"
},
"exploration_angle": {
"type": "string",
"description": "Agent-chosen exploration angle (e.g., 'architecture', 'security', 'dataflow')"
},
"exploration_index": {
"type": "integer",
"minimum": 1,
"maximum": 4,
"description": "Exploration index (1-4) in parallel exploration set"
},
"total_explorations": {
"type": "integer",
"minimum": 1,
"maximum": 4,
"description": "Total number of parallel explorations"
},
"duration_seconds": {
"type": "integer",
"description": "Exploration duration in seconds"