Skip to content

refactor(harness-ops): simplify changelog status, surface discovery and native-drift scripts - #15335

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14555-42997924828-1
Nov 11, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14555

Summary

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

Simplified the three harness-ops changelog scripts without changing their behavior. changelog-status.sh now uses one shared numeric version sort (vsort) in its three places, derives the in-range version list by parameter expansion instead of a cut/tr pipeline, prints the releases line from one branch instead of three, and merges a duplicated comment. discover-surfaces.sh gains a count_depth2 helper for its six depth-2 find counts and uses one [[ ]] test for its argument check. native_drift.py precomputes the class-to-lane map once (CLASS_LANE) instead of on every evaluate_row call, hoists the plugin_backed lookup out of a per-name comprehension, and turns the candidate-key loop and the changes-dict setup into compact comprehensions. Every flag, exported name, output line, ordering and exit code stays the same; a fresh-context review that read each test's assertions found no behavior change.

Not verified

  • The script test suites (changelog-status.test.sh, discover-surfaces.test.sh, native_drift.test.sh, test_native_drift.py) were not executed: this lane's Bash runs only the named wrappers, so they are left to the PR's CI
  • Lint (shellcheck, ruff format/check) on the touched scripts was not run here for the same reason; left to the PR's CI
  • tidy skipped two passes: pass 2 (comment deletions) needs change-shape.sh and pass 5 (ai-slop fix) needs detect.sh and digest-guard.sh, neither runnable in this lane; the fragment line is the issue's required wording and a manual read found no AI-writing tell
  • ci-status green on the PR is a PR CI check, not runnable here

Fix

  • plugins/harness-ops/skills/changelog/scripts/changelog-status.sh: vsort helper shared by vmax, the in-range sort and the latest-release sort; range_versions array via ${in_range[]%%[[:space:]]*} replaces first/versions and the cut/tr pipeline; the releases: line is printed from one if/else…
  • plugins/harness-ops/skills/changelog/scripts/discover-surfaces.sh: count_depth2 helper replaces six inline find -mindepth 2 -maxdepth 2 | count_lines pipelines; the argument check is one [[ ... || ... == -* ]] test instead of a case-in-if
  • plugins/harness-ops/skills/changelog/scripts/native_drift.py: CLASS_LANE module constant replaces the per-call reverse dict in evaluate_row; plugin_backed lookup hoisted out of the summarize comprehension; candidate keys built by a list comprehension; diff_surfaces changes dict built from one kinds…
  • .changes/harness-ops/work-resolve-issue-issue-14555-42997924828-1-27827f9a.md: new patch fragment, ### Changed, Internal simplification, no behavior change.

Verification

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

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

The run reports:

  • check-changelog-fragments (before and after tidy and the review fix): all 2 fragments valid
  • check-changed-skills (before and after): CHECK-SKILL changelog PASS, 0 errors, 3 pre-existing warnings unrelated to the scripts
  • check-affected (before and after): 14 passed, 5 skipped (typos not installed; tree-code checks reported by the check), the rest CI-only
  • fresh-context review subagent over the whole diff, reading changelog-status.test.sh, discover-surfaces.test.sh, native_drift.test.sh and test_native_drift.py: no behavior change found; its one clarity finding (a comment still said the version is cut at the tab) is fixed
  • tidy-diff over the changed lines: passes 1 (simplify), 3 (generated-code residue) and 4 (write-for-humans on the fragment) ran and found nothing further to edit
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42997924828

Left out: the items under Not verified.

Related

#14555

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

Security review: PR #15335 (head f7aa3b4)

Result: no security issues found. This was a full first review, not blocking-only. The prior-findings file lists 0 earlier heads.

