Stop a chunk whose epic lacks Goals or Audience, and test do-epic's run end to end
This commit is contained in:
+3
-1
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user