debug-council

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Debug Council: Research-Aligned Self-Consistency

Debug Council:符合研究标准的自一致性调试

Pure implementation of self-consistency (Wang et al., 2022). Each agent receives the raw user prompt and explores/debugs independently. No pre-processing, no shared context. Majority voting selects the answer.
Use this for bugs and problems with ONE correct answer.
完全实现自一致性(Wang等人,2022年)。每个Agent都会收到原始用户提示词,并独立进行探索/调试。无预处理,无共享上下文。通过多数投票选出最终答案。
此方法适用于只有一个正确答案的Bug和问题。

Step 0: Ask User How Many Agents

步骤0:询问用户需要的Agent数量

Before doing anything else, ask the user how many solver agents to use:
How many debug agents would you like me to use? (3-10)

Recommendations:
- 3 agents: Faster, still reliable
- 5 agents: Good balance
- 7 agents: High confidence
- 10 agents: Maximum confidence (critical bugs)

Note: Each agent will independently explore the codebase and find the bug.
This takes longer but provides true independence per the research.
Wait for the user's response. If they specified a number (e.g., "debug council of 5"), use that.
Minimum: 3 agents | Maximum: 10 agents

在执行任何操作之前,询问用户要使用多少个求解Agent
How many debug agents would you like me to use? (3-10)

Recommendations:
- 3 agents: Faster, still reliable
- 5 agents: Good balance
- 7 agents: High confidence
- 10 agents: Maximum confidence (critical bugs)

Note: Each agent will independently explore the codebase and find the bug.
This takes longer but provides true independence per the research.
等待用户回复。如果用户指定了数量(例如“debug council of 5”),则使用该数量。
最低:3个Agent | 最高:10个Agent

CRITICAL: Pure Research Alignment

⚠️ 关键:严格遵循研究标准

What This Means

具体要求

  1. NO orchestrator exploration - Do NOT read files or gather context before spawning agents
  2. Raw user prompt to all agents - Each agent gets the user's original request, unchanged
  3. Each agent explores independently - Agents discover the codebase themselves
  4. True independence - No shared context, no cross-contamination
  1. 禁止编排器探索 - 在生成Agent之前,不得读取文件或收集上下文
  2. 向所有Agent提供原始用户提示词 - 每个Agent收到的都是用户的原始请求,未做任何修改
  3. 每个Agent独立探索 - Agent自行探索代码库
  4. 真正的独立性 - 无共享上下文,无交叉干扰

Why This Matters

重要性

The research shows that independent samples converge on correct answers. If we pre-process or share context, we:
  • Introduce orchestrator bias
  • Reduce independence
  • May miss what individual agents would discover

研究表明,独立样本会收敛到正确答案。如果我们进行预处理或共享上下文,将会:
  • 引入编排器偏差
  • 降低独立性
  • 可能错过单个Agent会发现的问题

Workflow

工作流程

Step 1: Capture the Raw User Prompt

步骤1:捕获原始用户提示词

Take the user's request exactly as stated. Do NOT:
  • ❌ Read files first
  • ❌ Explore the codebase
  • ❌ Add context
  • ❌ Rephrase or enhance the prompt
Just capture what the user said.
原样记录用户的请求。不得:
  • ❌ 先读取文件
  • ❌ 探索代码库
  • ❌ 添加上下文
  • ❌ 改写或优化提示词
只需记录用户的原话。

Step 2: Spawn Agents IN PARALLEL with RAW PROMPT

步骤2:并行生成Agent并提供原始提示词

Spawn ALL agents simultaneously. Each gets the exact same raw prompt:
Task(agent: "debug-solver-1", prompt: "[USER'S EXACT WORDS]")
Task(agent: "debug-solver-2", prompt: "[USER'S EXACT WORDS]")
Task(agent: "debug-solver-3", prompt: "[USER'S EXACT WORDS]")
... (all in the SAME batch - parallel execution)
DO NOT modify the prompt. DO NOT add context. Raw user words only.
同时生成所有Agent。每个Agent都会收到完全相同的原始提示词
Task(agent: "debug-solver-1", prompt: "[USER'S EXACT WORDS]")
Task(agent: "debug-solver-2", prompt: "[USER'S EXACT WORDS]")
Task(agent: "debug-solver-3", prompt: "[USER'S EXACT WORDS]")
... (all in the SAME batch - parallel execution)
不得修改提示词。不得添加上下文。仅使用用户的原始原话。

