Repository navigation
Align tool, command, and flag names with plannotator - #2
Merged
Merged
Conversation
`@plannotator/pi-extension` ships an overlapping pi plan mode. Adopt its naming convention so the two are distinguishable, and match its write gate and review-outcome model where revdiff can express it. Renames: - `plan_submit` -> `revdiff_submit_plan` - `mark_done` -> `revdiff_mark_done` - `/plan` -> `/revdiff-plan-mode` - `/plan-abort` -> `/revdiff-plan-abort` - `/plan-status` -> `/revdiff-plan-status` - `--plan` -> `--revdiff-plan`, avoiding a collision with plannotator's own `--plan` flag Add `stripPlanTools`, which filters the pre-rename names alongside the current ones so a session persisted by an earlier version cannot carry a stale `plan_submit` into a restored tool list. Drop the `isAbsolute` early return from `isPlanPathAllowed` to match plannotator's `isPlanWritePathAllowed`: an absolute path is now judged by containment, so one pointing inside cwd is allowed. Add a third review outcome. revdiff exposes two signals only, exit 0 for a clean quit and exit 10 for annotations, so a crash, a signal, or a missing binary previously reached the agent as fabricated plan feedback and invited it to revise the plan in response to an error. Classification moves into an exported pure `classifyReviewOutcome`, and a session that ended without a decision now tells the agent to resubmit instead. Approve-with-notes is deliberately not implemented: revdiff has no signal that distinguishes annotating-and-approving from annotating-and-denying.
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.
Context
@plannotator/pi-extensionships a pi plan mode that overlaps this extension almost entirely — identicalPhaseunion, an equivalent plan-submit tool, the same[DONE:n]protocol, and functions literally namedparseChecklist/markCompletedSteps. This adopts its naming convention so the two are distinguishable when both are installed, and matches its write gate and review-outcome model as far asrevdiffcan express it.Renames
plan_submitrevdiff_submit_planmark_donerevdiff_mark_done/plan/revdiff-plan-mode/plan-abort/revdiff-plan-abort/plan-status/revdiff-plan-status--plan--revdiff-planThe flag rename is not cosmetic: plannotator registers its own
--plan, so the old name collided.Prompt and error strings were updated in lockstep — otherwise the agent gets told to call a tool that no longer exists.
Migration.
stripPlanToolsfilters the pre-rename names alongside the current ones at every site that rebuilds the tool list, so a session persisted by an earlier version cannot carry a staleplan_submitinto a restored list.Write gate
Dropped the
isAbsoluteearly return fromisPlanPathAllowed, matching plannotator'sisPlanWritePathAllowed. An absolute path is now judged purely by containment, so one pointing inside cwd is accepted. Paths outside cwd are still rejected by the existingpath.relativecheck.This deliberately inverts an existing assertion in
test/parsing.test.ts; the test now also pins the outside-cwd case that actually matters.Review outcomes
revdiffexposes two signals only — exit0(clean quit) and exit10(--exit-code-on-annotations). Everything else was previously folded into the deny path:The agent read that as plan feedback and would try to revise the plan in response to a crash. Following plannotator's
classifyAnnotateOutcome, a session that ends without a decision is now its own outcome and tells the agent to resubmit.Classification moved into an exported pure
classifyReviewOutcome(launchError, exitCode, rawOutput), which makes the three-way result testable without driving the TUI.Not implemented: approve-with-notes. Verified against
revdiff v1.13.0—--helpand--dump-keysshowq(quit, flushes annotations),Q(discard_quit), andO(flush_output). There is no flag or key that distinguishes annotating-and-approving from annotating-and-denying, so plannotator's approved-with-feedback case cannot be represented. Related:Qdiscard-quit is indistinguishable from a genuine clean approve (both exit0with empty output).Verification
npm run validate— 11/11 passing (8 pre-existing + 3 new).Warning
npm testruns againstdist/, andtscnever prunes deleted files from it, so stale compiled tests keep running and inflate the count. Runrm -rf distfirst. Acleanstep inbuildwould be a worthwhile follow-up.Out of scope
import { Type } from "typebox"is unlisted inpackage.json— pre-existing onmain, flagged not fixed.readme.md's project structure liststest/keywords.test.ts, which doesn't exist onmain.