Skip to content

Share the pending mergeability verdict with hosted eligibility - #1759

Merged
mergify[bot] merged 5 commits into
mainfrom
lean178/1255-share-mergeability-verdict
Nov 26, 2026
Merged

mergify[bot] merged 5 commits into
mainfrom
lean178/1255-share-mergeability-verdict

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Share the pending mergeability verdict with hosted eligibility

Context and goal

  • Goal: Keep hosted eligibility pending until GitHub computes the existing source mergeability verdict.
  • Problem: Local readiness blocks unknown mergeability but hosted can publish success for the same source head.
  • Context: Reuse one predicate for local and hosted readiness. Give the hosted observation a bounded retry sequence and recheck the same head before using the verdict.

Closes #1255

Acceptance

  • Local and hosted readiness use the same pending and conflicting verdicts.
  • A hosted refresh can observe unknown settle at the same SHA. A known conflict fails and an unresolved unknown cannot pass.
  • Preserve local waiting behavior, source identity checks, and existing checks and review requirements.

Base

Base: aa563c2

Notes

Carries forward the common mergeability verdict from #1433. Keep existing hosted publication, outage handling, and candidate guards.

Validation

Recorded for 8e95c45772a8

  • 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, f61c323, request_changes
  • delta, claude, 8a97532, approve
  • delta, claude, 12d2ec8, approve

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 f61c323d413517e44c4fe614f1aec9ae44dc76cf, 62.0s: request_changes (0 critical, 1 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)

Findings without a file location:

  • suggestion: eligibility.main --publish still reports pending mergeability as failure — SETUP.md:508 documents python -m loopzero.eligibility ... --publish as a way to publish the same hosted context. That entry point still maps every non-ready result to failure. Hosted now maps MERGEABILITY_PENDING (and a missing review) to pending in hosted._source_status, so a temporary UNKNOWN turns the required context red through this path but not through loopzero.hosted. The two entry points that publish the same context now disagree. Fix: move _source_status into eligibility and use it in both hosted._run and eligibility.main (return nonzero only on failure).

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

Comment thread src/loopzero/candidate.py Resolved
Comment thread src/loopzero/hosted.py
return True


def _source_status(result: github.Readiness, current: github.PR) -> tuple[str, str]:

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: Mergeability re-check is duplicated between evaluate and _source_status

eligibility.evaluate already re-fetches the PR and turns a ready result into (blocker,) when mergeability_blocker(current) is set (eligibility.py:204-208). hosted._run then fetches the PR again and _source_status repeats the same check. The hosted re-fetch is needed for the head-change guard, but having the blocker check in two places invites drift. Consider keeping the mergeability check only in evaluate, so _source_status maps reasons to a state and does not need current.

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 delta review by claude on 8a9753279a38d12ebfbe6d357706226f10f2ea50, 24.3s: 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: Add a regression test for mergeability settling during candidate attestation — Dropping mergeable from _source_fingerprint looks right. The snapshot is taken from _lookup_source before source_policy runs. hosted.policy then calls eligibility.evaluate, and _source_snapshot (eligibility.py:167-174) waits for GitHub's mergeability result. Once that result settles, the field goes from null to true/false, so the recheck at candidate.py:574-578 would always raise CandidateRaceError ("metadata changed") for a source that started out unknown. The policy still checks mergeability on fresh pr_view reads (eligibility.py:204-208), so no check is lost. A conflict that appears after the policy check but before the final recheck goes unnoticed, but the merge-queue candidate would hit that conflict itself. No test in tests/candidate covers this. Smallest fix: add a test where the first source lookup returns mergeable: null and the recheck returns mergeable: true at the same head, and assert that attestation succeeds. Without it, a future change could put the field back in the fingerprint and nothing would catch it.

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

@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

waits for test headroom after #1663

@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 12d2ec87ebfbdebed81418a8fb5aaaa29709bac8, 24.1s: 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)

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

ancestor_review=review is not None and review["commit_id"] != head,
publishers=publishers)
if snapshot is None and source_fingerprint(github.pr_view(repo, number)) != source_fingerprint(pr):
current = github.pr_view(repo, number) if snapshot is None else pr

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: Snapshot-less recheck uses a conditional assignment that both later guards repeat

current = github.pr_view(...) if snapshot is None else pr is followed by two separate if snapshot is None and ... checks. When a snapshot is supplied, current is never used, so the ternary branch does nothing and the same condition is checked three times. A single if snapshot is None: block that fetches current, compares fingerprints, and then applies mergeability_blocker(current) when result.ready would behave the same and be easier to read. Behaviour is correct as written: hosted callers that pass a snapshot get the same mergeability recheck in _publication_snapshot and _source_status.

@eowca
eowca marked this pull request as ready for review November 26, 2026 12:57
@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 48edeec at 13:49 UTC

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

So far

  • ✅ Entered the queue Thu 26 Nov, 13:44 · rule main · triggered by @eowca with the @mergifyio queue command
  • ✅ Passed · draft #1911
  • ✅ Merged 13:49 · 48edeec · 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 48edeec into main Nov 26, 2026
11 checks passed
@mergify mergify Bot removed the queued label Nov 26, 2026
@eowca
eowca deleted the lean178/1255-share-mergeability-verdict branch November 26, 2026 13:50
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.

Share the unknown-mergeability verdict with hosted eligibility

1 participant