Skip to content

refactor(ai-slop): simplify the audit scripts without changing behavior - #14623

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

kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-14395-42612697031-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #14395

Summary

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

Simplified the five listed ai-slop audit scripts, keeping every output, exit code, message and flag the same. Argument parsing now uses one-line case arms, the style cross-check.sh already used, and emit-fix-record.sh's nested case is gone. detect.sh drops the LC_ALL=C prefixes that repeated its top-level export LC_ALL=C, replaces a flag variable with continue 2, and uses brace expansion for its seven stream directories. cross-check.sh swaps a two-arm case for one [[ ]] pattern test, and emit-fix-record.sh drops a -n test that -s already covers. digest-guard.sh gets the same one-line case arms. The script headers that digest-guard.sh and emit-fix-record.sh print as usage text are unchanged.

Not verified

  • The script test suites (detect.test.sh, cross-check.test.sh, digest-guard.test.sh, emit-fix-record.test.sh) did not run here: this lane runs only the named wrappers, and check-changed-skills skips script tests (CHECK_SKILL_SKIP_SCRIPT_TESTS=1). Left to the PR's CI.
  • shellcheck and shfmt did not run here. The new one-line case arms and { a; b; } groups match the style cross-check.sh already used. Left to the PR's CI.
  • ci-status green is a PR check, left to the PR's CI.
  • Tidy passes 4 and 5 (docs-hygiene writing rules, ai-slop fix) were skipped on the changelog fragment because the issue fixes its body word for word. Tidy passes 1 to 3 found nothing more to change in the code lines.

Fix

  • plugins/ai-slop/skills/audit/scripts/cross-check.sh: the rule-em-dash disabled check is now an if with a [[ ]] pattern test instead of a two-arm case.
  • plugins/ai-slop/skills/audit/scripts/detect.sh: argument parsing uses one-line case arms; LC_ALL=C prefixes that repeated the exported value are removed (phrase_fragment_ok, scan_grep, extract_prose, the finding awk); the phrase-removal loop uses continue 2 instead of a flag; mkdir uses brace…
  • plugins/ai-slop/skills/audit/scripts/digest-guard.sh: the argument-count guard and the --help and fallback case arms are each on one line.
  • plugins/ai-slop/skills/audit/scripts/emit-findings.sh: argument parsing uses one-line case arms.
  • plugins/ai-slop/skills/audit/scripts/emit-fix-record.sh: the nested option case, with its unreachable *) exit 2 arm, is now one flat arm per flag that uses an ME name variable; the not-applied-rows test is now [[ -s ]] alone.
  • .changes/ai-slop/work-resolve-issue-issue-14395-42612697031-1-5f736018.md: patch fragment whose body is ### Changed and the line "Internal simplification, no behavior change."

Verification

The runner ran each check from the base copy against 411f87e:

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

The run reports:

  • check-changelog-fragments: all 9 fragments valid (run before and after tidy).
  • check-changed-skills: plugins/ai-slop/skills/audit PASS, 0 errors, 10 warnings that predate this change (description length, body size, fresh-eyes notes), all in SKILL.md and reference files this change does not touch.
  • check-affected: 13 passed, 6 skipped, over 6 changed files (run before and after tidy).
  • fresh-context review subagent, which read the files only and ran no commands: no findings. It argued the case/[[ ]] equivalence, that the LC_ALL=C export comes before every call, that continue 2 skips the same fragments, the brace-expansion order, that [[ -s "" ]] is false, and that the…
  • git-read diff --numstat HEAD: 5 scripts changed, 34 lines added and 106 removed, plus the new 7-line fragment.
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42612697031

Left out: the items under Not verified.

Related

#14395

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 411f87ed1485c7c3113774fad4645d695ea52acd: read 6 of 6 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #14623 (refactor(ai-slop): simplify the audit scripts)

I found no security issues.

I read every hunk in all 6 changed files. None of them match a trusted-path glob. The diff touches no trust control, workflow, plugin manifest or standing instruction.

