Answer architecture round 2: 0 🔴, 3 🟡 (0 misread); the cycle's and the chunk run's suites sit beside their modules, and the claim rule and the model override have one home each
CI / tests (pull_request) Successful in 3m23s

This commit is contained in:
2026-11-19 11:29:32 +01:00
parent b8595db647
commit df210aaeca
31 changed files with 807 additions and 657 deletions
+4 -4
View File
@@ -2,9 +2,9 @@
import time
import typing
from forge.reviews import APPROVED, CHANGES_REQUESTED, github_decision, REVIEW_REQUIRED, waiting_threads
from failure import Failure
from forge.commands import Forge, Run
from forge.reviews import github_decision, waiting_threads
# A human answers in hours, so merge polls once a minute and gives up after 90 minutes. That leaves half an hour for the queue and the checks inside the 2 hours a background command may run; a run that needs more is killed before the give-up message prints, and its next run goes on from what it pushed.
POLL_SECONDS = 60
@@ -25,13 +25,13 @@ def approval(number: str, run: Run) -> bool | Failure:
decision = github_decision(number, run)
if isinstance(decision, Failure):
return decision
if decision == "CHANGES_REQUESTED":
if decision == CHANGES_REQUESTED:
return Failure(f"a reviewer requested changes on pull request {number}")
if not decision:
return Failure("wait-for-approval is set, but the branch protection requires no review, so GitHub reports no decision; ask the human to require a review in the protection or to set wait-for-approval to false")
if decision not in ("APPROVED", "REVIEW_REQUIRED"):
if decision not in (APPROVED, REVIEW_REQUIRED):
return Failure(f"GitHub reports the review decision {decision!r} on pull request {number}, and chunk-pr doesn't know that decision")
return decision == "APPROVED"
return decision == APPROVED
def approved(number: str, run: Run, sleep: typing.Callable[[float], None] = time.sleep) -> Failure | None: