Add failing tests for #1284#1302
Draft
prompt-driven-github[bot] wants to merge 1 commit into
Draft
Conversation
Changed-file detection uses whitespace-blind `git diff --name-only`, so a trailing-whitespace-only commit is treated as a real code change. This reclassifies the module to an `update` op and triggers a spurious heal, failing auto-heal on approved, otherwise-green PRs. Adds behavioral tests (real git repos) covering all three code sites (ci_drift_heal, scripts/ and pdd/ ci_detect_changed_modules) plus the caller paths (detect_drift, detect). Also corrects the source-of-truth prompt specs to mandate whitespace-aware detection via `git diff -w --numstat`. Tests fail on current code and will pass once detection ignores whitespace-only changes. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds failing tests that detect the bug reported in #1284:
auto-healfails on whitespace-only PR commits.Test Files
tests/test_ci_drift_heal.py— Tests 1–4 (direct_get_git_changed_files+ callerdetect_drift)tests/test_ci_detect_changed_modules.py— Tests 5–7 (scripts/ source, pdd/ mirror, callerdetect())Prompt Files (Step 7 fixes)
pdd/prompts/ci_drift_heal_python.prompt— mandates whitespace-aware change detectionpdd/prompts/ci_detect_changed_modules_python.prompt— replacesgit diff --name-onlywithgit diff -w --numstatWhat This PR Contains
subprocess.run) that reproduce the reported bugRoot Cause
Changed-file detection uses whitespace-blind
git diff --name-only <base>inpdd/ci_drift_heal.py:_get_git_changed_files(and the sibling_git_changed_filesin bothpdd/andscripts/ci_detect_changed_modules.py). A trailing-whitespace-only commit is reported as a changed file, sodetect_driftreclassifies the module to anupdateoperation and triggers a spuriouspdd updateheal — failing auto-heal on an approved, otherwise-green PR. The fix is to derive the changed set fromgit diff -w --numstat <base>(path column); notegit diff -w --name-onlydoes NOT work because-wdoes not affect tree-level name selection.Next Steps
git diff -w --numstat, third tab-separated path field), keeping thepdd/mirror byte-identical to thescripts/sourceFixes #1284
Generated by PDD agentic bug workflow