Skip to content

refactor(harness-config): simplify the second half of audit-engine.sh - #15559

Merged
melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-14502-43165102223-1
Nov 12, 2026
Merged

melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-14502-43165102223-1

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14502

Summary

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

Simplified code that starts in the second half of plugins/harness-config/skills/audit/scripts/audit-engine.sh (lines 1315-2628 of 2628, measured at start) without changing behavior. The category B baseline loop now reads with mapfile, iterates by index, and sets target, severity and lane note in one place. check_h loops over the two managed-only model keys instead of repeating the block. The debug-log numbers are read with bash regexes instead of three sed processes, and a line a pattern misses still passes through whole, as sed left it. The personal-only, malformed and layer lists are each built with one jq instead of two. I left out batching the coverage-manifest reads: jq -r pretty-prints an object-valued hook, so the batched form would not have matched byte for byte.

Not verified

  • plugins/harness-config/skills/audit/scripts/audit-engine.test.sh was not run: this lane allows no interpreter or test runner, so it is left to the PR's CI
  • tidy: passes 1-3 (code) ran with no edits; passes 4-5 (markdown writing rules, ai-slop) were skipped because the fragment body is the exact text the issue requires
  • The untracked root dotfiles (.bashrc, .bash_profile, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc) come from the lane sandbox, not this change, and belong in no patch

Fix

  • plugins/harness-config/skills/audit/scripts/audit-engine.sh: category B loop (mapfile, index loop, merged ask-rules branches); check_h managed-only rows as a loop; skill-listing numbers via bash regex with sed-equivalent fall-through; lines_json helper and single-jq list builders at assembly
  • .changes/harness-config/work-resolve-issue-issue-14502-43165102223-1-d0e0b75d.md: patch fragment, ### Changed, "Internal simplification, no behavior change."

Verification

The runner ran each check from the base copy against 54707b6:

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

The run reports:

  • check-changelog-fragments: all 5 fragments valid (ran before and after tidy and after the review fix)
  • check-changed-skills: PASS, 0 errors, 7 warnings, all in the audit skill's unchanged SKILL.md and reference files
  • check-affected: 13 passed, 6 skipped, over 2 changed files (ran three times, last after the review fix)
  • fresh-context review subagent: every change matches the old behavior except one, the debug-log fall-through when grep prints its own 'Binary file ... matches' line instead of a log line; fixed by initializing each value to the whole line as sed did
  • review subagent: audit-engine.test.sh asserts on the output document only; its sed -n source extraction pulls functions this change does not touch
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/43165102223

Left out: the items under Not verified.

Related

#14502

Merge-Risk: max=MEDIUM demote=false head=8d08444d40dae60cb44dd86db2340f8f66a61938 rubric=8.4.9 rater=claude-opus-5-5 checker=claude-opus-5-5

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

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #15559 (incremental, head 8d08444)

I found no security issues. This pass reported blocking findings only, because the lane already reviewed head 54707b6.

Scope. I read the one hunk in the incremental diff, in plugins/harness-config/skills/audit/scripts/audit-engine.sh. The file matches no trusted-path glob. It is not a trust control, a merge hold, a plugin manifest or a standing instruction surface.

What I checked

  • lines_json call sites (audit-engine.sh#L2541-L2542): "${PERSONAL_ONLY[@]}" and "${MALFORMED[@]}" became ${PERSONAL_ONLY[@]+"${PERSONAL_ONLY[@]}"} and ${MALFORMED[@]+"${MALFORMED[@]}"}.
    • This is the standard way to expand a possibly empty array safely under set -u.
    • When the array has elements, the inner expansion stays quoted, so elements are not split or globbed.
    • When the array is empty, the function gets no arguments and returns [].
    • The data still reaches jq only on stdin, never in the jq program text, so the change adds no injection or command-execution surface.

No prior findings apply. The lane's only earlier post was a clean summary, and the settled-threads file adds nothing for this hunk. The PR description contains no instructions aimed at the review lane.

critical-findings: 0

@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 54707b6d42d99e1eddb73e5c0c48581c82adaca2; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review (incremental, blocking only): 54707b6 → 8d08444

I read the whole incremental diff. Its one listed file is plugins/harness-config/skills/audit/scripts/audit-engine.sh, and the push changes only two lines in it (L2541-2542). I checked them by reading the code. I ran nothing.

What changed: personal_json and malformed_json now call lines_json with ${PERSONAL_ONLY[@]+"${PERSONAL_ONLY[@]}"} and ${MALFORMED[@]+"${MALFORMED[@]}"}. This is the fix this lane suggested in its earlier advisory finding, applied word for word.

  • Empty array: the guarded expansion produces no arguments, so $# -eq 0 and lines_json prints [], as the base did. No unbound-variable abort happens under set -u on bash before 4.4.
  • Non-empty array: each element still goes through as its own quoted word, so printf '%s\n' "$@" | jq -Rcn '[inputs]' builds the same array as before.
  • Matches existing code: this is the guard the file already uses for JQ_LF at L507.

The earlier finding is resolved, and the change brings back the base behavior on bash 4.0–4.3. That brings the closing issue's "Behavior is unchanged" criterion, which the earlier review held back for that bash range, back to met by reading. The other #14502 criteria still hold:

  • The push touches the same file and stays in range 2 of 2.
  • The line count barely moves.

This lane cannot see ci-status, and audit-engine.test.sh results remain author-claimed and unverified.

This lane already reviewed an earlier head, so this review was blocking only. No new findings. No plugin manifest changes. No settled-threads file was named. The PR context holds no embedded directives aimed at the lane.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor Author

Verification evidence for 8d08444

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-15559-8d08444d40dae60cb44dd86db2340f8f66a61938, expires on 2026-12-12.

One comment per pull request, updated in place for each new head.

Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM62foiU
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 12, 2026
@melodic-automation-lanes
melodic-automation-lanes Bot removed this pull request from the merge queue due to a manual request Nov 12, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit fdfe931 Nov 12, 2026
67 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14502-43165102223-1 branch November 12, 2026 06:54
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit fdfe931207eebe6cd5767ba71bd31bd5a6bc469c; 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-engine.sh harness-config plugin code (part 2 of 2)

0 participants