You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+54-9Lines changed: 54 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,67 @@
1
+
## v0.0.87 (2025-12-18)
2
+
1
3
## v0.0.86 (2025-12-17)
2
4
3
5
### Feat
4
6
5
-
- add metadata files for Python test command execution results and configuration
6
-
- add encode_message prompt for encoding functionality in Python
7
-
- add encode_message prompt for regression tests and enhance test auto-discovery in integration tests
8
-
- enhance LLM prompts with detailed mock vs production code guidance and improve integration test script for clarity
9
-
- add integration and static tests for mock vs production code guidance in LLM prompts
10
-
- enhance unit test inclusion in code generation, implement example error detection, and improve directory summarization; update README and tests accordingly
7
+
-**`--dry-run` Flag for Sync Command:** Renamed the `--log` flag to `--dry-run` for clearer semantics. The `--dry-run` flag analyzes sync state without executing operations, showing what sync would do. The old `--log` flag is deprecated with a warning directing users to use `--dry-run` instead.
8
+
9
+
-**Mock vs Production Code Guidance in LLM Prompts:** Added comprehensive guidance to `fix_verification_errors_LLM.prompt` and `find_verification_errors_LLM.prompt` for distinguishing mock configuration errors from production code errors. Prompts now instruct the LLM to:
10
+
- Identify test files using mocks (MagicMock, unittest.mock, patch)
11
+
- Check mock setup FIRST when errors occur (wrong `return_value` structure, missing `__getitem__` configuration)
12
+
- Preserve production code API usage patterns unless documentation proves otherwise
13
+
- Follow a diagnosis priority: mock configuration → mock chaining → production code
14
+
15
+
-**Unit Test Auto-Discovery Regression Test:** Added regression test #20 to `tests/regression.sh` that validates the `generate` command's unit test auto-discovery feature. Tests both `--exclude-tests` mode (no context, expects failure) and default auto-discovery mode (expects success).
16
+
17
+
-**Encode Message Prompt:** Added `prompts/encode_message_python.prompt` as a simple prompt for testing unit test auto-discovery and regression test scenarios.
11
18
12
19
### Fix
13
20
14
-
- improve verification success tracking in error fixing loop and update related tests
15
-
- add run_attempt to branch name for re-run support
21
+
-**Verification Success Tracking Bug:** Fixed a critical bug in `fix_verification_errors_loop` where the function incorrectly reported "No improvement found" when secondary verification passed but the issue count didn't decrease. Added `any_verification_passed` flag that tracks when code was actually changed AND secondary verification passed. The function now correctly returns `success=True` when verification passes, even if the LLM's issue count assessment is unchanged. This ensures code that compiles and runs correctly is recognized as successful. Key changes:
22
+
- Track `any_verification_passed` separately from best iteration tracking
23
+
- Only set flag when `code_updated=True` AND verification passes
24
+
- Return `success=True` with `final_issues=0` when verification passed
16
25
17
26
### Refactor
18
27
19
-
- remove unused warnings import from maintenance commands
28
+
-**Remove Unused Warnings Import:** Cleaned up unused `warnings` import from `pdd/commands/maintenance.py`.
29
+
30
+
-**Error Fixing Loop Prompt Simplification:** Streamlined `prompts/fix_verification_errors_loop_python.prompt` from 123 lines to 63 lines by:
31
+
- Condensing implementation details into "behavior defined by test suite" directive
32
+
- Listing key behaviors to implement without step-by-step instructions
33
+
- Focusing on inputs/outputs and test compliance
34
+
35
+
### Docs
36
+
37
+
-**Prompting Guide Major Update:** Significantly expanded `docs/prompting_guide.md` with ~200 lines of new content:
38
+
-**Automated Grounding (PDD Cloud):** Explains how vector embedding and similarity search automatically provides few-shot examples during generation
39
+
-**Grounding Overrides:** Documents `<pin>module_name</pin>` and `<exclude>module_name</exclude>` tags for controlling automatic example retrieval
40
+
-**Three Pillars of PDD Generation:** New section explaining how Prompt (WHAT), Grounding (HOW), and Tests (CORRECTNESS) work together
41
+
-**Prompt Abstraction Guidance:** Added 10-30% prompt-to-code ratio target with clear guidelines on what NOT to include in prompts
42
+
-**Non-Deterministic Tag Warnings:** Added explicit warnings about `<shell>` and `<web>` tags introducing environment-dependent behavior
43
+
-**Requirements Writing Guide:** Expanded with before/after examples and testability criteria
44
+
45
+
### Tests
46
+
47
+
- Added 320+ lines of verification loop tests in `tests/test_fix_verification_errors_loop.py` covering:
48
+
- Verification passes but issue count unchanged (regression test for the bug)
49
+
- Best iteration restored with verification passed
50
+
- Proper `any_verification_passed` flag behavior
51
+
- Success determination based on verification outcome vs issue count
52
+
53
+
- Added 130+ lines of maintenance command tests in `tests/test_commands_maintenance.py` covering:
54
+
-`@track_cost` decorator verification for sync and auto-deps commands
55
+
- Deprecated `--log` flag warning emission and `dry_run=True` propagation
56
+
-`click.Abort` re-raising (not caught by generic error handlers)
57
+
- Error handling with correct arguments to `handle_error`
58
+
-`ctx.obj=None` graceful handling in setup command
59
+
60
+
- Added 68 lines of static prompt tests in `tests/test_mock_vs_production_fix.py` verifying:
Copy file name to clipboardExpand all lines: SETUP_WITH_GEMINI.md
+39-22Lines changed: 39 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
This example shows you how to set up **Prompt-Driven Development (PDD)** with a free **Gemini API key** and run the built-in **Hello** example.
4
4
5
-
> **Goal:** By the end, you’ll have PDD installed, Gemini configured, and `pdd generate` running on the Hello example.
5
+
> **Goal:** By the end, you'll have PDD installed, Gemini configured, and `pdd sync` running on the Hello example.
6
6
7
7
---
8
8
@@ -82,11 +82,13 @@ cd pdd/examples/hello
82
82
83
83
If you already pasted the key into `pdd setup`, you can skip this section. Otherwise:
84
84
85
-
1. Go to [Google AI Studio](https://aistudio.google.com/app/apikey).
86
-
2. Log in with your Google account.
87
-
3. Click **Create API key**.
85
+
1. Go to [Google AI Studio](https://aistudio.google.com/app/apikey).
86
+
2. Log in with your Google account.
87
+
3. Click **Create API key**.
88
88
4. Copy the key.
89
89
90
+
> **Students:** The Gemini API is free for everyone, but university students get higher rate limits (60 requests/min, 300K tokens/day) extended through June 2026. You can also claim [1 year of Google AI Pro free](https://gemini.google/students/) (sign up by Jan 31, 2026) for additional perks like NotebookLM and 2TB storage.
91
+
90
92
**macOS/Linux (bash/zsh)**
91
93
```bash
92
94
export GEMINI_API_KEY="PASTE_YOUR_KEY_HERE"
@@ -122,10 +124,9 @@ head -2 ~/.pdd/llm_model.csv
122
124
123
125
---
124
126
125
-
## 6. Output locations (tests & examples)
127
+
## 6. Output locations (optional, skip for this quickstart)
126
128
127
-
By default, PDD writes generated files next to your source code.
128
-
To keep repos tidy, set these environment variables once (e.g., in `~/.zshrc` or `~/.bashrc`):
129
+
By default, PDD writes generated files next to your source code. For real projects, you can set these environment variables to organize outputs:
129
130
130
131
```bash
131
132
export PDD_TEST_OUTPUT_PATH=tests
@@ -136,36 +137,52 @@ With these set, PDD will place outputs like so:
136
137
- Examples → `examples/<module>/...`
137
138
- Tests → `tests/<module>/...`
138
139
140
+
> **Note:** For the Hello example below, leave these unset so files generate in the current directory.
141
+
139
142
---
140
143
141
-
## 7. Run the Hello Example
144
+
## 7. Validate Your Setup
145
+
146
+
Before using the main workflow, verify your configuration works by running a quick generate:
142
147
143
148
From `pdd/examples/hello`:
144
149
145
150
```bash
146
-
# generate code from the prompt
147
151
pdd generate hello_python.prompt
152
+
```
153
+
154
+
If this succeeds, your API key and model configuration are working correctly.
155
+
156
+
---
157
+
158
+
## 8. Use Sync (Primary Workflow)
159
+
160
+
The `pdd sync` command is the primary way to work with PDD. It generates code, tests, and examples for a module, keeping everything in sync:
148
161
149
-
# run the generated example if it has a main block
150
-
python examples/hello/hello.py
162
+
```bash
163
+
pdd sync hello
151
164
```
152
165
153
-
If the generated `hello.py` is minimal (no `__main__` block), run it interactively:
166
+
Use `--force` to regenerate even if files already exist:
154
167
155
168
```bash
156
-
python -i examples/hello/hello.py
157
-
>>> hello()
158
-
hello
169
+
pdd --force sync hello
159
170
```
160
171
161
-
---
162
-
## 8. (Optional) Sync
172
+
After syncing, run the generated example:
163
173
164
-
After you’ve confirmed `generate` works:
174
+
```bash
175
+
python hello.py
176
+
```
177
+
178
+
If the generated `hello.py` is minimal (no `__main__` block), run it interactively:
165
179
166
180
```bash
167
-
pdd --force sync hello
181
+
python -i hello.py
182
+
>>> hello()
183
+
hello
168
184
```
185
+
169
186
---
170
187
171
188
## 9. What if nothing prints?
@@ -181,7 +198,7 @@ In that case you have two options:
181
198
182
199
### Option A — Run interactively
183
200
```bash
184
-
python -i examples/hello/hello.py
201
+
python -i hello.py
185
202
>>> hello()
186
203
hello
187
204
```
@@ -194,10 +211,10 @@ if __name__ == "__main__":
194
211
```
195
212
Then re-run:
196
213
```bash
197
-
python examples/hello/hello.py
214
+
python hello.py
198
215
# output:
199
216
hello
200
217
```
201
218
202
219
203
-
✅ That’s it! You’ve installed PDD, configured Gemini, set up the model CSV, and generated your first working example.
220
+
✅ That's it! You've installed PDD, configured Gemini, and used `pdd sync` to generate your first module.
0 commit comments