-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Summary
When generating a single file, pdd generate defines a function with one signature and then calls it with incompatible arguments later in the same file. This is an internal consistency failure within a single generation unit.
Evidence (from hackathon extension generation in pdd_cloud)
hackathon_compliance.py — wrong args to own function
Function definition (line 217):
def fetch_file_content(owner: str, repo: str, path: str, headers: Dict[str, str]) -> str:
url = f"{GITHUB_API_URL}/repos/{owner}/{repo}/contents/{path}"
response = requests.get(url, headers=headers)
...Call site (line 44):
readme_content = fetch_file_content(repo_url, 'README.md', github_token)3 arguments passed, 4 expected. And the types are wrong:
repo_url(full URL) passed asowner(username)'README.md'passed asrepo(repo name)github_token(string) passed aspath(file path)headers(dict) not passed at all
Other call sites in the same file (lines 178, 213, 237) call the function correctly with (owner, repo, path, headers). Only the trigger function got it wrong.
Root Cause
PDD likely generated the trigger function (on_submission_created) and the utility functions (fetch_file_content) in separate passes or contexts, and didn't cross-check the function signature when generating the call site.
Expected Behavior
PDD should verify that function calls match the function's signature within the same file. This is a basic consistency check that could catch:
- Wrong number of arguments
- Wrong argument order/types
- Missing required arguments
Impact
Runtime crash: TypeError: fetch_file_content() missing 1 required positional argument: 'headers'
Labels
pdd-bug