Skip to content

Commit 4593f9e

Browse files
Relax PR metadata governance checks (#7607)
* Relax PR metadata governance severity * Simplify PR template metadata requirements * Restore concise PR checklist * Restore Reminder-style PR checklist
1 parent a02d7c7 commit 4593f9e

4 files changed

Lines changed: 48 additions & 56 deletions

File tree

.github/pull_request_template.md

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,44 +8,17 @@
88
- [ ] I have requested any needed governance exception below.
99

1010
### Linked Issue
11-
Fix #...
11+
Fix #
1212

1313
### Unit Tests and/or Case Tests for my changes
14-
- A unit test is added for each new feature or bug fix.
15-
16-
### Exact Verification Performed
1714
- Commands run:
1815
- Result summary:
1916
- Checks not run, with reason:
2017

2118
### What's changed?
22-
- Example: My changes might affect the performance of the application under certain conditions, and I have tested the impact on various scenarios...
23-
24-
### Governance Checklist
25-
- Global dependencies: no net increase in `GlobalV`, `GlobalC`, or `PARAM` code references, or exception requested below with reason, scope, risk, and cleanup plan.
26-
- Default parameters: no new default arguments added to existing interfaces, or exception requested below.
27-
- Headers: no unnecessary header dependencies or `.hpp` propagation, or rationale provided below.
28-
- Line endings: text files use LF; only `.bat` and `.cmd` use CRLF.
29-
- Build linkage: new source files are listed in the relevant `CMakeLists.txt`, or rationale provided below.
30-
- Documentation: behavior/interface changes include documentation updates, or no documentation update is required because ...
31-
- CodeRabbit: if automatic review has not started and the repository has CodeRabbit installed, request `@coderabbitai review`.
32-
33-
### INPUT Parameter Changes
34-
- Parameters added/removed/changed:
35-
- `docs/parameters.yaml` updated: yes/no/not applicable
36-
- `docs/advanced/input_files/input-main.md` updated: yes/no/not applicable
37-
- If not updated, explain why no INPUT documentation update is required:
38-
39-
### Core Module Impact
40-
- Affected core modules:
41-
- Risk summary:
42-
- Compatibility or performance impact:
19+
- Example: brief summary of the user-visible or developer-facing change.
4320

44-
### Governance Exception
45-
- Rule:
46-
- Reason:
47-
- Scope:
48-
- User or maintenance risk:
49-
- Why the normal rule cannot be followed now:
50-
- Follow-up cleanup plan:
51-
- Requested approver:
21+
### Governance Notes
22+
- INPUT/docs changes:
23+
- Core module impact:
24+
- Exceptions requested:

docs/developers_guide/agent_governance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ decisions.
8282
| Test sufficiency | Tests cover important behavior | AI review + human confirmation | AI + human review | medium | human confirmation | semantic review | Not mechanically blocked |
8383
| INPUT behavior linkage | Parameter metadata/default/type/parser behavior updates YAML and docs | phase-one mechanical + AI review | CI + AI review | high | block | behavior-field diff plus docs/PR body | Comment-only parameter-file changes are not blocked |
8484
| Documentation sync | Behavior/interface docs updated | phase-one mechanical warning + AI review | CI + AI review | medium | warn | changed paths and PR body | Major behavior changes escalate to reviewers |
85-
| PR metadata completeness | Issue, tests, behavior, INPUT, core impact, exceptions | phase-one mechanical | CI or GitHub bot | medium | block | PR template fields | Not run by local hook |
85+
| PR metadata completeness | Issue, tests, behavior, INPUT, core impact, exceptions | phase-one mechanical | CI or GitHub bot | medium | warn | PR template fields | Not run by local hook |
8686
| AI workflow | Interface lookup, uncertainty, verification report | AI review | AI review | high | warn | review transcript/output | Applies to AI agents |
8787
| Exceptions | Reason, scope, risk, follow-up plan | human confirmation | human review + CI | high | human confirmation | PR exception section | CI checks presence, not approval |
8888

tools/03_code_analysis/agent_governance_check.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -542,10 +542,6 @@ def check_pr_metadata(findings: List[Finding], body: Optional[str]) -> None:
542542
"Linked Issue",
543543
"Unit Tests and/or Case Tests for my changes",
544544
"What's changed?",
545-
"Governance Checklist",
546-
"INPUT Parameter Changes",
547-
"Core Module Impact",
548-
"Governance Exception",
549545
]
550546
sections = pr_sections(body)
551547
missing = [section for section in required_sections if section not in sections]
@@ -563,12 +559,11 @@ def check_pr_metadata(findings: List[Finding], body: Optional[str]) -> None:
563559
add_finding(
564560
findings,
565561
"PR metadata completeness",
566-
BLOCK,
562+
WARN,
567563
"pull_request.body",
568564
None,
569565
"; ".join(reason_parts),
570-
"Fill the PR template with issue linkage, test evidence, behavior impact, governance notes, and exception details.",
571-
allow_exception=False,
566+
"Fill the PR template with issue linkage, test evidence, and a concise change summary.",
572567
)
573568

574569

tools/03_code_analysis/test_agent_governance_check.py

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ def test_blocks_input_parameter_change_when_required_docs_are_deleted(self):
277277

