Skip to content

refactor(ai-slop): simplify audit script helpers without behavior change - #14536

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14396

Summary

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

Simplified the five listed /ai-slop:audit shell files without changing outputs, exit codes, flags or function names. The edits fold repeated invocations into one in-file helper (a jq presence check in cascade-read.sh, a hardened git call in rubric-fanout.sh), drop redundant conditions and a flag variable, hoist a loop-invariant separator choice out of a loop, and collapse an if/else array assignment into the file's existing empty-safe expansion idiom. No code moved between files.

Not verified

  • The ai-slop shell test suites (cascade-read.test.sh, resolve-targets.test.sh, detect.test.sh, rubric-fanout tests) could not be run directly in this lane; check-affected ran its 13 selected checks but its output does not name them, so the suites are left to the PR's CI
  • tidy-diff passes 4 and 5 (docs-hygiene writing rules, ai-slop fix) skipped for the changelog fragment: its wording is fixed verbatim by the issue's acceptance criteria. Passes 1-3 ran over the code lines and made no edit
  • ci-status green is checked on the PR by CI

Fix

  • plugins/ai-slop/skills/audit/scripts/lib/cascade-read.sh: add _cascade_has_jq for the four command -v jq checks; cascade::list and cascade::slug_map bind their nameref straight from $1 instead of through a dest local
  • plugins/ai-slop/skills/audit/scripts/lib/opt-value.sh: require_opt_value drops the redundant $# -lt 3 test (covered by -z "${3:-}") and the two single-use locals
  • plugins/ai-slop/skills/audit/scripts/lib/resolve-targets.sh: list_tracked_or_fallback picks the path separator once before the loop; resolve_targets drops the paths_file_empty flag (the bare-invocation fallback is now the elif of the --paths-file branch) and assigns the result with one empty-safe…
  • plugins/ai-slop/skills/audit/scripts/rubric-fanout.sh: add git_safe for the three git -c core.fsmonitor= -c core.hooksPath=/dev/null calls in cmd_plan
  • plugins/ai-slop/skills/audit/scripts/user-scope.sh: consider() drops a redundant -n "$t" test that "$t" == *.md already implies
  • .changes/ai-slop/work-resolve-issue-issue-14396-42595386991-1-f5b6b541.md: patch fragment, ### Changed, "Internal simplification, no behavior change."

Verification

The runner ran each check from the base copy against 72afea6:

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

The run reports:

  • check-changelog-fragments: all 4 fragments under .changes/ valid (run before and after tidy)
  • check-changed-skills: plugins/ai-slop/skills/audit PASS, 0 errors, 10 pre-existing warnings unrelated to this diff (run before and after tidy)
  • check-affected: 13 passed, 6 skipped over 6 changed files (run before and after tidy)
  • fresh-context review subagent over the whole diff: no confirmed behavior change; its one open question (paths_file_empty equivalence) is settled by the original code, which set the flag exactly when --paths-file yielded no paths, the same case the new elif excludes
  • caller check: every cascade::* and resolve_targets destination name in detect.sh and the tests is distinct from the functions' locals, so the nameref reshaping reaches the same variables
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42595386991

Left out: the items under Not verified.

Related

#14396

Merge-Risk: max=MEDIUM demote=false head=72afea6e07ba8a943f9f29b06bddb65fda41e4da rubric=8.1.3 rater=claude-opus-5-5 checker=claude-opus-5-5

Lane-Activity: work-resolve-issue/resolve-issue
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

pr-merge's gate refuses its verifier verdict (verify:missing)

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Security review: PR #14536, refactor(ai-slop): simplify audit script helpers without behavior change

No security issues found. I read every hunk of all 6 changed files. None of them matches a trusted-path glob, and the diff touches no trust control, merge hold, workflow, token request or plugin manifest. There are no manifest lines.

What I checked:

  • rubric-fanout.sh, new git_safe wrapper: it keeps both hardening flags, -c core.fsmonitor= -c core.hooksPath=/dev/null. All three cmd_plan call sites now go through it. So a target repository's own config still cannot run an fsmonitor program or hooks. Putting -C and the later -c core.quotePath=false after the wrapper's flags is the same order git parsed before. No call site lost the hardening.
  • user-scope.sh, consider(): dropping -n "$t" changes nothing. The empty string can never match *.md, so the check was redundant. The rules that confine symlink targets are unchanged: the target must sit inside "$realroot"/*, must be a regular readable file, and the newline/tab guard still runs.
  • opt-value.sh: -z "${3:-}" already covers the case where $3 is missing. Because || stops at the first true test, "$3" == -* only runs once $3 is known to be set and non-empty. Rejection of a missing value or a dash-led value still happens before exit 2.
  • resolve-targets.sh: the bare-invocation fallback (git ls-files under repo_root) now runs in the elif. It still runs only when no --paths-file was given and raw is empty. That is exactly when the old code ran it, so an empty --paths-file still scans nothing. Hoisting the separator choice prints the same paths as before. dest_ref=(${files[@]+"${files[@]}"}) is the standard quoted, empty-safe expansion, so file names are not word-split or globbed.
  • cascade-read.sh: _cascade_has_jq is the same command -v jq check. The namerefs now bind straight from $1, which is the same caller-supplied name the old dest local held. That does not widen what a caller can name. The callers are in-repo scripts and tests.
  • Mode change: opt-value.sh and resolve-targets.sh go from 100644 to 100755. Making a sourced library executable has no security impact here.
  • PR context and changelog fragment: neither contains embedded instructions aimed at this lane.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Code review: no findings

I read every hunk of all 6 changed files. I checked each edit for behavior equivalence against the closing issue #14396.

Per-file equivalence (checked by reading the code; I did not run the test suites):

  • lib/cascade-read.sh: _cascade_has_jq is exactly the command -v jq >/dev/null 2>&1 it replaces, at all four sites. In cascade::list and cascade::slug_map, the nameref now binds straight from $1, and no $dest use is left in either body. A caller name that collided with the old locals (key, layer, v, raw, …) collides the same way it did before. The only difference: a caller array named dest used to alias the removed local and now works. The change makes no case worse.
  • lib/opt-value.sh: when $# -lt 3, $3 is unset, so -z "${3:-}" already holds. The guard, its message ($1: $2 requires a value) and exit 2 are unchanged.
  • lib/resolve-targets.sh: the separator choice moved out of the loop and gives the same output for every $dir. The old paths_file_empty flag was set only when --paths-file was given and produced no paths. The old fallback ran only when no paths file was given and raw was empty, which is exactly the new elif. dest_ref=(${files[@]+"${files[@]}"}) is the same empty-safe idiom the file already uses at lines 139/149/153/156.
  • rubric-fanout.sh: git_safe expands to the same argument vector at all three call sites, including the -C "$top" -c core.quotePath=false log ordering. No unconverted hardened git call is left in the file.
  • user-scope.sh: an empty $t cannot match *.md, so dropping -n "$t" changes nothing.
  • The 100644 → 100755 mode changes on opt-value.sh and resolve-targets.sh match cascade-read.sh (already 100755). They also match the convention in scripts/check-affected.sh that the issue lane makes changed .sh files executable, as apply-patch does (L33-L35). Both files are sourced only, so running them is unaffected.

Closing issue #14396 acceptance criteria:

  • Behavior unchanged: met, by the equivalence reading above. The existing cascade-read, resolve-targets, detect and rubric-fanout test suites cover these paths. The author says they could not run them in-lane, so their result is left to the PR's CI and is unverified here.
  • Only the listed files plus a changelog fragment are edited: met.
  • Within 400 lines and 15 files: met (6 files, a small diff).
  • ci-status green: the author says CI checks it. I can't check it from this lane.
  • Fragment: met. bump: patch, ### Changed, "Internal simplification, no behavior change."

The PR's verification results (check-changelog-fragments, check-changed-skills, check-affected) are author-claimed and unverified by this review.

Prior findings: none (earlier heads reviewed: 0). This was a full review, not blocking only.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 72afea6

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-14536-72afea6e07ba8a943f9f29b06bddb65fda41e4da, 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 d6cf80f Nov 9, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14396-42595386991-1 branch November 9, 2026 11:03
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit d6cf80f78d902e8d17219344219ee025e08c99d4; 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 the audit ai-slop plugin code (2 of 2)

0 participants