Step 3: Agents Work Independently

步骤3:Agent独立工作

Each agent will:
  1. Read and understand the user's request
  2. Explore the codebase using their tools (Read, Grep, Glob, LS)
  3. Identify the root cause
  4. Reason through solutions (chain-of-thought)
  5. Generate a complete fix
Each agent works in complete isolation - they cannot see what other agents are doing or have found.
每个Agent会执行以下操作:
  1. 读取并理解用户的请求
  2. 使用工具(Read、Grep、Glob、LS)探索代码库
  3. 确定问题根源
  4. 通过思维链(chain-of-thought)推理解决方案
  5. 生成完整的修复方案
每个Agent完全独立工作 - 它们无法看到其他Agent的操作或发现的内容。

Step 4: Track Progress & Collect Solutions

步骤4:跟踪进度并收集解决方案

As agents complete, show progress to the user:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                     AGENT PROGRESS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
☑ Agent 1 - Complete
☑ Agent 2 - Complete  
☑ Agent 3 - Complete
☐ Agent 4 - Working...
☐ Agent 5 - Working...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Update this display as each agent finishes. When all complete:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                     AGENT PROGRESS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
☑ Agent 1 - Complete ✓
☑ Agent 2 - Complete ✓
☑ Agent 3 - Complete ✓
☑ Agent 4 - Complete ✓
☑ Agent 5 - Complete ✓

All agents finished! Analyzing solutions...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Collect all outputs for voting.
当Agent完成任务时,向用户展示进度
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                     AGENT PROGRESS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
☑ Agent 1 - Complete
☑ Agent 2 - Complete  
☑ Agent 3 - Complete
☐ Agent 4 - Working...
☐ Agent 5 - Working...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
随着每个Agent完成任务,更新此显示。当所有Agent完成时:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                     AGENT PROGRESS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
☑ Agent 1 - Complete ✓
☑ Agent 2 - Complete ✓
☑ Agent 3 - Complete ✓
☑ Agent 4 - Complete ✓
☑ Agent 5 - Complete ✓

All agents finished! Analyzing solutions...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
收集所有输出结果用于投票。

Step 5: Majority Voting

步骤5:多数投票

Group solutions by their core approach/answer:
  1. Identify the key decision in each solution
  2. Group solutions that make the same key decision
  3. Count how many agents chose each approach
Voting rules:
  • Clear majority (≥50%): Select that solution, HIGH confidence
  • Plurality (highest < 50%): Select that solution, MEDIUM confidence
  • No clear winner: Analyze disagreement, LOW confidence
按核心方法/答案对解决方案进行分组
  1. 识别每个解决方案中的关键决策
  2. 将做出相同关键决策的解决方案分组
  3. 统计选择每种方法的Agent数量
投票规则
  • 绝对多数(≥50%):选择该解决方案,置信度高
  • 相对多数(最高占比<50%):选择该解决方案,置信度中等
  • 无明显胜出者:分析分歧点,置信度低

Step 6: Implement the Winner

步骤6:实施胜出方案

Implement the majority solution. Do NOT synthesize or merge - use the winning answer as-is.
实施多数派解决方案。不得合成或合并方案 - 直接使用胜出的答案。

Step 7: Report Results

步骤7:汇报结果

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                    DEBUG COUNCIL RESULTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                    DEBUG COUNCIL RESULTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📊 Voting Summary

📊 投票汇总

ApproachDescriptionAgentsVotes
✅ A[description]1, 2, 4, 5, 75/7
B[description]3, 62/7
Winner: Approach A (71% consensus)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ApproachDescriptionAgentsVotes
✅ A[description]1, 2, 4, 5, 75/7
B[description]3, 62/7
Winner: Approach A (71% consensus)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🔍 What Each Agent Found

🔍 各Agent的发现

Agent 1

Agent 1

  • Files explored: [list]
  • Root cause identified: [summary]
  • Solution: [brief]
  • Files explored: [list]
  • Root cause identified: [summary]
  • Solution: [brief]

Agent 2

Agent 2

  • Files explored: [list]
  • Root cause identified: [summary]
  • Solution: [brief]