What I checked:

  • detect.sh, LC_ALL=C prefixes removed. The script still sets export LC_ALL=C at the top level (detect.sh#L46). That line runs before the functions that used the prefixes (phrase_fragment_ok, scan_grep, extract_prose and the finding awk). Byte-wise matching is unchanged, so no locale-dependent pattern change reaches the scan.
  • detect.sh, the continue 2 and the brace-expanded mkdir. Both do the same as before. Removed phrases are still skipped, and the same seven stream directories are created under the quoted $SCAN_DIR. No new path or injection surface.
  • Argument parsing in detect.sh, emit-findings.sh, emit-fix-record.sh and digest-guard.sh. Every option that takes a value still calls require_opt_value before reading $2. Unknown options still exit 2. In emit-fix-record.sh, the inner *) exit 2 arm that was removed could never run.
  • emit-fix-record.sh, [[ -s "$NA_ROWS" ]]. -s on an empty string is false, so the earlier -n test added nothing. NA_ROWS starts as "" (line 32).
  • cross-check.sh. The case became an equivalent [[ == *pattern* ]] test. The value comes from the detector's own config output and is not run as code.
  • Changelog fragment. Documentation only.

Instruction surface: no standing instruction was deleted or softened.

PR context: I found no embedded instructions aimed at the review.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Code review: PR #14623, refactor(ai-slop): simplify the audit scripts

Result: no findings. I read every hunk of all 6 changed files. This was a full review, not blocking only (no earlier head was reviewed).

What I checked

  • detect.sh, LC_ALL=C prefixes removed. The script runs export LC_ALL=C at detect.sh#L46. That line runs before phrase_fragment_ok, scan_grep, extract_prose and the finding awk are defined or called, and nothing in the script unsets or overrides LC_ALL. The removed prefixes repeated the exported value, so the locale doesn't change. The existing portability test in detect.test.sh (output identical under LC_ALL=C) still applies.
  • detect.sh, phrase-removal loop. [[ "$frag" == "$r" ]] && continue 2 skips the same fragments the removed flag skipped. The script runs under set -u only, so the failed [[ ]] status at the end of the inner loop has no side effect.
  • detect.sh, mkdir. The brace expansion "$SCAN_DIR"/{P,W,TP,TW,DP,DW,TDW} produces the same seven paths in the same order. The error handling is unchanged.
  • Argument parsing in detect.sh, emit-findings.sh and emit-fix-record.sh. Every flag, the require_opt_value call, the shift count, the arm order and the unknown-option message and exit code match the base. In emit-fix-record.sh, the new ME variable holds the same literal the old code passed to require_opt_value and printed in the unknown-argument message. ME is set after line 2 and before the set -euo line, so the usage() header extracted by sed -n '2,/^set -euo/p' is unchanged. The removed nested *) exit 2 arm couldn't be reached.
  • emit-fix-record.sh, [[ -s "$NA_ROWS" ]]. NA_ROWS defaults to "" and [[ -s "" ]] is false, so the (none) branch is taken exactly as before.
  • cross-check.sh. The if [[ " $disabled " == *" rule-em-dash "* ]] test matches what the two-arm case did.
  • digest-guard.sh. These are one-line versions of the same commands. Exit codes and usage calls are unchanged.
  • Changelog fragment. It has bump: patch and the body ### Changed / "Internal simplification, no behavior change.", which is what the closing issue requires.

Closing issue #14395, acceptance criteria

  • Behavior unchanged: met, by reading the code as above. The existing script test suites cover these paths (arg parsing, the LC_ALL=C portability test, --not-applied-rows handling). I didn't run them because this lane has no shell.
  • The diff edits only the listed files plus a fragment: met.
  • Within 400 changed lines and 15 hand-edited files: met (5 scripts, about 140 lines).
  • ci-status green: not verified by this lane. The author says it's left to the PR's CI.
  • Fragment body: met.

Other notes

  • Plugin manifests: none changed, so there are no manifest lines.
  • Embedded instructions: the PR context contains none.
  • Author-claimed checks: the verification the author reports (check-changelog-fragments, check-changed-skills, check-affected) is their claim, and I haven't confirmed it. shellcheck, shfmt and the script tests weren't run by the author or by this lane. They're left to CI.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit 9cb8788 Nov 9, 2026
49 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-14395-42612697031-1 branch November 9, 2026 13:30
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 audit ai-slop plugin code (1 of 2)

1 participant