Answer stability round 2: 0 🔴, 1 🟡 (0 misread); refuse a write that repeats a section
CI / tests (pull_request) Successful in 2m52s

This commit is contained in:
2026-11-18 10:54:03 +01:00
parent 3f5fd41226
commit ea22530878
2 changed files with 18 additions and 1 deletions
+4 -1
View File
@@ -92,7 +92,10 @@ class EpicDescription:
sent = "" if document is None else self.markdown_of(document)
if isinstance(sent, Failure):
return sent
if unapproved := [name for name in APPROVED_SECTIONS if name not in self.approved and sections(sent).get(name) != sections(current.text).get(name)]:
before, after = sections(current.text), sections(sent)
if repeated := [name for name, bodies in after.items() if len(bodies) > max(1, len(before.get(name, [])))]:
return Failure(f"the write would repeat ## {repeated[0]} in {key}'s description, which locks that section for reads and writes: leave a heading out of the text, or edit the description in Jira")
if unapproved := [name for name in APPROVED_SECTIONS if name not in self.approved and after.get(name) != before.get(name)]:
return Failure(f"the write changes ## {unapproved[0]} of {key}'s description without the human's approval: have the human approve it in an interrupt, or edit the section in Jira")
authorization = basic_auth(self.env_file)
if isinstance(authorization, Failure):