Skip to content

Add failing tests for #1074#1079

Draft
prompt-driven-github[bot] wants to merge 3 commits into
mainfrom
fix/issue-1074
Draft

Add failing tests for #1074#1079
prompt-driven-github[bot] wants to merge 3 commits into
mainfrom
fix/issue-1074

Conversation

@prompt-driven-github
Copy link
Copy Markdown
Contributor

Summary

Adds 8 behavioral regression tests that reproduce the bug reported in #1074: global sync misreading nested worktrees and path-aware architecture metadata.

Test File

  • tests/test_issue_1074_reproduction.py — 8 tests, 6 currently failing on main (reproducing AC2–AC5), 2 passing as regression guards (AC1 already works via the existing dot-prefix filter).

Acceptance Criteria Covered

AC Behavior Tests Current status on main
AC1 Global sync ignores nested .pddrc under .worktrees/ 2 passes (regression guard)
AC2 Duplicate absolute output filepaths scheduled only once 1 fails
AC3 sync-architecture infers path-aware filepaths from nested prompt names 2 fails
AC4 Nested architecture.json resolves against ancestor prompts/ root 1 fails
AC5 Stale-basename / case-variant <pdd-dependency> tags normalized 2 fails

Root Cause (from Step 6 analysis)

Four localized defects in two files:

  • AC2pdd/agentic_sync.py:480: dedup key is (arch_path, basename); must also dedupe on the resolved absolute filepath.
  • AC3pdd/architecture_sync.py:329-343 (_infer_filepath): non-path-aware and case-sensitive; should mirror filepath_to_prompt_filename and consult _EXT_TO_LANGUAGE case-insensitively.
  • AC4pdd/architecture_sync.py:105-136 (_resolve_sync_paths): stops at the first architecture.json without verifying a sibling prompts/; must walk up to find an ancestor prompts/.
  • AC5pdd/architecture_sync.py:281-287 (filter drops bare basenames) and 873-886 (writes verbatim): needs a normalization map built from existing arch filenames, mirroring normalize_architecture_filenames's old_to_new pattern.

Next Steps

  1. Implement the four fixes at the locations listed above
  2. Verify all 8 tests in tests/test_issue_1074_reproduction.py pass
  3. Run full test suite (pytest -vv tests/) to check for regressions
  4. Mark PR as ready for review

Fixes #1074


Generated by PDD agentic bug workflow

Adds 8 behavioral tests covering all 5 acceptance criteria in #1074:

- AC1 (worktree skip): 2 tests confirming nested .pddrc under
  .worktrees/ is ignored (already passes via existing dot-prefix filter,
  kept as regression guard).
- AC2 (duplicate filepath dedup): 1 test confirming architecture entries
  pointing at the same absolute output filepath are scheduled once.
- AC3 (path-aware filepath inference): 2 tests confirming sync-architecture
  infers nested output filepaths from path-aware prompt names like
  src/workers/runtime/gemini_cli_Python.prompt.
- AC4 (ancestor prompts/ root): 1 test confirming nested architecture.json
  resolves against an ancestor prompts/ directory.
- AC5 (dependency-tag normalization): 2 tests confirming legacy basename
  and case-variant <pdd-dependency> tags are normalized to existing
  architecture filenames.

6 of 8 tests fail on main, reproducing the bugs at:
- pdd/agentic_sync.py:480 (dedup key)
- pdd/architecture_sync.py:329-343 (_infer_filepath)
- pdd/architecture_sync.py:105-136 (_resolve_sync_paths)
- pdd/architecture_sync.py:281-287, 873-886 (dep-tag normalization)

Refs #1074

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
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.

bug: global sync misreads nested worktrees and path-aware architecture metadata

1 participant