Skip to content

Commit eaeb009

Browse files
committed
Bump version
1 parent e91ec3a commit eaeb009

34 files changed

+1436
-180
lines changed

CHANGELOG.md

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,51 @@
1+
## v0.0.93 (2025-12-27)
2+
3+
### Feat
4+
5+
- enhance prompt functions with language support and output schema
6+
- add update command to Makefile for prompt updates based on code changes
7+
- add language parameter to various functions for improved language handling
8+
- implement .env file key management and improve project root detection
9+
- enhance cloud configuration and error handling
10+
11+
### Fix
12+
13+
- remove temporary 'NEW PARAMETER' comment
14+
- include Vertex AI credentials in retry calls for llm_invoke
15+
116
## v0.0.92 (2025-12-25)
217

318
### Feat
419

5-
- add cloud configuration examples and enhance path handling
6-
- support subdirectory basenames in output path generation
7-
- implement environment variable checks for cloud execution in code generator
8-
- enhance error handling for cloud execution in code generator
9-
- add centralized cloud configuration module for PDD CLI
10-
- enhance cloud URL configuration and authentication handling
11-
- enhance backup organization and schema validation
20+
- **Centralized Cloud Configuration:** Added `pdd/core/cloud.py` module providing `CloudConfig` class for consistent cloud URL configuration and JWT token handling across all cloud-enabled commands. Supports `PDD_CLOUD_URL` for testing against different environments (local emulator, staging, production) and `PDD_JWT_TOKEN` for pre-injected tokens in CI/CD pipelines.
21+
22+
- **Subdirectory Basename Support:** Updated `generate_output_paths`, `sync_main`, and `sync_orchestration` to handle module basenames with subdirectory paths (e.g., `core/cloud`). Directory structure is preserved in output filenames: `core/cloud` with pattern `test_{basename}.py` produces `core/test_cloud.py`.
23+
24+
- **Enhanced Cloud Error Handling:** Cloud code generation now distinguishes between recoverable errors (5xx, timeouts → local fallback) and non-recoverable errors (401 auth, 402 insufficient credits, 403 access denied, 400 validation → immediate failure with clear error message). Added `PDD_CLOUD_ONLY` and `PDD_NO_LOCAL_FALLBACK` env vars to disable local fallback.
25+
26+
- **CI/Headless Mode Detection:** Added automatic TTY detection for CI/non-interactive environments. When `--force` is set and running in headless mode (non-TTY), API key prompts are skipped and cloud authentication failures fail gracefully instead of blocking on user input.
1227

1328
### Fix
1429

