Skip to content

Commit 65dc857

Browse files
Align PR template human section validation
Remove the human-tested checkbox from the default PR template and update the PR description validator to use the HUMAN-to-AGENT boundary for human notes. Co-authored-by: openhands <openhands@all-hands.dev>
1 parent 735e9be commit 65dc857

3 files changed

Lines changed: 12 additions & 46 deletions

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- Keep this PR as draft until it is ready for review. -->
22

33
<!-- AI/LLM agents:
4-
Do not edit the HUMAN section or human-tested checkbox.
4+
Do not edit the HUMAN section.
55
In the AGENT section and the template fields below, provide evidence that the
66
code runs properly end-to-end. Just running unit tests is NOT sufficient. Explain
77
exactly what command you ran and include logs, screenshots, or reproduction notes.
@@ -15,8 +15,6 @@ characters) before marking ready for review.
1515
AI agents must not edit this section.
1616
-->
1717

18-
- [ ] A human has tested these changes.
19-
2018
AGENT:
2119

2220
---

.github/scripts/check_pr_description.py

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from pathlib import Path
99

1010

11-
HUMAN_TESTED_TEXT = "A human has tested these changes."
1211
# Reject placeholders while allowing a concise human-written sentence.
1312
MIN_HUMAN_NOTE_CHARS = 20
1413
# These are the only PR-template sections that must remain and contain content.
@@ -20,18 +19,6 @@
2019
AGENT_HEADING_RE = re.compile(r"(?im)^\s*AGENT:\s*$")
2120

2221

23-
def checkbox_re(label: str) -> re.Pattern[str]:
24-
return re.compile(rf"(?im)^\s*[-*]\s+\[(?P<mark>[ xX])]\s+{re.escape(label)}\s*$")
25-
26-
27-
def checkbox_is_checked(pattern: re.Pattern[str], text: str) -> bool:
28-
match = pattern.search(text)
29-
return match is not None and match.group("mark").lower() == "x"
30-
31-
32-
HUMAN_TESTED_RE = checkbox_re(HUMAN_TESTED_TEXT)
33-
34-
3522
def visible_text(text: str) -> str:
3623
"""Return PR body content that should count as author-provided text."""
3724
lines = []
@@ -61,16 +48,16 @@ def extract_sections(body: str) -> dict[str, str]:
6148

6249

6350
def extract_human_note(body: str) -> str:
64-
"""Return human-written text in the required location before the checkbox."""
51+
"""Return human-written text in the required location before AGENT."""
6552
human_match = HUMAN_HEADING_RE.search(body)
6653
if human_match is None:
6754
return ""
6855

69-
checkbox_match = HUMAN_TESTED_RE.search(body, human_match.end())
70-
if checkbox_match is None:
56+
agent_match = AGENT_HEADING_RE.search(body, human_match.end())
57+
if agent_match is None:
7158
return ""
7259

73-
return visible_text(body[human_match.end() : checkbox_match.start()])
60+
return visible_text(body[human_match.end() : agent_match.start()])
7461

7562

7663
def validate_pr_body(body: str) -> list[str]:
@@ -81,20 +68,7 @@ def validate_pr_body(body: str) -> list[str]:
8168

8269
human_note = extract_human_note(body)
8370
if len(human_note) < MIN_HUMAN_NOTE_CHARS:
84-
errors.append(
85-
"Add a short human-written note between `HUMAN:` and "
86-
"the human-tested checkbox."
87-
)
88-
89-
human_tested = HUMAN_TESTED_RE.search(body)
90-
if human_tested is None:
91-
errors.append(
92-
f"Keep the `- [ ] {HUMAN_TESTED_TEXT}` checkbox in the PR description."
93-
)
94-
elif not checkbox_is_checked(HUMAN_TESTED_RE, body):
95-
errors.append(
96-
"A human must check `A human has tested these changes.` before review."
97-
)
71+
errors.append("Add a short human-written note between `HUMAN:` and `AGENT:`.")
9872

9973
if AGENT_HEADING_RE.search(body) is None:
10074
errors.append("Keep the `AGENT:` marker from the PR template.")

tests/cross/test_check_pr_description.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ def _load_prod_module():
3030
I reviewed the agent's changes and confirmed they do what the PR says.
3131
The implementation is small and the validation output matches the goal.
3232
33-
- [x] A human has tested these changes.
34-
3533
AGENT:
3634
3735
---
@@ -80,20 +78,16 @@ def test_human_section_must_be_first_visible_line_and_filled():
8078
errors = validate_pr_body(body)
8179

8280
assert "The first visible line of the PR description must be `HUMAN:`." in errors
83-
assert (
84-
"Add a short human-written note between `HUMAN:` and the human-tested checkbox."
85-
in errors
86-
)
87-
81+
assert "Add a short human-written note between `HUMAN:` and `AGENT:`." in errors
8882

89-
def test_human_tested_checkbox_must_be_checked():
90-
body = VALID_BODY.replace("- [x] A human has tested", "- [ ] A human has tested")
9183

92-
assert (
93-
"A human must check `A human has tested these changes.` before review."
94-
in validate_pr_body(body)
84+
def test_human_tested_checkbox_is_not_required():
85+
body = VALID_BODY.replace(
86+
"AGENT:", "- [ ] A human has tested these changes.\n\nAGENT:", 1
9587
)
9688

89+
assert validate_pr_body(body) == []
90+
9791

9892
def test_required_template_fields_must_be_present_and_filled():
9993
how_to_test = (

0 commit comments

Comments
 (0)