Skip to content

refactor(scripts): simplify eight check scripts without changing behavior - #14578

Merged
kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-14358-42612707359-1
Nov 9, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-14358-42612707359-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #14358

Summary

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

Applied behavior-preserving simplifications to the eight listed check scripts: reuse of the existing read_list::report_stale helper in place of a hand-rolled stale loop, one shared skill-name regex, one name=value operand guard instead of two copies, a single sort instead of a repeated sort-and-diff, bash builtins instead of basename, cat, wc and grep forks, a redundant glob alternative dropped, and history narration and a garbled citation trimmed from comments. Outputs, exit codes, flags and printed text are unchanged; no file was renamed, moved or deleted. The diff is 8 files, 32 insertions and 47 deletions.

Not verified

  • The scripts' own test suites (scripts/*.test.sh) and the whole-repo scanner runs check-affected lists as CI only were not executed here; this lane runs only the named wrappers. Left to the PR's CI.
  • tidy: not run, because every changed file is under scripts/, a listed shared path.
  • Commit: per the runner's instructions the change is left uncommitted in the working tree for the runner to turn into a patch.
  • ci-status green is a PR check, left to the PR's CI.

Fix

  • scripts/check-next-graph.py: the plugin:skill name pattern, used twice in read_roster, is one compiled SKILL_NAME regex.
  • scripts/check-orphaned-fixtures.sh: the stale-baseline loop (stale_to plus stale_line) is replaced by the existing read_list::report_stale helper, which prints the same lines; a comment that restated the function was dropped.
  • scripts/check-pipefail-grep-q.sh: the awk name=value operand guard, duplicated in both file-collection branches, runs once after collection; $(cat file) became $(<file).
  • scripts/check-plugin-catalog-enablement.sh: the enabledPlugins keys are sorted once and compared as strings, with the diff reusing the sorted copy; the redundant empty-keys guard went with it; a history paragraph about a past security review was trimmed.
  • scripts/check-plugin-manifest-presence.sh: the header says 'Three checks' to match the three it lists.
  • scripts/check-publisher-token-alignment.sh: publisher_like dropped the 'melodic-software' alternative that 'melodic-software' already covers; the loop's two ifs are one condition.
  • scripts/check-purged-em-dashes.sh: the union-expansion comment's misplaced Command Substitution citation and change history were rewritten to the reason that remains; the finding count uses grep -c on a here-string instead of printf | wc | tr.
  • scripts/check-queue-front-matter.sh: basename became ${item##*/}, and the status and priority set checks use bash =~ instead of a grep fork.

Verification

The runner ran each check from the base copy against 29426c6:

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

The run reports:

  • check-changelog-fragments: all 7 changelog fragments valid; scripts/ belongs to no plugin, so no fragment applies.
  • check-changed-skills: no changed skills under plugins/*/skills/, nothing to gate.
  • check-affected: 11 passed, 5 skipped (markdown, typos not installed, cross-plugin-source-drift, validate-plugins, changed-skills) over the 8 changed files; the whole-repo scanners for these scripts are listed as CI only.
  • review: a fresh-context subagent read the diff and full files hunk by hunk and found no input that behaves differently before and after (set -e and pipefail paths, empty arrays under set -u, trailing newlines, =~ versus grep -E on single-line values, name=value operands, empty or absent baselines).
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42612707359

Left out: the items under Not verified.

Related

#14358

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

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Security review: PR #14578, a refactor that simplifies eight check scripts

I found no security issues in this pull request.

I read every hunk of all 8 changed files. None of them match a trusted-path glob, and none are trust controls, merge holds, plugin manifests or standing instructions. The diff also deletes no guardrail rule. Comment trims (history narration and a garbled citation) are the only prose removed.

What I checked:

  • scripts/check-publisher-token-alignment.sh: dropping *'@melodic-software'* does not narrow the publisher-class match, because *'melodic-software'* already covers it. Folding the two ifs into ! org_member && publisher_like keeps the same result for every token.
  • scripts/check-pipefail-grep-q.sh: the name=value → ./name=value operand guard now runs once over files[] after both collection branches. It still runs before awk sees any operand, so no file argument can now be read as an awk assignment.
  • scripts/check-orphaned-fixtures.sh: read_list::report_stale (scripts/lib/read-list.sh:233-243) prints the same STALE BASELINE lines and returns 1 when anything is stale. The script then sets stale=1, so the gate still fails.
  • scripts/check-queue-front-matter.sh: the =~ checks replace grep -qE with the same anchored pattern. VALID_STATUSES and VALID_PRIORITIES come from the repository, not from untrusted input.
  • check-plugin-catalog-enablement.sh, check-purged-em-dashes.sh, check-next-graph.py, check-plugin-manifest-presence.sh: the changes are local rewrites or comment edits. They create no injection surface and touch no token or secret handling.

No embedded instructions appeared in the PR context. The closing issue's body was withheld by the wrapper because its author is not on the allowed-author list. This was a full review, not blocking-only, because there were no earlier heads to compare against.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Code review: PR #14578, refactor of eight check scripts

No findings. I read every hunk of all 8 changed files. For each change, I compared it against the code it calls at head to see whether behavior stays the same, as issue #14358's first acceptance criterion requires.

  • scripts/check-next-graph.py: SKILL_NAME is the same pattern as the old inline regex, and both call sites still use fullmatch.
  • scripts/check-orphaned-fixtures.sh: read_list::report_stale (scripts/lib/read-list.sh:233-243) runs the same stale_to and stale_line steps the old loop did. It returns 1 only when an entry is stale. stale is only used in the > 0 exit test, so setting it to 1 instead of a count gives the same exit codes and stderr.
  • scripts/check-pipefail-grep-q.sh: the ./ prefix for name=value paths now runs once after both branches. The old code prefixed before -f in the default branch, and -f gives the same answer with or without the prefix. In the args branch the prefix still comes after the readability check. An empty files array either exits early (default branch) or cannot happen (args branch). $(<file) reads the same bytes as $(cat file).
  • scripts/check-plugin-catalog-enablement.sh: declared_keys comes from a command substitution (line 108), so its trailing newlines are stripped, just like sorted_keys. Comparing the two strings gives the same result as the old diff, including when the list is empty, so dropping the empty-list guard changes nothing.
  • scripts/check-plugin-manifest-presence.sh: the header now says "Three checks", which matches the three it lists (FORWARD, INVERSE, NO BIN).
  • scripts/check-publisher-token-alignment.sh: the dropped *@melodic-software* alternative was already covered by *melodic-software*. Merging the two if tests into ! org_member && publisher_like keeps the same truth table.
  • scripts/check-purged-em-dashes.sh: grep -c '' <<<"$findings" and printf '%s\n' | wc -l count the same lines, including 1 for an empty string. A here-string always has at least one line, so grep exits 0. The comment edit only removes history.
  • scripts/check-queue-front-matter.sh: fm_value prints one line and exits, so =~ with an anchored ERE matches what line-based grep -qE matched. The alternation sets are plain words. ${item##*/} gives the same result as basename for a glob result with no trailing slash.

Closing issue #14358 criteria:

  • Unchanged behavior: met, based on the reading above. No file was renamed, moved or deleted. Several suites can catch a regression here, including scripts/lib/read-list.test.sh (which covers report_stale) and the scripts' own *.test.sh files.
  • Only the listed files are edited: met (8 files, all listed).
  • Size limit: met (32 insertions, 47 deletions, 8 files).
  • ci-status green: not verified here. The PR body leaves it to CI.

I did not run any scripts or tests. The PR body's verification is the author's claim and I have not checked it.

No plugin manifests changed. No embedded instructions were found in the PR context or prior-findings files.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit ddc0a68 Nov 9, 2026
50 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-14358-42612707359-1 branch November 9, 2026 13:17
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 check-next-graph.py, check-orphaned-fixtures.sh, check-pipefail-grep-q.sh and 5 more repository scripts

1 participant