Skip to content

refactor(plugin-quality): simplify packet and audit collector scripts - #14790

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14702

Summary

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

Simplified four of the five listed plugin-quality scripts without changing outputs, exit codes, flags or --help text. packet-seal.sh now writes the original and the generation manifest through one write_manifest helper instead of two near-identical loops. collect-standards.sh folds the repeated topic-absent / basis-missing preamble of its five probes into topic_ready. collect-categories.sh flattens its cygpath block and drives section validation and the missing-section sweep from one list. packet-prune.sh prints its summary from one line and drops in-loop comments that repeated the header. test-helpers.sh is left as it is: its two lane initializers are already minimal, and any reshaping would touch the primitives its suites rely on. Choice of means: the shared helpers take a parameter (kind in write_manifest, an optional needle in topic_ready) so every printed message stays byte-for-byte the same.

Not verified

  • The plugin-quality *.test.sh suites (packet-prune, packet-seal, collect-categories, collect-standards) could not be executed in this lane; left to the PR's CI
  • ci-status green is a PR check, left to the PR's CI
  • plugins/plugin-quality/scripts/test-helpers.sh left unchanged: no simplification that keeps both lane shapes' primitives and wording intact
  • tidy: markdown passes 4 and 5 skipped because the only markdown line is the changelog fragment body, which the issue fixes word for word
  • Untracked runner files at the checkout root (.bashrc, .bash_profile, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc) are not part of this change and should be excluded from the patch

Fix

  • plugins/plugin-quality/scripts/packet-seal.sh: extract write_manifest for the two manifest-writing loops in record; the no-symlink rationale comment moves with it
  • plugins/plugin-quality/scripts/packet-prune.sh: one summary echo keyed on --apply; shorten two in-loop comments that restated header properties 2 and 3 (header, and so --help, unchanged)
  • plugins/plugin-quality/skills/audit/scripts/collect-categories.sh: cygpath resolution as one && chain; awk section list declared once in BEGIN and reused for validation and the END missing-section sweep; drop redundant initializations and a redundant finding_open reset
  • plugins/plugin-quality/skills/audit/scripts/collect-standards.sh: replace topic_file and the per-topic file/rel/cite preambles with topic_ready
  • .changes/plugin-quality/work-resolve-issue-issue-14702-42645412511-1-4d4e0092.md: patch fragment, ### Changed, "Internal simplification, no behavior change."

Verification

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

  • 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: plugins/plugin-quality/skills/audit PASS, 0 errors, 6 pre-existing warnings (run before and after tidy)
  • check-affected: 13 passed, 6 skipped over 5 changed files (run before and after tidy)
  • fresh-context review subagent over the whole diff: no behavior change found; confirmed message text, temp names, exit codes, probe order, --help ranges and bash 3.2 / mawk / BSD awk portability
  • tidy-diff over the change's hunks: no edits needed in the code passes
  • diff size: 5 files, 107 added / 174 removed lines in the 4 scripts plus a 7-line fragment, within the 400-line / 15-file limit
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42645412511

Left out: the items under Not verified.

Related

#14702

Merge-Risk: max=MEDIUM demote=false head=b80ad8f3c669c24ac2103507fe2c584a17f85b70 rubric=8.1.6 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 b80ad8f3c669c24ac2103507fe2c584a17f85b70: read 5 of 5 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #14790 (head b80ad8f)

I found no security issues. I read every hunk of all 5 changed files. None of them matches a TRUSTED PATHS glob, and the diff does not touch any trust control, merge hold, plugin manifest or standing instruction.

