Repository navigation
A resumed run takes its pull request from the journal - #104
Merged
Merged
Conversation
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
The first wave on the closed loop found this, and it cannot resolve itself.
A run implemented before the closed loop has CI observations with no
prand nopr_state.back.latest_pr_statetherefore readsNone, which the ending rule deliberately treats as open — silence must not end a run — sorecord_run_outcomeis refused. Meanwhile the derivation cannot rediscover the pull request by branch code or issue linkage, because the branch is long gone, so it settles on no pull request, records no observation, and returnstimeout. Nothing in that cycle can ever write apr_state. The run can never end, and every wave re-derives it.Observed live at 14:14 UTC on
9a5978a:record_run_outcome {"outcome":"timeout"} -- refused: a run with an open pull request cannot endfor muesli runsi726-…andi728-…, both atmerge_requested, both withlatest_pr_state: None. Their journals name the pull requests they asked to merge — #735 (merged 2026-08-30) and #730 — so the information was there all along.The fix takes it from there.
back.latest_prprefers the newest observation'sprand falls back to the newestrequest_mergepayload's: the journal names the pull request a run asked to merge, whatever discovery can still see.back-statereports that number, so a resumed run derives against a pull request it can actually observe, sees it merged, and ends.Effect on the merge gate
The gate is untouched: no change to what evidence a merge needs, to
_merge_gate,merge_ready_pr, or the kernel's authorisation.One behavioural consequence is worth naming rather than hiding. A run stranded at
merge_requestedcan now find its own pull request again, so if that pull request is still open the loop will finish the merge the run had already authorised. That is the recovery the closed loop exists for — a pass that died betweenrequest_mergeand the merge itself — and it still requires the kernel'sacceptbound to the exact head being merged. The two runs that prompted this are both already merged, so they will simply end.Testing
bash batch/run-queue.sh --self-testpasses on LinuxPython suite 1987 passed, 3 skipped (up 4, the new tests);
--self-testrc 0 on macOS. No bash changed here, only the kernel reader and the CLI that feeds it; CI ran the self-test on Linux for this branch and it passed (6m19s), alongside the Python suite.Four tests: the observation's
prwins when it has one; a legacy run with an observation carrying noprtakes the number from its merge request; a journal naming no pull request anywhere reports empty; andback-stateprints the fallback. The second fails without the fix — it is the live case above, reduced.Anything a reviewer should look at twice
pr_state; the loop still has to observe the pull request before the kernel will let the run end.