feat(team-tech-debt): add plan approval gate, worktree execution, PR merge, and parallel multi-perspective scanning

Pipeline enhancements:
- Plan Approval Gate: user reviews remediation plan after TDPLAN (approve/revise/abort)
- Worktree Execution: TDFIX and TDVAL run in isolated git worktree with dedicated branch
- PR Merge: auto commit, push, and create PR via gh after validation passes
- Parallel Fan-out: triple-layer scanning (subagent explore + CLI dimensions + multi-perspective Gemini)
- Multi-perspective Gemini: auto-detect security/performance/quality/architecture angles
- Fan-in aggregation: cross-reference dedup with severity boosting for multi-source findings
This commit is contained in:
catlog22
2026-02-24 10:23:01 +08:00
parent b2c1288dab
commit 6f0bbe84ea
9 changed files with 556 additions and 84 deletions

View File

@@ -49,6 +49,10 @@ function sortBatches(batches) {
// 按类型分组并排序
const sortedBatches = sortBatches(batches)
// Worktree 路径(从 shared memory 加载)
const worktreePath = sharedMemory.worktree?.path || null
const cmdPrefix = worktreePath ? `cd "${worktreePath}" && ` : ''
// 每批最大 items 数
const MAX_ITEMS_PER_BATCH = 10
@@ -97,7 +101,7 @@ for (const [batchName, actions] of Object.entries(finalBatches)) {
description: `Tech debt cleanup: ${batchName} (${actions.length} items)`,
prompt: `## Goal
${prompt}
${worktreePath ? `\n## Worktree强制\n- 工作目录: ${worktreePath}\n- **所有文件操作必须在 ${worktreePath} 下进行**\n- 读文件: Read("${worktreePath}/path/to/file")\n- Bash 命令: cd "${worktreePath}" && ...\n- 禁止修改主工作树\n` : ''}
## Items to Fix
${actions.map(a => `### ${a.debt_id}: ${a.action}
- File: ${a.file || 'N/A'}
@@ -123,9 +127,9 @@ ${fileList.map(f => `- ${f}`).join('\n')}`
status: 'completed'
}
// 检查文件是否被修改
// 检查文件是否被修改(在 worktree 中执行)
for (const file of fileList) {
const modified = Bash(`git diff --name-only -- "${file}" 2>/dev/null`).trim()
const modified = Bash(`${cmdPrefix}git diff --name-only -- "${file}" 2>/dev/null`).trim()
if (modified) {
fixResults.files_modified.push(file)
}