Have larv-review's scoring-run trigger count unreleased changes as chunk-preflight does

This commit is contained in:
2026-10-22 01:43:04 +02:00
parent b9963df226
commit 591db4a33e
7 changed files with 37 additions and 24 deletions
+6 -8
View File
@@ -1,5 +1,6 @@
from git_repo import commits_since, file_at, full_history, git, newest_release_tag
from chunk_pick import default_plan, unreleased_changes
from failure import Failure
from git_repo import file_at, full_history, git
from comprehension_history import HISTORY, HistoryChange
@@ -22,10 +23,7 @@ def history_changes(default: str) -> list[HistoryChange] | Failure:
return changes
def committed_since_release(default: str) -> bool | Failure:
"""Whether the default branch holds a commit after its newest `v*` tag, or any commit when it has none."""
newest = newest_release_tag(default)
if isinstance(newest, Failure):
return newest
count = commits_since(newest, default)
return count if isinstance(count, Failure) else count > 0
def changes_unreleased(root: str, default: str) -> bool | Failure:
"""Whether the default branch holds a change after its last release, counted as chunk-preflight counts it: `chunk_pick.unreleased_changes`. root is the checkout the git commands run in."""
changes = unreleased_changes(default_plan(root, default).cut)
return changes if isinstance(changes, Failure) else changes > 0