Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions askcc/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,12 @@
- Check out the PR branch using `gh pr checkout <number>` to inspect the full source.
- Run the project's test suite to confirm all tests pass.

Pre-merge guard (CHANGES_REQUESTED):
- Before merging, check for unresolved CHANGES_REQUESTED reviews using \
`gh pr view <number> -R <owner/repo> --json reviews --jq '[.reviews[] | select(.state == "CHANGES_REQUESTED")]'`.
- If any CHANGES_REQUESTED reviews exist, DO NOT merge. Instead, address the requested changes, \
reply to all inline comments, push a follow-up fix commit on the PR branch, and re-request review.

Definition of Done checklist:
1. **Acceptance criteria** — verify each criterion from the issue is satisfied by the code changes.
2. **Test coverage** — new and changed logic has unit tests. Look for untested code paths.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "askcc"
version = "0.2.7"
version = "0.2.8"
description = "A one-shot cc cli executor"
authors = [{ name = "mknt", email = "shane.cousins@gmail.com" }]
readme = "README.md"
Expand Down
20 changes: 20 additions & 0 deletions tests/test_askcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from askcc.definitions import (
AGENT_CONFIGS,
DEVELOP_AGENT_PROMPT,
REVIEWPR_AGENT_PROMPT,
AgentAction,
AgentConfig,
SupportedLanguage,
Expand Down Expand Up @@ -278,6 +279,25 @@ def test_removes_legacy_write_tests_line(self):
assert "Write tests for every new or changed behavior" not in DEVELOP_AGENT_PROMPT


class TestReviewprPromptMergeGuard:
"""The pr-review prompt must block merging when CHANGES_REQUESTED reviews exist (issue #86)."""

def test_includes_changes_requested_check_command(self):
assert (
"gh pr view <number> -R <owner/repo> --json reviews --jq '[.reviews[] "
'| select(.state == "CHANGES_REQUESTED")]\'' in REVIEWPR_AGENT_PROMPT
)

def test_includes_do_not_merge_instruction(self):
assert "DO NOT merge" in REVIEWPR_AGENT_PROMPT

def test_includes_address_inline_comments_instruction(self):
assert "reply to all inline comments" in REVIEWPR_AGENT_PROMPT

def test_includes_pre_merge_guard_heading(self):
assert "Pre-merge guard" in REVIEWPR_AGENT_PROMPT


class TestWritePromptContent:
def test_writes_file_with_correct_name(self):
filepath = write_prompt_content("plan", "monkut", "askcc-cli", 42, "issue content here")
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading