Skip to content

refactor(ci): simplify the maintenance-audit-lane-runs scripts - #14203

Merged
kyle-sexton merged 3 commits into
mainfrom
work-resolve-issue/issue-14110-42508835655-1
Nov 8, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
work-resolve-issue/issue-14110-42508835655-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #14110

Summary

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

Simplified five of the six lane-sweep scripts without changing behavior: 62 lines added, 101 removed. Repeated code inside each file now goes through small local helpers (outcome counts, failed-name lists, run URLs, the latest-jobs read and elapsed seconds in collect.mjs; a drop() helper in file-findings.mjs; writeMatrix in handoff.mjs; outOfBudget, a cached last run id, one appId and labels computed once per issue in triage-sweep.mjs). findings.mjs merges two map writes into one condition and collapses two expressions. Following the issue's out-of-scope note, no code moved between files and nothing was deduplicated across files. write-findings.mjs is unchanged because it is already 40 lines with nothing to cut. Outputs, written files, printed text, JSON key order, exports and CLI commands stay the same.

Not verified

  • node --test for .github/scripts/maintenance-audit-lane-runs: this lane cannot run node, so the suite is left to the PR's CI.
  • ci-status is green: a PR CI check, left to the PR's CI.
  • Tidy skipped: every changed file is under .github/, a listed shared path for tidy.
  • write-findings.mjs left unchanged: it is 40 lines with no repeated code or simplification that would make it shorter or clearer.

Fix

  • .github/scripts/maintenance-audit-lane-runs/collect.mjs: added local helpers elapsed, failedNames, runUrl, latestJobs and countOutcomes, and used them in detailA, detailD and detailC in place of repeated inline code; collapsed the client call, log read and open-items write onto fewer lines.
  • .github/scripts/maintenance-audit-lane-runs/file-findings.mjs: prepareItems records dropped findings through one drop(unit, title, reason) helper (same key order), and the claim check ends in if/else instead of push-and-continue.
  • .github/scripts/maintenance-audit-lane-runs/findings.mjs: planDigest sets the fingerprint map in one condition (last open issue, else first); lastLineFp and shortEntry are single expressions that build the same strings.
  • .github/scripts/maintenance-audit-lane-runs/handoff.mjs: the route and route-skipped commands write their matrix output through one writeMatrix helper, keeping the same text.
  • .github/scripts/maintenance-audit-lane-runs/triage-sweep.mjs: selectCandidates normalizes labels once per issue and bornReady takes them as given; an outOfBudget helper replaces five copies of the call-budget regex test; runSweep reads state.runs.at(-1) once into last; main validates LANES_APP_ID…

Verification

The runner ran each check from the base copy against 20cbc8b:

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

The run reports:

  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-changelog-fragments: all 3 existing fragments valid. No plugin changed, so no fragment is needed.
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-changed-skills: no changed skills, nothing to gate.
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-affected: 8 passed, 8 skipped over 5 changed files; the rest are CI-only.
  • Fresh-context review subagent over the full diff: no observable behavior difference found (helper output, JSON key order, awaited-call order, string bytes, edge cases).
  • Grep for tests that read these scripts' source text: none do, so no test assertion is affected (handoff.test.mjs and file-findings.test.mjs only run the scripts).
  • git-read diff --stat: 5 files, 62 insertions, 101 deletions, within the issue's 400-line and 15-file limits.
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42508835655

Left out: the items under Not verified.

Related

#14110

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

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #14203 (head d11b499)

No security issues found. I read every hunk of all 5 changed files:

  • .github/scripts/maintenance-audit-lane-runs/collect.mjs
  • .github/scripts/maintenance-audit-lane-runs/file-findings.mjs
  • .github/scripts/maintenance-audit-lane-runs/findings.mjs
  • .github/scripts/maintenance-audit-lane-runs/handoff.mjs
  • .github/scripts/maintenance-audit-lane-runs/triage-sweep.mjs

The PR claims to be a refactor that keeps behavior the same. For the security-relevant logic, I checked that claim against the code.

