fix(prompts): add PR already-reviewed guard and reduce redundant issue comments#101
Merged
Merged
Conversation
#100) - REVIEWPR_AGENT_PROMPT: add `Pre-review dedup` block before `Pre-merge guard`. Skips review entirely when ellen-goc's last substantial review (body > 50 chars) postdates the PR's most recent commit. - REVIEWPR_AGENT_PROMPT: remove unconditional linked-issue comment line. The PR review itself is the canonical record. - DEVELOP_AGENT_PROMPT: make the on-completion issue comment conditional — comment only when this session opened a new PR; skip on follow-up commits. - Tests: add `TestReviewprPromptDedupGuard`, `TestReviewprPromptNoLinkedIssueComment`, and `TestDevelopPromptConditionalIssueComment` (literal-substring asserts mirroring the `TestReviewprPromptMergeGuard` precedent).
5 tasks
- DEVELOP_AGENT_PROMPT: warn that unquoted labels starting with / or \ are parsed as mermaid parallelogram/trapezoid shape syntax and break rendering with a lexical error. Show quoted form: B["/simplify, ..."] vs broken B[/simplify, ...]. - Tests: add TestDevelopPromptMermaidLabelSafety asserting the heading, quoted example, and shape-collision wording (literal-substring style). - uv.lock: sync to 0.2.11.
- Tests: collapse multi-paragraph docstrings on TestReviewprPromptDedupGuard and TestDevelopPromptConditionalIssueComment to one-liners matching the TestReviewprPromptMergeGuard precedent. - DEVELOP_AGENT_PROMPT: drop 'before commenting' from the existing-PR bullet; the issue comment is now governed by the conditional bullets that follow.
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.
Closes #100
Summary
Pre-review dedupblock toREVIEWPR_AGENT_PROMPT(placed beforePre-merge guard) that short-circuits when ellen-goc's last substantial review postdates the PR's most recent commit — no review, no linked-issue comment.Also post a brief summary on the linked issueline fromREVIEWPR_AGENT_PROMPT. The PR review is now the canonical record.Comment on the issue summarizing what was implementedbullet inDEVELOP_AGENT_PROMPTwith a two-branch instruction: comment when the session opened a new PR; skip on follow-up commits (the PR description update is sufficient).Mermaid label safetyguidance toDEVELOP_AGENT_PROMPTso labels containing/,\,(,),|,:, etc. get quoted (B["/simplify, commit, push"]) instead of being parsed as parallelogram/trapezoid shape syntax — prevents the "Lexical error / Unrecognized text" rendering failure that broke the original PR description.TestReviewprPromptDedupGuard,TestReviewprPromptNoLinkedIssueComment,TestDevelopPromptConditionalIssueComment, andTestDevelopPromptMermaidLabelSafetytotests/test_askcc.pyusing the existing literal-substring assertion style.Verification
uv run pytest— passed (236 tests, +11 new)uv run ruff check— passed (no issues)uv run pyright— passed (0 errors, 0 warnings)Key Flows
flowchart TD A[pr-review triggered] --> B[Pre-review: read diff, gh pr checkout, run tests] B --> C{Pre-review dedup:<br/>last_review >= last_commit?} C -- yes --> D[Skip entirely:<br/>no review, no issue comment] C -- no --> E[Pre-merge guard:<br/>CHANGES_REQUESTED check] E --> F[Definition of Done checklist] F --> G[gh pr review --approve / --request-changes]flowchart TD A[develop completes] --> B["/simplify, commit, push"] B --> C{New PR opened<br/>this session?} C -- yes --> D[Open PR + comment on issue:<br/>summary of what was implemented] C -- no --> E[Update existing PR description:<br/>skip issue comment]Test plan
TestReviewprPromptDedupGuardassertsPre-review dedupheading,gh pr view --json reviews,commitsquery fragments (sort_by(.committedDate),.author.login == "ellen-goc",(.body|length > 50),--json reviews,commits),skip entirely, and dedup-before-merge-guard ordering.TestReviewprPromptNoLinkedIssueCommentasserts the removed line is absent.TestDevelopPromptConditionalIssueCommentasserts the unconditional bullet is gone and both conditional branches (If this session opened a new PR,PR already existed,PR description update is sufficient) are present.TestDevelopPromptMermaidLabelSafetyasserts theMermaid label safetyheading, the quotedB["/simplify, commit, push"]example, and theparallelogram/trapezoid shape syntaxwarning.uv run pytest/uv run ruff check/uv run pyrightall green locally.