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
pdd/prompts/split_LLM.prompt
CHANGED
|
@@ -1,65 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
% Here are some examples of splitting prompts:
|
|
3
|
-
<examples>
|
|
4
|
-
|
|
5
|
-
<example_1>
|
|
6
|
-
<1_input_prompt><include>./context/split/1/initial_pdd_python.prompt</include></1_input_prompt>
|
|
7
|
-
<1_input_code><include>./context/split/1/pdd.py</include></1_input_code>
|
|
8
|
-
<1_example_code><include>./context/split/1/split_get_extension.py</include></1_example_code>
|
|
9
|
-
<1_sub_prompt><include>./context/split/1/sub_pdd_python.prompt</include></1_sub_prompt>
|
|
10
|
-
<1_modified_prompt><include>./context/split/1/final_pdd_python.prompt</include></1_modified_prompt>
|
|
11
|
-
</example_1>
|
|
12
|
-
|
|
13
|
-
<example_2>
|
|
14
|
-
<2_input_prompt><include>./context/split/2/initial_pdd_python.prompt</include></2_input_prompt>
|
|
15
|
-
<2_input_code><include>./context/split/2/pdd.py</include></2_input_code>
|
|
16
|
-
<2_example_code><include>./context/split/2/split_pdd_construct_output_path.py</include></2_example_code>
|
|
17
|
-
<2_sub_prompt><include>./context/split/2/sub_pdd_python.prompt</include></2_sub_prompt>
|
|
18
|
-
<2_modified_prompt><include>./context/split/2/final_pdd_python.prompt</include></2_modified_prompt>
|
|
19
|
-
</example_2>
|
|
20
|
-
|
|
21
|
-
<example_3>
|
|
22
|
-
<3_input_prompt><include>./context/split/3/initial_postprocess_python.prompt</include></3_input_prompt>
|
|
23
|
-
<3_input_code><include>./context/split/3/postprocess.py</include></3_input_code>
|
|
24
|
-
<3_example_code><include>./context/split/3/split_postprocess_find_section.py</include></3_example_code>
|
|
25
|
-
<3_sub_prompt><include>./context/split/3/sub_postprocess_python.prompt</include></3_sub_prompt>
|
|
26
|
-
<3_modified_prompt><include>./context/split/3/final_postprocess_python.prompt</include></3_modified_prompt>
|
|
27
|
-
</example_3>
|
|
28
|
-
|
|
29
|
-
<example_4>
|
|
30
|
-
<4_input_prompt><include>./context/split/4/initial_construct_paths_python.prompt</include></4_input_prompt>
|
|
31
|
-
<4_input_code><include>./context/split/4/construct_paths.py</include></4_input_code>
|
|
32
|
-
<4_example_code><include>./context/split/4/split_construct_paths_generate_output_filename.py</include></4_example_code>
|
|
33
|
-
<4_sub_prompt><include>./context/split/4/sub_construct_paths_python.prompt</include></4_sub_prompt>
|
|
34
|
-
<4_modified_prompt><include>./context/split/4/final_construct_paths_python.prompt</include></4_modified_prompt>
|
|
35
|
-
</example_4>
|
|
36
|
-
|
|
37
|
-
<example_5>
|
|
38
|
-
<5_input_prompt><include>context/split/5/cli_python.prompt</include></5_input_prompt>
|
|
39
|
-
<5_input_code><include>context/split/5/cli.py</include></5_input_code>
|
|
40
|
-
<5_example_code><include>context/split/5/split_track_cost.py</include></5_example_code>
|
|
41
|
-
<5_sub_prompt><include>context/split/5/track_cost_python.prompt</include></5_sub_prompt>
|
|
42
|
-
<5_modified_prompt><include>context/split/5/modified_cli_python.prompt</include></5_modified_prompt>
|
|
43
|
-
</example_5>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<example_6>
|
|
47
|
-
<6_input_prompt><include>context/split/6/cli_python.prompt</include></6_input_prompt>
|
|
48
|
-
<6_input_code><include>context/split/6/cli.py</include></6_input_code>
|
|
49
|
-
<6_example_code><include>context/split/6/split_conflicts.py</include></6_example_code>
|
|
50
|
-
<6_sub_prompt><include>context/split/6/conflicts_main_python.prompt</include></6_sub_prompt>
|
|
51
|
-
<6_modified_prompt><include>context/split/6/modified_cli_python.prompt</include></6_modified_prompt>
|
|
52
|
-
</example_6>
|
|
53
|
-
|
|
54
|
-
<example_7>
|
|
55
|
-
<7_input_prompt><include>context/split/7/cli_python.prompt</include></7_input_prompt>
|
|
56
|
-
<7_input_code><include>context/split/7/cli.py</include></7_input_code>
|
|
57
|
-
<7_example_code><include>context/split/7/split_trace_main.py</include></7_example_code>
|
|
58
|
-
<7_sub_prompt><include>context/split/7/trace_main_python.prompt</include></7_sub_prompt>
|
|
59
|
-
<7_modified_prompt><include>context/split/7/modified_cli_python.prompt</include></7_modified_prompt>
|
|
60
|
-
</example_7>
|
|
61
|
-
</examples>
|
|
62
|
-
</pdd>
|
|
1
|
+
|
|
63
2
|
|
|
64
3
|
<context>
|
|
65
4
|
% You are an expert LLM Prompt Engineer. Your goal is to split the input_prompt (a larger prompt) into a sub_prompt and modified_prompt (two smaller prompts) with no loss of functionality. This is to make it easier to generate and test the modules easier.
|
pdd/prompts/trace_LLM.prompt
CHANGED
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
%
|
|
2
|
-
|
|
3
|
-
%
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
% You are a highly accurate Python Software Engineer. Your job is to locate the exact line (or smallest excerpt) in the prompt file that produced the current line in the generated code.
|
|
2
|
+
|
|
3
|
+
% Inputs
|
|
4
|
+
code_file (str) : full contents of the generated code file
|
|
5
|
+
code_str (str) : the single line from the code file currently under inspection
|
|
6
|
+
prompt_file (str) : full contents of the originating prompt file
|
|
7
|
+
|
|
8
|
+
% Rules
|
|
9
|
+
1. Identify the minimal substring in prompt_file whose wording most directly corresponds to code_str. Copy it VERBATIM.
|
|
10
|
+
2. Do not paraphrase, summarize, or reformat; the substring must appear exactly in prompt_file.
|
|
11
|
+
3. If multiple lines apply, choose the most specific line or snippet (prefer the shortest exact match).
|
|
12
|
+
4. Provide a short explanation of why the substring matches code_str.
|
|
13
|
+
|
|
14
|
+
% Output format (MUST follow exactly; no additional text)
|
|
15
|
+
<analysis>
|
|
16
|
+
Explain your reasoning here in plain text (no JSON). Reference the file sections you compared.
|
|
17
|
+
</analysis>
|
|
18
|
+
<verbatim_prompt_line>
|
|
19
|
+
<<PASTE THE EXACT SUBSTRING FROM prompt_file HERE>>
|
|
20
|
+
</verbatim_prompt_line>
|
|
21
|
+
|
|
22
|
+
% Reference materials
|
|
13
23
|
<code_file>
|
|
14
|
-
|
|
24
|
+
{CODE_FILE}
|
|
15
25
|
</code_file>
|
|
16
26
|
|
|
17
|
-
% Here is the code_str to reference:
|
|
18
|
-
|
|
19
27
|
<code_str>
|
|
20
|
-
|
|
28
|
+
{CODE_STR}
|
|
21
29
|
</code_str>
|
|
22
30
|
|
|
23
|
-
% Here is the prompt_file to reference:
|
|
24
|
-
|
|
25
31
|
<prompt_file>
|
|
26
|
-
|
|
32
|
+
{PROMPT_FILE}
|
|
27
33
|
</prompt_file>
|
|
28
|
-
|
|
29
|
-
% To generate the prompt_line, find a substring of prompt_file that matches code_str, which is a substring of code_file.
|
|
30
|
-
|
|
@@ -1,18 +1,102 @@
|
|
|
1
1
|
% You are tasked with determining whether a given prompt has finished outputting everything or if it still needs to continue. This is crucial for ensuring that all necessary information has been provided before proceeding with further actions. You will often be provided the last few hundred characters of the prompt_text to analyze and determine if it appears to be complete or if it seems to be cut off or unfinished. You are just looking at the prompt_text and not the entire prompt file. The beginning part of the prompt_text is not always provided, so you will need to make a judgment based on the text you are given.
|
|
2
2
|
|
|
3
|
+
% IMPORTANT:
|
|
4
|
+
% - The prompt_text may contain code in various languages without Markdown fences.
|
|
5
|
+
% - Do NOT require triple backticks for completeness; judge the code/text itself.
|
|
6
|
+
% - Prefer concrete syntactic signals of completeness over stylistic ones.
|
|
7
|
+
|
|
3
8
|
% Here is the prompt text to analyze:
|
|
4
9
|
<prompt_text>
|
|
5
10
|
{PROMPT_TEXT}
|
|
6
11
|
</prompt_text>
|
|
7
12
|
|
|
13
|
+
% Optional language hint (may be empty or missing). If not provided, infer the language from the text:
|
|
14
|
+
<language>
|
|
15
|
+
{LANGUAGE}
|
|
16
|
+
</language>
|
|
17
|
+
|
|
8
18
|
% Carefully examine the provided prompt text and determine if it appears to be complete or if it seems to be cut off or unfinished. Consider the following factors:
|
|
9
19
|
1. Sentence structure: Are all sentences grammatically complete?
|
|
10
20
|
2. Content flow: Does the text end abruptly or does it have a natural conclusion?
|
|
11
21
|
3. Context: Based on the content, does it seem like all necessary information has been provided?
|
|
12
22
|
4. Formatting: Are there any unclosed parentheses, quotation marks, or other formatting issues that suggest incompleteness?
|
|
13
23
|
|
|
24
|
+
% Multi-language code completeness heuristics (apply when text looks like code):
|
|
25
|
+
- If the text forms a syntactically complete module/snippet for the language, treat it as finished (even without Markdown fences).
|
|
26
|
+
- Generic signals across languages:
|
|
27
|
+
* Balanced delimiters: (), [], {{}}, quotes, and block comments are closed.
|
|
28
|
+
* No mid-token/mid-statement tail: it does not end on `return a +`, `a =`, `def foo(`, `function f(`, trailing `.`, `->`, `::`, trailing `,`, or a line-continuation like `\\`.
|
|
29
|
+
* Block closure: constructs that open a block are closed (e.g., Python indentation after `:`, or matching `{{}}` in C/Java/JS/TS/Go).
|
|
30
|
+
- Language specifics (use LANGUAGE if given; otherwise infer from the text):
|
|
31
|
+
* Python: colon-introduced blocks closed; indentation consistent; triple-quoted strings balanced.
|
|
32
|
+
* JS/TS: braces and parentheses balanced; no dangling `export`/`import` without a following specifier; `/* ... */` comments closed.
|
|
33
|
+
* Java/C/C++/C#: braces and parentheses balanced; string/char literals closed; block comments closed.
|
|
34
|
+
* Go: braces balanced; no dangling keyword indicating an unfinished clause.
|
|
35
|
+
* HTML/XML: tags properly nested/closed; attributes properly quoted; no unfinished `<tag` or dangling `</`.
|
|
36
|
+
- If this is only the tail of a longer file, mark finished when the tail itself is syntactically complete and does not indicate a dangling continuation.
|
|
37
|
+
|
|
14
38
|
% Provide your reasoning for why you believe the prompt is complete or incomplete.
|
|
15
39
|
|
|
16
40
|
% Output a JSON object with two keys:
|
|
17
41
|
1. "reasoning": A string containing your structured reasoning
|
|
18
|
-
2. "is_finished": A boolean value (true if the prompt is complete, false if it's incomplete)
|
|
42
|
+
2. "is_finished": A boolean value (true if the prompt is complete, false if it's incomplete)
|
|
43
|
+
|
|
44
|
+
% Examples (concise):
|
|
45
|
+
<examples>
|
|
46
|
+
<example1>
|
|
47
|
+
<input>
|
|
48
|
+
<prompt_text>
|
|
49
|
+
def add(a, b):\n return a + b\n
|
|
50
|
+
</prompt_text>
|
|
51
|
+
</input>
|
|
52
|
+
<output>
|
|
53
|
+
{{"reasoning": "Python code parses; blocks and quotes are closed; ends on a complete return statement.", "is_finished": true}}
|
|
54
|
+
</output>
|
|
55
|
+
</example1>
|
|
56
|
+
<example2>
|
|
57
|
+
<input>
|
|
58
|
+
<prompt_text>
|
|
59
|
+
def add(a, b):\n return a +
|
|
60
|
+
</prompt_text>
|
|
61
|
+
</input>
|
|
62
|
+
<output>
|
|
63
|
+
{{"reasoning": "Ends mid-expression (`return a +`), indicates unfinished statement.", "is_finished": false}}
|
|
64
|
+
</output>
|
|
65
|
+
</example2>
|
|
66
|
+
<example3>
|
|
67
|
+
<input>
|
|
68
|
+
<prompt_text>
|
|
69
|
+
function add(a, b) {{\n return a + b;\n}}\n
|
|
70
|
+
</prompt_text>
|
|
71
|
+
<language>
|
|
72
|
+
JavaScript
|
|
73
|
+
</language>
|
|
74
|
+
</input>
|
|
75
|
+
<output>
|
|
76
|
+
{{"reasoning": "JS braces and parentheses balanced; ends at a statement boundary; no dangling tokens.", "is_finished": true}}
|
|
77
|
+
</output>
|
|
78
|
+
</example3>
|
|
79
|
+
<example4>
|
|
80
|
+
<input>
|
|
81
|
+
<prompt_text>
|
|
82
|
+
<div class=\"box\">Hello
|
|
83
|
+
</prompt_text>
|
|
84
|
+
<language>
|
|
85
|
+
HTML
|
|
86
|
+
</language>
|
|
87
|
+
</input>
|
|
88
|
+
<output>
|
|
89
|
+
{{"reasoning": "HTML tag not closed (missing </div>); attribute quotes OK but element is unclosed.", "is_finished": false}}
|
|
90
|
+
</output>
|
|
91
|
+
</example4>
|
|
92
|
+
<example5>
|
|
93
|
+
<input>
|
|
94
|
+
<prompt_text>
|
|
95
|
+
class C:\n def f(self):\n x = 1\n
|
|
96
|
+
</prompt_text>
|
|
97
|
+
</input>
|
|
98
|
+
<output>
|
|
99
|
+
{{"reasoning": "All blocks properly indented and closed in the visible tail; no dangling colon blocks or open delimiters; tail is syntactically complete.", "is_finished": true}}
|
|
100
|
+
</output>
|
|
101
|
+
</example5>
|
|
102
|
+
</examples>
|
|
@@ -16,4 +16,25 @@
|
|
|
16
16
|
1. Using the provided input_code and input_prompt, identify what the code does and how it was generated.
|
|
17
17
|
2. Compare the input_code and modified_code to determine the changes made by the user.
|
|
18
18
|
3. Identify what the modified_code does differently from the input_code.
|
|
19
|
-
4. Generate a modified_prompt that will guide the generation of the modified_code based on the identified changes.
|
|
19
|
+
4. Generate a modified_prompt that will guide the generation of the modified_code based on the identified changes.
|
|
20
|
+
5. Ensure that the modified_prompt adheres to the principles of Prompt-Driven Development (PDD) and includes all necessary sections: Role and Scope, Requirements, Dependencies & Context, Instructions, and Deliverables.
|
|
21
|
+
6. Try to preserve the structure and format of the existing prompt as much as possible while incorporating the necessary changes to reflect the modifications in the code.
|
|
22
|
+
|
|
23
|
+
% When generating the modified prompt, you must follow the core principles of Prompt-Driven Development (PDD).
|
|
24
|
+
% Here are the essential guidelines for structuring a PDD prompt:
|
|
25
|
+
<pdd_prompting_guide>
|
|
26
|
+
% The prompt you generate must follow this structure:
|
|
27
|
+
1) First paragraph: describe the role and responsibility of the module/component within the system (consider the LAYER if provided).
|
|
28
|
+
2) A "Requirements" section with numbered points covering functionality, contracts, error handling, validation, logging, performance, and security.
|
|
29
|
+
3) A "Dependencies" section using XML include tags for each dependency (see format below).
|
|
30
|
+
4) An "Instructions" section with precise implementation guidance (clarify inputs/outputs, function/class responsibilities, edge cases, and testing notes).
|
|
31
|
+
5) A clear "Deliverable" section describing the expected code artifacts and entry points.
|
|
32
|
+
|
|
33
|
+
% Dependencies format and conventions:
|
|
34
|
+
- Represent each dependency using an XML tag with the dependency name, and put the file path inside an <include> tag. For example:
|
|
35
|
+
<orders_service>
|
|
36
|
+
<include>context/orders_service_example.py</include>
|
|
37
|
+
</orders_service>
|
|
38
|
+
- Prefer real example files available in the provided context (use <include-many> when listing multiple). If examples are not provided, assume dependency examples live under context/ using the pattern context/[dependency_name]_example. You should always try to include example files when possible.
|
|
39
|
+
- Include all necessary dependencies for the module/component (based on the provided context and references).
|
|
40
|
+
</pdd_prompting_guide>
|