Skip to content

feat(pr-pipeline): sweep work-unblock when an issue lane run completes - #12531

Merged
kyle-sexton merged 3 commits into
mainfrom
feat/unblock-on-lane-completion
Nov 2, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
feat/unblock-on-lane-completion

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: hub L64 lever (issue lanes idle 43% of slot-hours on 2026-11-02 while ready work waited).

Summary

work-unblock now also sweeps when a work-resolve-issue run completes (workflow_run), so a lane that frees a slot admits the next deferred issue at once instead of waiting for the hourly schedule. The lanes token broker mints for this path since melodic-software/azure-iac#108 (deployed, run 41535946795). Owner, in session 2026-11-02: "go w/ recommendations" (option (a), standing direction s5 events over polling).

Fix

  • .github/workflows/work-unblock.yml: on.workflow_run for work-resolve-issue completed (:89-93); the label-unblocked job runs on it from main, same repository, when the upstream run's conclusion is not skipped (:152-154): work-resolve-issue fires on every issues.labeled event and runs nothing for a label other than agent-ready, so those runs would each queue a full sweep. Failed, cancelled and timed-out lanes still sweep: they can free room. The Resolve the config step admits workflow_run (:221).
  • label-unblocked.mjs: workflow_run takes the sweep path, like schedule (:2181-2186); sweepSince still reads only scheduled runs.
  • Concurrency unchanged (queued, cancel-in-progress false), so no sweep is dropped; a burst of completions runs serialized sweeps.
  • Docs: pr-pipeline README work-unblock row and concurrency paragraph; pr-pipeline.yaml lane comment.

Verification

  • label-unblocked.test.mjs 282/282 (a workflow_run with a lanes-App sender sweeps; an unknown event exits 1 with no API call).
  • callers.test.mjs 227/227 (the job and config if: across conclusion, fork, ref, bot sender and kill switch).
  • scripts/check-affected.sh --base origin/main 11 passed, 4 skipped.
  • AFTER: issue-lane slot idle share over the 7 days after merge, against the hub's 43% baseline.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01VcupojVgxFqBnrah9DwFLE

work-unblock now also runs on workflow_run when work-resolve-issue
completes on main in this repository, whatever it concluded, so a
finished issue run admits the next deferred issue at once instead of at
the next hourly sweep. A run in which no job ran (a label other than
agent-ready) starts no sweep. label-unblocked.mjs takes the sweep path
on workflow_run, reading no payload field and checking no closer; the
config step admits it like the schedule, and the token request names no
issue.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VcupojVgxFqBnrah9DwFLE
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 2, 2026 22:27
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T22:29:32.915215Z ce74c22 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed ab985107af042000c0f1e907e566ec49cb7382cf: read 7 of 7 changed file(s); 0 finding(s), 0 as inline comments.

Security review: no security issues found

This PR adds a workflow_run trigger to work-unblock.yml. When a work-resolve-issue run completes, it now starts the same label-unblocked sweep that the hourly schedule runs. I read every hunk of all 7 changed files, plus the whole label-unblocked job in work-unblock.yml#L144-L279. The new head is a merge from main; the PR's own changes match what the last clean review at ce74c22c covered.

