Run a preflight before each fresh worker and put its facts in the worker's prompt

This commit is contained in:
2026-10-17 00:29:24 +02:00
parent 46b79e7803
commit f9615cb3b0
22 changed files with 532 additions and 76 deletions
+5 -7
View File
@@ -1,5 +1,5 @@
from failure import Failure
from git_repo import file_at, full_history, git
from git_repo import file_at, full_history, git, newest_release_tag
from comprehension_history import HISTORY, HistoryChange
@@ -24,10 +24,8 @@ def history_changes(default: str) -> list[HistoryChange] | Failure:
def landed_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."""
# Sorts v1.0.0-rc.1 below v1.0.0.
tags = git("-c", "versionsort.suffix=-", "tag", "--list", "v*", "--merged", default, "--sort=-v:refname")
if isinstance(tags, Failure):
return tags
newest = tags.split()[:1]
count = git("rev-list", "--count", f"{newest[0]}..{default}" if newest else default)
newest = newest_release_tag(default)
if isinstance(newest, Failure):
return newest
count = git("rev-list", "--count", f"{newest}..{default}" if newest else default)
return count if isinstance(count, Failure) else int(count) > 0