From 578a4f680da1457eb12ced5c8cda278dad7df033 Mon Sep 17 00:00:00 2001 From: Time Date: Sun, 18 Oct 2026 04:46:29 +0000 Subject: [PATCH] card #77: kept .github/time/time.py (generated) --- .github/time/time.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/time/time.py b/.github/time/time.py index b6eda07..d9a17a7 100644 --- a/.github/time/time.py +++ b/.github/time/time.py @@ -548,6 +548,19 @@ def votes(pr: dict, since: str) -> dict[str, str]: return latest +def standing_voters() -> int: + """How many identities the standing seats vote as: a seat with its own Gitea user (TIME_SEAT_) is one, and every + seat that posts as Time shares one. The tie-break waits until that many have voted.""" + ids = set() + for spec in review_specs("TIME_REVIEW"): + kind, _, rest = spec.partition(":") + if kind == "cursor": + continue # a Cursor agent comments on its own schedule; it doesn't hold up the count + seat = (rest.split() or [kind])[0] if kind in SEAT_KINDS else kind + ids.add(seat if seat_token(seat) else TIME_BOT) + return max(1, len(ids)) + + def quorum() -> int: """TIME_REVIEW_QUORUM: approvals needed, net of objections (default 1).""" try: @@ -640,7 +653,7 @@ def land(card: dict, last: dict, revised_at: str | None = None) -> None: v = decide(cast) if v is None: # Not settled. Wait while nobody has voted, a standing seat has yet to vote, or the split is already reported. - if not cast or last.get("split") or len(cast) < max(1, len(review_specs("TIME_REVIEW"))): + if not cast or last.get("split") or len(cast) < standing_voters(): return tie = (os.environ.get("TIME_REVIEW_TIEBREAK") or "").strip() a, o = tally(cast) @@ -652,7 +665,7 @@ def land(card: dict, last: dict, revised_at: str | None = None) -> None: cast = votes(pr, since) v = decide(cast) a, o = tally(cast) - if v is None: + if v != "approve": # the tie-break seat's Object ends in the split message too: one verdict a human reads once label(pr["number"], "needs-human") comment(n, f"⏱️ Time: the council is split {a}–{o} on PR #{pr['number']}; over to a human.", {"beat": "needs-human", "pr": pr["number"], "split": True})