Skip to content

bug: pdd sync can write architecture dependencies not declared by prompt metadata #1061

@Serhan-Asad

Description

@Serhan-Asad

Problem

PR #1055 for #1054 produced an architecture / prompt dependency mismatch.

On origin/main, agentic_update_python.prompt had this architecture dependency:

"dependencies": ["agentic_update_LLM.prompt"]

In sync commit 632f9193e34560debb3d9aa3df287e0e49cf97ef, root architecture.json changed it to:

"dependencies": ["agentic_update_LLM.prompt", "sync_order_python.prompt"]

But pdd/prompts/agentic_update_python.prompt still only declares:

<pdd-dependency>agentic_update_LLM.prompt</pdd-dependency>

It includes pdd/sync_order.py only as helper/source context:

<pdd.sync_order.extract_includes_from_file>
    <include select="def:extract_includes_from_file" mode="interface">pdd/sync_order.py</include>
</pdd.sync_order.extract_includes_from_file>

That made CI fail:

architecture.json / <include> mismatch: 'agentic_update_python.prompt' declares dependency on module 'sync_order' ('sync_order_python.prompt') but the prompt has no <include> or <pdd-dependency> of that module's prompt

Why This Matters

PDD currently treats <pdd-dependency> as the authoritative architectural dependency declaration. A plain implementation include can be context without being an architecture edge.

If sync decides a dependency belongs in architecture.json, it must either:

  • add/preserve the matching <pdd-dependency>...prompt</pdd-dependency> in the prompt, or
  • avoid adding that architecture dependency.

Writing only one side creates immediate validation failure.

Likely Areas To Inspect

  • pdd/auto_deps_architecture.py
  • pdd/architecture_sync.py::update_architecture_from_prompt
  • metadata sync paths used by pdd sync
  • pdd/architecture_include_validation.py::cross_validate_architecture_with_prompt_includes

Expected

After pdd sync, architecture dependencies and prompt dependency metadata should remain consistent.

Acceptance Criteria

  • Add a regression using the chore: PDD sync for #1054 #1055 shape: a prompt gains a selected/interface include of pdd/sync_order.py but no <pdd-dependency>sync_order_python.prompt</pdd-dependency>.
  • Sync must not produce a validate-arch-includes mismatch.
  • If sync intentionally adds sync_order_python.prompt to architecture dependencies, it must also update the prompt metadata source accordingly.
  • pdd checkup --validate-arch-includes passes after the sync.

Related

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions