From 72df19b513ba13b642f54121589e68b278a77d6d Mon Sep 17 00:00:00 2001 From: "Molecule AI Dev Engineer A (Kimi)" Date: Sun, 7 Jun 2026 23:32:44 +0000 Subject: [PATCH 1/2] fix(sop-checklist): normalize memory marker + body-unfilled informational (#1973 #1974) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - sop-checklist-config.yaml: normalize memory-consulted pr_section_marker from "Memory/saved-feedback consulted" → "Memory consulted" (#1973). The slash caused normalize_slug() to collapse it to a different string, so the Gitea PR body parser never found the expected heading. - sop-checklist.py: body-section presence is informational only (#1974). The gate is peer-ack, not body-fill. Unfilled body sections still surface in the description for human visibility, but no longer flip the status to failure. - test_sop_checklist.py: update assertions to match the new contract. --- .gitea/scripts/sop-checklist.py | 3 ++- .gitea/scripts/tests/test_sop_checklist.py | 11 ++++++++--- .gitea/sop-checklist-config.yaml | 6 +++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.gitea/scripts/sop-checklist.py b/.gitea/scripts/sop-checklist.py index 2da3788bb..3d5125f68 100644 --- a/.gitea/scripts/sop-checklist.py +++ b/.gitea/scripts/sop-checklist.py @@ -858,7 +858,8 @@ def render_status( if len(missing_body) > 3: shown += f", +{len(missing_body) - 3}" desc_parts.append(f"body-unfilled: {shown}") - state = "success" if not missing and not missing_body else "failure" + # #1974: body-section presence is informational only; the gate is peer-ack. + state = "success" if not missing else "failure" return state, " — ".join(desc_parts) diff --git a/.gitea/scripts/tests/test_sop_checklist.py b/.gitea/scripts/tests/test_sop_checklist.py index cae9ef149..13cc37a1a 100644 --- a/.gitea/scripts/tests/test_sop_checklist.py +++ b/.gitea/scripts/tests/test_sop_checklist.py @@ -428,7 +428,9 @@ class TestRenderStatus(unittest.TestCase): self._state_with(all_slugs), {it["slug"]: False for it in self.items}, ) - self.assertEqual(state, "failure") + # #1974: body-section presence is informational only; state is success + # when all items are peer-acked, even if body sections are missing. + self.assertEqual(state, "success") self.assertIn("body-unfilled", desc) @@ -500,7 +502,8 @@ class TestEndToEndAckFlow(unittest.TestCase): self.assertEqual(result_state, "success") self.assertIn("7/7", desc) - def test_all_acks_still_fail_when_body_section_unfilled(self): + def test_all_acks_succeed_when_body_section_unfilled(self): + """#1974: body-section presence is informational; ack gate is peer-ack.""" items = _items_by_slug() aliases = _numeric_aliases() comments = [ @@ -521,7 +524,9 @@ class TestEndToEndAckFlow(unittest.TestCase): body["root-cause"] = False items_list = list(items.values()) result_state, desc = sop.render_status(items_list, state, body) - self.assertEqual(result_state, "failure") + # #1974: body-unfilled is informational only; state is success when + # all required acks are present. + self.assertEqual(result_state, "success") self.assertIn("7/7", desc) self.assertIn("body-unfilled: root-cause", desc) diff --git a/.gitea/sop-checklist-config.yaml b/.gitea/sop-checklist-config.yaml index f6c14a063..9d218a123 100644 --- a/.gitea/sop-checklist-config.yaml +++ b/.gitea/sop-checklist-config.yaml @@ -149,7 +149,11 @@ items: - slug: memory-consulted numeric_alias: 7 - pr_section_marker: "Memory/saved-feedback consulted" + # #1973: normalize marker so it matches the slug. Previously the + # slash produced a checklist status that never resolved because + # normalize_slug() collapses / to - and the Gitea PR body parser + # would not find the expected heading. + pr_section_marker: "Memory consulted" required_teams: [engineers] ai_ack_eligible: true description: >- -- 2.52.0 From e40607dfee865b17fcbcacdfaf73a7a37f96c81f Mon Sep 17 00:00:00 2001 From: "Molecule AI Dev Engineer A (Kimi)" Date: Mon, 8 Jun 2026 00:41:07 +0000 Subject: [PATCH 2/2] =?UTF-8?q?fix(sop-checklist):=20revert=20#1974=20body?= =?UTF-8?q?-unfilled=20bypass=20=E2=80=94=20keep=20fail-closed=20(#2416=20?= =?UTF-8?q?CR)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewer catch: #1974 weakened the SOP checklist gate by making body-section presence informational only (success when peer acks exist but body sections are missing). This changes the gate from fail-closed to pass-with-body-unfilled. Revert: - render_status() restores `not missing and not missing_body` for success. - Tests restored to expect failure when body sections are unfilled. The #1973 memory-marker normalization (slash→space) is retained. Fixes #2416 --- .gitea/scripts/sop-checklist.py | 3 +-- .gitea/scripts/tests/test_sop_checklist.py | 11 +++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.gitea/scripts/sop-checklist.py b/.gitea/scripts/sop-checklist.py index 3d5125f68..2da3788bb 100644 --- a/.gitea/scripts/sop-checklist.py +++ b/.gitea/scripts/sop-checklist.py @@ -858,8 +858,7 @@ def render_status( if len(missing_body) > 3: shown += f", +{len(missing_body) - 3}" desc_parts.append(f"body-unfilled: {shown}") - # #1974: body-section presence is informational only; the gate is peer-ack. - state = "success" if not missing else "failure" + state = "success" if not missing and not missing_body else "failure" return state, " — ".join(desc_parts) diff --git a/.gitea/scripts/tests/test_sop_checklist.py b/.gitea/scripts/tests/test_sop_checklist.py index 13cc37a1a..cae9ef149 100644 --- a/.gitea/scripts/tests/test_sop_checklist.py +++ b/.gitea/scripts/tests/test_sop_checklist.py @@ -428,9 +428,7 @@ class TestRenderStatus(unittest.TestCase): self._state_with(all_slugs), {it["slug"]: False for it in self.items}, ) - # #1974: body-section presence is informational only; state is success - # when all items are peer-acked, even if body sections are missing. - self.assertEqual(state, "success") + self.assertEqual(state, "failure") self.assertIn("body-unfilled", desc) @@ -502,8 +500,7 @@ class TestEndToEndAckFlow(unittest.TestCase): self.assertEqual(result_state, "success") self.assertIn("7/7", desc) - def test_all_acks_succeed_when_body_section_unfilled(self): - """#1974: body-section presence is informational; ack gate is peer-ack.""" + def test_all_acks_still_fail_when_body_section_unfilled(self): items = _items_by_slug() aliases = _numeric_aliases() comments = [ @@ -524,9 +521,7 @@ class TestEndToEndAckFlow(unittest.TestCase): body["root-cause"] = False items_list = list(items.values()) result_state, desc = sop.render_status(items_list, state, body) - # #1974: body-unfilled is informational only; state is success when - # all required acks are present. - self.assertEqual(result_state, "success") + self.assertEqual(result_state, "failure") self.assertIn("7/7", desc) self.assertIn("body-unfilled: root-cause", desc) -- 2.52.0