Stop a chunk whose epic lacks Goals or Audience, and test do-epic's run end to end

This commit is contained in:
2026-11-18 21:11:02 +01:00
parent f780d091b1
commit 9c9a7d917d
3 changed files with 194 additions and 2 deletions
+3 -1
View File
@@ -257,12 +257,14 @@ def repoless_models(epic: EpicRun) -> Models:
def premises_read(root: str | None, epic: EpicRun) -> str | Failure:
"""The epic's Goals and Audience, from its description, then those of the repo checked out at root, where the chunk has one."""
"""The epic's Goals and Audience, from its description, then those of the repo checked out at root, where the chunk has one. A Failure where the epic lacks either: no chunk runs without premises."""
bodies: list[str] = []
for name in ("Goals", "Audience"):
body = epic.record.section(name)
if isinstance(body, Failure):
return Failure(f"the epic {epic.key}'s description: {body.reason} - no premises.")
if not body.strip():
return Failure(f"the epic {epic.key}'s description has no text under a `## {name}` heading - no premises.")
bodies.append(body)
theirs = read_premises(root, epic.paths.home) if root else ""
if isinstance(theirs, Failure):