fix(pi): let agent submit any markdown plan file by path#595
Open
backnotprop wants to merge 3 commits intomainfrom
Open
fix(pi): let agent submit any markdown plan file by path#595backnotprop wants to merge 3 commits intomainfrom
backnotprop wants to merge 3 commits intomainfrom
Conversation
Removes all configured plan-file state (module var, --plan-file flag, /plannotator-set-file command, interactive path prompt). The agent now writes its plan as a markdown file anywhere inside the working directory and calls plannotator_submit_plan with the file path. During planning, the write gate allows any .md / .mdx file inside cwd (with traversal/absolute-escape rejection) instead of a single configured path. plannotator_submit_plan gains a required filePath parameter, which is validated, stat-checked, and read. Version history in ~/.plannotator continues to key off plan content so naming is free-form without losing version linking. For provenance purposes, this commit was AI assisted.
5 tasks
isSubmitPathAllowed was a pure pass-through to isPlanWritePathAllowed with no plausible reason to diverge. Use the write-gate helper directly from submit_plan and drop the alias. For provenance purposes, this commit was AI assisted.
The shipped plannotator.json planning prompt still referenced
${planFilePath} and instructed the agent to call plannotator_submit_plan
with no arguments. After the submit tool gained a required filePath
parameter, default sessions hit the stale prompt and submits failed.
Rewritten to match the new flow: agent picks its own plan filename and
passes it to plannotator_submit_plan.
For provenance purposes, this commit was AI assisted.
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
Replaces the configured-file plan-mode model with an agent-driven one. The agent writes its plan as a markdown file anywhere inside the working directory and passes the path to
plannotator_submit_plan.--plan-fileflag,/plannotator-set-filecommand, interactive path prompt, and theplanFilePathmodule state.plannotator_submit_plangains a requiredfilePatharg, validated as.md/.mdxinside cwd, stat-checked, then read.lastSubmittedPathtracks the last submission so execution phase rebuilds correctly on session resume.PLAN.mdorplans/<name>.mdconventions.Version history in
~/.plannotator/history/{project}/{slug}/already keys off plan content (first# Heading+ date) rather than file path, so free-form naming keeps version linking intact.Supersedes #594 — that PR's directory-scope gate introduced sibling-write leakage and didn't fix the submit-on-directory failure mode.
Test plan
bun test apps/pi-extension— 35 pass (tool-scope tests rewritten for extension-based gate)bun run typecheck— cleanbun run build:review && bun run build:hook && bun run --cwd apps/pi-extension build— succeedPLAN.md, submit, approve → executingplans/foo.md, submit → approvesrc/app.tsduring planning → blocked