Skip to content

refactor(docs-hygiene): simplify audit-noise detect and emit scripts - #14548

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14456

Summary

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

Simplified three of the four audit-noise scripts without changing their behavior. detect.sh now takes every argument after -- in one append. emit-findings.sh merges the two descr() field tests into one regex and replaces five copies of the declined-candidates printf loop with a print_declined helper, keeping the same reasons in the same order. noise-shapes.sh checks the reserved .work roots with one membership test, makes audit_noise_shape_tier call audit_noise_shape_tier_into so the tier table lives in one place, and drops a whitespace trim that could never change the value. lib/opt-value.sh is a 10-line guard with nothing to simplify, so it is unchanged. No function, flag or output text changed.

Not verified

  • detect.test.sh and emit-findings.test.sh were not run: the lane cannot run code from the checked tree, so the PR's CI runs these suites.
  • shellcheck, the portability lint and cant-fail-scan over the edited shell scripts were not run here. check-affected marks them CI only, so they are left to the PR's CI.
  • ci-status green is a PR check left to the PR's CI.
  • tidy passes 4 and 5 (the markdown writing rules and the ai-slop fix) were skipped for the changelog fragment: the issue fixes its text word for word.

Fix

  • plugins/docs-hygiene/skills/audit-noise/scripts/detect.sh: -- takes the rest of the arguments with TARGETS+=("$"); break, replacing a shift loop. The frontmatter comment is reworded to drop a question left in it.
  • plugins/docs-hygiene/skills/audit-noise/scripts/emit-findings.sh: descr() matches ^(description|when_to_use): in one test. A print_declined awk helper replaces five copies of the same loop in END. Dropped a ticket back-reference from a comment.
  • plugins/docs-hygiene/skills/audit-noise/scripts/lib/noise-shapes.sh: the ghost-ref reserved roots are checked against one space-delimited list. audit_noise_shape_tier calls audit_noise_shape_tier_into instead of repeating its case table. Removed a redundant trailing-whitespace trim in…
  • .changes/docs-hygiene/work-resolve-issue-issue-14456-42601518528-1-e862584e.md: patch fragment, ### Changed, "Internal simplification, no behavior change."

Verification

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

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

The run reports:

  • check-changelog-fragments: all 2 fragments valid (run before and after tidy)
  • check-changed-skills: CHECK-SKILL audit-noise PASS, 0 errors, 4 warnings that were already there (description length, body size, no Gotchas)
  • check-affected: 13 passed, 6 skipped, over 4 changed files (run before and after tidy)
  • fresh-context review subagent: found all 7 hunks equivalent under bash 4.4+/5 and gawk/mawk/BWK awk, including passing never-assigned arrays to print_declined, nameref resolution in audit_noise_shape_tier, and the reserved-list membership test
  • code-tidying:tidy-diff over the 10 changed hunks: no edits needed
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42601518528

Left out: the items under Not verified.

Related

#14456

Merge-Risk: max=MEDIUM demote=false head=78892384cf9dabcde3858703694fb35b09fc75e6 rubric=8.1.4 rater=claude-opus-5-5 checker=claude-opus-5-5

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

Security review: PR #14548 (head 7889238)

I found no security issues.

I read all four changed files in full in .claude-lane/pr.diff. None of them match a trusted-path glob, and none is a plugin manifest, a workflow, an action, a merge hold or a standing instruction surface.

  • plugins/docs-hygiene/skills/audit-noise/scripts/detect.sh: -- now does TARGETS+=("$@"); break instead of the shift loop. The result is the same: every remaining argument is added as a quoted target, with no new word splitting or globbing. The other change rewords a comment.
  • plugins/docs-hygiene/skills/audit-noise/scripts/emit-findings.sh: the two descr() regex tests are merged into one with alternation. The new print_declined awk helper prints the same constant reason strings through printf with %s. No input reaches a format string or a command. A comment loses a ticket reference.
  • plugins/docs-hygiene/skills/audit-noise/scripts/lib/noise-shapes.sh:
    • Reserved-root membership is now a space-delimited *" $seg "* test. seg comes from the capture [a-z0-9][a-z0-9_-]*, so it cannot contain a space and cannot match across entries (L32-L40).
    • audit_noise_shape_tier now calls audit_noise_shape_tier_into. That function's nameref local is _audit_noise_tier_out, a different name from the caller's tier, so the nameref resolves correctly (L329-L337).
    • A redundant whitespace trim is removed.
    • The file mode changes from 100644 to 100755 on a sourced library. Nothing runs differently because of that, and nothing it gates changes.
  • .changes/docs-hygiene/...e862584e.md: a changelog fragment, prose only.

