pdd-cli 0.0.45__py3-none-any.whl → 0.0.118__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pdd/__init__.py +40 -8
- pdd/agentic_bug.py +323 -0
- pdd/agentic_bug_orchestrator.py +497 -0
- pdd/agentic_change.py +231 -0
- pdd/agentic_change_orchestrator.py +526 -0
- pdd/agentic_common.py +598 -0
- pdd/agentic_crash.py +534 -0
- pdd/agentic_e2e_fix.py +319 -0
- pdd/agentic_e2e_fix_orchestrator.py +426 -0
- pdd/agentic_fix.py +1294 -0
- pdd/agentic_langtest.py +162 -0
- pdd/agentic_update.py +387 -0
- pdd/agentic_verify.py +183 -0
- pdd/architecture_sync.py +565 -0
- pdd/auth_service.py +210 -0
- pdd/auto_deps_main.py +71 -51
- pdd/auto_include.py +245 -5
- pdd/auto_update.py +125 -47
- pdd/bug_main.py +196 -23
- pdd/bug_to_unit_test.py +2 -0
- pdd/change_main.py +11 -4
- pdd/cli.py +22 -1181
- pdd/cmd_test_main.py +350 -150
- pdd/code_generator.py +60 -18
- pdd/code_generator_main.py +790 -57
- pdd/commands/__init__.py +48 -0
- pdd/commands/analysis.py +306 -0
- pdd/commands/auth.py +309 -0
- pdd/commands/connect.py +290 -0
- pdd/commands/fix.py +163 -0
- pdd/commands/generate.py +257 -0
- pdd/commands/maintenance.py +175 -0
- pdd/commands/misc.py +87 -0
- pdd/commands/modify.py +256 -0
- pdd/commands/report.py +144 -0
- pdd/commands/sessions.py +284 -0
- pdd/commands/templates.py +215 -0
- pdd/commands/utility.py +110 -0
- pdd/config_resolution.py +58 -0
- pdd/conflicts_main.py +8 -3
- pdd/construct_paths.py +589 -111
- pdd/context_generator.py +10 -2
- pdd/context_generator_main.py +175 -76
- pdd/continue_generation.py +53 -10
- pdd/core/__init__.py +33 -0
- pdd/core/cli.py +527 -0
- pdd/core/cloud.py +237 -0
- pdd/core/dump.py +554 -0
- pdd/core/errors.py +67 -0
- pdd/core/remote_session.py +61 -0
- pdd/core/utils.py +90 -0
- pdd/crash_main.py +262 -33
- pdd/data/language_format.csv +71 -63
- pdd/data/llm_model.csv +20 -18
- pdd/detect_change_main.py +5 -4
- pdd/docs/prompting_guide.md +864 -0
- pdd/docs/whitepaper_with_benchmarks/data_and_functions/benchmark_analysis.py +495 -0
- pdd/docs/whitepaper_with_benchmarks/data_and_functions/creation_compare.py +528 -0
- pdd/fix_code_loop.py +523 -95
- pdd/fix_code_module_errors.py +6 -2
- pdd/fix_error_loop.py +491 -92
- pdd/fix_errors_from_unit_tests.py +4 -3
- pdd/fix_main.py +278 -21
- pdd/fix_verification_errors.py +12 -100
- pdd/fix_verification_errors_loop.py +529 -286
- pdd/fix_verification_main.py +294 -89
- pdd/frontend/dist/assets/index-B5DZHykP.css +1 -0
- pdd/frontend/dist/assets/index-DQ3wkeQ2.js +449 -0
- pdd/frontend/dist/index.html +376 -0
- pdd/frontend/dist/logo.svg +33 -0
- pdd/generate_output_paths.py +139 -15
- pdd/generate_test.py +218 -146
- pdd/get_comment.py +19 -44
- pdd/get_extension.py +8 -9
- pdd/get_jwt_token.py +318 -22
- pdd/get_language.py +8 -7
- pdd/get_run_command.py +75 -0
- pdd/get_test_command.py +68 -0
- pdd/git_update.py +70 -19
- pdd/incremental_code_generator.py +2 -2
- pdd/insert_includes.py +13 -4
- pdd/llm_invoke.py +1711 -181
- pdd/load_prompt_template.py +19 -12
- pdd/path_resolution.py +140 -0
- pdd/pdd_completion.fish +25 -2
- pdd/pdd_completion.sh +30 -4
- pdd/pdd_completion.zsh +79 -4
- pdd/postprocess.py +14 -4
- pdd/preprocess.py +293 -24
- pdd/preprocess_main.py +41 -6
- pdd/prompts/agentic_bug_step10_pr_LLM.prompt +182 -0
- pdd/prompts/agentic_bug_step1_duplicate_LLM.prompt +73 -0
- pdd/prompts/agentic_bug_step2_docs_LLM.prompt +129 -0
- pdd/prompts/agentic_bug_step3_triage_LLM.prompt +95 -0
- pdd/prompts/agentic_bug_step4_reproduce_LLM.prompt +97 -0
- pdd/prompts/agentic_bug_step5_root_cause_LLM.prompt +123 -0
- pdd/prompts/agentic_bug_step6_test_plan_LLM.prompt +107 -0
- pdd/prompts/agentic_bug_step7_generate_LLM.prompt +172 -0
- pdd/prompts/agentic_bug_step8_verify_LLM.prompt +119 -0
- pdd/prompts/agentic_bug_step9_e2e_test_LLM.prompt +289 -0
- pdd/prompts/agentic_change_step10_identify_issues_LLM.prompt +1006 -0
- pdd/prompts/agentic_change_step11_fix_issues_LLM.prompt +984 -0
- pdd/prompts/agentic_change_step12_create_pr_LLM.prompt +131 -0
- pdd/prompts/agentic_change_step1_duplicate_LLM.prompt +73 -0
- pdd/prompts/agentic_change_step2_docs_LLM.prompt +101 -0
- pdd/prompts/agentic_change_step3_research_LLM.prompt +126 -0
- pdd/prompts/agentic_change_step4_clarify_LLM.prompt +164 -0
- pdd/prompts/agentic_change_step5_docs_change_LLM.prompt +981 -0
- pdd/prompts/agentic_change_step6_devunits_LLM.prompt +1005 -0
- pdd/prompts/agentic_change_step7_architecture_LLM.prompt +1044 -0
- pdd/prompts/agentic_change_step8_analyze_LLM.prompt +1027 -0
- pdd/prompts/agentic_change_step9_implement_LLM.prompt +1077 -0
- pdd/prompts/agentic_crash_explore_LLM.prompt +49 -0
- pdd/prompts/agentic_e2e_fix_step1_unit_tests_LLM.prompt +90 -0
- pdd/prompts/agentic_e2e_fix_step2_e2e_tests_LLM.prompt +91 -0
- pdd/prompts/agentic_e2e_fix_step3_root_cause_LLM.prompt +89 -0
- pdd/prompts/agentic_e2e_fix_step4_fix_e2e_tests_LLM.prompt +96 -0
- pdd/prompts/agentic_e2e_fix_step5_identify_devunits_LLM.prompt +91 -0
- pdd/prompts/agentic_e2e_fix_step6_create_unit_tests_LLM.prompt +106 -0
- pdd/prompts/agentic_e2e_fix_step7_verify_tests_LLM.prompt +116 -0
- pdd/prompts/agentic_e2e_fix_step8_run_pdd_fix_LLM.prompt +120 -0
- pdd/prompts/agentic_e2e_fix_step9_verify_all_LLM.prompt +146 -0
- pdd/prompts/agentic_fix_explore_LLM.prompt +45 -0
- pdd/prompts/agentic_fix_harvest_only_LLM.prompt +48 -0
- pdd/prompts/agentic_fix_primary_LLM.prompt +85 -0
- pdd/prompts/agentic_update_LLM.prompt +925 -0
- pdd/prompts/agentic_verify_explore_LLM.prompt +45 -0
- pdd/prompts/auto_include_LLM.prompt +122 -905
- pdd/prompts/change_LLM.prompt +3093 -1
- pdd/prompts/detect_change_LLM.prompt +686 -27
- pdd/prompts/example_generator_LLM.prompt +22 -1
- pdd/prompts/extract_code_LLM.prompt +5 -1
- pdd/prompts/extract_program_code_fix_LLM.prompt +7 -1
- pdd/prompts/extract_prompt_update_LLM.prompt +7 -8
- pdd/prompts/extract_promptline_LLM.prompt +17 -11
- pdd/prompts/find_verification_errors_LLM.prompt +6 -0
- pdd/prompts/fix_code_module_errors_LLM.prompt +12 -2
- pdd/prompts/fix_errors_from_unit_tests_LLM.prompt +9 -0
- pdd/prompts/fix_verification_errors_LLM.prompt +22 -0
- pdd/prompts/generate_test_LLM.prompt +41 -7
- pdd/prompts/generate_test_from_example_LLM.prompt +115 -0
- pdd/prompts/increase_tests_LLM.prompt +1 -5
- pdd/prompts/insert_includes_LLM.prompt +316 -186
- pdd/prompts/prompt_code_diff_LLM.prompt +119 -0
- pdd/prompts/prompt_diff_LLM.prompt +82 -0
- pdd/prompts/trace_LLM.prompt +25 -22
- pdd/prompts/unfinished_prompt_LLM.prompt +85 -1
- pdd/prompts/update_prompt_LLM.prompt +22 -1
- pdd/pytest_output.py +127 -12
- pdd/remote_session.py +876 -0
- pdd/render_mermaid.py +236 -0
- pdd/server/__init__.py +52 -0
- pdd/server/app.py +335 -0
- pdd/server/click_executor.py +587 -0
- pdd/server/executor.py +338 -0
- pdd/server/jobs.py +661 -0
- pdd/server/models.py +241 -0
- pdd/server/routes/__init__.py +31 -0
- pdd/server/routes/architecture.py +451 -0
- pdd/server/routes/auth.py +364 -0
- pdd/server/routes/commands.py +929 -0
- pdd/server/routes/config.py +42 -0
- pdd/server/routes/files.py +603 -0
- pdd/server/routes/prompts.py +1322 -0
- pdd/server/routes/websocket.py +473 -0
- pdd/server/security.py +243 -0
- pdd/server/terminal_spawner.py +209 -0
- pdd/server/token_counter.py +222 -0
- pdd/setup_tool.py +648 -0
- pdd/simple_math.py +2 -0
- pdd/split_main.py +3 -2
- pdd/summarize_directory.py +237 -195
- pdd/sync_animation.py +8 -4
- pdd/sync_determine_operation.py +839 -112
- pdd/sync_main.py +351 -57
- pdd/sync_orchestration.py +1400 -756
- pdd/sync_tui.py +848 -0
- pdd/template_expander.py +161 -0
- pdd/template_registry.py +264 -0
- pdd/templates/architecture/architecture_json.prompt +237 -0
- pdd/templates/generic/generate_prompt.prompt +174 -0
- pdd/trace.py +168 -12
- pdd/trace_main.py +4 -3
- pdd/track_cost.py +140 -63
- pdd/unfinished_prompt.py +51 -4
- pdd/update_main.py +567 -67
- pdd/update_model_costs.py +2 -2
- pdd/update_prompt.py +19 -4
- {pdd_cli-0.0.45.dist-info → pdd_cli-0.0.118.dist-info}/METADATA +29 -11
- pdd_cli-0.0.118.dist-info/RECORD +227 -0
- {pdd_cli-0.0.45.dist-info → pdd_cli-0.0.118.dist-info}/licenses/LICENSE +1 -1
- pdd_cli-0.0.45.dist-info/RECORD +0 -116
- {pdd_cli-0.0.45.dist-info → pdd_cli-0.0.118.dist-info}/WHEEL +0 -0
- {pdd_cli-0.0.45.dist-info → pdd_cli-0.0.118.dist-info}/entry_points.txt +0 -0
- {pdd_cli-0.0.45.dist-info → pdd_cli-0.0.118.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
% You are an expert software engineer investigating a bug report. Your task is to create a draft pull request with the failing tests and link it to the issue.
|
|
2
|
+
|
|
3
|
+
% Context
|
|
4
|
+
|
|
5
|
+
You are working on step 10 of 10 (final step) in an agentic bug investigation workflow. Previous steps have generated and verified both unit tests and E2E tests that detect the bug.
|
|
6
|
+
|
|
7
|
+
% Inputs
|
|
8
|
+
|
|
9
|
+
- GitHub Issue URL: {issue_url}
|
|
10
|
+
- Repository: {repo_owner}/{repo_name}
|
|
11
|
+
- Issue Number: {issue_number}
|
|
12
|
+
|
|
13
|
+
% Issue Content
|
|
14
|
+
<issue_content>
|
|
15
|
+
{issue_content}
|
|
16
|
+
</issue_content>
|
|
17
|
+
|
|
18
|
+
% Previous Steps Output
|
|
19
|
+
<step1_output>
|
|
20
|
+
{step1_output}
|
|
21
|
+
</step1_output>
|
|
22
|
+
|
|
23
|
+
<step2_output>
|
|
24
|
+
{step2_output}
|
|
25
|
+
</step2_output>
|
|
26
|
+
|
|
27
|
+
<step3_output>
|
|
28
|
+
{step3_output}
|
|
29
|
+
</step3_output>
|
|
30
|
+
|
|
31
|
+
<step4_output>
|
|
32
|
+
{step4_output}
|
|
33
|
+
</step4_output>
|
|
34
|
+
|
|
35
|
+
<step5_output>
|
|
36
|
+
{step5_output}
|
|
37
|
+
</step5_output>
|
|
38
|
+
|
|
39
|
+
<step6_output>
|
|
40
|
+
{step6_output}
|
|
41
|
+
</step6_output>
|
|
42
|
+
|
|
43
|
+
<step7_output>
|
|
44
|
+
{step7_output}
|
|
45
|
+
</step7_output>
|
|
46
|
+
|
|
47
|
+
<step8_output>
|
|
48
|
+
{step8_output}
|
|
49
|
+
</step8_output>
|
|
50
|
+
|
|
51
|
+
<step9_output>
|
|
52
|
+
{step9_output}
|
|
53
|
+
</step9_output>
|
|
54
|
+
|
|
55
|
+
% Worktree Information
|
|
56
|
+
|
|
57
|
+
You are operating in an isolated git worktree at: {worktree_path}
|
|
58
|
+
This worktree is already checked out to branch `fix/issue-{issue_number}`.
|
|
59
|
+
Do NOT create a new branch - just stage, commit, and push.
|
|
60
|
+
|
|
61
|
+
% Files to Stage
|
|
62
|
+
|
|
63
|
+
**IMPORTANT: Only stage these specific files:**
|
|
64
|
+
{files_to_stage}
|
|
65
|
+
|
|
66
|
+
% Your Task
|
|
67
|
+
|
|
68
|
+
1. **Prepare the commit**
|
|
69
|
+
- You are already on branch `fix/issue-{issue_number}` in an isolated worktree
|
|
70
|
+
- **CRITICAL: Stage ONLY the test file(s) created in Steps 7 and 9**
|
|
71
|
+
- Get the exact file paths from:
|
|
72
|
+
- Step 7's `FILES_CREATED:` or `FILES_MODIFIED:` output (unit tests)
|
|
73
|
+
- Step 9's `E2E_FILES_CREATED:` or `E2E_FILES_MODIFIED:` output (E2E tests)
|
|
74
|
+
- Stage each file individually: `git add <exact_file_path>`
|
|
75
|
+
- **DO NOT use `git add .` or `git add -A`** - these will stage unrelated files and pollute the PR
|
|
76
|
+
- Verify only the intended files are staged: `git status --short` (should show only the test file(s))
|
|
77
|
+
- Commit with a descriptive message referencing the issue
|
|
78
|
+
|
|
79
|
+
2. **Create the draft PR**
|
|
80
|
+
- Push the branch to origin
|
|
81
|
+
- Create a draft pull request using `gh pr create --draft`
|
|
82
|
+
- Link to the issue using "Fixes #{issue_number}" in the PR body
|
|
83
|
+
|
|
84
|
+
3. **Post final summary**
|
|
85
|
+
- Comment on the issue with PR link and next steps for the fix
|
|
86
|
+
|
|
87
|
+
4. **Include PDD fix command**
|
|
88
|
+
- Extract code file path from Step 5's `**Location:**` field (strip the `:line_number` suffix)
|
|
89
|
+
- Use test file path from Step 7's `FILES_CREATED:` or test file section
|
|
90
|
+
- Search repo for matching prompt file: `find . -name "*.prompt" -type f`
|
|
91
|
+
- Derive module name from code file (e.g., `pdd/foo.py` -> `foo`)
|
|
92
|
+
- Use verification program: `context/{{module_name}}_example.py`
|
|
93
|
+
- Use error log path: `fix-issue-{issue_number}.log` for the fix command output
|
|
94
|
+
- Include a ready-to-run `pdd fix` command in your GitHub comment
|
|
95
|
+
- If no prompt file or verification program exists, include a note that they must be created first
|
|
96
|
+
|
|
97
|
+
% PR Creation Command
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
gh pr create --draft --title "Add failing tests for #{issue_number}" --body "$(cat <<'EOF'
|
|
101
|
+
## Summary
|
|
102
|
+
Adds failing tests that detect the bug reported in #{issue_number}.
|
|
103
|
+
|
|
104
|
+
## Test Files
|
|
105
|
+
- Unit test: `{{unit_test_file_path}}`
|
|
106
|
+
- E2E test: `{{e2e_test_file_path}}` (if applicable)
|
|
107
|
+
|
|
108
|
+
## What This PR Contains
|
|
109
|
+
- Failing unit test that reproduces the reported bug
|
|
110
|
+
- Failing E2E test that verifies the bug at integration level (if applicable)
|
|
111
|
+
- Tests are verified to fail on current code and will pass once the bug is fixed
|
|
112
|
+
|
|
113
|
+
## Root Cause
|
|
114
|
+
{{root_cause_summary}}
|
|
115
|
+
|
|
116
|
+
## Next Steps
|
|
117
|
+
1. [ ] Implement the fix at the identified location
|
|
118
|
+
2. [ ] Verify the unit test passes
|
|
119
|
+
3. [ ] Verify the E2E test passes
|
|
120
|
+
4. [ ] Run full test suite
|
|
121
|
+
5. [ ] Mark PR as ready for review
|
|
122
|
+
|
|
123
|
+
Fixes #{issue_number}
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
*Generated by PDD agentic bug workflow*
|
|
127
|
+
EOF
|
|
128
|
+
)"
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
% Output
|
|
132
|
+
|
|
133
|
+
After creating the PR, use `gh issue comment` to post your final report to issue #{issue_number}:
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
gh issue comment {issue_number} --repo {repo_owner}/{repo_name} --body "..."
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Your comment should follow this format:
|
|
140
|
+
|
|
141
|
+
```markdown
|
|
142
|
+
## Step 10: Draft PR Created
|
|
143
|
+
|
|
144
|
+
### Pull Request
|
|
145
|
+
**PR #{{pr_number}}:** [{{pr_title}}]({{pr_url}})
|
|
146
|
+
|
|
147
|
+
### Branch
|
|
148
|
+
`fix/issue-{issue_number}`
|
|
149
|
+
|
|
150
|
+
### What's Included
|
|
151
|
+
- Failing unit test at `{{unit_test_file_path}}`
|
|
152
|
+
- Failing E2E test at `{{e2e_test_file_path}}` (if applicable)
|
|
153
|
+
- Commits: {{commit_count}}
|
|
154
|
+
|
|
155
|
+
### Next Steps for Maintainers
|
|
156
|
+
1. Review the failing tests to understand the expected behavior
|
|
157
|
+
2. Implement the fix at the identified location
|
|
158
|
+
3. Verify both unit and E2E tests pass with your fix
|
|
159
|
+
4. Run full test suite to check for regressions
|
|
160
|
+
5. Mark the PR as ready for review
|
|
161
|
+
|
|
162
|
+
### PDD Fix Command
|
|
163
|
+
|
|
164
|
+
To auto-fix this bug using PDD:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
cd {{worktree_path}}
|
|
168
|
+
pdd --force fix --loop --max-attempts 5 --verification-program context/{{module_name}}_example.py {{prompt_file}} {{code_file_path}} {{test_file_path}} fix-issue-{{issue_number}}.log
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
*Investigation complete. A draft PR with failing tests has been created and linked to this issue.*
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
% Important
|
|
176
|
+
|
|
177
|
+
- Create a DRAFT PR (not ready for review) since it only contains the failing tests
|
|
178
|
+
- The PR should clearly state that a fix is still needed
|
|
179
|
+
- Use "Fixes #{issue_number}" to auto-link the PR to the issue
|
|
180
|
+
- Do NOT create a new branch - you are already on the correct branch in the worktree
|
|
181
|
+
- Include both unit test files (Step 7) and E2E test files (Step 9) if both exist
|
|
182
|
+
- Always post your findings as a GitHub comment before completing
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
% You are an expert software engineer investigating a bug report. Your task is to check if this issue is a duplicate of an existing issue.
|
|
2
|
+
|
|
3
|
+
% Context
|
|
4
|
+
|
|
5
|
+
You are working on step 1 of 10 in an agentic bug investigation workflow. Your findings will be posted as a comment on the GitHub issue.
|
|
6
|
+
|
|
7
|
+
% Inputs
|
|
8
|
+
|
|
9
|
+
- GitHub Issue URL: {issue_url}
|
|
10
|
+
- Repository: {repo_owner}/{repo_name}
|
|
11
|
+
- Issue Number: {issue_number}
|
|
12
|
+
|
|
13
|
+
% Issue Content
|
|
14
|
+
<issue_content>
|
|
15
|
+
{issue_content}
|
|
16
|
+
</issue_content>
|
|
17
|
+
|
|
18
|
+
% Your Task
|
|
19
|
+
|
|
20
|
+
1. **Search for duplicates**
|
|
21
|
+
- Use `gh issue list` to search for similar issues in this repository
|
|
22
|
+
- Look for issues with similar error messages, stack traces, or descriptions
|
|
23
|
+
- Consider both open and closed issues
|
|
24
|
+
- Search using key terms from the bug report (error messages, affected modules, symptoms)
|
|
25
|
+
|
|
26
|
+
2. **Evaluate matches**
|
|
27
|
+
- For each potential duplicate, read the issue to verify similarity
|
|
28
|
+
- Consider: same root cause? same symptoms? same affected code?
|
|
29
|
+
- A true duplicate has the same underlying problem, not just similar keywords
|
|
30
|
+
|
|
31
|
+
3. **Handle duplicates**
|
|
32
|
+
If duplicates are found:
|
|
33
|
+
- Merge any unique information from this issue into the original
|
|
34
|
+
- Add a comment to the original issue noting the additional context
|
|
35
|
+
- Close this issue with a comment linking to the original
|
|
36
|
+
- Report which issue is the canonical one
|
|
37
|
+
|
|
38
|
+
If no duplicates:
|
|
39
|
+
- Report that this appears to be a new issue
|
|
40
|
+
- Proceed with investigation
|
|
41
|
+
|
|
42
|
+
% Output
|
|
43
|
+
|
|
44
|
+
After completing your analysis, use `gh issue comment` to post your findings to issue #{issue_number}:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
gh issue comment {issue_number} --repo {repo_owner}/{repo_name} --body "..."
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Your comment should follow this format:
|
|
51
|
+
|
|
52
|
+
```markdown
|
|
53
|
+
## Step 1: Duplicate Check
|
|
54
|
+
|
|
55
|
+
**Status:** [No duplicates found | Duplicate of #XXX]
|
|
56
|
+
|
|
57
|
+
### Search Performed
|
|
58
|
+
- Searched for: [key terms used]
|
|
59
|
+
- Issues reviewed: [count]
|
|
60
|
+
|
|
61
|
+
### Findings
|
|
62
|
+
[If duplicates found: explanation of why they match and what action was taken]
|
|
63
|
+
[If no duplicates: brief confirmation this is a new issue]
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
*Proceeding to Step 2: Documentation Check*
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
% Important
|
|
70
|
+
|
|
71
|
+
- Always post your findings as a GitHub comment before completing
|
|
72
|
+
- If this is a duplicate, still post a comment explaining the closure
|
|
73
|
+
- Be thorough but efficient in your search
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
% You are an expert software engineer investigating a bug report. Your task is to check if the reported behavior is actually a bug or documented/expected behavior.
|
|
2
|
+
|
|
3
|
+
% Context
|
|
4
|
+
|
|
5
|
+
You are working on step 2 of 10 in an agentic bug investigation workflow. Previous step checked for duplicate issues.
|
|
6
|
+
|
|
7
|
+
**This step may terminate the workflow** if the reported behavior matches documentation (not a bug).
|
|
8
|
+
|
|
9
|
+
% Inputs
|
|
10
|
+
|
|
11
|
+
- GitHub Issue URL: {issue_url}
|
|
12
|
+
- Repository: {repo_owner}/{repo_name}
|
|
13
|
+
- Issue Number: {issue_number}
|
|
14
|
+
- Issue Author: @{issue_author}
|
|
15
|
+
|
|
16
|
+
% Issue Content
|
|
17
|
+
<issue_content>
|
|
18
|
+
{issue_content}
|
|
19
|
+
</issue_content>
|
|
20
|
+
|
|
21
|
+
% Previous Step Output
|
|
22
|
+
<step1_output>
|
|
23
|
+
{step1_output}
|
|
24
|
+
</step1_output>
|
|
25
|
+
|
|
26
|
+
% Your Task
|
|
27
|
+
|
|
28
|
+
1. **Locate documentation**
|
|
29
|
+
- Find README.md, docs/, CONTRIBUTING.md, and any relevant documentation
|
|
30
|
+
- Look for API documentation, usage guides, or configuration docs
|
|
31
|
+
- Check for inline documentation in relevant code files
|
|
32
|
+
|
|
33
|
+
2. **Check for documented behavior**
|
|
34
|
+
- Is the reported behavior explicitly documented as expected?
|
|
35
|
+
- Are there documented limitations or known constraints?
|
|
36
|
+
- Does the documentation describe correct usage that the user may have missed?
|
|
37
|
+
- Are there documented prerequisites or configuration requirements?
|
|
38
|
+
|
|
39
|
+
3. **Evaluate**
|
|
40
|
+
- **Confirmed bug**: Behavior contradicts documentation or is clearly incorrect → Continue workflow
|
|
41
|
+
- **Feature request**: User wants different behavior than what's documented → STOP workflow
|
|
42
|
+
- **User error**: The user is not following documented usage → STOP workflow
|
|
43
|
+
- **Documentation gap**: Behavior is expected but not documented → Continue (fix docs)
|
|
44
|
+
- **Unclear**: More investigation needed → Continue workflow
|
|
45
|
+
|
|
46
|
+
% Output
|
|
47
|
+
|
|
48
|
+
After completing your analysis, use `gh issue comment` to post your findings to issue #{issue_number}:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
gh issue comment {issue_number} --repo {repo_owner}/{repo_name} --body "..."
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Your comment should follow this format:
|
|
55
|
+
|
|
56
|
+
**If Confirmed Bug or Needs Investigation:**
|
|
57
|
+
```markdown
|
|
58
|
+
## Step 2: Documentation Check
|
|
59
|
+
|
|
60
|
+
**Status:** [Confirmed Bug | Documentation Gap | Needs Investigation]
|
|
61
|
+
|
|
62
|
+
### Documentation Reviewed
|
|
63
|
+
- [List of files/sections checked]
|
|
64
|
+
|
|
65
|
+
### Findings
|
|
66
|
+
[Explanation of what the documentation says vs. what the user reports]
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
*Proceeding to Step 3: Triage*
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**If Feature Request (STOP workflow):**
|
|
73
|
+
```markdown
|
|
74
|
+
## Step 2: Documentation Check
|
|
75
|
+
|
|
76
|
+
**Status:** Feature Request (Not a Bug)
|
|
77
|
+
|
|
78
|
+
### Documentation Reviewed
|
|
79
|
+
- [List of files/sections checked]
|
|
80
|
+
|
|
81
|
+
### Findings
|
|
82
|
+
The reported behavior matches the current documentation. This appears to be a **feature request** rather than a bug.
|
|
83
|
+
|
|
84
|
+
**Current documented behavior:**
|
|
85
|
+
[Quote or summarize relevant documentation]
|
|
86
|
+
|
|
87
|
+
**Requested behavior:**
|
|
88
|
+
[What the user wants instead]
|
|
89
|
+
|
|
90
|
+
### Recommendation
|
|
91
|
+
If you'd like to change this behavior, consider using `pdd change` to create a feature request instead. This workflow (`pdd bug`) is designed for cases where the code doesn't match its documented behavior.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
*Investigation paused - this appears to be a feature request, not a bug.*
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**If User Error (STOP workflow):**
|
|
98
|
+
```markdown
|
|
99
|
+
## Step 2: Documentation Check
|
|
100
|
+
|
|
101
|
+
**Status:** User Error (Not a Bug)
|
|
102
|
+
|
|
103
|
+
### Documentation Reviewed
|
|
104
|
+
- [List of files/sections checked]
|
|
105
|
+
|
|
106
|
+
### Findings
|
|
107
|
+
The reported issue appears to be a usage error rather than a bug.
|
|
108
|
+
|
|
109
|
+
**Correct usage per documentation:**
|
|
110
|
+
[Explain how to use the feature correctly]
|
|
111
|
+
|
|
112
|
+
**What went wrong:**
|
|
113
|
+
[Explain the user's mistake]
|
|
114
|
+
|
|
115
|
+
### Recommendation
|
|
116
|
+
Please try the correct usage above. If you still experience issues after following the documentation, please reopen this issue with additional details.
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
*Investigation paused - this appears to be a usage error, not a bug.*
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
% Important
|
|
123
|
+
|
|
124
|
+
- **STOP the workflow** if status is "Feature Request" or "User Error"
|
|
125
|
+
- **CONTINUE the workflow** if status is "Confirmed Bug", "Documentation Gap", or "Needs Investigation"
|
|
126
|
+
- Tag the issue author when asking for clarification
|
|
127
|
+
- Mention `pdd change` as an alternative for feature requests
|
|
128
|
+
- Be helpful and non-judgmental in your assessment
|
|
129
|
+
- Always post your findings as a GitHub comment before completing
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
% You are an expert software engineer investigating a bug report.
|
|
2
|
+
Your task is to assess if there's sufficient information to attempt reproduction.
|
|
3
|
+
|
|
4
|
+
% Context
|
|
5
|
+
|
|
6
|
+
You are working on step 3 of 10 in an agentic bug investigation workflow.
|
|
7
|
+
Previous steps checked for duplicates and reviewed documentation.
|
|
8
|
+
|
|
9
|
+
**This step may terminate the workflow** if insufficient information exists.
|
|
10
|
+
|
|
11
|
+
% Inputs
|
|
12
|
+
|
|
13
|
+
- GitHub Issue URL: {issue_url}
|
|
14
|
+
- Repository: {repo_owner}/{repo_name}
|
|
15
|
+
- Issue Number: {issue_number}
|
|
16
|
+
- Issue Author: @{issue_author}
|
|
17
|
+
|
|
18
|
+
% Issue Content
|
|
19
|
+
<issue_content>
|
|
20
|
+
{issue_content}
|
|
21
|
+
</issue_content>
|
|
22
|
+
|
|
23
|
+
% Previous Steps Output
|
|
24
|
+
<step1_output>
|
|
25
|
+
{step1_output}
|
|
26
|
+
</step1_output>
|
|
27
|
+
|
|
28
|
+
<step2_output>
|
|
29
|
+
{step2_output}
|
|
30
|
+
</step2_output>
|
|
31
|
+
|
|
32
|
+
% Your Task
|
|
33
|
+
|
|
34
|
+
1. **Evaluate what we know**
|
|
35
|
+
- Do we understand what behavior the user expected?
|
|
36
|
+
- Do we understand what behavior actually occurred?
|
|
37
|
+
- Are there reproduction steps or enough context to infer them?
|
|
38
|
+
- Can we identify the general area of code involved?
|
|
39
|
+
|
|
40
|
+
2. **Decide**
|
|
41
|
+
- **Proceed**: We have enough to attempt reproduction
|
|
42
|
+
- **Needs More Info**: Critical gaps prevent meaningful reproduction attempt
|
|
43
|
+
|
|
44
|
+
% Output
|
|
45
|
+
|
|
46
|
+
After completing your analysis, use `gh issue comment` to post your findings to issue #{issue_number}:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
gh issue comment {issue_number} --repo {repo_owner}/{repo_name} --body "..."
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Your comment should follow this format:
|
|
53
|
+
|
|
54
|
+
**If Proceed:**
|
|
55
|
+
```markdown
|
|
56
|
+
## Step 3: Triage
|
|
57
|
+
|
|
58
|
+
**Status:** Proceed
|
|
59
|
+
|
|
60
|
+
### Summary
|
|
61
|
+
[What we understand about the issue and why we can attempt reproduction]
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
*Proceeding to Step 4: Reproduction*
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**If Needs More Info (STOP workflow):**
|
|
68
|
+
```markdown
|
|
69
|
+
## Step 3: Triage
|
|
70
|
+
|
|
71
|
+
**Status:** Needs More Info
|
|
72
|
+
|
|
73
|
+
### What We Know
|
|
74
|
+
[Summary of information gathered from steps 1-2]
|
|
75
|
+
|
|
76
|
+
### What We Need
|
|
77
|
+
To investigate this issue further, we need clarification on:
|
|
78
|
+
|
|
79
|
+
1. [Specific question 1]
|
|
80
|
+
2. [Specific question 2]
|
|
81
|
+
...
|
|
82
|
+
|
|
83
|
+
@{issue_author} - Could you provide this information?
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
*Investigation paused - awaiting additional information from issue author.*
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
% Important
|
|
90
|
+
|
|
91
|
+
- **STOP the workflow** if status is "Needs More Info"
|
|
92
|
+
- Tag the issue author (@username) when requesting info
|
|
93
|
+
- Be specific about what information is missing
|
|
94
|
+
- Only request info that's truly necessary to attempt reproduction
|
|
95
|
+
- Always post your findings as a GitHub comment before completing
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
% You are an expert software engineer investigating a bug report. Your task is to reproduce the reported issue locally.
|
|
2
|
+
|
|
3
|
+
% Context
|
|
4
|
+
|
|
5
|
+
You are working on step 4 of 10 in an agentic bug investigation workflow. Previous steps confirmed this is not a duplicate, assessed documentation, and triaged for sufficient information.
|
|
6
|
+
|
|
7
|
+
% Inputs
|
|
8
|
+
|
|
9
|
+
- GitHub Issue URL: {issue_url}
|
|
10
|
+
- Repository: {repo_owner}/{repo_name}
|
|
11
|
+
- Issue Number: {issue_number}
|
|
12
|
+
|
|
13
|
+
% Issue Content
|
|
14
|
+
<issue_content>
|
|
15
|
+
{issue_content}
|
|
16
|
+
</issue_content>
|
|
17
|
+
|
|
18
|
+
% Previous Steps Output
|
|
19
|
+
<step1_output>
|
|
20
|
+
{step1_output}
|
|
21
|
+
</step1_output>
|
|
22
|
+
|
|
23
|
+
<step2_output>
|
|
24
|
+
{step2_output}
|
|
25
|
+
</step2_output>
|
|
26
|
+
|
|
27
|
+
<step3_output>
|
|
28
|
+
{step3_output}
|
|
29
|
+
</step3_output>
|
|
30
|
+
|
|
31
|
+
% Your Task
|
|
32
|
+
|
|
33
|
+
1. **Extract reproduction information**
|
|
34
|
+
- Identify error messages, stack traces, or symptoms from the issue
|
|
35
|
+
- Find any reproduction steps provided by the reporter
|
|
36
|
+
- Note the environment details (OS, versions, configuration)
|
|
37
|
+
|
|
38
|
+
2. **Locate the affected code**
|
|
39
|
+
- Parse stack traces to identify relevant files and line numbers
|
|
40
|
+
- Find the module/function mentioned in the issue
|
|
41
|
+
- Explore the codebase to understand the code path
|
|
42
|
+
|
|
43
|
+
3. **Attempt reproduction**
|
|
44
|
+
- Set up the minimal environment needed
|
|
45
|
+
- Follow the reproduction steps (or infer them from the issue)
|
|
46
|
+
- Run the code and observe the behavior
|
|
47
|
+
- Capture the actual error/output
|
|
48
|
+
|
|
49
|
+
4. **Document results**
|
|
50
|
+
- **Reproduced**: Describe exact steps and observed behavior
|
|
51
|
+
- **Partially reproduced**: Describe what worked and what differed
|
|
52
|
+
- **Could not reproduce**: Explain what was tried and potential reasons
|
|
53
|
+
|
|
54
|
+
% Output
|
|
55
|
+
|
|
56
|
+
After completing your analysis, use `gh issue comment` to post your findings to issue #{issue_number}:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
gh issue comment {issue_number} --repo {repo_owner}/{repo_name} --body "..."
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Your comment should follow this format:
|
|
63
|
+
|
|
64
|
+
```markdown
|
|
65
|
+
## Step 4: Reproduction
|
|
66
|
+
|
|
67
|
+
**Status:** [Reproduced | Partially Reproduced | Could Not Reproduce]
|
|
68
|
+
|
|
69
|
+
### Environment
|
|
70
|
+
- [Relevant environment details]
|
|
71
|
+
|
|
72
|
+
### Steps Taken
|
|
73
|
+
1. [Step 1]
|
|
74
|
+
2. [Step 2]
|
|
75
|
+
3. ...
|
|
76
|
+
|
|
77
|
+
### Observed Behavior
|
|
78
|
+
```
|
|
79
|
+
[Error message, output, or behavior observed]
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Affected Files
|
|
83
|
+
- `path/to/file.py:123` - [brief description]
|
|
84
|
+
|
|
85
|
+
### Notes
|
|
86
|
+
[Any additional observations or discrepancies from the reported issue]
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
*Proceeding to Step 5: Root Cause Analysis*
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
% Important
|
|
93
|
+
|
|
94
|
+
- If you cannot reproduce, still proceed - the analysis may reveal the issue
|
|
95
|
+
- Document your environment carefully for comparison with the reporter's
|
|
96
|
+
- Capture actual error output, not paraphrased descriptions
|
|
97
|
+
- Always post your findings as a GitHub comment before completing
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
% You are an expert software engineer investigating a bug report. Your task is to analyze the root cause of the issue.
|
|
2
|
+
|
|
3
|
+
% Context
|
|
4
|
+
|
|
5
|
+
You are working on step 5 of 10 in an agentic bug investigation workflow. Previous steps have triaged, attempted reproduction, and gathered context.
|
|
6
|
+
|
|
7
|
+
% Inputs
|
|
8
|
+
|
|
9
|
+
- GitHub Issue URL: {issue_url}
|
|
10
|
+
- Repository: {repo_owner}/{repo_name}
|
|
11
|
+
- Issue Number: {issue_number}
|
|
12
|
+
|
|
13
|
+
% Issue Content
|
|
14
|
+
<issue_content>
|
|
15
|
+
{issue_content}
|
|
16
|
+
</issue_content>
|
|
17
|
+
|
|
18
|
+
% Previous Steps Output
|
|
19
|
+
<step1_output>
|
|
20
|
+
{step1_output}
|
|
21
|
+
</step1_output>
|
|
22
|
+
|
|
23
|
+
<step2_output>
|
|
24
|
+
{step2_output}
|
|
25
|
+
</step2_output>
|
|
26
|
+
|
|
27
|
+
<step3_output>
|
|
28
|
+
{step3_output}
|
|
29
|
+
</step3_output>
|
|
30
|
+
|
|
31
|
+
<step4_output>
|
|
32
|
+
{step4_output}
|
|
33
|
+
</step4_output>
|
|
34
|
+
|
|
35
|
+
% Your Task
|
|
36
|
+
|
|
37
|
+
1. **Analyze the code path**
|
|
38
|
+
- Read the affected files identified in reproduction
|
|
39
|
+
- Trace the execution flow that leads to the error
|
|
40
|
+
- Understand the data flow and transformations
|
|
41
|
+
|
|
42
|
+
2. **Research external sources**
|
|
43
|
+
- Search for the error message or symptoms online
|
|
44
|
+
- Check if the issue relates to a known bug in dependencies
|
|
45
|
+
- Look for similar issues in library/framework documentation
|
|
46
|
+
- Search GitHub issues, StackOverflow, or forums for related problems
|
|
47
|
+
- Note any relevant version constraints or breaking changes
|
|
48
|
+
|
|
49
|
+
3. **Analyze repository history**
|
|
50
|
+
- Use `git log` and `git blame` on affected files to identify when problematic code was introduced
|
|
51
|
+
- Search for related PRs that modified this code: `gh pr list --search "keyword" --state all`
|
|
52
|
+
- Review PR discussions for context on why changes were made
|
|
53
|
+
- Check closed issues for similar (not just duplicate) problems that provide historical insight
|
|
54
|
+
- Look for recent commits that might correlate with the bug's first appearance
|
|
55
|
+
|
|
56
|
+
4. **Identify the root cause**
|
|
57
|
+
- What condition triggers the bug?
|
|
58
|
+
- Is it a logic error, edge case, race condition, or incorrect assumption?
|
|
59
|
+
|
|
60
|
+
5. **Run experiments**
|
|
61
|
+
- Add debug output or modify code temporarily to verify hypotheses
|
|
62
|
+
- Test edge cases and boundary conditions
|
|
63
|
+
- Confirm your understanding of why the bug occurs
|
|
64
|
+
|
|
65
|
+
6. **Document the root cause**
|
|
66
|
+
- Explain the bug in clear terms
|
|
67
|
+
- Identify the specific line(s) or logic that need to change
|
|
68
|
+
- Note any related issues or implications
|
|
69
|
+
|
|
70
|
+
% Output
|
|
71
|
+
|
|
72
|
+
After completing your analysis, use `gh issue comment` to post your findings to issue #{issue_number}:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
gh issue comment {issue_number} --repo {repo_owner}/{repo_name} --body "..."
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Your comment should follow this format:
|
|
79
|
+
|
|
80
|
+
```markdown
|
|
81
|
+
## Step 5: Root Cause Analysis
|
|
82
|
+
|
|
83
|
+
**Root Cause Identified:** [Yes | Partially | No]
|
|
84
|
+
|
|
85
|
+
### Summary
|
|
86
|
+
[One-paragraph explanation of what causes the bug]
|
|
87
|
+
|
|
88
|
+
### Technical Details
|
|
89
|
+
- **Location:** `path/to/file.py:123`
|
|
90
|
+
- **Problematic Code:**
|
|
91
|
+
```python
|
|
92
|
+
# The issue is here
|
|
93
|
+
problematic_code_snippet()
|
|
94
|
+
```
|
|
95
|
+
- **Why it fails:** [Explanation]
|
|
96
|
+
|
|
97
|
+
### External Research
|
|
98
|
+
- **Search terms:** [key terms searched]
|
|
99
|
+
- **Sources checked:** [GitHub, StackOverflow, docs, etc.]
|
|
100
|
+
- **Relevant findings:** [any related issues, known bugs, or workarounds found]
|
|
101
|
+
|
|
102
|
+
### Repository History
|
|
103
|
+
- **Relevant commits:** [commits that introduced or modified the problematic code]
|
|
104
|
+
- **Related PRs:** [PRs that touch the affected code path, with discussion context]
|
|
105
|
+
- **Similar past issues:** [closed issues with related symptoms or fixes]
|
|
106
|
+
|
|
107
|
+
### Experiments Performed
|
|
108
|
+
1. [What you tested and what it revealed]
|
|
109
|
+
2. ...
|
|
110
|
+
|
|
111
|
+
### Fix Direction
|
|
112
|
+
[High-level description of what needs to change to fix this]
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
*Proceeding to Step 6: Test Plan*
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
% Important
|
|
119
|
+
|
|
120
|
+
- Be specific about the exact location and nature of the bug
|
|
121
|
+
- Distinguish between symptoms and root cause
|
|
122
|
+
- If root cause is unclear, document what you learned and hypotheses
|
|
123
|
+
- Always post your findings as a GitHub comment before completing
|