Skip to content

bug: agentic update scope guard reverts included-doc edits #987

@Serhan-Asad

Description

@Serhan-Asad

Problem

prompts/agentic_update_LLM.prompt explicitly allows the update agent to modify:

  • the prompt file
  • documents referenced by <include> tags
  • new shared include files in context/

But run_agentic_update() only allows the prompt, code file, and selected tests through _revert_out_of_scope_changes(). Any included doc or new context include that the agent edits or creates is out of scope and can be reverted.

This leaves pdd update --all unable to satisfy the documented "included docs are part of the prompt" requirement tracked by #860 and the closed #732.

Evidence

  • prompts/agentic_update_LLM.prompt allows included-doc and new shared include edits.
  • pdd/agentic_update.py builds _allowed = {prompt_path.resolve(), code_path.resolve()} plus selected tests, then calls _revert_out_of_scope_changes(PROJECT_ROOT, _allowed).
  • The allowed set does not include resolved prompt include files or new shared include files.

Expected

run_agentic_update() should derive an allowlist from resolved prompt includes and preserve permitted included-doc edits and intentional new shared context include files, while still reverting unrelated mutations.

Acceptance criteria

  • Add a regression test where a prompt includes a source doc and pdd update preserves an edit to that doc.
  • Add a regression test where a new shared include file under an allowed context/docs path can be preserved when intentionally created.
  • Keep unrelated file mutations reverted.
  • Align the implementation allowlist with the permissions described in agentic_update_LLM.prompt.
  • Reuse the same include parsing semantics as PDD preprocessing/fingerprinting once those are unified.

Related


Migrated from gltanaka/pdd#1369 (originally filed 2026-05-05 by gltanaka). gltanaka/pdd is deprecated.

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