The PR context file contains no embedded instructions aimed at this lane. Prior findings: none. This was the first review of this PR (blocking only: no).

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Code review: no findings

This is a full review. I read every hunk of all 4 changed files. None of them falls under a trusted path. There are no prior findings and no settled threads, and the PR context contains no embedded instructions.

Equivalence checks on each hunk

  • detect.sh --: TARGETS+=("$@"); break exits the outer while loop (detect.sh:39-74) with the same targets the shift loop built. Nothing after the loop reads $#, and an empty "$@" is safe under set -u.
  • detect.sh comment: only the wording changed.
  • emit-findings.sh descr(): ^(description|when_to_use): matches exactly the lines the two separate tests matched, and the ERE alternation is portable to mawk.
  • emit-findings.sh print_declined: it is defined at top level. Each array it receives is also indexed as an array in the main rule (emit-findings.sh:356-382), so all three awks treat it as an array even when it is empty. The reason strings contain no %, so moving them from the format string to a %s argument prints the same bytes, in the same order.
  • noise-shapes.sh reserved list: seg is captured by [a-z0-9][a-z0-9_-]* (noise-shapes.sh:32), so it can hold no space. The space-delimited membership test therefore accepts the same set as the old || chain.
  • noise-shapes.sh audit_noise_shape_tier: the nameref target tier does not collide with _audit_noise_tier_out or shape inside _into. The case table in audit_noise_shape_tier_into (noise-shapes.sh:329-337) is the same as the one removed, and the printed digit is the same.
  • noise-shapes.sh trim: the trailing-whitespace trim removed after the closing-hash regex was redundant. Line 345 already trims, and BASH_REMATCH[1] ends on a character that is neither # nor whitespace.

Closing issue #14456 acceptance criteria

  • Behavior unchanged: met by the reading above. The existing detect.test.sh and emit-findings.test.sh suites would catch a regression. The PR says it did not run them; I did not run them either (this lane has no shell), so that is left to CI.
  • Edits only the listed files and a fragment: met.
  • Size limits: met (about 30 changed lines, 3 hand-edited files).
  • ci-status is green: I cannot verify it here; it is a CI check.
  • Fragment body: met. It has bump: patch, a ### Changed heading and the exact line the issue asks for.

Note (not a finding)

lib/noise-shapes.sh changes mode from 100644 to 100755. The file has no shebang, and its header says it is "sourceable; not invoked directly". The mode change matches the issue lane's exec-bit step for changed .sh files, described in check-affected.sh#L33-L35. It does not change what the scripts do when sourced, but the PR body's "No function, flag or output text changed" does not mention it.

No paved-path row was found in the standards index. The only path-scoped rule matching these files is .claude/rules/skill-bodies-state-current-rules.md, and none of its criteria apply to these script edits.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 7889238

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-14548-78892384cf9dabcde3858703694fb35b09fc75e6, 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 b5cead7 Nov 9, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14456-42601518528-1 branch November 9, 2026 12:00
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 2, survived 5, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 29%; mutation score 29%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/docs-hygiene/skills/audit-noise/scripts/detect.sh 0 2 0 0 0 0
plugins/docs-hygiene/skills/audit-noise/scripts/emit-findings.sh 2 1 0 0 0 0
plugins/docs-hygiene/skills/audit-noise/scripts/lib/noise-shapes.sh 0 2 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/docs-hygiene/skills/audit-noise/scripts/detect.sh:62 SBR productive input-gap
plugins/docs-hygiene/skills/audit-noise/scripts/detect.sh:63 SBR productive input-gap
plugins/docs-hygiene/skills/audit-noise/scripts/emit-findings.sh:309 other productive input-gap
plugins/docs-hygiene/skills/audit-noise/scripts/lib/noise-shapes.sh:40 other productive input-gap
plugins/docs-hygiene/skills/audit-noise/scripts/lib/noise-shapes.sh:324 SBR productive input-gap

The run's summary has the full report.

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-noise docs-hygiene plugin code

0 participants