Problem
Merge-queue run 41120003339 (PR #1214, queue SHA 6a8383f7) had every lane green, yet pr / required failed with Required job did not complete successfully at the exact SHA from scripts/ci_evidence.py.
emit() reads the run-attempt job list a few seconds after the last lane finishes. That list lags a job's own completion: 38 s after ci / ci / status had completed (the single-job endpoint reported completed / success), the job list still reported it as in_progress, so successful_jobs() rejected the run and the queue dropped the PR.
Change
settled_jobs()re-reads the job list, bounded to twelve reads ten seconds apart, until every expected job reportscompleted, and logs which jobs it is waiting on.emit()judges the last read exactly as before:successful_jobs()still rejects incomplete, skipped, cancelled or failed required jobs, so the bound only turns a transient lag into the existing failure instead of hiding it.reuse()is unchanged; it already requires the producer run itself to becompleted.
The wait stays well inside the aggregate's 10-minute timeout (at most 110 s). Because policy_digest() covers scripts/, this change invalidates reuse of queue evidence produced before it, which is the intended behaviour for any validation-policy change.
Tests
Two regression tests in tests/scripts/test_ci_evidence.py: one reproduces the lag (two in_progress reads, then settled) and asserts the evidence is accepted after two sleeps; one asserts the read count is bounded and that a job that never settles is still rejected.
uv run --locked pytest tests/scripts/test_ci_evidence.py -q→ 76 passeduv run --locked pytest tests/tooling/test_pr_validation.py -q→ 182 passeduv run --locked ruff check/ruff format --checkclean on both files
add8d00, the branch has moved onArchitecture
Data flow
Review
✨ Nothing flagged · reviewed
add8d00🪧 More tips
npx skills add coldteadotai/pr-lens, then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."npx @coldtea/pr-lens-cli analyze --base origin/mainon a branch, thennpx @coldtea/pr-lens-cli render .pr-lens/graph.json. Same lenses, your own model key, before the pull request existsrenderreads.github/pr-lens.ymland applies your renames, exclusions and lane pins at draw timegithub.comment.collapsed: truein.github/pr-lens.ymlto fold the comment behind one View architecture… row. Drawing still runs as before.github/workflows/pr-lens.ymlwithcoldteadotai/pr-lens/packages/action@v0and your model provider's key as itsapi-keyto run PR Lens from your own CI. Any/chat/completionsendpoint worksgithub.description: falsein.github/pr-lens.ymlto stop PR Lens adding buttons to your PR descriptionsThanks for using PR Lens! It's free for OSS. If it helped, a star helps other teams find it.