feat: widen agentic_update scope guard allowlist to include prompt includes (#987)#991
Open
prompt-driven-github[bot] wants to merge 1 commit into
Open
feat: widen agentic_update scope guard allowlist to include prompt includes (#987)#991prompt-driven-github[bot] wants to merge 1 commit into
prompt-driven-github[bot] wants to merge 1 commit into
Conversation
…cludes (#987) Updates requirement #10 (Scope Guard) of `agentic_update_python.prompt` to align the runtime allowlist with the permissions documented in `agentic_update_LLM.prompt`. The allowlist now also covers documents referenced by `<include>` tags in the prompt being updated and new shared include files under the `context/` directory tree, while unrelated file mutations remain reverted. Adds `compute_user_intent_paths` from `pdd/preprocess.py` as a new dependency so include parsing reuses the canonical PDD preprocessing/ fingerprinting semantics (acceptance criterion 5). Falls back to the legacy baseline on parser/IO failure. Closes #987 Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates the
Scope Guardrequirement inprompts/agentic_update_python.promptso the runtime allowlist used by_revert_out_of_scope_changesaligns with the permissions documented inagentic_update_LLM.prompt. The agent's edits to<include>-referenced docs and to new shared include files undercontext/are now preserved, while unrelated file mutations are still reverted.Closes #987
Changes Made
Prompts Modified
pdd/prompts/agentic_update_python.prompt— Rewrites requirement Self‑upgrade to pdd‑cli 0.0.40 fails on Windows 11 (“No module named pip” inside uv shim) #10 (Scope Guard) to:<include>paths from the original prompt text (raw and${VAR}-expanded) viacompute_user_intent_pathsfrompdd/preprocess.py, reusing canonical PDD preprocessing/fingerprinting semantics (acceptance criterion 5).PROJECT_ROOT / "context".PROJECT_ROOTcontainment on every entry added beyond the baseline.{prompt, code, tests}baseline on parser/IO failure (emits a non-fatal warning when verbose).pdd.preprocess(functioncompute_user_intent_paths) to the% Dependenciesblock of the prompt.Why
pdd/agentic_update.pypreviously built_allowed = {prompt_path.resolve(), code_path.resolve()} | {p.resolve() for p in selected_tests}, so any included doc or new sharedcontext/include the agent intentionally edited could be reverted — breaking the "included docs are part of the prompt" contract tracked in #860 and #732.Review Checklist
<pdd.preprocess>block uses<include select=\"def:compute_user_intent_paths\">formpdd updatepreserves agent's edit to that doccontext/is preserved when intentionally createdagentic_update_LLM.promptpermissionscompute_user_intent_pathsNext Steps After Merge
context/-include preservation.Created by pdd change workflow