Answer architecture round 1: 4 🔴, 5 🟡 (0 misread); one-way plan packages with a plan core and an Atlassian client, one parse and print of an item's cells, a pure chunk-start decision, a settings table, one plan read and one standing per pick, one config load in chunk-pr, notifier backends in notifier, and the bin regroup filed as item 392

This commit is contained in:
2026-11-16 14:47:46 +01:00
parent 3f7d85c48e
commit f58250d0ce
103 changed files with 1299 additions and 1044 deletions
+6 -4
View File
@@ -140,10 +140,12 @@ def commit_breaches(commit: CommitCall, home: pathlib.Path) -> list[Breach]:
if isinstance(config, Failure) and not isinstance(config, Unnamed):
unread = [Breach("commit-title", f"the project's config cannot be read, so the title is not checked against its template: {config.reason}", commit.directory)]
titles = config.titles if isinstance(config, ProjectConfig) else templates.BARE
return unread + title_breaches(commit, titles, isinstance(config, ProjectConfig) and on_item_branch(commit.directory, config.branch)) + round_cap_breaches(commit, titles) + todo_breaches(commit.directory, home)
# A checkout no config names has no branch template, so no title of its must fit one.
branch = checkout_branch(commit.directory) if isinstance(config, ProjectConfig) else None
return unread + title_breaches(commit, titles, config.branch if isinstance(config, ProjectConfig) else templates.BRANCH, branch) + round_cap_breaches(commit, titles) + todo_breaches(commit.directory, home)
def on_item_branch(directory: str, template: str) -> bool:
"""Whether directory's checkout is on a branch that fits template, the config's `branch`: a plan item's branch, whose commits carry the item's ID. Any other branch, such as a release review's, has no item to give {id}."""
def checkout_branch(directory: str) -> str | None:
"""The branch directory's checkout is on; None where HEAD is detached or git cannot tell."""
branch = guarded_git(directory, "symbolic-ref", "--quiet", "--short", "HEAD")
return not isinstance(branch, Failure) and templates.branch_fits(template, branch)
return None if isinstance(branch, Failure) else branch.strip()