What I checked

  • Who can trigger a dispatch (triage-sweep.mjs). The comment above the dispatch call says selectCandidates is the only author check before an intake-triage.yml dispatch (L444-L445).
    • The filter still requires !i.pull_request && authorIds.has(String(i.user?.id)) (L115).
    • The new untriagedOrReady helper computes names(i, statusLabels.get(i.number)) once and passes it to bornReady. The old code called names(i, statusLabels.get(i.number)) inside bornReady, so the label set is the same: lowercased, with the Work-status override. bornReady has only this one caller.
    • ADMISSION_HOLDS (which includes UNTRUSTED_LABELS) is still applied unchanged.
  • Who counts as a trusted author (triage-sweep.mjs main, collect.mjs). authorIds is still built from humanIds(list) plus LANES_APP_ID, and only when that ID matches ^[1-9][0-9]*$. The hoisted appId uses the same regex. It feeds both authorIds and readState, and readState's hand-back check still needs appId !== null. collect.mjs's trusted set is unchanged.
  • Caching last in runSweep. The code never changes state.runs inside the loop: dispatch writes [...state.runs, id] into a new array. So last is always the same value as state.runs.at(-1) at each place it replaced.
  • Budget stops. outOfBudget uses the same /call budget/ test, so a budget error still re-throws or truncates the run in all five places. collect.mjs's own inline check is unchanged.
  • Fingerprint mapping (findings.mjs planDigest). !has || open gives the same result as the old two separate set calls. In lastLineFp, removing ?? "" is safe because split always returns at least one element.
  • Evidence checks (file-findings.mjs). Findings that fail validation, have a unit mismatch, or fail a claim check are still dropped and never pushed. The if/else keeps that behavior.
  • handoff.mjs. writeMatrix writes exactly the same GITHUB_OUTPUT text. Nothing new from outside reaches it.

Scope and controls

  • No changed file matches a trusted-path glob. The workflow .github/workflows/maintenance-audit-lane-runs.yml is on the list but is not changed.
  • The change does not touch any trust control: the trusted-trigger check, the token broker or lane token scope, the kill switch, or the merge holds.
  • No plugin manifest or instruction surface is changed.
  • The PR context file has no embedded text directed at this lane.

The prior-findings file says blocking only: yes, so this review reported only CRITICAL and IMPORTANT findings, and there are none. The one earlier post from this lane is a summary comment with no findings, so nothing carries forward.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review (blocking only): refactor(ci): simplify the maintenance-audit-lane-runs scripts (#14203)

I read every hunk of all 5 changed files: collect.mjs, file-findings.mjs, findings.mjs, handoff.mjs and triage-sweep.mjs, all under .github/scripts/maintenance-audit-lane-runs/. This lane already reviewed an earlier head, so this review reports blocking findings only.

No blocking findings. I compared each rewrite with the code it replaces:

  • collect.mjs: each new helper (elapsed, failedNames, runUrl, latestJobs, countOutcomes) gives the same result as the inline code it replaces, and the duration still uses run_started_at ?? created_at. Nothing else used the removed seconds helper. The new ?? [] in failedNames(checks) only matters where the old code would already have crashed.
  • findings.mjs: the merged byFp condition !has || open gives the same final map as the two separate writes. shortEntry builds the same string as [a, "", b].join("\n"). Dropping ?? "" after .at(-1) changes nothing, because split always returns at least one element.
  • triage-sweep.mjs: bornReady is only called from selectCandidates, and it now gets the same lower-cased names(...) list it used to build itself. Caching last is safe because nothing in the loop changes state.runs after it is read: the dispatch branch builds a new array ([...state.runs, id]). outOfBudget matches the regex it replaces in all five places. The single appId value is the same one both uses had before.
  • file-findings.mjs and handoff.mjs: drop() keeps the key order {unit, title, reason}. writeMatrix writes the same text, and it reads GITHUB_OUTPUT when it is called, not when it is defined.

Prior finding: my earlier inline finding was about the out-of-scope package.json edits (discussion_r4507410001). Neither package.json is in this head's diff any more; the change now touches only the listed .mjs files. So I have not posted it again.

Closing issue #14110, acceptance criteria:

  • "Behavior is unchanged…": met, based on the comparison above. The existing triage-sweep.test.mjs, file-findings.test.mjs and handoff.test.mjs run these code paths. I could not run them: this lane has no shell.
  • "The diff edits only the listed files…": met. All 5 changed files are on the issue's list, and write-findings.mjs is unchanged.
  • "within 400 changed lines and 15 hand-edited files": met (5 files, about 163 changed lines).
  • "ci-status is green": I can't see CI from this lane. The PR body leaves it to CI; that is the author's statement and I have not verified it.

No .claude/rules/ path rule matches these files. No plugin manifest changed. The PR context contained no embedded instructions aimed at this lane.

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head d11b499a92879d052fba8cdb66bbf4ad457db6c4. The lanes clear this reason on their own; the next scheduled run judges it again.

pr-merge's gate holds it on its risk score (evidence-unbound:claude-review: not bound: no-run;
  evidence-unbound:claude-security-review: not bound: no-run)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 1 inline finding(s) on dbf28c099482a9359de645c7baf1c247f5ad8b39; the summary is in this lane's pull request comment.