... (for each agent)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  • Files explored: [list]
  • Root cause identified: [summary]
  • Solution: [brief]
... (for each agent)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🧠 Reasoning Highlights

🧠 推理亮点

Why majority chose Approach A:

多数派选择方案A的原因:

  • Agent 1: "[key insight]"
  • Agent 2: "[key insight]"
  • Agent 4: "[key insight]"
  • Agent 1: "[key insight]"
  • Agent 2: "[key insight]"
  • Agent 4: "[key insight]"

Why minority chose differently:

少数派选择不同方案的原因:

  • Agent 3: "[different perspective]"
  • Agent 3: "[different perspective]"

Valuable minority insight:

有价值的少数派观点:

[Any good ideas from minority that might be worth noting]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[Any good ideas from minority that might be worth noting]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📈 Confidence: HIGH/MEDIUM/LOW

📈 置信度:高/中/低

[Explanation based on voting distribution and reasoning quality]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[基于投票分布和推理质量的说明]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✅ Selected Solution

✅ 选定的解决方案

[The complete winning solution]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[The complete winning solution]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🔧 Implementation

🔧 实施

[The actual code change being made]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

---
[The actual code change being made]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

---

Configuration

配置

ModeAgentsUse Case
debug council of 3
3Faster, still reliable
debug council of 5
5Good balance
debug council of 7
7High confidence
debug council of 10
10Maximum confidence
If user just says
debug council
, ask them to choose.

ModeAgentsUse Case
debug council of 3
3速度较快,仍可靠
debug council of 5
5平衡性能与可靠性
debug council of 7
7高置信度
debug council of 10
10最高置信度
如果用户只说
debug council
,请让他们选择具体数量。

Research Basis

研究依据

Based on "Self-Consistency Improves Chain of Thought Reasoning in Language Models" (Wang et al., 2022):
PrincipleOur Implementation
Same prompt to allRaw user prompt, unmodified
Independent samplesEach agent explores independently
No shared contextNo orchestrator pre-processing
Chain-of-thoughtAgents use ultrathink
Majority votingCount approaches, select majority

基于论文《Self-Consistency Improves Chain of Thought Reasoning in Language Models》(Wang等人,2022年):
PrincipleOur Implementation
Same prompt to all原始用户提示词,未做修改
Independent samples每个Agent独立探索
No shared context无编排器预处理
Chain-of-thoughtAgent使用ultrathink
Majority voting统计方法,选择多数派方案

Why This is Slower (And Why That's OK)

为何速度较慢(以及为什么可以接受)

Each agent independently:
  • Explores the codebase
  • Reads relevant files
  • Reasons through the problem
  • Generates a solution
This takes 3-10x longer than shared-context approaches, but provides:
  • True independence - no orchestrator bias
  • Diverse exploration - agents may find different things
  • Research alignment - matches the paper exactly
  • Maximum reliability - for when accuracy matters most
Use this for critical problems where getting it right matters more than getting it fast.

每个Agent独立执行以下操作:
  • 探索代码库
  • 读取相关文件
  • 推理问题解决方案
  • 生成解决方案
这比共享上下文的方法慢3-10倍,但能提供:
  • 真正的独立性 - 无编排器偏差
  • 多样化探索 - Agent可能发现不同问题
  • 符合研究标准 - 完全匹配论文要求
  • 最高可靠性 - 适用于准确性优先的场景
适用于准确性比速度更重要的关键问题。

Agents

Agent说明

10 identical debug solver agents in
agents/
directory:
  • debug-solver-1
    through
    debug-solver-10
All agents:
  • Same instructions
  • Same temperature (0.7)
  • Same tools (Read, Grep, Glob, LS)
  • Use ultrathink (extended thinking)
  • Focus on finding the ONE correct answer
Diversity comes from sampling randomness and independent exploration, not different prompts.
agents/
目录中有10个相同的调试求解Agent:
  • debug-solver-1
    debug-solver-10
所有Agent:
  • 相同的指令
  • 相同的温度参数(0.7)
  • 相同的工具(Read、Grep、Glob、LS)
  • 使用ultrathink(扩展思维)
  • 专注于找到唯一正确答案
多样性来自采样随机性和独立探索,而非不同的提示词。