Name plan_reasons' first argument ref, since it can be a commit, and pin the emptied-release words in SKILL.md
CI / tests (pull_request) Successful in 2m7s

This commit is contained in:
2026-11-11 00:11:20 +01:00
parent 58402083cb
commit 13d1550299
3 changed files with 11 additions and 8 deletions
+6 -6
View File
@@ -63,17 +63,17 @@ def emptied(before: list[Item], after: list[Item], shipped: list[Item], renamed:
return sorted(named - {item.release for item in kept} - renamed)
def plan_reasons(default: str, ids: list[int] | None) -> list[str] | Failure:
"""Why the plan calls a scoring run, from the default branch's todo.md and the checkout's; empty where the project opts out of the comprehension check. Where ids is None, the chunk ships each item the default branch's plan holds and the checkout's does not."""
def plan_reasons(ref: str, ids: list[int] | None) -> list[str] | Failure:
"""Why the plan calls a scoring run, from todo.md at ref and the checkout's; empty where the project opts out of the comprehension check. ref is the default branch, or the commit where the chunk began. Where ids is None, the chunk ships each item the plan at ref holds and the checkout's does not."""
checkout = top()
if isinstance(checkout, Failure):
return checkout
decisions = file_at(default, "docs/decisions.md", checkout)
decisions = file_at(ref, "docs/decisions.md", checkout)
if isinstance(decisions, Failure):
return decisions
if OPTED_OUT.search(decisions):
return []
held = default_plan(checkout, default)
held = default_plan(checkout, ref)
before = held.todo
if isinstance(before, Failure):
return before
@@ -86,14 +86,14 @@ def plan_reasons(default: str, ids: list[int] | None) -> list[str] | Failure:
if isinstance(planned, NoItemsTable):
planned = []
if isinstance(planned, Failure):
return Failure(f"{default}'s todo.md: {planned.reason}")
return Failure(f"{ref}'s todo.md: {planned.reason}")
renamed = renames(after)
if isinstance(renamed, Failure):
return Failure(f"the checkout's todo.md: {renamed.reason}")
landed_release = landed_towards(planned, held.cut)
if isinstance(landed_release, Failure):
return landed_release
unmeasured = unmeasured_cut(default, checkout)
unmeasured = unmeasured_cut(ref, checkout)
if isinstance(unmeasured, Failure):
return unmeasured
if ids is None: