Skip to content

fix(prompts): add PR already-reviewed guard and reduce redundant issue comments#101

Merged
monkut merged 4 commits into
mainfrom
feature/100-pr-already-reviewed-guard
Apr 30, 2026
Merged

fix(prompts): add PR already-reviewed guard and reduce redundant issue comments#101
monkut merged 4 commits into
mainfrom
feature/100-pr-already-reviewed-guard

Conversation

@monkut

@monkut monkut commented Apr 29, 2026

Copy link
Copy Markdown
Owner

Closes #100

Summary

  • Adds a Pre-review dedup block to REVIEWPR_AGENT_PROMPT (placed before Pre-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.
  • Removes the unconditional Also post a brief summary on the linked issue line from REVIEWPR_AGENT_PROMPT. The PR review is now the canonical record.
  • Replaces the unconditional Comment on the issue summarizing what was implemented bullet in DEVELOP_AGENT_PROMPT with a two-branch instruction: comment when the session opened a new PR; skip on follow-up commits (the PR description update is sufficient).
  • Adds Mermaid label safety guidance to DEVELOP_AGENT_PROMPT so 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.
  • Adds TestReviewprPromptDedupGuard, TestReviewprPromptNoLinkedIssueComment, TestDevelopPromptConditionalIssueComment, and TestDevelopPromptMermaidLabelSafety to tests/test_askcc.py using 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 &gt;= 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]
Loading
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]
Loading

Test plan

 #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).
monkut added 3 commits April 30, 2026 15:01
- 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.
@monkut monkut merged commit 5bca6f4 into main Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(prompts): add PR already-reviewed guard and reduce redundant issue comments

1 participant