Skip to content

fix(pr-unblock): stop redispatching fix-docs after a run that completed without a check - #11195

Merged
kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-8890-41015913636-1
Oct 30, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-8890-41015913636-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #8890

Summary

Opened by the work-resolve-issue lane. The run's own summary:

The fix-docs dispatcher now treats a PR as handled once a pr-refine fix-docs #<n> run for it has completed, whether or not it posted a check. A PR whose only completed run was lost (cancelled, timed_out or startup_failure) gets one more dispatch and none after a second lost run. The rule reads the workflow run listing the dispatcher already fetches for its in-flight guard, so it adds no API call. It runs before the dispatch-slot check, so a same-repository PR stopped at the trigger gate no longer takes a slot. The fix-ci boxes of this issue already landed in #9363 (e5fd363), per the 2026-10-30 decision comment; this PR closes the three remaining fix-docs boxes.

Not verified

  • The node:test suites (fix-docs-dispatch.test.mjs, callers.test.mjs, dispatch.test.mjs) were not run here: this lane's Bash runs only the named wrappers, and check-affected listed no node test step. They are left to the PR's CI. Both the review and I checked the new tests against the code by reading
  • Comments in protected workflow files still say fix-docs-dispatch.mjs dispatches a PR again when no check was posted: .github/workflows/pr-refine.yml:159-160 and .github/workflows/pr-run-activity-read.yml:137-138 and :3221-3223. This lane cannot write .github/workflows/**, and no behavior depends on
  • Tidy skipped: the change touches the listed shared path .github/ and also docs/conventions/, and it spans more than one area (the cutoff is 1).
  • This rule follows the decision comment as written. A run listing cannot tell a run the broker refused, a hold skipped, a kill switch stopped, or one whose fix-docs-handoff read failed, from a run that ran the model, so each of these now ends fix-docs for the PR. The header comment and pr-run-activit
  • The ADR 0071 citation fix-docs-dispatch.mjs:207 was already stale before this change and was left alone, since ADRs record a point in time.
  • The person check 'Retitle the issue to the dispatcher half' is left to a person, per the decision comment.

Fix

  • .github/scripts/pr-unblock/fix-docs-dispatch.mjs: new docsRunsEnded(runs, title), which uses LOST from infra-failure.mjs. dispatchDocsFixes keeps the whole run listing and runs that rule ahead of the maxDispatch slot check, the in-flight guard, the history read and the per-head cap. A PR it settles
  • .github/scripts/pr-unblock/fix-docs-dispatch.test.mjs: the in-flight test's completed run is now a single cancelled run, so it still checks only the in-flight guard. Three new tests: (1) a completed run with no check ends the PR, with no history read and no docsRuns entry left; (2) one lost run gets
  • .github/actions/resolve-config/callers.test.mjs: two comments no longer say fix-docs-dispatch.mjs redispatches a PR that posted no check.
  • .github/scripts/maintenance-reconcile-lost-runs/reconcile.mjs: a comment now says fix-docs-dispatch.mjs redispatches only a PR's first lost run.
  • docs/conventions/pr-pipeline/pr-run-activity.md: three passages now state the new fix-docs dispatcher rule: the fallback-leg paragraph, the kill-switch bullet and the post-decline bullet. Before, they said the PR is dispatched again.
  • .changes/pr-pipeline/work-resolve-issue-issue-8890-3f8a61c2.md: new patch fragment (Fixed) for the pr-pipeline convention.

Verification

The runner ran each check from the base copy against 54928f6:

  • scripts/check-changelog-fragments.sh --check: passed

The run reports:

  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-changelog-fragments: All 14 changelog fragment(s) under .changes/ are valid (run before and after the review fixes).
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-affected: 10 passed, 5 skipped over 6 changed files (typos not installed; the rest are CI-only).
  • cant-fail-scan --file .github/scripts/pr-unblock/fix-docs-dispatch.test.mjs --lines 279-340 --check: PASS, no gating findings, 29 test blocks parsed.
  • Fresh-context review subagent over the whole diff: no correctness bug found. Its doc, nit and test-gap findings were fixed: header wording, the docsRuns entry is now dropped, docsRunsEnded is no longer exported, an in-flight-plus-lost test was added, the kill-switch doc exception was added, and the
  • Grep for line citations into the changed files: only ADR 0069's pr-run-activity.md:61 (unchanged) and ADR 0071's fix-docs-dispatch.mjs:207 (already drifted before this change).
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41015913636

Left out: the items under Not verified.

Related

#8890

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 54928f61fc884e56b1cbfa7d73f891c22f32a4c6: 0 finding(s), 0 as inline comments.

No security issues found in this change.

critical-findings: 0

What changed: fix-docs-dispatch.mjs now treats a PR as done once a completed pr-refine fix-docs #<n> run exists for it. A PR whose only completed run was lost (cancelled, timed_out or startup_failure) gets one more dispatch. The rest is comment, doc and test updates plus a changelog fragment.

Checked:

  • Who reaches it: a PR author can only influence whether their own PR is dispatched. The run title comes from the workflow's run-name (PR number and activity), not from PR text. The change can only suppress dispatches, so it opens no path to a leak, compromise or charge.
  • Trust controls: the change does not widen a trusted-actor check, token scope, kill switch, signer grant or merge hold.
    • fix-docs-dispatch.mjs is not among the files merge-holds.mjs lists as enforcement paths (lines ~337-343).
    • It imports LOST from infra-failure.mjs but does not change that file.
    • isHandled and markHandled are still used only by the dispatcher's own record.
  • Fail direction: a listing that is truncated or missing a run costs at most one extra dispatch, and a rate-limited listing still dispatches nothing. Every change makes the dispatcher do less, which is the safe direction for a loop breaker.
  • Manifests: none touched.
  • Instruction surface: no standing instruction, CLAUDE.md, skill or hook is deleted or narrowed.
  • PR text: no embedded directives aimed at the reviewer.

Behavior note, not a security finding: a run the broker refused, a hold skipped or a kill switch stopped now ends fix-docs for that PR, as the PR description says. This is the intended trade-off.

Spend: the change reduces model runs on prepaid credit and adds none.

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 54928f61fc884e56b1cbfa7d73f891c22f32a4c6: 0 finding(s), 0 as inline comments.

No blocking or advisory findings. I read the diff, the PR context and closing issue #8890, and the surrounding fix-docs-dispatch.mjs code. I did not run the test suites.

Acceptance criteria for #8890 (the three open fix-docs boxes)

  • Completed run with no check, not lost: docsRunsEnded returns true when any completed run titled for the PR was not lost. The PR is marked handled and its docsRuns entry is dropped, with no history read. The first new test covers this for success, failure and skipped.
  • Only run was lost: one lost run (cancelled, timed_out or startup_failure) gets one more dispatch, and a second lost run ends the PR. The ended.length > lost || lost > 1 logic matches this. The second new test covers all three lost conclusions, a mixed case, and an in-flight retry.
  • Trigger-gate stop takes no dispatch slot: the ended check now runs before the maxDispatch check. The third new test shows feat: add docs-hygiene plugin #57 is skipped, so feat: add work-items plugin #58 and feat: add fable-5-playbook plugin #59 both dispatch and nothing is deferred.
  • No new API call: the code reuses the run listing already read for the in-flight guard. LOST is imported from infra-failure.mjs, which fix-ci-dispatch.mjs already imports the same way.

Checked, no problem found

  • The in-flight guard still works. runs.find(status !== "completed" …) replaces the old active filter, and the existing in-flight test was changed to use a cancelled completed run so it tests only that guard.
  • The new rule is keyed on PR number, not head. The existing earlier-commit history check also works per PR, so the two agree.
  • The run-name in pr-refine.yml is pr-refine ${activity} #${pr-number}, which matches runTitle.

Behavior and design notes (not findings; the PR and the decision comment accept them)

  • A run the broker refused, a hold skipped, or the kill switch stopped now ends fix-docs for that PR. Before, the PR was dispatched again once the switch was off. The PR body and the updated docs state this.
  • The rule only sees the runs in the listing the dispatcher fetches. I did not find where listWorkflowRuns is implemented, so I could not check its page size. The header comment says a run older than the listing costs one more run.
  • Comments in pr-refine.yml (around lines 159-160) and pr-run-activity-read.yml still describe the old redispatch behavior. The PR body says the lane could not edit workflow files. This is comment drift only, with no behavior effect.

Cost: the change only reduces repeated lane runs, which spend prepaid credits. It starts no billed resource, so there is no hold.

Trusted paths: docs/conventions/pr-pipeline/pr-run-activity.md and .github/scripts/pr-unblock/* fall under the trusted globs. I read these changes in full and found no trust-boundary widening. The change only adds a stop condition to a dispatcher. The PR context text was treated as data, and I found no embedded instructions in it.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit e5146f8 Oct 30, 2026
44 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-8890-41015913636-1 branch October 30, 2026 07:41
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.

pr-unblock: derive fix-ci-subscription's start and the restart cap from trusted values

1 participant