Skip to content

Reconcile eligibility dispatch after finding resolution - #1754

Merged
mergify[bot] merged 3 commits into
mainfrom
lean178/1509-recover-eligibility-dispatch-v2
Nov 26, 2026
Merged

mergify[bot] merged 3 commits into
mainfrom
lean178/1509-recover-eligibility-dispatch-v2

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Context and goal

After resolving a finding, look for a matching workflow run before retrying an ambiguous dispatch. Check the current head and trusted findings before issuing a second write.

Closes #1509. Supersedes #1562, whose approved head conflicts with a resolve fixture update on main.

Validation

Recorded for ae032ea2f6ae

  • 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

The original delivery head passed the full check and primary review. Focused resolve tests passed after the merge conflict was reconciled. GitHub workflow-run visibility remains unverified live. Python source +32 lines, tests +0.


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

Review

Architecture-Review: unchanged; dispatch reconciliation uses the configured base, trusted publishers and existing workflow input.
Co-Authored-By: Codex <noreply@openai.com>

@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 f80655ba38ec4ad297d72f166154d5fc57f62568, 58.2s: approve (0 critical, 0 important, 3 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

def refresh_eligibility(repo: str, pr: PR, branch: str, base: str, publishers: tuple[str, ...]) -> None:
args = eligibility_dispatch_args(repo, pr.number, base)
since = datetime.fromtimestamp(time.time(), UTC).isoformat(timespec="seconds")

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: An empty run list is treated as proof that no dispatch happened, but it may only mean the run isn't visible yet

since comes from the local clock, and the lookup runs only 5 s after the failed POST. If the POST actually went through, two things can hide that run: (1) the local clock is ahead of GitHub's clock by more than the dispatch latency, so created>=since filters the run out; (2) GitHub creates workflow_dispatch runs asynchronously, and listing can lag. That lag is most likely during the same 5xx incidents that trigger this path. In either case _eligibility_dispatched returns False and a second dispatch goes out. The duplicate is mostly harmless because the source job's concurrency group queues it with cancel-in-progress: false. Still, it contradicts the note that an observation you can't trust should not authorize a duplicate. Smallest fix: before treating an empty list as absence, either take since from a server-side timestamp (for example the Date header of the PR read), or subtract a small margin and keep only same-PR runs whose created_at is after the resolution. At minimum, document the residual risk.

Comment thread src/loopzero/github.py
except (GhError, ProcTimeout, OSError) as exc:
retry = shlex.join(("gh", *args))
raise GhError(("refresh Loop-zero Eligibility",), f"{exc}\nRun manually: {retry}") from exc
raise GhError(("refresh Loop-zero Eligibility",),

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: The final error repeats "refresh Loop-zero Eligibility failed"

The head-changed, findings-appeared and could-not-identify errors are raised as GhError(("refresh Loop-zero Eligibility",), ...). The outer handler wraps them again with the same command tuple, so the user sees refresh Loop-zero Eligibility failed: Finding on PR #7 is resolved. refresh Loop-zero Eligibility failed: .... Fix: raise the inner errors with a plain message (for example a ValueError caught by the outer handler), or use exc.tail when exc already carries this command.

Comment thread src/loopzero/github.py
try:
_gh(*args)
except (GhUnavailable, ProcTimeout) as exc:
if isinstance(exc, GhUnavailable) and not _transient_error(exc.tail, False):

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: The transient check repeats a decision _gh already made

_gh raises GhUnavailable for a non-read request only when the error was rate limited or transient. Re-running _transient_error(exc.tail, False) is only there to drop the rate-limit case, and nothing says so. Add a short comment, or have _gh mark rate-limit failures explicitly, so the two classifications can't silently drift apart.

@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

❌ Left the queue · checks fails with this pull request

1 min in the queue, less than a minute of it CI.

So far

  • ✅ Entered the queue Thu 26 Nov, 10:32 · rule main · triggered by @eowca with the @mergifyio queue command
  • ❌ Checks failed · draft #1809
  • 🚫 Left the queue 10:33 · f80655b

The failure is in this pull request. It failed tested alone on top of main.

Reason

The merge conditions cannot be satisfied due to failing checks

  • checks

Failing checks:

To get back in the queue

  • Push a fix: the pull request is queued again once its queue conditions match.
  • If the failure is a flake, comment @mergifyio queue to queue it again as it is.

Merge conditions not met when it left the queue

  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-neutral = checks
    • check-skipped = checks
    • check-success = checks
2 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 = Loop-zero Eligibility
    • check-neutral = Loop-zero Eligibility
    • check-skipped = Loop-zero Eligibility

Times in UTC · dashboard · how the merge queue works

@mergify mergify Bot added the queued label Nov 26, 2026
@mergify mergify Bot mentioned this pull request Nov 26, 2026
10 of 30 tasks
@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

No description provided.

@mergify mergify Bot removed the dequeued label Nov 26, 2026

@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 delta review by claude on 922ee2e0912bba1c35094acd09e8b28b1af60e83, 8.0s: approve (0 critical, 0 important, 1 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)

Findings without a file location:

  • suggestion: I found nothing to review: the diff since the last review is empty — The header says diff_utf8_bytes is 0, and nothing follows it, so there are no changes since the previous review. HEAD 922ee2e is a merge of origin/main into the branch. Any changes the merge added to the branch's own work are not in this delta, so this review checks none of the #1509 acceptance criteria. If the merge was supposed to resolve conflicts in the dispatch-recovery code, review the merge result against main. Pay particular attention to how it interacts with #1652 (bounded task-state lock acquisition) and #1870 (GitHub response parsing), because the retry and observation logic depends on both.

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

@eowca
eowca marked this pull request as draft November 26, 2026 12:44

@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 delta review by claude on ae032ea2f6ae73af9c9b8d073739455becef3bad, 10.1s: approve (0 critical, 0 important, 0 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.

@eowca
eowca marked this pull request as ready for review November 26, 2026 13:46
@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 cf8bb6c at 13:53 UTC

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

So far

  • ✅ Entered the queue Thu 26 Nov, 13:47 · rule main · triggered by @eowca with the @mergifyio queue command
  • ✅ Passed · draft #1912
  • ✅ Merged 13:53 · cf8bb6c · 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 cf8bb6c into main Nov 26, 2026
16 checks passed
@mergify mergify Bot removed the queued label Nov 26, 2026
@eowca
eowca deleted the lean178/1509-recover-eligibility-dispatch-v2 branch November 26, 2026 13:55
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.

Recover eligibility dispatch after a successful finding resolution

1 participant