15-
- resolve path resolution mismatch in sync_orchestration
16-
- mock isatty in test fixture for headless mode compatibility
17-
- extend --force to skip API key prompts in CI/headless environments
18-
- add headless mode detection for CI/non-TTY environments
19-
- add timeout and non-TTY mode for pdd sync in CI
20-
- rename code.py to buggy.py in agentic test fixtures
21-
- correct typo in prompt tag from <proompt_content> to <prompt_content>
22-
- package docs and add fallback path resolution for includes
30+
- **Path Resolution Mismatch (Issue #177):** Fixed `sync_orchestration` to use absolute paths when calling `code_generator_main` and `context_generator_main`, preventing path resolution mode conflicts between sync (`cwd`) and generate (`config_base`). Also ensures output directories exist before writing.
2331

24-
### Refactor
32+
- **Package Include Resolution (Issue #175):** `preprocess.py` now falls back to package directory when resolving `<include>` directives, allowing bundled docs like `docs/prompting_guide.md` to be found after pip/wheel installation.
33+
34+
- **Sync Log Subdirectory Handling:** All sync log and fingerprint file operations now use `_safe_basename()` to properly handle subdirectory basenames in filenames.
35+
36+
- **Prompt Tag Typo:** Corrected `<proompt_content>` to `<prompt_content>` in agentic fix prompt.
37+
38+
- **Agentic Test Fixtures:** Renamed `code.py` to `buggy.py` in agentic test fixtures to avoid confusion with module names.
39+
40+
### CI
41+
42+
- **Package Install Test Workflow:** Added `.github/workflows/package-test.yml` to validate that packaged PDD correctly resolves `<include>` directives for bundled docs when installed via pip/wheel (not editable install).
43+
44+
### Tests
2545

26-
- remove local _safe_basename function and update tests for subdirectory handling
27-
- centralize cloud configuration and authentication handling
46+
- Added 266 lines of tests in `tests/core/test_cloud.py` covering `CloudConfig` URL resolution, JWT token handling, and environment variable precedence.
47+
- Added subdirectory basename tests in `test_generate_output_paths.py` and `test_sync_orchestration.py`.
48+
- Added headless mode and force flag tests across sync and code generator modules.
2849

2950
## v0.0.91 (2025-12-24)
3051

Makefile

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ help:
3737
@echo " make public-diff ITEM=path - Show diff between public clone file and local file (uses same ITEM rules)"
3838
@echo " make sync-public - Fetch public remote and list commits missing locally"
3939
@echo "Fixing & Maintenance:"
40+
@echo " make update [MODULE=name] - Update prompt based on code changes (uses git)"
4041
@echo " make fix [MODULE=name] - Fix prompts command"
4142
@echo " make crash MODULE=name - Fix crashes in code"
4243
@echo " make detect CHANGE_FILE=path - Detect which prompts need changes based on a description file"
@@ -99,7 +100,7 @@ TEST_OUTPUTS := $(patsubst $(PDD_DIR)/%.py,$(TESTS_DIR)/test_%.py,$(PY_OUTPUTS))
99100
# All Example files in context directory (recursive)
100101
EXAMPLE_FILES := $(shell find $(CONTEXT_DIR) -name "*_example.py" 2>/dev/null)
101102

102-
.PHONY: all clean test requirements production coverage staging regression sync-regression all-regression install build analysis fix crash update-extension generate run-examples verify detect change lint publish publish-public publish-public-cap public-ensure public-update public-import public-diff sync-public
103+
.PHONY: all clean test requirements production coverage staging regression sync-regression all-regression install build analysis fix crash update update-extension generate run-examples verify detect change lint publish publish-public publish-public-cap public-ensure public-update public-import public-diff sync-public
103104

104105
all: $(PY_OUTPUTS) $(MAKEFILE_OUTPUT) $(CSV_OUTPUTS) $(EXAMPLE_OUTPUTS) $(TEST_OUTPUTS)
105106

@@ -401,6 +402,29 @@ else
401402
done
402403
endif
403404

405+
# Update prompt based on code changes
406+
update:
407+
ifdef MODULE
408+
@echo "Updating prompt for module: $(MODULE)"
409+
$(eval PY_FILE := $(PDD_DIR)/$(MODULE).py)
410+
$(eval PY_PROMPT := $(PROMPTS_DIR)/$(MODULE)_python.prompt)
411+
412+
@if [ ! -f "$(PY_FILE)" ]; then \
413+
echo "Error: Code file $(PY_FILE) not found."; \
414+
exit 1; \
415+
fi
416+
@if [ ! -f "$(PY_PROMPT)" ]; then \
417+
echo "Error: Prompt file $(PY_PROMPT) not found."; \
418+
exit 1; \
419+
fi
420+
421+
@echo "Updating $(PY_PROMPT) based on changes in $(PY_FILE)"
422+
conda run -n pdd --no-capture-output pdd --verbose update --git $(PY_PROMPT) $(PY_FILE)
423+
else
424+
@echo "Running repository-wide prompt update"
425+
conda run -n pdd --no-capture-output pdd --verbose update
426+
endif
427+
404428
# Generate requirements.txt
405429
requirements:
406430
@echo "Generating requirements.txt"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PDD (Prompt-Driven Development) Command Line Interface
22

3-
![PDD-CLI Version](https://img.shields.io/badge/pdd--cli-v0.0.92-blue) [![Discord](https://img.shields.io/badge/Discord-join%20chat-7289DA.svg?logo=discord&logoColor=white)](https://discord.gg/Yp4RTh8bG7)
3+
![PDD-CLI Version](https://img.shields.io/badge/pdd--cli-v0.0.93-blue) [![Discord](https://img.shields.io/badge/Discord-join%20chat-7289DA.svg?logo=discord&logoColor=white)](https://discord.gg/Yp4RTh8bG7)
44

55
## Introduction
66

@@ -285,7 +285,7 @@ export PDD_TEST_OUTPUT_PATH=/path/to/tests/
285285

286286
## Version
287287

288-
Current version: 0.0.92
288+
Current version: 0.0.93
289289

290290
To check your installed version, run:
291291
```
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
{
2-
"pdd_version": "0.0.88",
3-
"timestamp": "2025-12-22T08:35:27.733455+00:00",
2+
"pdd_version": "0.0.92",
3+
"timestamp": "2025-12-27T06:20:47.556501+00:00",
44
"command": "test",
55
"prompt_hash": "f8df355ee1c6e73a393a00c18232048a83fde694b33c472771246631a3724bf6",
6-
"code_hash": "29aa57b99745c5b05294fd6a6d1824c48f5aa98ede79f1749dc095f347c8953c",
7-
"example_hash": "81ef141e1fdd1e87c85f288e5be103edba9f404b7bfc7e0320d42c8aa4af3235",
8-
"test_hash": "194b2eb564e82c016b45813ee19df84149c3e539becb487e2bc805f2e244ef2f"
6+
"code_hash": "3550d60e3f28f2b52aa5e96d6d30d71a39d96034999119e6b03c992d561ebfb8",
7+
"example_hash": "0457722ba39ac828b1735059a263f8ec351f702c0e27f7944687bed2a2a0b1b3",
8+
"test_hash": "f1d1487a1384af1c7eceaa1eca0d9ed4251e832ce2bf7d8b41be41fbccb5c57e",
9+
"test_files": {
10+
"test_hello.py": "f1d1487a1384af1c7eceaa1eca0d9ed4251e832ce2bf7d8b41be41fbccb5c57e"
11+
}
912
}
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
2-
"timestamp": "2025-12-23T07:41:46.034334+00:00",
2+
"timestamp": "2025-12-27T06:20:47.161210+00:00",
33
"exit_code": 0,
44
"tests_passed": 3,
55
"tests_failed": 0,
66
"coverage": 100.0,
7-
"test_hash": "0d66a51dff392f38ad3f13bce1bd9ae5e2dbff20186ecec77f42e8ac00f11eb5"
7+
"test_hash": "f1d1487a1384af1c7eceaa1eca0d9ed4251e832ce2bf7d8b41be41fbccb5c57e",
8+
"test_files": {
9+
"test_hello.py": "f1d1487a1384af1c7eceaa1eca0d9ed4251e832ce2bf7d8b41be41fbccb5c57e"
10+
}
811
}

examples/hello/C

Whitespace-only changes.

examples/hello/E

Whitespace-only changes.

examples/hello/T

Whitespace-only changes.
Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
11
import sys
22
import os
33

4-
# Add the source directory to the system path to allow importing the module.
5-
# The module is located in the '../src' directory relative to this script.
4+
# Add the src directory to the system path to allow importing the hello module
5+
# This ensures the example is portable and can find the module relative to this script's location
66
current_dir = os.path.dirname(os.path.abspath(__file__))
77
src_path = os.path.join(current_dir, '..', 'src')
88
sys.path.append(src_path)
99

10-
# Import the specific function from the module
1110
from hello import hello
1211

13-
def main():
12+
def run_example():
1413
"""
15-
Demonstrates the usage of the hello module.
14+
Demonstrates the usage of the hello function from the hello module.
15+
16+
Input Parameters:
17+
None
18+
19+
Output:
20+
Prints "hello" to the standard output.
1621
"""
17-
print("Calling hello() function:")
22+
print("--- Running hello() example ---")
1823

1924
# Call the hello function
20-
# Input: None
21-
# Output: Prints "hello" to standard output
25+
# This function takes no arguments and returns None.
26+
# Its primary side effect is printing to the console.
2227
hello()
2328

29+
print("--- Example complete ---")
30+
2431
if __name__ == "__main__":
25-
main()
32+
run_example()

examples/hello/h_python.prommpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
write a python function 'hello' that prints "hello"

0 commit comments

Comments
 (0)