I read every hunk of all 4 changed files. None of them matches a trusted-path glob. None is a plugin manifest, a trust control, a merge hold or a standing instruction surface.

  • .changes/harness-ops/...27827f9a.md is a new changelog fragment (bump: patch, "Internal simplification"). It is data only.

  • plugins/harness-ops/skills/changelog/scripts/changelog-status.sh:

    • adds a vsort helper that wraps the same sort -t. -k1,1n -k2,2n -k3,3n call
    • builds range_versions with a parameter expansion ("${in_range[@]%%[[:space:]]*}", quoted) in place of cut/tr
    • folds the releases: print into one branch

    No new input sources, no command construction from untrusted text, and no eval or unquoted expansion was added. The git log subject parsing and its regex gating are unchanged.

  • plugins/harness-ops/skills/changelog/scripts/discover-surfaces.sh:

    • the argument check becomes [[ "$#" -gt 1 || "${1:-}" == -* ]], which rejects the same inputs as the old case
    • the new count_depth2 helper passes "$1" and "${@:2}" quoted to find, and every caller passes a fixed literal path and fixed predicates

    No path-injection surface was added.

  • plugins/harness-ops/skills/changelog/scripts/native_drift.py gets a module-level CLASS_LANE reverse map, a hoisted plugin_backed lookup, and two comprehensions. These are pure data refactors with no I/O, subprocess or deserialization changes.

There was no embedded instruction text in the PR context. The instruction-exception register did not apply because no instruction surface changed.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: PR #15335, simplify the harness-ops changelog scripts

No findings. I read every hunk of all 4 changed files. None of them is on a trusted path, and no plugin manifest changed.

I checked each refactor for any change in behavior. I reasoned from the code and ran nothing; the PR's test and lint runs are claimed by the author and I have not verified them.

changelog-status.sh

  • vsort: it uses the same sort -t. -k1,1n -k2,2n -k3,3n as the three places it replaces. Process substitutions and command substitutions inherit shell functions, so the call inside mapfile ... < <(...) still works.
  • mode="after"; [[ -n ... ]] && mode="between": the script runs with set -uo pipefail and no -e. When range_first is empty, the failing test has no effect.
  • range_versions=("${in_range[@]%%[[:space:]]*}"): rows look like X.Y.Z\t<count>, so cutting at the first whitespace gives the same version as cutting at the tab. The old line was cut -f1 | tr '\n' ' ' followed by trimming the trailing space. ${range_versions[*]} gives the same space-joined list, because the script never changes IFS. The removed first and versions variables are not used anywhere else in the file.
  • releases: line: it now prints before the cap if, but each case prints the same line as before. Output order stays range, releases, cap, recommend.

discover-surfaces.sh

  • Argument check: [[ "$#" -gt 1 || "${1:-}" == -* ]] is the same test as the old case.
  • count_depth2 DIR ARGS...: each call expands to the same find DIR -mindepth 2 -maxdepth 2 ARGS as the old line, keeping its predicate order and 2>/dev/null.

native_drift.py

  • plugin_backed lookup: moving it out of the loop is safe. The function rejects a non-dict inventory before it gets there, and the loop never changes inventory.
  • CLASS_LANE: it builds the same reverse map that evaluate_row used to build on every call.
  • Comprehensions: the candidate list and the changes dict keep the same order and the same isinstance filter.

Closing issue #14555

  • Behavior unchanged: met, as far as I can tell from reading the code. The repository has test suites for these scripts (changelog-status.test.sh, discover-surfaces.test.sh, native_drift.test.sh, test_native_drift.py) that could catch a regression. The author says they did not run them and leaves them to CI.
  • Only the listed files and changelog fragments edited: met.
  • Within 400 changed lines: met.
  • Fragment wording: met. It has bump: patch, a ### Changed heading and the required line.
  • ci-status green: depends on CI, so I could not check it here.

The PR body and the issue contain no embedded instructions aimed at this review.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for f7aa3b4

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-15335-f7aa3b4e5d940b3c7d07bb9016a023999592392b, expires on 2026-12-11.

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 11, 2026
Merged via the queue into main with commit e1e6195 Nov 11, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14555-42997924828-1 branch November 11, 2026 11:05
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

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

File Killed Survived Timeout No coverage Invalid Not run
plugins/harness-ops/skills/changelog/scripts/changelog-status.sh 2 1 0 0 0 0
plugins/harness-ops/skills/changelog/scripts/discover-surfaces.sh 1 1 0 0 0 0
plugins/harness-ops/skills/changelog/scripts/native_drift.py 2 0 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/harness-ops/skills/changelog/scripts/changelog-status.sh:318 ROR productive input-gap
plugins/harness-ops/skills/changelog/scripts/discover-surfaces.sh:31 other productive input-gap

The run's summary has the full report.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit e1e61956a62de084a5121150815459cc01d19615; 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 changelog harness-ops plugin code

0 participants