Skip to content

refactor(harness-config): simplify audit-instructions scan and lane scripts - #15485

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14496-43134672544-1
Nov 12, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14496

Summary

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

Simplified three of the four listed audit-instructions scripts without changing behavior. instruction-scan.sh folds the separate grep check into the tool loop, drops guards and an awk branch that can never run (the files list is never empty past the early exit, and the scan awk only ever gets mode count or merge), and stops passing an unused -v rationale. lane-runs.sh inlines the one-call sha256_file wrapper and replaces the nested loop in the required-param check with a single key-string lookup. restatement-scan.py tightens the block-scalar loop, the quote check, split_units' flush, recoverable's return and the sibling loop (now any()), and drops no-op rstrip/strip calls. test-helpers.sh was already minimal and is a per-plugin copy under docs/contracts/shell-test-helpers, so it is unchanged.

Not verified

  • Ran no test suite (instruction-scan.test.sh, lane-runs.test.sh, restatement-scan.test.sh) or shellcheck/ruff directly: this lane's shell runs only the named wrappers. check-affected passed, but its output does not list which suites it ran; left to the PR's CI.
  • ci-status green is a PR check, left to the PR's CI.
  • tidy skipped its markdown passes (write-for-humans, ai-slop) on the changelog fragment, because the issue fixes the fragment body word for word; code passes 1-3 ran and found nothing to change.
  • test-helpers.sh left unchanged: it is already minimal, its contract makes it a deliberate per-plugin copy (docs/contracts/shell-test-helpers/README.md), and folding its helpers would cross files, which is out of scope.

Fix

  • plugins/harness-config/skills/audit-instructions/scripts/instruction-scan.sh: grep check folded into the required-tool loop (same message and exit 2); dead else if branch removed from SCAN_AWK; always-true files/chunk_start guards removed; unused -v rationale dropped from the scan awk call;…
  • plugins/harness-config/skills/audit-instructions/scripts/lane-runs.sh: one-call sha256_file wrapper inlined; required --param check reduced to one pass building a key string plus a membership test (same missing-key order and message)
  • plugins/harness-config/skills/audit-instructions/scripts/restatement-scan.py: block-scalar loop and quote check simplified; split_units flush drops a redundant empty-text branch; no-op rstrip/strip removed in parse_sections; recoverable returns its condition directly; sibling-section loop becomes…
  • .changes/harness-config/work-resolve-issue-issue-14496-43134672544-1-6f79c964.md: new patch fragment, ### Changed / Internal simplification, no behavior change.

Verification

The runner ran each check from the base copy against 613687c:

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

The run reports:

  • check-changelog-fragments: all 7 fragments valid (run before and after tidy)
  • check-changed-skills: audit-instructions PASS, 0 errors, 4 pre-existing size/fresh-eyes warnings unrelated to the scripts (run before and after tidy)
  • check-affected: 14 passed, 5 skipped over 4 changed files (run before and after tidy)
  • fresh-context review subagent over the whole diff: every hunk behavior-preserving; no test assertion depends on a changed line (instruction-scan.test.sh case 18 still sees exit 2 and 'grep required')
  • diff size: 4 files, 41 added / 72 removed lines in the scripts plus the 7-line fragment, within the 400-line / 15-file limit
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/43134672544

Left out: the items under Not verified.

Related

#14496

Merge-Risk: max=MEDIUM demote=false head=613687c81d448bfbb4996e2075df0b3e5ff54dd0 rubric=8.4.8 rater=claude-opus-5-5 checker=claude-opus-5-5

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

Copy link
Copy Markdown
Contributor

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

Security review: PR #15485 (head 613687c)

I found no security issues. I read every hunk of all 4 changed files in .claude-lane/pr.diff.

Scope. No changed file matches a trusted-path glob. The diff touches no trust control: not the trusted-trigger or trusted-actor list, the lane token request or broker, the kill switch, a merge hold, or any other action under .github/actions/. It also changes no plugin manifest and no standing instruction (CLAUDE.md, a skill or agent body, a hook allowlist).

What changed:

  • .changes/harness-config/...6f79c964.md: a new changelog fragment. It is only data and runs nothing.

  • plugins/harness-config/skills/audit-instructions/scripts/instruction-scan.sh:

    • The separate grep check now runs inside the required-tool loop, with the same exit 2.
    • The unreachable else if branch is gone from SCAN_AWK.
    • The always-true array guards around the scan block are removed.
    • The unused -v rationale is dropped.

    None of this adds a new input source or a new spot where a value is interpolated. Every variable is still passed to awk with -v and to grep as a quoted argument.

  • plugins/harness-config/skills/audit-instructions/scripts/lane-runs.sh:

    • The sha256_file wrapper is inlined as sha256_stdin <"$f", which is quoted and comes after the existing [[ -f "$f" ]] check.
    • The required-param check now builds one space-delimited key string and tests membership with a pattern match. Each key comes from the script's own $REQUIRED_PARAMS list.

    A --param key that contains spaces could make that match succeed falsely. These are arguments the local caller passes to a local digest helper, though, so there is no trust boundary and no exploit path.

  • plugins/harness-config/skills/audit-instructions/scripts/restatement-scan.py: pure rewrites of the parsing control flow (block-scalar loop, quote check, the sentence-flush step, any() sibling check). There is no new I/O, no eval or subprocess, and no path handling.

Embedded text in PR context: none found.

Spend: none. The change adds no lane runs, model or effort changes, or billed resources.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: no findings

I read every hunk in all 4 changed files and checked each simplification against the unchanged code around it. Each one keeps the old behavior:

instruction-scan.sh

  • grep check: grep is now the first tool in the required-tool loop. The message (ERROR: grep required) and exit 2 are the same, and grep is still checked first.
  • Removed files / chunk_start guards: they were always true at that point. The early exit at L670-677 runs when files is empty. With a non-empty files, the chunking loop always leaves len > 0, so chunk_start gets an entry (L374-377).
  • Removed else if in SCAN_AWK: it could never run. inner_mode is only ever count or merge, and count is handled by the first branch.
  • Dropped -v rationale: SCAN_AWK never reads it. The rationale matches at L559/L572 are in the I6 awk, which gets its own -v rationale at L488.

lane-runs.sh

  • Inlined sha256_file: it was a one-call wrapper; behavior is unchanged.
  • Key-string membership test: this is exact for every input that can reach it. Keys are validated against ^[a-z_]+$ at L240, so no key contains a space that could cause a false match. Missing keys are still reported in the same order with the same message.

restatement-scan.py

  • Block-scalar loop, quote check, recoverable return, any(): each is logically equivalent to the old code. any() stops at the first match the same way the old break did.
  • flush: an empty text splits to [""], which adds no units, so dropping the empty-text branch changes nothing.
  • rstrip("\n") removal: it did nothing, because lines comes from splitlines() (L245).
  • Heading .strip() removal: it also did nothing. HEADING_RE's group 2 already excludes trailing spaces, and normalize() strips anyway.

Closing issue #14496, acceptance criteria

  • Behavior unchanged: met, by my reading of the code.
  • Only the listed files plus a fragment are edited: met. test-helpers.sh is left unchanged, and the PR body says why.
  • Under 400 lines and 15 files: met.
  • Changelog fragment: met. It has bump: patch, ### Changed and the required body line.
  • ci-status is green: left to CI; I couldn't check it.

Not verified by me: I had no shell in this run, so I ran no tests. The author's results (check-affected 14 passed, the fragment and skill checks passing) are their own claims. The PR body says the three test suites, shellcheck and ruff were not run directly.

No plugin manifest changed. Nothing in the PR context reads as an instruction to this lane.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 613687c

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-15485-613687c81d448bfbb4996e2075df0b3e5ff54dd0, 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
Merged via the queue into main with commit 35a9e39 Nov 12, 2026
70 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14496-43134672544-1 branch November 12, 2026 02:35
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 35a9e3962a4ded1e19b7a6e972359ec964fb3203; 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-instructions harness-config plugin code (2 of 2)

0 participants