From 5dcf62045f0159b4d074d2759e6dd018fefce30b Mon Sep 17 00:00:00 2001 From: Drefvelin <54400154+Drefvelin@users.noreply.github.com> Date: Fri, 25 Sep 2026 10:26:46 +0000 Subject: [PATCH] Keep deny feedback from being published as the patch note line. A deny reason is an instruction for the week's note. A sentence in that feedback is no longer saved as the replacement line. Co-authored-by: Cursor --- backend/src/patchnotes/revise.py | 24 ++++-------------------- backend/src/patchnotes/test_revise.py | 16 ++++++++++++---- 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/backend/src/patchnotes/revise.py b/backend/src/patchnotes/revise.py index f7180ad4..579dc5bd 100644 --- a/backend/src/patchnotes/revise.py +++ b/backend/src/patchnotes/revise.py @@ -1,8 +1,9 @@ """Turn a staff deny reason into a new pending line. -The reason stays on the staff review. It is not copied into the public note -unless staff wrote the replacement themselves. A line that should not be -published is left denied. +The reason is an instruction. It is not copied into the public note. +Only an explicit replacement, such as "say: Added a station", becomes the +line. Feedback that covers several points is handled for the whole week, +not here. A line that should not be published is left denied. """ from __future__ import annotations @@ -28,15 +29,7 @@ r"(?i)\b(?:make (?:it|this)|move (?:it|this) to|this is|put (?:it|this) in)\b" ) _QUOTED = re.compile(r"[\"“”']([^\"“”']{2,80})[\"“”']") -_COMPLAINT = re.compile( - r"(?i)\b(" - r"don'?t|do not|dont|remove|drop|without|spoiler|secret|lore|hidden|" - r"vague|unclear|wrong|leak|leaks|reveal|reveals|mention|shorter|technical|" - r"bugfix|bug fix|internal" - r")\b" -) _SKIP_PHRASES = frozenset({"it", "this", "that", "the line", "line", "this line"}) -_ASK = re.compile(r"(?i)(\?\s*$|\b(can you|could you|would you)\b)") def rewrite(section: str, body: str, reason: str) -> tuple[str, str] | None: @@ -55,8 +48,6 @@ def rewrite(section: str, body: str, reason: str) -> tuple[str, str] | None: return None stripped = _strip_requested(text, note) candidate = stripped if stripped is not None else text - if candidate == text and _looks_like_replacement(note): - candidate = note return _accept(section, text, candidate, note) @@ -78,13 +69,6 @@ def _explicit_replacement(reason: str) -> str | None: return text or None -def _looks_like_replacement(reason: str) -> bool: - """A finished player sentence can replace a line. A question cannot.""" - if _COMPLAINT.search(reason) or _ASK.search(reason): - return False - return player_text(reason) is not None - - def _section_of(reason: str, current: str) -> str: if _SECTION_INTENT.search(reason) is None: return current diff --git a/backend/src/patchnotes/test_revise.py b/backend/src/patchnotes/test_revise.py index cbc277d7..e1923c2e 100644 --- a/backend/src/patchnotes/test_revise.py +++ b/backend/src/patchnotes/test_revise.py @@ -1,4 +1,4 @@ -"""Deny reasons become a new line, or the line stays denied.""" +"""Deny reasons become a new line only when staff give the replacement, or the line stays denied.""" from __future__ import annotations @@ -19,9 +19,17 @@ def test_explicit_wording_replaces_the_line(self) -> None: self.assertEqual(section, "new") self.assertEqual(body, "Added a station") - def test_staff_sentence_is_the_new_line(self) -> None: - section, body = rewrite("adjusted", "Changed a price", "Lowered the station price") - self.assertEqual((section, body), ("adjusted", "Lowered the station price")) + def test_a_staff_sentence_is_not_the_new_line(self) -> None: + self.assertIsNone(rewrite("adjusted", "Changed a price", "Lowered the station price")) + + def test_feedback_about_several_points_is_not_pasted_in(self) -> None: + self.assertIsNone( + rewrite( + "new", + "Custom masks can be skinned onto your character.", + "custom masks can be submitted via token, thats the important bit", + ) + ) def test_drop_leaves_the_line_denied(self) -> None: self.assertIsNone(rewrite("new", "Added a station", "Don't post this"))