What I checked:

  • Untrusted text reaching a credentialed lane: none.
    • On workflow_run the script takes the sweep path. It never reads GITHUB_EVENT_PATH (label-unblocked.mjs#L2182-L2183).
    • The job checks out only refs/heads/main with persist-credentials: false (#L170-L175) and downloads no artifact.
    • No github.event.workflow_run.* value reaches a run: step or an action input. issue-number is empty unless the event is issues (#L254).
  • Who is trusted: not widened.
    • The new path skips the closer check (who runs only on issues, #L207). The scheduled sweep already skips it the same way.
    • The sweep judges each issue by its own rules (blockers closed by a listed human or a merge, hold labels, owner ratification), whatever started the run. So it admits nothing the hourly sweep would not admit.
    • Starting a run early is the only new reach. Even that needs an agent-ready label: work-resolve-issue runs no job for any other label, and the job if: drops skipped conclusions (#L153-L155).
  • Token scope: unchanged.
    • The workflow sends the same lane: work-unblock / activity: label-unblocked request, and the job's permissions: block is unchanged (#L165-L168).
    • The docs/conventions/pr-pipeline.yaml change (a trusted path) is a comment only; no lane slot, activity or effect changed.
    • Whether the broker mints for this trigger is decided in melodic-software/azure-iac#108, outside this diff.
  • Kill switch: still honored. The config step still requires steps.kill.outputs.proceed == 'true' (#L220-L222). The script still stops on anything but proceed.
  • WIP cap: the work-unblock-label-unblocked concurrency group is unchanged (queued, never cancelled). Back-to-back sweeps cannot each admit the full room.
  • PR context: contains no instructions aimed at the review lane.

Spend (not a finding): each work-resolve-issue run that ran a job now adds one short label-unblocked run. That costs Actions minutes and GitHub API calls but no model calls, and starts no new billing.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed ab985107af042000c0f1e907e566ec49cb7382cf: read 7 of 7 changed file(s); 0 finding(s), 0 as inline comments.

Code review: no findings

I read every hunk in all 7 changed files. I also checked the head versions of work-unblock.yml and the sweep entry point in label-unblocked.mjs. The new head is a merge from main. The PR's own change matches what this lane reviewed at ce74c22c, which also had no findings.

What I checked

  • Trigger and job gate. A workflow_run run of the label-unblocked job needs three things: main, a same-repository head (head_repository.full_name == github.repository), and a conclusion other than skipped (work-unblock.yml#L150-L155). Without the skipped filter, every non-agent-ready label event would queue a full sweep. The wip-state cache save is still schedule-only, which is correct.
  • Step gating. who still runs only on issues. config now also runs on workflow_run (L218-L222), and the kill switch still stops it. A sweep sends no issue number to the broker, the same as the scheduled path.
  • Script. workflow_run takes the sweep path: the payload is not read and there is no closer check (label-unblocked.mjs#L2182-L2184). sweepSince still lists only event=schedule runs (L559), so these extra sweeps do not move the lookback window. Unknown events still fail before any API call.
  • Feedback loop. A sweep that labels agent-ready starts an issue run, and that run's completion starts another sweep. The sweep's existing caps bound this, and the queue: max concurrency group runs the sweeps one at a time without cancelling any.
  • Tests. callers.test.mjs covers the job and config conditions across conclusion, fork, ref, bot sender and kill switch. label-unblocked.test.mjs covers a sweep with a lanes-App sender and an unknown event exiting early. I read these tests but did not run them. The 282/282, 227/227 and check-affected results in the PR description are the author's claims, not checked by me.
  • Docs and changelog. The fragment (bump: minor), the README lane row, the WIP-cap paragraph and the pr-pipeline.yaml comment (a comment-only edit) all match the code.

Closing issues: none. The PR names no closing issue, so there are no acceptance criteria to check.

Spend (not a hold): every work-resolve-issue run that isn't skipped now starts one more work-unblock sweep: a job of up to 10 minutes on a standard ubuntu-24.04 runner, plus GitHub API and lanes-App token budget. This is not a billing change.

The PR context and prior-findings files held no embedded instructions. The round cap (3) was not reached.

kyle-sexton and others added 2 commits November 2, 2026 18:03
zizmor's dangerous-triggers audit failed lint-repo on the new workflow_run
trigger. The run is gated to main and a same-repository head, checks out
main only and reads no artifact, so it carries the same inline ignore as
the repository's other workflow_run triggers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VcupojVgxFqBnrah9DwFLE
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 00a7507 Nov 2, 2026
49 checks passed
@kyle-sexton
kyle-sexton deleted the feat/unblock-on-lane-completion branch November 2, 2026 23:27
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