Skip to content

refactor(harness-config): simplify the audit skill's check scripts - #15496

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14503

Summary

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

Simplified three of the four harness-config audit scripts without changing their output or exit codes. check-plugin-drift.sh now prints its REMOVED, NEW and RENAME lists through one print_items helper instead of four copied read loops. It also drops a jq call that recomputed rename_count under another name, and computes the local and upstream counts only when the OK line that prints them runs. check-hook-coverage.sh builds each --json array with one print_array helper in place of six repeated mapfile/printf blocks; the printed bytes are unchanged. check-doc-citations.sh folds the page-state branch, moves the EOF-row comment to the first loop that needs it, and exits with exit $((MISSING > 0)). check-effort-pins.sh is unchanged: no edit made it clearly shorter or clearer without risk to its output.

Not verified

  • The harness-config script test suites (check-*.test.sh, audit-engine.test.sh, fix-plugin-drift.test.sh) were not run: this lane runs no interpreter or test runner. Left to the PR's CI.
  • ci-status green is a PR CI check; left to the PR's CI
  • check-effort-pins.sh was reviewed but not changed: no edit made it clearly shorter or clearer without risk to its output
  • tidy pass 5 (ai-slop): the detector script was not run because this lane's Bash allows only the named wrappers. The one-line fragment was read by hand against the rubric and has no tells.
  • tidy proposal not applied: inline the one-line display_lines wrapper in check-plugin-drift.sh. It needs edits outside the changed lines.
  • verify/checks steps: no build or shell linter beyond check-affected could be run here; shellcheck and the suites run in the PR's CI

Fix

  • plugins/harness-config/skills/audit/scripts/check-plugin-drift.sh: added print_items helper replacing four duplicated item-print loops; replaced the duplicate catalog_renames jq call with the existing rename_count; computed local_count and upstream_count only on the no-drift path where they are…
  • plugins/harness-config/skills/audit/scripts/check-hook-coverage.sh: replaced print_nodes and six mapfile/printf blocks in the --json emitter with one print_array helper producing the same bytes
  • plugins/harness-config/skills/audit/scripts/check-doc-citations.sh: folded the PAGE_STATE assignment branch, moved the trailing-newline read comment to the first manifest loop, and replaced the two-line exit with exit $((MISSING > 0))
  • .changes/harness-config/work-resolve-issue-issue-14503-43138015763-1-08e06e7c.md: patch fragment, ### Changed, "Internal simplification, no behavior change."

Verification

The runner ran each check from the base copy against eceb486:

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

The run reports:

  • check-changelog-fragments: all 18 fragments valid (run before and after tidy and after the review fix)
  • check-changed-skills: plugins/harness-config/skills/audit PASS, 0 errors, 7 warnings, none of them about the changed scripts
  • check-affected: 13 passed, 6 skipped over 4 changed files (run three times, last after the review fix)
  • fresh-context review subagent over the full diff: found one byte-level difference. A catalog holding several JSON documents made the combined single-jq count read print different counts and a new stderr line. Fixed by restoring one jq call per count. It traced the --json emitter bytes for zero, one…
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/43138015763

Left out: the items under Not verified.

Related

#14503

Merge-Risk: max=MEDIUM demote=false head=f046a19b1b3bc7534004527afcbc14f6d8b0974e rubric=8.4.8 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 needs no new review of f046a19b1b3bc7534004527afcbc14f6d8b0974e: no file of this pull request changed since the review of eceb486.

Security review: PR #15496 at eceb4865

No security issues found. I read the whole change in all 4 files. None of them matches a trusted-path glob. None is a trust control, merge hold, kill switch, token request, plugin manifest or standing instruction. They are three local audit scripts in plugins/harness-config/skills/audit/scripts/ and one changelog fragment.