What I checked:

  • plugins/plugin-quality/scripts/packet-seal.sh: the new write_manifest keeps the symlink refusal for both the original manifest and the generation manifest. It still removes the temp file and exits 2 when a digest or the final move fails. The filter [[ "$kind" == manifest ]] || ! is_manifest_name "$name" || continue has the same effect as before:

    • an original seal still digests every entry;
    • a generation seal still skips manifest names.

    So a link in a packet still cannot make an outside file read as sealed content.

  • plugins/plugin-quality/scripts/packet-prune.sh: the per-candidate containment check before rm -rf is unchanged: it canonicalizes with pwd -P, requires a path under $root_abs/, and rejects a candidate that is itself a symlink (-L). So is the recursive, case-insensitive item*.md retention check. Only comments were shortened and the summary line was refactored. A dry run still prints would-delete=, never deleted=.

  • plugins/plugin-quality/skills/audit/scripts/collect-categories.sh: the cygpath/realpath chain gives the same result as the old nested ifs. The section checks now read from one graded list. Nothing is newly interpolated into shell or awk code: $DIR still reaches awk as a -v variable.

  • plugins/plugin-quality/skills/audit/scripts/collect-standards.sh: topic_ready builds paths from $ROOT and topic_rel as before. Its values go only into emit_probe output and into awk -v variables. It runs nothing new and handles no new input.

  • .changes/...md: a changelog fragment only.

Instruction-surface check: the lines removed from packet-prune.sh are code comments that explained checks the code still runs. No rule an instruction surface relied on is lost.

Embedded text: none found in the PR context.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Code review: no findings

I read every change in all 5 files and checked each refactor against the head file and the code it calls. Behavior stays the same: outputs, exit codes, printed text and flags are unchanged.

  • packet-seal.sh write_manifest: The new guard [[ "$kind" == manifest ]] || ! is_manifest_name "$name" || continue skips manifest names only for a generation, as before. The extra symlink explanation line is still printed only for the original manifest. The error messages come out byte-for-byte as before, both cannot write the <kind> in: and cannot install the <kind>:. The temp file keeps the same name and is removed on every failure, then the script exits 2. name, file and d are now local, and nothing after either call reads them. The original-manifest path could never see a packet.sha256.N entry anyway, because an existing generation makes the script exit before it gets there. So applying the generation-only skip there changes nothing.
  • packet-prune.sh: The single summary echo picks deleted= when --apply is set and would-delete= otherwise. The dry-run notice still prints only on a dry run. The shortened comments point at header properties 2 and 3, which still say what the removed text said. The header is untouched, so --help output is the same.
  • collect-categories.sh:
    • The cygpath chain sets DIR/CYGPATH_OK under exactly the same conditions as the nested ifs.
    • In awk, the dropped initializations rely on default values (""/0), so print (bad ? …) and exit bad behave as before.
    • Dropping the finding_open = 0 reset is safe. close_section → close_finding already clears the flag whenever a section is open, and no finding can open while section == "".
    • Section handling is unchanged: an unknown section still ends with section="", a duplicate still keeps section=name, and the three allowed ungraded headings still skip.
    • req, nreq and graded don't clash with any other name, and check_source declares its own local i.
  • collect-standards.sh topic_ready: Probes run in the same order and produce the same topic-absent / basis-missing output. cite already returned nothing for a missing file, so calling it only once the file exists changes nothing. For hook-budget, which has no needle, t_cite keeps the previous topic's value, but that probe never reads it. Nothing else read the removed variables (inv_*, seam_*, unc_*, win_*, hook_*, base).

Closing issue #14702:

  • Behavior unchanged: met by my reading. I didn't run anything; the author says the *.test.sh suites are left to CI.
  • Only listed files plus a changelog fragment are edited: met.
  • Size limit: met (5 files, about 280 changed lines).
  • Fragment is bump: patch with ### Changed and the exact line "Internal simplification, no behavior change.": met.
  • ci-status green: not something this review can check.

Leaving test-helpers.sh unchanged is explained in the PR body.

Path rules: .claude/rules/skill-bodies-state-current-rules.md and cost-claims.md match the two skills/audit/scripts/*.sh files, but the diff adds no restated upstream specifics and no cost figures. No plugin manifest changed, so the manifest checks don't apply.

The PR body has no instructions aimed at this review.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for b80ad8f

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-14790-b80ad8f3c669c24ac2103507fe2c584a17f85b70, 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 a46f98f Nov 9, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14702-42645412511-1 branch November 9, 2026 19:59
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit a46f98f84e595cf732801d7d6e26a0c64a42af30; 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 scripts and audit plugin-quality plugin code

0 participants