Skip to content

refactor(scripts): simplify check-artifact-retention, check-changed-skills and check-changelog-parity - #14644

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14351-42615160478-1
Nov 9, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14351-42615160478-1

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14351

Summary

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

Simplified four of the six listed check scripts without changing their output, exit codes or flags (net 46 added, 64 removed lines before restoring two shellcheck initializations). check-artifact-retention.mjs passes the per-file YAML line counter straight into collect() instead of through a Map, takes each step's index from entries() instead of an O(n^2) indexOf, builds the workflow file list in one chain instead of a loop over a one-element array, and reads each family row once. check-changelog-parity.sh gains version_at, sans_version_at and require_semver helpers in place of five inline git show | jq reads and two copies of the SemVer refusal, reuses head_has for the consumed-fragment probe, and drops a redundant length guard; check-changed-skills.sh looks evals-warrant exemptions up in an associative set instead of a linear search function and formats the job key with printf -v; check-cant-fail-scan.sh prints the last line with a parameter expansion instead of | tail -1. check-artifact-retention.sh and check-changelog-fragments.sh were reviewed and left unchanged: the wrapper is already minimal, and the fragments script's only duplication (its manifest_version helpers) is shared with check-changelog-parity.sh, which is cross-file dedupe the issue puts out of scope.

Not verified

  • Test suites scripts/check-artifact-retention.test.sh, check-cant-fail-scan.test.sh, check-changed-skills.test.sh, check-changelog-parity.test.sh, check-script-contract.test.sh not run: this lane can run only the named check wrappers; left to the PR's CI
  • tidy skipped: every changed file is under scripts/, a listed shared path, so the tidy cutoffs exclude it
  • check-artifact-retention.sh --check (CI-only whole-repo scanner per check-affected) not run here; left to the PR's CI
  • ci-status green is an acceptance criterion the PR's CI decides

