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
1 change: 1 addition & 0 deletions .agents/skills/doc_quality_policy/publish_review_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"approve with nits": "COMMENT",
"approve_with_nits": "COMMENT",
"request changes": "COMMENT",
"request_changes": "COMMENT",
}


Expand Down
16 changes: 16 additions & 0 deletions .agents/skills/doc_quality_policy/test_publish_review_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,22 @@ def test_request_changes_maps_to_non_blocking_github_comment(self):
self.assertEqual(payload["event"], "COMMENT")
self.assertIn("canonical subagent terminology", payload["body"])

def test_request_changes_underscore_spelling_maps_to_non_blocking_comment(self):
payload = prs.build_review_payload(
_signal(
"request_changes",
important=1,
blocking_findings=[
"`src/content/docs/example.mdx:42` — Use the canonical subagent "
"terminology. Requested change: replace `children` with `subagents`."
],
),
"1",
"sha1",
"github-actions[bot]",
)
self.assertEqual(payload["event"], "COMMENT")

def test_rejects_blocking_verdict_without_actionable_findings(self):
with self.assertRaisesRegex(ValueError, "blocking_findings"):
prs.build_review_payload(
Expand Down
15 changes: 8 additions & 7 deletions .agents/skills/review-docs-pr/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,14 @@ the review yourself. Emit the signal with `reviewer_login` set to
`github-actions[bot]`; the GitHub Actions runner publishes the review with its
short-lived token after the cloud agent returns.

1. Determine the authenticated reviewer and map the verdict:
1. Determine the authenticated reviewer:
```bash
REVIEWER_LOGIN=$(gh api user --jq .login)
```
Use `APPROVE` for `Approve` and `Approve with nits`; nits do not block
merge, so an approval supersedes any earlier change request from the same
reviewer. Use `REQUEST_CHANGES` only for `Request changes`.
Every verdict — `Approve`, `Approve with nits`, and `Request changes` —
publishes as a non-blocking `COMMENT` GitHub review event. The required
`Agent docs review` status check still fails on critical or important
findings. Engineering review requests remain advisory.
2. Write the signal JSON object to `/tmp/review-signal.json`, set its
`reviewer_login` to `$REVIEWER_LOGIN`, and render that same object as the
`[SIGNAL:pr-review]` line in the final response. Then construct the
Expand All @@ -223,9 +224,9 @@ short-lived token after the cloud agent returns.
review = json.loads(Path("review.json").read_text())
signal = json.loads(Path("/tmp/review-signal.json").read_text())
event = {
"Approve": "APPROVE",
"Approve with nits": "APPROVE",
"Request changes": "REQUEST_CHANGES",
"Approve": "COMMENT",
"Approve with nits": "COMMENT",
"Request changes": "COMMENT",
}[os.environ["VERDICT"]]
findings = []
for comment in review["comments"]:
Expand Down
8 changes: 7 additions & 1 deletion .agents/skills/review-docs-pr/test_publishing_snippet.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ def test_hidden_signal_remains_parseable(self):
self.assertEqual(problems, [])
self.assertEqual(parsed["verdict"], signal["verdict"])

def test_policy_distinguishes_comment_event_from_required_check(self):
text = SKILL.read_text(encoding="utf-8")
self.assertIn("non-blocking `COMMENT` GitHub review event", text)
self.assertIn("`Agent docs review` status check still fails", text)
self.assertIn("Engineering review requests remain advisory.", text)

def test_findings_and_verdict_are_still_rendered(self):
payload, _ = self._run(
comments=[{"path": "a.md", "line": 3, "body": "Fix this typo."}],
Expand All @@ -122,7 +128,7 @@ def test_findings_and_verdict_are_still_rendered(self):
self.assertIn("## Findings", payload["body"])
self.assertIn("`a.md:3` — Fix this typo.", payload["body"])
self.assertIn("## Verdict\nRequest changes", payload["body"])
self.assertEqual(payload["event"], "REQUEST_CHANGES")
self.assertEqual(payload["event"], "COMMENT")


if __name__ == "__main__":
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
python3 .agents/skills/doc_quality_policy/test_check_compression_contract.py
python3 .agents/skills/doc_quality_policy/test_verify_review_signal.py
python3 .agents/skills/doc_quality_policy/test_publish_review_signal.py
python3 .agents/skills/doc_quality_policy/test_stale_review_requests.py
python3 .agents/skills/doc_quality_policy/test_agent_docs_review_workflow.py
python3 .agents/skills/doc_quality_policy/test_manifest.py

Expand Down
Loading