Record do-epic's repo picks and sub-task summaries in the team's own spelling
CI / tests (pull_request) Failing after 2m33s

This commit is contained in:
Lilleman
2026-11-20 09:10:55 +01:00
parent e9e11f10a0
commit 15c978b708
9 changed files with 130 additions and 23 deletions
+8 -6
View File
@@ -7,7 +7,7 @@ import json
from claude_code.reply import Claude, claude_reply, Limited
from do_epic.backend.protocol import EpicIssue, EpicStore
from failure import Failure
from do_epic.repo_pick import label_of, LabelRepos, of_label, Repo, REPO_NAME
from do_epic.repo_pick import label_of, LabelRepos, of_label, Repo, REPO_NAME, team_label
from model_routing.ladder import Rung
from claude_code.entries import structured_output
@@ -64,7 +64,7 @@ def is_split(item: EpicIssue, issues: list[EpicIssue]) -> bool:
return SPLIT_LABEL in item.labels or any(task.parent == item.key and not task.by_loop for task in issues)
def split(store: EpicStore, issue: EpicIssue, team: LabelRepos, by_person: bool, rule: str, language: str, checkouts: tuple[str, ...], rung: Rung, claude: Claude, cwd: str) -> Split | Failure | Limited:
def split(store: EpicStore, issue: EpicIssue, team: LabelRepos, by_person: bool, rule: str, language: str, checkouts: tuple[str, ...], rung: Rung, claude: Claude, cwd: str, summary_template: str | None = None) -> Split | Failure | Limited:
"""Splits the epic's child issue into a sub-task per repo it changes, where that is more than one. by_person says a person filed the issue, and checkouts are the epic's repos that claude may read. An item that changes one repo or none is left as it is, for repo_pick, and one already split (is_split) is left alone.
A sub-task of the item already labelled for a repo counts as that repo's, so a run that failed after filing some sub-tasks leaves the next run to file only the lacking ones. The comment on a person's issue is posted once its sub-tasks are filed, just before the item is marked. A failure after the comment but before the mark posts it again on the next run."""
@@ -87,7 +87,7 @@ def split(store: EpicStore, issue: EpicIssue, team: LabelRepos, by_person: bool,
for part in predicted.parts:
if part.repo in have:
continue
key = store.file(issue.key, task_summary(part.repo, issue.summary), part.change, (label_of(Repo(part.repo)),))
key = store.file(issue.key, task_summary(part.repo, issue.summary, team, summary_template), part.change, (label_of(Repo(part.repo), team),))
if isinstance(key, Failure):
return Failure(f"cannot file the sub-task for {part.repo} under {issue.key}: {key.reason}; {sub_tasks_filed(filed)}; run do-epic again to file the rest")
filed.append(key)
@@ -105,9 +105,11 @@ def sub_tasks_filed(keys: list[str]) -> str:
return f"this run filed {', '.join(keys)}" if keys else "this run filed no sub-task"
def task_summary(repo: str, summary: str) -> str:
"""A sub-task's summary. Three readers, seated as a client's team, picked `[<repo>] <the item's summary>` from four candidates, over `<repo>: …`, `… (<repo>)` and `… — <repo> part`, 3-0."""
return f"[{repo}] {summary}"
def task_summary(repo: str, summary: str, team: LabelRepos, template: str | None) -> str:
"""A sub-task's summary: the team's template (config.py) with `{label}` the team's label for the repo, else its name, and `{Summary}` the item's summary with a capital first letter. Without a template, `[<repo>] <the item's summary>`: three readers, seated as a client's team, picked that from four candidates, over `<repo>: …`, `… (<repo>)` and `… — <repo> part`, 3-0."""
if template is None:
return f"[{repo}] {summary}"
return template.format(label=team_label(repo, team) or repo, Summary=summary[:1].upper() + summary[1:])
def finished(issues: list[EpicIssue], key: str) -> bool: