Skip to content

refactor(harness-ops): simplify mod-posture.sh argument handling - #14847

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14511-42681193271-1
Nov 10, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14511

Summary

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

Simplified plugins/harness-ops/skills/audit-mod-posture/scripts/mod-posture.sh without changing what it prints or returns. A die() helper replaces six copies of the 'print mod-posture.sh: <message> to stderr, exit 2' block; usage() now strips the comment prefix in one sed instead of piping two; and the hooks-modules check is a single || chain, which drops the modules flag variable. The script is 14 lines shorter. One edge case does change: if stderr cannot be written, an unknown argument used to make the loop spin forever, because the exit came after a failed echo through &&. It now exits 2. Every message, exit code and help line is otherwise byte-identical.

Not verified

  • mod-posture.test.sh was not run: this lane runs only the named wrappers, so the test suite is left to the PR's CI
  • tidy: passes 1-3 found nothing to change in the listed lines, and pass 4 (write-for-humans) left the fragment unchanged because the issue fixes its wording. Pass 5 (ai-slop) covered the rubric read only: the detector script cannot run under this lane's Bash allowlist, so its deterministic layer did…

Fix

  • plugins/harness-ops/skills/audit-mod-posture/scripts/mod-posture.sh: added die() and routed the need(), unknown-argument, --project, --date, --surface and jq-missing errors through it; usage() is one sed; folded the modules if/elif/flag into one || chain ending in continue
  • .changes/harness-ops/work-resolve-issue-issue-14511-42681193271-1-7006428d.md: new patch fragment, '### Changed' with 'Internal simplification, no behavior change.'

Verification

The runner ran each check from the base copy against 8e9400a:

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

The run reports:

  • check-changelog-fragments: all 10 fragments valid
  • check-changed-skills: audit-mod-posture PASS, 0 errors, 0 warnings
  • check-affected: 13 passed, 6 skipped (the skips are reported by the check: ruff with no .py changed, typos not installed, checked-tree-code checks), the rest are CI-only
  • fresh-context review subagent compared old and new code: no differences in stdout, stderr text, exit codes, flags or written files. One difference only when stderr cannot be written: an unknown argument now exits 2 where the old code looped forever. --help output is byte-identical (every line in…
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42681193271

Left out: the items under Not verified.

Related

#14511

Merge-Risk: unrated reason=no-run

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

Security review: PR #14847 (head 8e9400a)

I found no security issues.

I read both changed files in full:

  • plugins/harness-ops/skills/audit-mod-posture/scripts/mod-posture.sh: this only restructures a local audit script.
    • A die() helper replaces six copies of the "print to stderr, exit 2" block. The messages and the exit code (2) stay the same. Every argument check still exits on bad input: need, unknown argument, --project, --date, --surface and the missing-jq check.
    • usage() now uses one sed -n '/^# Usage:/,/^# Exit:/s/^# \{0,1\}//p' call. It reads only the script's own file (${BASH_SOURCE[0]}) and builds no command from input.
    • The hooks-modules if/elif/flag is now one { … } || { … } || continue chain. The logic is the same: the plugin.json check runs when the hooks.json file is missing or its jq test fails, just as with the old elif. A plugin skipped before is still skipped.
    • The diff adds no new interpolation of caller input, no new eval and no new path handling. --date and --surface keep the same checks they had before.
  • .changes/harness-ops/…-7006428d.md: a changelog fragment. It is prose only and touches no security surface.

None of the trusted-path globs match the changed files. The diff touches no trust control, merge hold, plugin manifest or standing instruction. The PR context has no embedded instructions aimed at this lane.

This is the first review of this pull request (not blocking only), and there are no prior findings to restate.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Code review: PR #14847, no findings

I read both changed files in full: the mod-posture.sh refactor and the new harness-ops changelog fragment. I found nothing to flag.

Behavior check. I checked each rewrite against the base code by reading it. I did not run the script.

  • usage(): It now uses a single sed -n '/^# Usage:/,/^# Exit:/s/^# \{0,1\}//p'. This prints only lines where the substitution matches. Every line in the range (head lines 16–20) starts with #, so nothing is dropped. ^# Usage: matches only once in the file, so the range opens only once. The output is the same as before.
  • die(): The old error blocks for need, --project, --date, --surface, jq-missing and unknown-argument each built the message mod-posture.sh: <msg> and exited 2. die() builds the same text and also exits 2. The old unknown-argument branch was echo … && exit 2. When writing to stderr failed, the && skipped the exit and the loop spun forever. Now it exits 2. The PR body states this change. It only happens when stderr can't be written, so it doesn't conflict with the "behavior unchanged" criterion in any way a caller would notice.
  • The modules check (head lines 141–143): {A && B; } || {C && D; } || continue gives the same result as the old if/elif/flag code. The script runs with set -uo pipefail and no -e, so the || chain doesn't change how errors are handled. The removed modules variable isn't used anywhere else in the script.

Closing issue #14511 acceptance criteria.

  • Behavior unchanged: met, as above. Existing tests in mod-posture.test.sh would catch a break:
    • the hooks.json and inline plugin.json modules cases (lines 190–196);
    • unknown argument exits 2 (line 324);
    • --help prints from Usage: through Exit: 0 (lines 326–327).
  • Only the listed file plus a fragment: met.
  • Size limit: met (the diff is well under 400 lines).
  • Fragment: met. It has bump: patch, ### Changed, and the required line.
  • ci-status green: I can't see CI from this lane. The author also says mod-posture.test.sh wasn't run in their run; that claim is unverified, and the suite is left to CI.

There is no plugin manifest change, so the manifest checks don't apply. This was a full review, not blocking-only, and there were no prior findings.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@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 43097ee Nov 10, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14511-42681193271-1 branch November 10, 2026 00:07
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 43097ee3643d8674a9309bd24a611915ed1ba631; 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 mod-posture.sh harness-ops plugin code

0 participants