What I checked:

  • check-plugin-drift.sh: The new print_items helper builds its jq program as "$JQ_DEFS $2". Each call passes $2 as a fixed string literal, so no catalog or settings data reaches the jq program text. The block data still arrives on stdin. Every item expression still runs through san, and every row still passes through display_lines, so the output sanitising is the same as before. Two other edits are safe: reusing rename_count for the old catalog_renames, which was the same jq expression, and moving the local_count and upstream_count jq calls into the no-drift branch. Neither adds a new input path.
  • check-hook-coverage.sh: print_array passes the jq program and its fields to the existing json_nodes as separate quoted arguments, with the same ${arr+"${arr[@]}"} expansion as before. The array name is a literal from each call. No new interpolation of untrusted values.
  • check-doc-citations.sh: This folds the PAGE_STATE assignment, moves a comment, and changes the exit to exit $((MISSING > 0)), which gives the same 0/1 exit status. The arithmetic uses a counter the script sets, not outside input.
  • .changes/...md: A changelog fragment that is prose only.

PR context: no embedded directives aimed at the review lane.

critical-findings: 0

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head f046a19b1b3bc7534004527afcbc14f6d8b0974e. No person needs to act: a lane clears this reason, and the next scheduled run judges it again.

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

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: no findings

I read every hunk of all 4 changed files. I traced each refactor against the base logic to check that output bytes and exit codes stay the same.

  • check-hook-coverage.sh: print_array shifts off <name> and passes <width> <prog> <fields...> on to json_nodes, the same arguments the six old call sites passed. The bytes printed are the same. Before, each array printed ' "x": [' + nodes + '\n ],\n'. Now it prints ' "x": [' + nodes + '\n ]' from the helper and ',\n' from the caller. The last array still ends '\n ]\n}\n'. nodes is now local to the helper and nothing else in the emitter reads it. ${nodes+"${nodes[@]}"} still handles the empty array under set -u.
  • check-plugin-drift.sh: print_items keeps the old loop's skip-empty-line and - output. The space added between $JQ_DEFS and the program does not change how jq parses it. rename_count uses the same jq expression as the removed catalog_renames, so the duplicate call is gone with no change. heuristic_count is the same as the old heuristic_renames. local_count and upstream_count are only read on the OK line, and they are now computed inside that branch. The script runs set -uo pipefail without -e, so skipping those two jq calls on the drift path changes no exit status.
  • check-doc-citations.sh: putting the page_file result into PAGE_STATE first and then testing it for empty gives the same SKIP behavior. As before, it runs in a command-substitution subshell. exit $((MISSING > 0)) gives the same exit codes (0 or 1) as the old two lines. Moving the comment changes nothing at run time.
  • Changelog fragment: bump: patch with ### Changed and "Internal simplification, no behavior change." This meets the closing issue's fragment criterion.

Closing issue #14503 criteria:

  • Behavior unchanged: met, by my reading. check-hook-coverage.test.sh and check-plugin-drift.test.sh cover the --json emitter and the drift/OK/RENAME output, and check-doc-citations.test.sh covers the third script, so a regression could fail CI.
  • Only the listed files plus a fragment are edited: met.
  • Within 400 lines and 15 files: met.
  • ci-status green: left to CI. I did not verify it.

The author says the test suites were not run in the lane. That claim is unverified, and I ran nothing myself. This lane has no shell.

No plugin manifest changed, so there are no manifest lines. The standards index under docs/standards has no paved-path row, so there are no paved-path criteria. I found no embedded directives in the PR context.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for f046a19

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-15496-f046a19b1b3bc7534004527afcbc14f6d8b0974e, expires on 2026-12-12.

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 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 12, 2026
@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 15fa72f Nov 12, 2026
62 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14503-43138015763-1 branch November 12, 2026 05:12
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 6, survived 1, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 86%; mutation score 86%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/harness-config/skills/audit/scripts/check-doc-citations.sh 2 0 0 0 0 0
plugins/harness-config/skills/audit/scripts/check-hook-coverage.sh 2 0 0 0 0 0
plugins/harness-config/skills/audit/scripts/check-plugin-drift.sh 2 1 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/harness-config/skills/audit/scripts/check-plugin-drift.sh:557 ROR productive no-assertion

The run's summary has the full report.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 15fa72fe94dd563109841fcd3ff79ea3b38930a6; 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 harness-config plugin code

1 participant