Skip to content

Share GitHub request and delivery evidence handling - #1811

Merged
mergify[bot] merged 1 commit into
mainfrom
lean178/575-github-readers-2
Nov 26, 2026
Merged

mergify[bot] merged 1 commit into
mainfrom
lean178/575-github-readers-2

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Share GitHub request and delivery evidence handling

Context and goal

Refs #575

Replaces #1787. This carries its net change as one commit on current main. Lean's verification of the conflict resolution applies to the patch carried forward here.

Acceptance

  • Remove at least 50 net source lines without changing test files.
  • Keep existing GitHub behavior and repository size gates green.

Validation

Recorded for 05b8afc34f1e

  • uv run --group dev ruff check src tests: exit 0
  • uv run --group dev tach check: exit 0
  • uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0
  • scripts/size_budget.sh: exit 0
  • uv run --group dev pytest -q: exit 0

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Review

  • primary, claude, 05b8afc, approve

Co-Authored-By: Codex <noreply@openai.com>
Architecture-Review: unchanged; GitHub retains ownership of PR and check evidence, with the same endpoints and verification rules.

@loopzero-feder-positronics loopzero-feder-positronics Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loopzero primary review by claude on 05b8afc34f1e4ace994e8b8625df41890b98cd2d, 51.6s: approve (0 critical, 0 important, 2 suggestion)

Settings per native call (launch configuration and CLI claims, not backend attestation):

  • Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)

Native Claude output is retained in the restricted local review receipt.

Comment thread src/loopzero/github.py
message_tail=None if diagnostic_api else tail)
if diagnostic_api or patch_error else tail)

error_command, detail = (command if rate_limited else argv), tail

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Post-loop error path depends on loop-scoped variables implicitly

After the for delay in delays loop, _gh now reads rate_limited, transient, response, tail, done and selected, which are only bound inside the loop body. That works today because every exit is covered: a timeout on the last attempt re-raises, and a final delay=None makes _retry_pause/_rate_limit_delay return False, which forces a break. The invariant isn't written down anywhere, though. If someone later changes delays so it no longer ends in None, or adds a continue path, the code could raise UnboundLocalError or fall through using stale values from the previous iteration. Smallest fix: add a one-line comment at the loop saying the last delay is always None, so every iteration that reaches the status check either returns or breaks.

Comment thread src/loopzero/github.py
raise GhError(("gh", "api", endpoint), "PR changed during branch lookup")
states = {"CLOSED", "MERGED"} if state == "CLOSED" else {state}
if pr.state not in states or not _matches_branch(detail["head"], repo, branch):
lookup = "completion" if state == "MERGED" else "branch"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Error wording now keyed implicitly on the requested state

_confirm_branch_pr picks "completion" vs "branch" lookup from state == "MERGED". This matches the old messages because only merged_pr_for_branch passes "MERGED" (pr_for_branch passes only OPEN/CLOSED). The coupling is easy to miss: a future caller that passes "MERGED" from a branch lookup would silently get the "completion" wording. Non-blocking. Passing the lookup label explicitly, or noting the coupling in a comment, would make it clearer.

@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@Mergifyio queue

@mergify

mergify Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

✅ Merged into main as 315ab10 at 10:53 UTC

5 min in the queue, 4 min of it CI.

So far

  • ✅ Entered the queue Thu 26 Nov, 10:49 · rule main · triggered by @eowca with the @mergifyio queue command
  • ✅ Passed · draft #1820
  • ✅ Merged 10:53 · 315ab10 · squash
3 merge conditions met
  • github-review-approved · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-success = checks
    • check-neutral = checks
    • check-skipped = checks
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-success = Loop-zero Eligibility
    • check-neutral = Loop-zero Eligibility
    • check-skipped = Loop-zero Eligibility

Times in UTC · dashboard · how the merge queue works

@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

No description provided.

@mergify
mergify Bot merged commit 315ab10 into main Nov 26, 2026
18 checks passed
@mergify mergify Bot removed the queued label Nov 26, 2026
@eowca
eowca deleted the lean178/575-github-readers-2 branch November 26, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant