Skip to content

refactor(reconcile-lost-runs): fold repeated listing, rate-limit and kind checks in reconcile.mjs - #14244

Merged
kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-14113-42514652858-1
Nov 8, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-14113-42514652858-1

Conversation

@melodic-automation-lanes

@melodic-automation-lanes melodic-automation-lanes Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Closes #14113

Summary

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

Simplified .github/scripts/maintenance-reconcile-lost-runs/reconcile.mjs without changing behavior (68 lines added, 99 removed). Repeated code now goes through small local helpers: passRateLimit (11 copies of the RateLimited rethrow), firstAttemptJobs (3 copies of the attempt-1 job listing and its one-page check), workflowFile and createdSince (the workflow file-name slice and the created filter), the existing runsPage closure (2 inline copies dropped), sayUnchecked (3 log lines of the same shape), one switchNoted value for a kill-switch condition written out twice, and RUN_ONLY_KINDS / FAILED_JOBS_WHY in place of the long kind-comparison chains in act(). Every message, URL, error text, export and the env interface is unchanged. holdReason's own listing check stays inline because it also guards the carried-read path.

Not verified

  • reconcile.test.mjs (node --test) was not run: this lane allows no interpreter, so the suite is left to the PR's CI
  • node --check syntax check was not run (no interpreter in this lane); the review subagent checked syntax by reading only
  • tidy skipped: the change touches .github/, a listed tidy shared path
  • ci-status green on the PR is left to the PR's CI
  • The working tree shows untracked dotfiles at the checkout root (.bashrc, .bash_profile, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc) that this run did not create. They look like sandbox mount placeholders and are not part of the change

Fix

  • .github/scripts/maintenance-reconcile-lost-runs/reconcile.mjs: added the non-exported helpers passRateLimit, workflowFile, createdSince, firstAttemptJobs, sayUnchecked, RUN_ONLY_KINDS and FAILED_JOBS_WHY, and replaced the duplicated code at each call site with them; reused runsPage for the intake…

Verification

The runner ran each check from the base copy against 113812e:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • .lane/checks/bin/check-changelog-fragments: all 3 fragments under .changes/ valid. No fragment is needed because .github/scripts is outside the plugin and convention roots that scripts/check-changelog-fragments.sh --check-required covers
  • .lane/checks/bin/check-changed-skills: no changed skills, nothing to gate
  • .lane/checks/bin/check-affected: 8 passed, 8 skipped, the rest are CI-only, over 1 changed file
  • git-read diff --numstat HEAD: 1 file, +68/-99
  • Fresh-context review subagent, given the diff and the original: no defects found. It checked evaluation order (the switchNoted hoist is pure), definitions before use, byte-identical messages, URLs and error texts, scoping, and syntax by reading only
  • Grep: reconcile.test.mjs imports only exported names, all unchanged, and reads no source text of reconcile.mjs
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42514652858

Left out: the items under Not verified.

Related

#14113

Merge-Risk: max=MEDIUM demote=false head=113812e565741acf77a96b60531fea09d65d3da2 rubric=8.1.2 rater=claude-opus-5-5 checker=claude-opus-5-5

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

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

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

Code review: PR #14244, a refactor of reconcile.mjs (closes #14113)

No findings. I read every hunk of the one changed file, .github/scripts/maintenance-reconcile-lost-runs/reconcile.mjs, and checked each new helper against the code it replaces.

  • passRateLimit sits at module level, before every use: in plan, act, main, the exported prefilterSpec and passStarts. Each call site that used to rethrow RateLimited keeps its original fallback (return null, return candidates, keep.add, laneFailures.set, the warning log, and so on).
  • firstAttemptJobs is a hoisted function declaration. Its endpoint, its one-page guard and its error text match all three copies it replaces. holdReason's check stays inline, as the PR description says.
  • workflowFile and createdSince build the same URLs as the inline slice and encode code they replace.
  • runsPage reuse: runsPage is declared in plan at L1253, in the same block scope as the intake and verdict listings and before them (L1440, L1469), so there is no TDZ error. Its body is the same as the two inline closures it replaces.
  • switchNoted hoist: killSwitchNoted (L573) is a pure predicate. Computing it before the reviewStopNoted branch changes no side effect, and when notes is falsy the value stays falsy, as before.
  • sayUnchecked produces the same text as the three say lines it replaces (#N: its spec|verdict could not be checked (...); the next run checks again). It is declared before the closures that call it.
  • RUN_ONLY_KINDS and FAILED_JOBS_WHY hold the same kind sets and suffix strings as the old comparison chains and the old object literal.

Closing issue #14113 acceptance criteria

  • Behavior unchanged: met by reading the code; I ran nothing. No exported name changes. reconcile.test.mjs exists in the repository to catch a regression.
  • Edits only the listed files: met; one file is changed.
  • Within 400 lines and 15 files: met (+68/−99 by the diff).
  • ci-status green: not verifiable from this lane. The author says the test suite and node --check were not run, so this is author-claimed and unverified, left to the PR's CI.

Other checks

  • No .claude/rules/ path-scoped rule matches the changed file.
  • The diff touches no plugin manifest.
  • The PR context contains no embedded instructions aimed at this lane.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

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

Security review: PR #14244 (head 113812e)

I found no security issues.

Scope: I read the full diff of .github/scripts/maintenance-reconcile-lost-runs/reconcile.mjs, the only changed file. It does not match any glob under TRUSTED PATHS. That list names infra-failure.mjs and the workflow, not reconcile.mjs. It is also none of the trust controls the skill lists: the trusted-trigger check, token broker, kill-switch action, merge holds or isolation actions.

What I checked:

  • passRateLimit replaces 11 copies of if (error instanceof RateLimited) throw error;. Each call site keeps its old fallback after the call, so a rate limit still stops the run.
  • Lane-App kill-switch condition. The hoisted switchNoted value at reconcile.mjs#L1108 keeps all of the old checks: notes, laneApp !== undefined, pull.user?.id === laneApp, pull.user?.type === "Bot" and killSwitchNoted(notes). killSwitchNoted (L573) has no side effects, so running it earlier changes nothing. No other PR author can reach the switch re-run path.
  • runsPage reuse for the intake and verdict-dispatch listings. The existing runsPage closure (L1253) is the same code as the two inline copies it replaces, and it is defined earlier in the same plan function, so both call sites can reach it.
  • firstAttemptJobs keeps the same URL and the same one-complete-page check, which fails closed.
  • workflowFile / createdSince build the same strings as before. Their inputs are constant workflow paths and timestamps, not text an attacker controls.
  • RUN_ONLY_KINDS / FAILED_JOBS_WHY contain the same kinds as the old comparison chains, so the set of item kinds that skip the pull-request head check, or get rerun-failed-jobs, is unchanged.

Nothing is widened: no new trusted actor, token scope, untrusted-text path or billable action. No embedded instructions appear in the PR context.

critical-findings: 0

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 113812e565741acf77a96b60531fea09d65d3da2, the head its arming checks judged.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 113812e

The verifier passed this head. The capture artifact holds the capture summary, which says whether the capture ran, and any screenshot or video that passed the mask check; this comment uploads no file.

Capture artifact: pr-capture-14244-113812e565741acf77a96b60531fea09d65d3da2, expires on 2026-12-08.

One comment per pull request, updated in place for each new head.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 8, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 8, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit 415e054 Nov 8, 2026
63 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-14113-42514652858-1 branch November 8, 2026 21:56
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.

Simplify the reconcile.mjs .github script

1 participant