pdd-cli 0.0.42__py3-none-any.whl → 0.0.90__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 +4 -4
- pdd/agentic_common.py +863 -0
- pdd/agentic_crash.py +534 -0
- pdd/agentic_fix.py +1179 -0
- pdd/agentic_langtest.py +162 -0
- pdd/agentic_update.py +370 -0
- pdd/agentic_verify.py +183 -0
- pdd/auto_deps_main.py +15 -5
- pdd/auto_include.py +63 -5
- pdd/bug_main.py +3 -2
- pdd/bug_to_unit_test.py +2 -0
- pdd/change_main.py +11 -4
- pdd/cli.py +22 -1181
- pdd/cmd_test_main.py +80 -19
- pdd/code_generator.py +58 -18
- pdd/code_generator_main.py +672 -25
- pdd/commands/__init__.py +42 -0
- pdd/commands/analysis.py +248 -0
- pdd/commands/fix.py +140 -0
- pdd/commands/generate.py +257 -0
- pdd/commands/maintenance.py +174 -0
- pdd/commands/misc.py +79 -0
- pdd/commands/modify.py +230 -0
- pdd/commands/report.py +144 -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 +281 -81
- pdd/context_generator.py +10 -2
- pdd/context_generator_main.py +113 -11
- pdd/continue_generation.py +47 -7
- pdd/core/__init__.py +0 -0
- pdd/core/cli.py +503 -0
- pdd/core/dump.py +554 -0
- pdd/core/errors.py +63 -0
- pdd/core/utils.py +90 -0
- pdd/crash_main.py +44 -11
- pdd/data/language_format.csv +71 -62
- pdd/data/llm_model.csv +20 -18
- pdd/detect_change_main.py +5 -4
- pdd/fix_code_loop.py +331 -77
- pdd/fix_error_loop.py +209 -60
- pdd/fix_errors_from_unit_tests.py +4 -3
- pdd/fix_main.py +75 -18
- pdd/fix_verification_errors.py +12 -100
- pdd/fix_verification_errors_loop.py +319 -272
- pdd/fix_verification_main.py +57 -17
- pdd/generate_output_paths.py +93 -10
- pdd/generate_test.py +16 -5
- pdd/get_jwt_token.py +48 -9
- pdd/get_run_command.py +73 -0
- pdd/get_test_command.py +68 -0
- pdd/git_update.py +70 -19
- pdd/increase_tests.py +7 -0
- pdd/incremental_code_generator.py +2 -2
- pdd/insert_includes.py +11 -3
- pdd/llm_invoke.py +1278 -110
- pdd/load_prompt_template.py +36 -10
- pdd/pdd_completion.fish +25 -2
- pdd/pdd_completion.sh +30 -4
- pdd/pdd_completion.zsh +79 -4
- pdd/postprocess.py +10 -3
- pdd/preprocess.py +228 -15
- pdd/preprocess_main.py +8 -5
- pdd/prompts/agentic_crash_explore_LLM.prompt +49 -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 +1071 -0
- pdd/prompts/agentic_verify_explore_LLM.prompt +45 -0
- pdd/prompts/auto_include_LLM.prompt +98 -101
- pdd/prompts/change_LLM.prompt +1 -3
- pdd/prompts/detect_change_LLM.prompt +562 -3
- pdd/prompts/example_generator_LLM.prompt +22 -1
- pdd/prompts/extract_code_LLM.prompt +5 -1
- pdd/prompts/extract_program_code_fix_LLM.prompt +14 -2
- 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 +16 -4
- pdd/prompts/fix_errors_from_unit_tests_LLM.prompt +6 -41
- pdd/prompts/fix_verification_errors_LLM.prompt +22 -0
- pdd/prompts/generate_test_LLM.prompt +21 -6
- pdd/prompts/increase_tests_LLM.prompt +1 -2
- pdd/prompts/insert_includes_LLM.prompt +1181 -6
- pdd/prompts/split_LLM.prompt +1 -62
- pdd/prompts/trace_LLM.prompt +25 -22
- pdd/prompts/unfinished_prompt_LLM.prompt +85 -1
- pdd/prompts/update_prompt_LLM.prompt +22 -1
- pdd/prompts/xml_convertor_LLM.prompt +3246 -7
- pdd/pytest_output.py +188 -21
- pdd/python_env_detector.py +151 -0
- pdd/render_mermaid.py +236 -0
- pdd/setup_tool.py +648 -0
- pdd/simple_math.py +2 -0
- pdd/split_main.py +3 -2
- pdd/summarize_directory.py +56 -7
- pdd/sync_determine_operation.py +918 -186
- pdd/sync_main.py +82 -32
- pdd/sync_orchestration.py +1456 -453
- pdd/sync_tui.py +848 -0
- pdd/template_registry.py +264 -0
- pdd/templates/architecture/architecture_json.prompt +242 -0
- pdd/templates/generic/generate_prompt.prompt +174 -0
- pdd/trace.py +168 -12
- pdd/trace_main.py +4 -3
- pdd/track_cost.py +151 -61
- pdd/unfinished_prompt.py +49 -3
- pdd/update_main.py +549 -67
- pdd/update_model_costs.py +2 -2
- pdd/update_prompt.py +19 -4
- {pdd_cli-0.0.42.dist-info → pdd_cli-0.0.90.dist-info}/METADATA +20 -7
- pdd_cli-0.0.90.dist-info/RECORD +153 -0
- {pdd_cli-0.0.42.dist-info → pdd_cli-0.0.90.dist-info}/licenses/LICENSE +1 -1
- pdd_cli-0.0.42.dist-info/RECORD +0 -115
- {pdd_cli-0.0.42.dist-info → pdd_cli-0.0.90.dist-info}/WHEEL +0 -0
- {pdd_cli-0.0.42.dist-info → pdd_cli-0.0.90.dist-info}/entry_points.txt +0 -0
- {pdd_cli-0.0.42.dist-info → pdd_cli-0.0.90.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
You are fixing a verification failure in a PDD (Prompt-Driven Development) project.
|
|
2
|
+
You are running as FALLBACK after PDD's normal verify loop failed multiple times to fix the code and/or program file so that the program output aligns with the prompt's intent.
|
|
3
|
+
|
|
4
|
+
## PDD Principle
|
|
5
|
+
The PROMPT FILE is the source of truth. Code is a generated artifact.
|
|
6
|
+
The PROGRAM FILE runs the code to verify its behavior against the prompt's intent.
|
|
7
|
+
|
|
8
|
+
## Files (you have full read/write access)
|
|
9
|
+
- Prompt file (THE SPEC): {prompt_path}
|
|
10
|
+
- Code file: {code_path}
|
|
11
|
+
- Program file: {program_path}
|
|
12
|
+
- Project root: {project_root}
|
|
13
|
+
|
|
14
|
+
## Previous Fix Attempts
|
|
15
|
+
The following shows what PDD's normal verify loop already tried.
|
|
16
|
+
DO NOT repeat these approaches - try something different.
|
|
17
|
+
<previous_attempts>
|
|
18
|
+
{previous_attempts}
|
|
19
|
+
</previous_attempts>
|
|
20
|
+
|
|
21
|
+
## Your Task
|
|
22
|
+
1. Read the prompt file to understand the intended behavior
|
|
23
|
+
2. Read the code and program files
|
|
24
|
+
3. Explore related files (imports, dependencies, helper modules, etc.) if needed
|
|
25
|
+
4. Determine what needs fixing:
|
|
26
|
+
- Code doesn't produce output matching prompt intent -> fix the code
|
|
27
|
+
- Program has implementation issues -> fix the program
|
|
28
|
+
- Issue requires changes to other files -> make those changes
|
|
29
|
+
5. Make ALL necessary changes so the program output aligns with the prompt
|
|
30
|
+
6. Run the program file to verify the fix
|
|
31
|
+
7. Repeat steps 4-6 until the program output aligns with the prompt's intent
|
|
32
|
+
8. Output a JSON string with the following fields:
|
|
33
|
+
- success: bool
|
|
34
|
+
- message: str
|
|
35
|
+
- cost: float
|
|
36
|
+
- model: str
|
|
37
|
+
- changed_files: list[str]
|
|
38
|
+
|
|
39
|
+
## Critical Rules
|
|
40
|
+
- The prompt file defines what's correct - code should conform to it
|
|
41
|
+
- DO NOT repeat approaches from the fix history above
|
|
42
|
+
- You may modify code, program, or other supporting files
|
|
43
|
+
- IMPORTANT: Read actual source files before assuming what functions/classes exist
|
|
44
|
+
- Do NOT guess at imports or API names
|
|
45
|
+
- Explore the codebase to understand actual exports
|
|
@@ -12,10 +12,28 @@ You are a prompt expert that helps select the necessary subset of "includes" (li
|
|
|
12
12
|
'Step 1.' - A string of possible includes based on the input_prompt.
|
|
13
13
|
'Step 2.' - A string explaining why an include might or might not be necessary for the prompt.
|
|
14
14
|
'Step 3.' - A string of the minimum set of includes required to achieve the goal of the input_prompt.
|
|
15
|
-
'Step 4.' - A string of the string_of_includes based on Step 3.
|
|
15
|
+
'Step 4.' - A string of the string_of_includes based on Step 3 (see strict tag naming rules below).
|
|
16
16
|
</output>
|
|
17
17
|
</definitions>
|
|
18
18
|
|
|
19
|
+
<tag_naming_rules_for_step_4>
|
|
20
|
+
IMPORTANT: Step 4 must emit XML snippets that wrap each <include> in a canonical dotted Python module tag.
|
|
21
|
+
|
|
22
|
+
Format:
|
|
23
|
+
<CANONICAL_MODULE_PATH><include>INCLUDE_PATH</include></CANONICAL_MODULE_PATH>
|
|
24
|
+
|
|
25
|
+
Canonical tag name rules:
|
|
26
|
+
- The wrapper tag MUST be a dotted Python import path (examples: utils.auth_helpers, utils.db_helpers, models.user).
|
|
27
|
+
- NEVER use *_example as the wrapper tag (e.g. do NOT output <auth_helpers_example>...</auth_helpers_example>).
|
|
28
|
+
- If INCLUDE_PATH is a context example (e.g. context/auth_helpers_example.py), the wrapper tag must be the real module
|
|
29
|
+
being exemplified (e.g. utils.auth_helpers). Prefer extracting the module path from the input_prompt text. If it is not
|
|
30
|
+
explicitly present, infer from filename + summary:
|
|
31
|
+
- default to utils.<base_name> for helpers/config/clients/etc
|
|
32
|
+
- default to models.<base_name> for data models
|
|
33
|
+
- If INCLUDE_PATH is not a context example, derive CANONICAL_MODULE_PATH from the file path by stripping the extension and
|
|
34
|
+
replacing '/' with '.' (e.g. core/change_handler.py -> core.change_handler).
|
|
35
|
+
</tag_naming_rules_for_step_4>
|
|
36
|
+
|
|
19
37
|
<context>
|
|
20
38
|
Here is the input_prompt to find the includes for: <input_prompt>{input_prompt}</input_prompt>
|
|
21
39
|
Here is the available_includes: <available_includes>{available_includes}</available_includes>
|
|
@@ -63,57 +81,32 @@ Here are some examples of how to do this:
|
|
|
63
81
|
Step 3. Return the success status, list of modified prompts, total cost, and model name.
|
|
64
82
|
</example_input_prompt>
|
|
65
83
|
<example_available_includes>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
context/find_section_example.py
|
|
87
|
-
context/fix_code_module_errors_example.py
|
|
88
|
-
context/fix_error_loop_example.py
|
|
89
|
-
context/fix_errors_from_unit_tests_example.py
|
|
90
|
-
context/generate_output_paths_example.py
|
|
91
|
-
context/generate_test_example.py
|
|
92
|
-
context/get_comment_example.py
|
|
93
|
-
context/get_extension_example.py
|
|
94
|
-
context/get_language_example.py
|
|
95
|
-
context/git_update_example.py
|
|
96
|
-
context/langchain_lcel_example.py
|
|
97
|
-
context/llm_selector_example.py
|
|
98
|
-
context/llm_token_counter_example.py
|
|
99
|
-
context/postprocess_0_example.py
|
|
100
|
-
context/postprocess_example.py
|
|
101
|
-
context/postprocessed_runnable_llm_output.py
|
|
102
|
-
context/preprocess_example.py
|
|
103
|
-
context/process_csv_change_example.py
|
|
104
|
-
context/prompt_caching.ipynb
|
|
105
|
-
context/split_example.py
|
|
106
|
-
context/tiktoken_example.py
|
|
107
|
-
context/trace_example.py
|
|
108
|
-
context/unfinished_prompt_example.py
|
|
109
|
-
context/unrunnable_raw_llm_output.py
|
|
110
|
-
context/update_prompt_example.py
|
|
111
|
-
context/xml_tagger_example.py
|
|
84
|
+
File: utils/csv_parser.py
|
|
85
|
+
Summary: Utility functions for parsing and processing CSV files with pandas
|
|
86
|
+
File: utils/file_processor.py
|
|
87
|
+
Summary: Generic file processing utilities for reading and writing various formats
|
|
88
|
+
File: core/change_handler.py
|
|
89
|
+
Summary: Main function for applying changes to code files with validation
|
|
90
|
+
File: models/data_validator.py
|
|
91
|
+
Summary: Pydantic models and validation functions for input data
|
|
92
|
+
File: cli/command_interface.py
|
|
93
|
+
Summary: Click-based command line interface utilities
|
|
94
|
+
File: database/connection.py
|
|
95
|
+
Summary: Database connection and query utilities
|
|
96
|
+
File: api/http_client.py
|
|
97
|
+
Summary: HTTP client for making API requests with retry logic
|
|
98
|
+
File: processing/text_analyzer.py
|
|
99
|
+
Summary: Text analysis and natural language processing functions
|
|
100
|
+
File: config/settings.py
|
|
101
|
+
Summary: Configuration management and environment variable handling
|
|
102
|
+
File: logging/logger.py
|
|
103
|
+
Summary: Centralized logging configuration and utilities
|
|
112
104
|
</example_available_includes>
|
|
113
105
|
<example_string_of_includes>
|
|
114
106
|
% Here are examples of how to use internal modules:
|
|
115
107
|
<internal_example_modules>
|
|
116
|
-
% Here is an example of the change function that will be used:
|
|
108
|
+
% Here is an example of the change function that will be used:
|
|
109
|
+
<core.change_handler><include>core/change_handler.py</include></core.change_handler>
|
|
117
110
|
</internal_example_modules>
|
|
118
111
|
</example_string_of_includes>
|
|
119
112
|
</example_1>
|
|
@@ -155,70 +148,74 @@ Here are some examples of how to do this:
|
|
|
155
148
|
Step 7. Return the unit_test, total_cost and model_name
|
|
156
149
|
</example_input_prompt>
|
|
157
150
|
<example_available_includes>
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
context/find_section_example.py
|
|
179
|
-
context/fix_code_module_errors_example.py
|
|
180
|
-
context/fix_error_loop_example.py
|
|
181
|
-
context/fix_errors_from_unit_tests_example.py
|
|
182
|
-
context/generate_output_paths_example.py
|
|
183
|
-
context/generate_test_example.py
|
|
184
|
-
context/get_comment_example.py
|
|
185
|
-
context/get_extension_example.py
|
|
186
|
-
context/get_language_example.py
|
|
187
|
-
context/git_update_example.py
|
|
188
|
-
context/langchain_lcel_example.py
|
|
189
|
-
context/llm_selector_example.py
|
|
190
|
-
context/llm_token_counter_example.py
|
|
191
|
-
context/postprocess_0_example.py
|
|
192
|
-
context/postprocess_example.py
|
|
193
|
-
context/postprocessed_runnable_llm_output.py
|
|
194
|
-
context/preprocess_example.py
|
|
195
|
-
context/process_csv_change_example.py
|
|
196
|
-
context/prompt_caching.ipynb
|
|
197
|
-
context/split_example.py
|
|
198
|
-
context/tiktoken_example.py
|
|
199
|
-
context/trace_example.py
|
|
200
|
-
context/unfinished_prompt_example.py
|
|
201
|
-
context/unrunnable_raw_llm_output.py
|
|
202
|
-
context/update_prompt_example.py
|
|
203
|
-
context/xml_tagger_example.py
|
|
151
|
+
File: frameworks/langchain_utils.py
|
|
152
|
+
Summary: LangChain LCEL utilities and chain composition helpers
|
|
153
|
+
File: llm/model_selector.py
|
|
154
|
+
Summary: Dynamic LLM model selection based on task requirements
|
|
155
|
+
File: llm/token_counter.py
|
|
156
|
+
Summary: Token counting utilities for various LLM providers
|
|
157
|
+
File: processing/prompt_processor.py
|
|
158
|
+
Summary: Prompt preprocessing and template management functions
|
|
159
|
+
File: testing/test_generator.py
|
|
160
|
+
Summary: Automated unit test generation from code and prompts
|
|
161
|
+
File: processing/completion_detector.py
|
|
162
|
+
Summary: Functions to detect incomplete LLM outputs and continue generation
|
|
163
|
+
File: processing/output_postprocessor.py
|
|
164
|
+
Summary: Post-processing utilities for cleaning and formatting LLM outputs
|
|
165
|
+
File: utils/file_reader.py
|
|
166
|
+
Summary: Safe file reading utilities with encoding detection
|
|
167
|
+
File: config/environment.py
|
|
168
|
+
Summary: Environment variable management and project path resolution
|
|
169
|
+
File: markdown/renderer.py
|
|
170
|
+
Summary: Rich markdown rendering and formatting utilities
|
|
204
171
|
</example_available_includes>
|
|
205
172
|
<example_string_of_includes>
|
|
206
|
-
% Here is an example of a LangChain Expression Language (LCEL) program:
|
|
173
|
+
% Here is an example of a LangChain Expression Language (LCEL) program:
|
|
174
|
+
<frameworks.langchain_utils><include>frameworks/langchain_utils.py</include></frameworks.langchain_utils>
|
|
207
175
|
|
|
208
176
|
% Here are examples of how to use internal modules:
|
|
209
177
|
<internal_example_modules>
|
|
210
|
-
% Here is an example how to preprocess the prompt from a file:
|
|
178
|
+
% Here is an example how to preprocess the prompt from a file:
|
|
179
|
+
<processing.prompt_processor><include>processing/prompt_processor.py</include></processing.prompt_processor>
|
|
211
180
|
|
|
212
|
-
% Example of selecting a Langchain LLM and counting tokens using llm_selector:
|
|
181
|
+
% Example of selecting a Langchain LLM and counting tokens using llm_selector:
|
|
182
|
+
<llm.model_selector><include>llm/model_selector.py</include></llm.model_selector>
|
|
213
183
|
|
|
214
|
-
% Example usage of the unfinished_prompt function:
|
|
184
|
+
% Example usage of the unfinished_prompt function:
|
|
185
|
+
<processing.completion_detector><include>processing/completion_detector.py</include></processing.completion_detector>
|
|
215
186
|
|
|
216
|
-
% Here is an example how to continue the generation of a model output:
|
|
187
|
+
% Here is an example how to continue the generation of a model output:
|
|
188
|
+
<processing.completion_detector><include>processing/completion_detector.py</include></processing.completion_detector>
|
|
217
189
|
|
|
218
|
-
% Here is an example how to postprocess the model output result:
|
|
190
|
+
% Here is an example how to postprocess the model output result:
|
|
191
|
+
<processing.output_postprocessor><include>processing/output_postprocessor.py</include></processing.output_postprocessor>
|
|
219
192
|
</internal_example_modules>
|
|
220
193
|
</example_string_of_includes>
|
|
221
194
|
</example_2>
|
|
195
|
+
|
|
196
|
+
<example_3>
|
|
197
|
+
<example_input_prompt>
|
|
198
|
+
% You are an expert Python engineer. Build an admin-only HTTP endpoint.
|
|
199
|
+
% The function must be decorated with @require_admin from utils.auth_helpers.
|
|
200
|
+
% Use utils.db_helpers to query Firestore and utils.error_handling for structured errors.
|
|
201
|
+
</example_input_prompt>
|
|
202
|
+
<example_available_includes>
|
|
203
|
+
File: context/auth_helpers_example.py
|
|
204
|
+
Summary: Example usage of authentication/authorization helpers such as require_admin
|
|
205
|
+
File: context/db_helpers_example.py
|
|
206
|
+
Summary: Example usage of Firestore database helper utilities for queries and pagination
|
|
207
|
+
File: context/error_handling_example.py
|
|
208
|
+
Summary: Example usage of structured error handling and custom exceptions
|
|
209
|
+
</example_available_includes>
|
|
210
|
+
<example_string_of_includes>
|
|
211
|
+
% Here are examples of how to use internal modules:
|
|
212
|
+
<internal_example_modules>
|
|
213
|
+
<utils.auth_helpers><include>context/auth_helpers_example.py</include></utils.auth_helpers>
|
|
214
|
+
<utils.db_helpers><include>context/db_helpers_example.py</include></utils.db_helpers>
|
|
215
|
+
<utils.error_handling><include>context/error_handling_example.py</include></utils.error_handling>
|
|
216
|
+
</internal_example_modules>
|
|
217
|
+
</example_string_of_includes>
|
|
218
|
+
</example_3>
|
|
222
219
|
</examples>
|
|
223
220
|
|
|
224
221
|
<instructions>
|
|
@@ -226,5 +223,5 @@ Here are some examples of how to do this:
|
|
|
226
223
|
Step 1. Select possible includes from the available_includes based on the input_prompt.
|
|
227
224
|
Step 2. Explain why an include might or might not be necessary for the prompt.
|
|
228
225
|
Step 3. Determine the minimum set of includes required to achieve the goal of the input_prompt.
|
|
229
|
-
Step 4. Generate the string_of_includes based on Step 3
|
|
226
|
+
Step 4. Generate the string_of_includes based on Step 3, following <tag_naming_rules_for_step_4>.
|
|
230
227
|
</instructions>
|
pdd/prompts/change_LLM.prompt
CHANGED
|
@@ -15,9 +15,7 @@
|
|
|
15
15
|
</inputs_outputs_definitions>
|
|
16
16
|
|
|
17
17
|
<change_prompt_examples>
|
|
18
|
-
|
|
19
|
-
../prompts/xml/change_example_partial_processed.prompt
|
|
20
|
-
</include>
|
|
18
|
+
[File not found: ../prompts/xml/change_example_partial_processed.prompt]
|
|
21
19
|
</change_prompt_examples>
|
|
22
20
|
|
|
23
21
|
<context>
|