Skip to content

Add failing tests for #522: fingerprint ignores include deps#527

Draft
Serhan-Asad wants to merge 2 commits intopromptdriven:mainfrom
Serhan-Asad:fix/issue-522
Draft

Add failing tests for #522: fingerprint ignores include deps#527
Serhan-Asad wants to merge 2 commits intopromptdriven:mainfrom
Serhan-Asad:fix/issue-522

Conversation

@Serhan-Asad
Copy link
Contributor

Summary

Adds failing tests that detect the bug reported in #522.

Test Files

  • Unit test: tests/test_sync_determine_operation.py
  • E2E test: tests/test_e2e_issue_522_include_fingerprint.py

What This PR Contains

  • Failing unit tests that reproduce the reported bug (included file changes → sync should regenerate but returns 'verify'/'nothing')
  • Failing E2E test that verifies the bug at integration level
  • Tests are verified to fail on current code and will pass once the bug is fixed

Root Cause

The fingerprint system in sync_determine_operation.py:1364 computes the hash using only calculate_sha256(paths['prompt']) — the raw top-level .prompt file. <include> dependencies are never resolved or hashed. When an included file changes but the top-level prompt doesn't, the fingerprint matches and sync skips regeneration.

Next Steps

  1. Implement the fix (hash preprocessed/include-expanded content instead of raw file)
  2. Verify the unit tests pass
  3. Verify the E2E test passes
  4. Run full test suite
  5. Mark PR as ready for review

Fixes #522


Generated by PDD agentic bug workflow

…lude> dependencies

Unit tests and E2E test that reproduce the bug where sync_determine_operation
only hashes the raw .prompt file, missing changes to <include>d dependencies.

Fixes promptdriven#522
@Serhan-Asad Serhan-Asad marked this pull request as ready for review February 15, 2026 16:31
@Serhan-Asad Serhan-Asad marked this pull request as draft February 15, 2026 16:31
@Serhan-Asad Serhan-Asad marked this pull request as ready for review February 15, 2026 21:22
@Serhan-Asad Serhan-Asad marked this pull request as draft February 15, 2026 21:23
@Serhan-Asad Serhan-Asad marked this pull request as ready for review February 15, 2026 22:43
@gltanaka
Copy link
Contributor

Hey @Serhan-Asad — thanks for tackling this one! Really appreciate the thorough approach: failing tests first, clean implementation of calculate_prompt_hash(), and solid E2E coverage. The code quality here is great.

I tested this locally and the unit tests + E2E tests all pass (88/88 on test_sync_determine_operation.py, 2/2 on the new E2E file, zero regressions). Nice work there.

However, I hit a gap when running the full manual reproduction from issue #522. Here's what happens:

  1. First pdd sync — the "insert includes" preprocessing step resolves <include>shared_types.py</include> tags and rewrites the original .prompt file with the tags stripped out.
  2. Second pdd sync (after modifying shared_types.py) — calculate_prompt_hash() reads the prompt, finds no <include> tags (they were removed in step 1), falls back to plain calculate_sha256(), and the hash still matches the fingerprint. Result: sync still says "nothing to do."

So the fix is correct at the fingerprint-calculation layer, but the upstream insert-includes step removes the <include> tags from the .prompt file before the fingerprint system ever sees them on subsequent runs.

A couple of possible paths forward:

  • Preserve <include> tags in the original .prompt file (only expand them into the _with_deps.prompt output)
  • Store include dependency paths + hashes in the fingerprint JSON so they can be checked independently of whether the tags still exist in the prompt

Would you be up for exploring one of these approaches? Happy to pair on it or discuss further. This is a real bug that needs fixing and you're clearly on the right track — just needs one more layer to close the loop end-to-end.

@gltanaka gltanaka marked this pull request as draft February 16, 2026 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sync fingerprint ignores <include> dependencies — stale code after included file changes

2 participants