Answer stability round 1: 0 🔴, 4 🟡 (0 misread); name each template fault truly and pass the template to split
CI / tests (pull_request) Successful in 2m33s

This commit is contained in:
Lilleman
2026-11-20 10:46:19 +01:00
parent 3e8910f573
commit c39d23a1b3
5 changed files with 54 additions and 44 deletions
+9 -11
View File
@@ -19,8 +19,8 @@ One pair per machine, the same for every epic (docs/decisions.md → `do-epic: d
- `jira-finish-transition` and `jira-finish-status` name the workflow transition that moves a finished chunk's issue and closes a finished epic, such as "Mark as done", and the status it leads to, such as "Done". A project's config names a plan item's the same way. Set both or neither; without them do-epic moves no issue to done and closes no epic.
- `jira-unblocking-statuses` lists the statuses at which an issue's work has landed though Jira doesn't count it done yet, such as `["Release Ready"]`, in upper or lower case. An issue in one of them takes no chunk and no longer blocks the issues it blocks. A status Jira counts as done always does both, listed or not.
- `jira-automation-moves-issues = true` says the team's own automation moves an issue when its pull request merges. do-epic then moves only the issue of a chunk without a repo, which has no pull request, and waits for the automation to move each other. It needs `jira-unblocking-statuses`, which then names the status the automation gives an issue whose pull request merged. false where left out.
- `[label-repos]` has one line for each label of the team's own that names a repo: the label, then that repo's name, such as `twu-4 = "tenant-web-ui-4"`. do-epic reads such a label as it reads its own `repo:<name>`. A team whose label is the repo's name maps the name to itself.
- `sub-task-summary` shapes the summary of each sub-task do-epic files for an issue that changes several repos, such as `"{label}: {Summary}"`. `{label}` is the team's label for the repo, else the repo's name, and `{Summary}` is the issue's summary with a capital first letter. It must hold `{Summary}`. Where left out, a summary is `[<repo>] <the issue's summary>`.
- `[label-repos]` has one line for each label of the team's own that names a repo: the label, then that repo's name, such as `twu-4 = "tenant-web-ui-4"`. do-epic reads such a label as it reads its own `repo:<name>`. A team whose label is the repo's name maps the name to itself. Where several lines name one repo, do-epic writes the label of the first.
- `repo-rule.md` is prose that says how to tell an item's repo, and mustn't be blank."""
import dataclasses
import pathlib
@@ -86,21 +86,19 @@ def label_repo_faults(table: object) -> list[str]:
def summary_template_faults(template: object) -> list[str]:
"""What is wrong with the SUB_TASK_SUMMARY template: a value that isn't one line with `{Summary}` and no other field than `{label}`."""
"""What is wrong with the SUB_TASK_SUMMARY template: a value that isn't one line, that holds a brace Python can't read, a field other than `{label}` and `{Summary}`, a format after a field's name, or no `{Summary}`."""
example = "`\"{label}: {Summary}\"`"
if not isinstance(template, str) or "\n" in template:
return [f"`{SUB_TASK_SUMMARY}` is {template!r}, not one line of text such as {example}"]
try:
fields = list(string.Formatter().parse(template))
except ValueError as failure:
return [f"`{SUB_TASK_SUMMARY}` is {template!r}, {failure}; write a brace that stands for itself twice, as {{{{ or }}}}"]
named = [name for _, name, spec, conversion in fields if name is not None and not spec and not conversion]
faults = [f"`{SUB_TASK_SUMMARY}` names {{{name}}}, and only {{label}} and {{Summary}} are known" for name in dict.fromkeys(named) if name not in ("label", "Summary")]
odd = [name for _, name, spec, conversion in fields if name is not None and (spec or conversion)]
fields = [(name, spec, conversion) for _, name, spec, conversion in string.Formatter().parse(template) if name is not None]
except ValueError:
return [f"`{SUB_TASK_SUMMARY}` is {template!r}, which has a brace that stands alone; write a brace that is plain text as {{{{ or }}}}"]
names = [name for name, _, _ in fields]
return [
*faults,
*([f"`{SUB_TASK_SUMMARY}` holds a field with a format or conversion, which isn't read"] if odd else []),
*([f"`{SUB_TASK_SUMMARY}` lacks {{Summary}}, so every sub-task would get the same summary, such as {example}"] if "Summary" not in named else []),
*(f"`{SUB_TASK_SUMMARY}` names {{{name}}}, and only {{label}} and {{Summary}} are known" for name in dict.fromkeys(names) if name not in ("label", "Summary")),
*(f"`{SUB_TASK_SUMMARY}` writes {{{name}{'!' + conversion if conversion else ''}{':' + spec if spec else ''}}} with something after the name; write {{{name}}} alone" for name, spec, conversion in fields if (spec or conversion) and name in ("label", "Summary")),
*([f"`{SUB_TASK_SUMMARY}` lacks {{Summary}}, so no sub-task's summary would say what changes in it, such as {example}"] if "Summary" not in names else []),
]