claude-lane: claude-review

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 1 of max 4 on dbf28c0.

@melodic-automation-lanes melodic-automation-lanes Bot added the needs-human Human-in-the-loop required; autonomous sessions must not resolve items carrying this. label Nov 8, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The pr-unblock lane stopped on this pull request and needs a person: an adjudicator found that a disputed review finding turns on what the change is meant to do, which a person decides.

Reason: intent

  • Reason: feedback-question-intent
  • Resume key: dbf28c099482a9359de645c7baf1c247f5ad8b39 (the head the lane stopped on)

To resume, deal with the reason above, remove the needs-human label (and do-not-merge, if set), then dispatch the pr-unblock workflow with pr-number=14203 and activity=address-feedback:

gh workflow run pr-unblock.yml -R melodic-software/claude-code-plugins -f pr-number=14203 -f activity=address-feedback

@kyle-sexton kyle-sexton removed the needs-human Human-in-the-loop required; autonomous sessions must not resolve items carrying this. label Nov 8, 2026
@melodic-automation-lanes melodic-automation-lanes Bot added the needs-session A pr-unblock stop a session builder takes: a change the lane cannot make. Not an owner stop. label Nov 8, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The pr-unblock lane stopped address-feedback on this pull request: the pull request has an unresolved review thread the lane does not take (a reviewer it does not act on, a review of an older head, or a thread it already answered), so no lane resolves it and a session builder takes it. The lane labels it needs-session for a session builder, who makes the change this lane cannot, and the run ends in a failing pr-unblock/address-feedback status on the head the lane gated.

When a retry on this head can change the outcome, the lane runs one on its own, up to its per-head cap, and edits this comment if it stops again; a run that does not stop clears the status. When no retry can (a review thread the lane does not take or settle, or a failing check after the retries are spent), a person resolves the threads or gets the checks green, then dispatches the workflow below: that run finds the cause gone and clears the status. On a pull request the lanes App opened, the dispatchers start that run once per stop; on any other, a person does. A new commit to the branch starts clean.

To run it again on this head now, dispatch the pr-unblock workflow:

gh workflow run pr-unblock.yml -R melodic-software/claude-code-plugins -f pr-number=14203 -f activity=address-feedback

@melodic-automation-lanes melodic-automation-lanes Bot removed the needs-session A pr-unblock stop a session builder takes: a change the lane cannot make. Not an owner stop. label 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 ad92062 Nov 8, 2026
129 of 131 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-14110-42508835655-1 branch November 8, 2026 21:48
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 3, survived 4, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 43%; mutation score 43%.

File Killed Survived Timeout No coverage Invalid Not run
.github/scripts/maintenance-audit-lane-runs/collect.mjs 0 3 0 0 0 0
.github/scripts/maintenance-audit-lane-runs/file-findings.mjs 1 0 0 0 0 0
.github/scripts/maintenance-audit-lane-runs/findings.mjs 1 0 0 0 0 0
.github/scripts/maintenance-audit-lane-runs/triage-sweep.mjs 1 1 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
.github/scripts/maintenance-audit-lane-runs/collect.mjs:172 AOR productive no-assertion
.github/scripts/maintenance-audit-lane-runs/collect.mjs:173 ROR productive no-assertion
.github/scripts/maintenance-audit-lane-runs/collect.mjs:180 AOR productive no-assertion
.github/scripts/maintenance-audit-lane-runs/triage-sweep.mjs:53 SBR productive input-gap

The run's summary has the full report.

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 .github: maintenance-audit-lane-runs

1 participant