Skip to content

Add failing tests for circular include cycle detection (#521)#528

Merged
gltanaka merged 2 commits intopromptdriven:mainfrom
Serhan-Asad:fix/issue-521
Feb 16, 2026
Merged

Add failing tests for circular include cycle detection (#521)#528
gltanaka merged 2 commits intopromptdriven:mainfrom
Serhan-Asad:fix/issue-521

Conversation

@Serhan-Asad
Copy link
Contributor

Summary

  • Adds unit tests detecting silent corruption from circular <include> tags
  • Adds E2E tests verifying the bug at CLI integration level
  • All circular-include tests fail on current code (confirming the bug)
  • Regression tests for valid includes pass

Test Files

  • Unit tests: tests/test_circular_includes.py (6 tests)
  • E2E tests: tests/test_e2e_issue_521_circular_includes.py (3 tests)

Root Cause

preprocess() has no cycle detection — circular includes recurse ~82 times until RecursionError, which is silently swallowed by a broad except Exception handler, returning corrupted output with exit code 0.

Next Steps

  1. Implement cycle detection in pdd/preprocess.py
  2. Verify all tests pass
  3. Run full test suite
  4. Mark PR as ready for review

Fixes #521


Generated by PDD agentic bug workflow

)

Unit and E2E tests that detect silent corruption from circular
<include> tags in the preprocessor. Tests fail on current code
and will pass once cycle detection is implemented.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Serhan-Asad Serhan-Asad marked this pull request as ready for review February 15, 2026 20:24
@Serhan-Asad Serhan-Asad marked this pull request as draft February 15, 2026 20:24
@Serhan-Asad Serhan-Asad marked this pull request as ready for review February 15, 2026 22:43
@gltanaka gltanaka merged commit fc1c7cb into promptdriven:main Feb 16, 2026
2 of 4 checks passed
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.

Circular <include> tags silently produce corrupted output (no cycle detection)

2 participants