feat(review): add @gittensory plan — issue → implementation plan command - #1360
Merged
Conversation
…and (#issue-coding-plan) A CodeRabbit-parity planning command, flag-gated by GITTENSORY_REVIEW_PLANNER (default OFF → byte-identical). When ON, a MAINTAINER who comments `@gittensory plan` on an issue gets a concise, actionable implementation plan generated from the issue text via Workers AI, posted as an issue comment so a contributor (or their agent) has a concrete starting point. SAFETY: flag-OFF the handler short-circuits BEFORE parsing, so `@gittensory plan` falls through to the existing mention path exactly as today. ON: maintainer-only (REAL repo permission, not the spoofable author_association); the model sees only the already-public issue title + body; the output is public-safe sanitized before posting; any model/error degrades to a recorded no-op (no comment). - src/review/planner.ts: isPlannerEnabled (flag); isPlanCommand (parse); classifyPlanCommandRequest (PURE, exhaustively unit-tested eligibility guard so the processor carries one branch); generateIssuePlan (bounded Workers AI call, fail-safe null); buildIssuePlanComment (public-safe render). - processors.ts: maybeProcessPlanCommand wired into the issue_comment flow (before the mention Q&A path); records a skip audit + product-usage event for every non-acting path and a generated event on success. - wrangler.jsonc + worker-configuration.d.ts + src/env.d.ts: the GITTENSORY_REVIEW_PLANNER flag (default OFF).
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (96.66%) is below the target coverage (97.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #1360 +/- ##
=======================================
Coverage 95.32% 95.33%
=======================================
Files 190 191 +1
Lines 20562 20622 +60
Branches 7425 7447 +22
=======================================
+ Hits 19601 19660 +59
Misses 378 378
- Partials 583 584 +1
🚀 New features to boost your workflow:
|
4 tasks
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
A CodeRabbit-parity planning command. Flag-gated by
GITTENSORY_REVIEW_PLANNER(default OFF → byte-identical deploy). When ON, a maintainer who comments@gittensory planon an issue gets a concise, actionable implementation plan generated from the issue text via Workers AI, posted as an issue comment so a contributor (or their agent) has a concrete starting point.Safety contract
@gittensory planfalls through to the existing mention path exactly as today.resolveRealRepoPermissionAssociation), never the spoofableauthor_association. The model sees only the already-public issue title + body; the output is public-safe sanitized before posting; any model/auth/error path degrades to a recorded no-op (no comment, an audit skip).Changes
src/review/planner.ts(new) —isPlannerEnabled(flag);isPlanCommand(parse);classifyPlanCommandRequest(pure, exhaustively unit-tested eligibility guard — wrong action / bot / missing repo·issue·installation·actor / a PR rather than an issue — so the processor carries a singleokbranch);generateIssuePlan(bounded Workers AI call, fail-safe null);buildIssuePlanComment(public-safe render).src/queue/processors.ts—maybeProcessPlanCommandwired into theissue_commentflow (before the mention Q&A path); a skip audit + product-usage event for every non-acting path, a generated event on success.wrangler.jsonc+worker-configuration.d.ts+src/env.d.ts— theGITTENSORY_REVIEW_PLANNERflag (default OFF).No linked issue — a config-as-code review enhancement in the CodeRabbit-parity series (follows #1347/#1350/#1353/#1357).
Scope
src/+wrangler.jsonc+ regeneratedworker-configuration.d.ts(Phase 4); no migration / OpenAPI (webhook-only, no routes)Validation
npm run test:ci— exit 0; 4386 tests passnpm audit --audit-level=moderate— 0 vulnerabilitiessrc/line + branch covered (lcov BRDA acrossplanner.ts,processors.ts) —src/env.d.tsis types-only (Codecov-ignored)classifyPlanCommandRequestall guards,generateIssuePlanok/empty/unavailable/throws, render); integration (maintainer posts a plan; flag-OFF byte-identical + AI never called; non-maintainer denied; non-plan comment declined; PR-comment skipped; no-plan fail-safe)Safety