278278
self.assert_blocked_by(result, "INPUT parameter documentation linkage")
279279

280-
def test_blocks_unfilled_pr_template_fields_from_event_payload(self):
280+
def test_warns_for_unfilled_pr_template_fields_from_event_payload(self):
281281
event = self.repo / "event.json"
282282
event.write_text(
283283
json.dumps(
@@ -293,25 +293,25 @@ def test_blocks_unfilled_pr_template_fields_from_event_payload(self):
293293

294294
result = self.run_checker("--event-path", str(event))
295295

296-
self.assert_blocked_by(result, "PR metadata completeness")
296+
self.assert_warns_with_success(result, "PR metadata completeness")
297297

298-
def test_blocks_empty_pr_template_from_event_payload(self):
298+
def test_warns_for_empty_pr_template_from_event_payload(self):
299299
for body in ("", None):
300300
with self.subTest(body=body):
301301
event = self.repo / "event.json"
302302
event.write_text(json.dumps({"pull_request": {"body": body}}))
303303

304304
result = self.run_checker("--event-path", str(event))
305305

306-
self.assert_blocked_by(result, "PR metadata completeness")
306+
self.assert_warns_with_success(result, "PR metadata completeness")
307307

308-
def test_blocks_missing_pr_body_from_event_payload(self):
308+
def test_warns_for_missing_pr_body_from_event_payload(self):
309309
event = self.repo / "event.json"
310310
event.write_text(json.dumps({"pull_request": {}}))
311311

312312
result = self.run_checker("--event-path", str(event))
313313

314-
self.assert_blocked_by(result, "PR metadata completeness")
314+
self.assert_warns_with_success(result, "PR metadata completeness")
315315

316316
def test_skips_pr_metadata_when_event_payload_is_not_a_pull_request(self):
317317
event = self.repo / "event.json"
@@ -322,7 +322,7 @@ def test_skips_pr_metadata_when_event_payload_is_not_a_pull_request(self):
322322
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
323323
self.assertNotIn("PR metadata completeness", result.stdout)
324324

325-
def test_accepts_filled_pr_template_fields_from_event_payload(self):
325+
def test_accepts_core_pr_template_fields_from_event_payload(self):
326326
event = self.repo / "event.json"
327327
event.write_text(
328328
json.dumps(
@@ -332,15 +332,38 @@ def test_accepts_filled_pr_template_fields_from_event_payload(self):
332332
"### Unit Tests and/or Case Tests for my changes\n"
333333
"Ran python3 -m unittest tools/03_code_analysis/test_agent_governance_check.py.\n\n"
334334
"### What's changed?\n"
335+
"Adds governance checks only; no runtime behavior change.\n"
336+
}
337+
}
338+
)
339+
)
340+
341+
result = self.run_checker("--event-path", str(event))
342+
343+
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
344+
self.assertNotIn("PR metadata completeness", result.stdout)
345+
346+
def test_accepts_reminder_style_pr_template_from_event_payload(self):
347+
event = self.repo / "event.json"
348+
event.write_text(
349+
json.dumps(
350+
{
351+
"pull_request": {
352+
"body": "### Reminder\n"
353+
"- [ ] I have read `AGENTS.md` and `docs/developers_guide/agent_governance.md`.\n"
354+
"- [ ] I have linked an issue or explained why this PR does not need one.\n"
355+
"- [ ] I have added adequate unit tests and/or case tests, or explained why not.\n"
356+
"- [ ] I have listed the exact verification commands run and their results.\n"
357+
"- [ ] I have described user-visible behavior changes, including INPUT parameter changes.\n"
358+
"- [ ] I have explained core-module impact for ESolver, HSolver, ElecState, Hamilt, Operator, Psi, or other `source/` changes.\n"
359+
"- [ ] I have requested any needed governance exception below.\n\n"
360+
"### Linked Issue\nNo issue; governance bootstrap.\n\n"
361+
"### Unit Tests and/or Case Tests for my changes\n"
362+
"Ran python3 -m unittest tools/03_code_analysis/test_agent_governance_check.py.\n\n"
363+
"### What's changed?\n"
335364
"Adds governance checks only; no runtime behavior change.\n\n"
336-
"### Governance Checklist\n"
337-
"Line endings, CMake linkage, and docs rules reviewed.\n\n"
338-
"### INPUT Parameter Changes\n"
339-
"No INPUT parameter changes.\n\n"
340-
"### Core Module Impact\n"
341-
"No core module impact.\n\n"
342-
"### Governance Exception\n"
343-
"No exceptions requested.\n"
365+
"### Governance Notes\n"
366+
"No INPUT, core module, or exception notes.\n"
344367
}
345368
}
346369
)
@@ -349,6 +372,7 @@ def test_accepts_filled_pr_template_fields_from_event_payload(self):
349372
result = self.run_checker("--event-path", str(event))
350373

351374
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
375+
self.assertNotIn("PR metadata completeness", result.stdout)
352376

353377
def test_warns_for_source_change_without_test_evidence(self):
354378
self.write("source/source_base/new_feature.cpp", "int new_feature() { return 1; }\n")

0 commit comments

Comments
 (0)