Fix

  • scripts/check-artifact-retention.mjs: collect() takes the LineCounter as a parameter (lineCounterFor Map removed); step index comes from seq.items.entries(); workflow file list built with sort/filter/map; per-step loop reads row = families\[key\] once
  • scripts/check-cant-fail-scan.sh: whole-tree success path prints the last output line with ${out##*$'\n'} instead of piping to tail -1
  • scripts/check-changed-skills.sh: evals-warrant exemptions held in an associative set evals_skip (evals_warrant_skip function removed); job key set with printf -v instead of a command substitution
  • scripts/check-changelog-parity.sh: new version_at, sans_version_at and require_semver helpers replace head_version_of, five inline manifest reads and two copies of the non-SemVer refusal; the consumed-fragment probe calls head_has; --check's ahead-of-manifest test nests under its non-empty guard; a…

Verification

The runner ran each check from the base copy against 18e7218:

  • 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 115 changelog fragment(s) under .changes/ are valid
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-changed-skills: no changed skills under plugins/*/skills/, nothing to gate (exit 0)
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-affected: first run failed shellcheck SC2154 on newest_key/version_key/head_key/base_key (assigned only via printf -v); restored their empty initializations; second run: 10 passed, 6 skipped over 4 changed files
  • fresh-context review subagent over the whole diff: no behavior change found in any of the four files (traced empty input, missing files, set -u, subshell vs main-shell exit, associative subscripts, error text)
  • grep for head_version_of, evals_warrant_skip and lineCounterFor: no remaining references outside an unrelated function of the same name in plugins/skill-quality/scripts/check-skill.sh; check-changelog-parity.test.sh extracts version_sort_key by sed, which is unchanged
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42615160478

Left out: the items under Not verified.

Related

#14351

Merge-Risk: max=MEDIUM demote=false head=18e7218b29535a5b491a6d00774baa868059efc9 rubric=8.1.4 rater=claude-opus-5-5 checker=claude-opus-5-5

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

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Code review, PR #14644 (head 18e7218b): no findings. I read every hunk of all 4 changed files. This is the first review of this PR, so the full review ran, not the blocking-only pass.

I traced each refactor against the base behavior, reading the head files and the unchanged helpers they now call:

  • scripts/check-artifact-retention.mjs
    • seq.items.entries() gives the same index the old indexOf(step) did. Parsed YAML nodes are distinct objects, and aliases fail isMap.
    • Each per-file LineCounter is now passed in directly, which matches the old Map lookup, since the Map was filled for that same file just before collect ran.
    • The sort().filter().map() chain lists the same workflow files in the same order.
    • row = families[key] reads the same fields as before. The removed local scan had no other readers; the gatedBy parameter of the same name was already shadowing it.
  • scripts/check-cant-fail-scan.sh: $(...) strips trailing newlines, so ${out##*$'\n'} prints the same last line tail -1 did. That includes empty output and single-line output.
  • scripts/check-changed-skills.sh: evals_skip is filled in the main shell from every row of the exemptions list before the stale-row exit. The lookup runs in a { } group in the same shell, so it holds the same set the removed linear search did.
  • scripts/check-changelog-parity.sh
    • version_at keeps the original || true, and sans_version_at matches the inline reads it replaces.
    • require_semver prints the same text and exits 2 in the same shell. The head version is still checked before the base version.
    • head_has (line 549) prints the same ls-tree failure message and exit 2 as the inlined probe it replaces.
    • Nesting newest_key/version_key under the non-empty guard changes nothing, because nothing else reads them.
    • Dropping the length guard around head_seen matches the unguarded loop already at line 336.

Closing issue #14351 acceptance criteria:

  • Behavior unchanged: met, judging by reading the code. The existing scripts/check-*.test.sh suites cover these scripts.
  • Only the listed files edited: met. All 4 changed files are on the issue's list.
  • Within 400 lines / 15 files: met.
  • ci-status green: decided by CI, which I can't see from here.

The PR's verification results (check-changed-skills / check-changelog-fragments passes, the check-affected rerun) are the author's claims. I did not run any test or check myself.

No embedded directives in the PR context. No spend or cost impact.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Security review: PR #14644, no security issues found

I read every hunk of all 4 changed files. None matches a TRUSTED PATHS: glob, and none is a trust control the lane lists (trusted-trigger, lane token, kill switch, broker signer, merge holds, plugin manifests). These scripts are CI check gates, so I checked each refactor for a change that would make a gate pass where it used to fail.

  • scripts/check-changelog-parity.sh
    • The consumed-fragment probe now calls head_has, which still exits 2 when git ls-tree fails (L549-L556). The call is a plain if in the main shell, so that exit still stops the gate.
    • require_semver keeps the same regex and the same exit 2 at both call sites, including separate checks of head_version and base_version.
    • version_at and sans_version_at keep the old pipelines exactly, || true included.
    • The ahead-of-manifest test moved under the -n "$newest" guard; the logic is the same.
    • The dropped length guard on head_seen makes no difference: the ${arr[@]+...} form already handles an empty array, and head_seen is declared associative (L637).
  • scripts/check-changed-skills.sh
    • The exemption lookup now uses declare -A evals_skip. It is filled from the same raw entries, after the same skill-path check, and does exact-key matching like the old linear search. A subscript inside ${evals_skip[$skill_dir]:-} is not evaluated as arithmetic and is not re-expanded, so a crafted skill path cannot inject commands or widen the exemption.
    • printf -v key gives the same key as the old command substitution.
  • scripts/check-artifact-retention.mjs
    • The step index from entries() equals the old indexOf, because each step node is a separate object.
    • The per-file LineCounter is passed to collect() as an argument instead of through a Map.
    • Reading the family row once (row = families[key]) leaves the scan and retention checks as they were.
  • scripts/check-cant-fail-scan.sh
    • ${out##*$'\n'} prints the same last line as | tail -1, because $(...) already strips trailing newlines. It only affects the success output.

The PR description and its context contain no instructions aimed at the review lane. The review was not blocking-only: this lane had reviewed no earlier head and had no prior findings.

critical-findings: 0

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 18e7218

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-14644-18e7218b29535a5b491a6d00774baa868059efc9, expires on 2026-12-09.

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 9, 2026
Merged via the queue into main with commit ec53267 Nov 9, 2026
64 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14351-42615160478-1 branch November 9, 2026 14:05
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit ec53267d7e86f411594e584d0b966feea887bc56; later checks count it verified from this comment.

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 six check scripts in scripts/

0 participants