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
+7
View File
@@ -47,6 +47,13 @@ def origin_head() -> str | Failure:
return Failure("origin names no default branch; set it with `git remote set-head origin --auto`")
def newest_release_tag(branch: str) -> str | None | Failure:
"""The newest `v*` tag merged into branch, None when it has none."""
# Sorts v1.0.0-rc.1 below v1.0.0.
tags = git("-c", "versionsort.suffix=-", "tag", "--list", "v*", "--merged", branch, "--sort=-v:refname")
return tags if isinstance(tags, Failure) else next(iter(tags.split()), None)
def commit_exists(commit: str) -> bool:
return not isinstance(git("rev-parse", "--quiet", "--verify", f"{commit}^{{commit}}"), Failure)