Skip to content

refactor(mutation-testing): simplify estimate-run, dotnet-test-selection and suppression-lint scripts - #15072

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14662

Summary

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

Simplified three of the four listed mutation-testing scripts without changing outputs, exit codes, printed text or flags. suppression-lint.sh drops two awk processes per digest (the first 16 characters of sha256sum/shasum output are the hash already), replaces tr/sed pipelines and $(printf) with bash parameter expansion and $'..' quoting, collapses the - and -- argument arms, swaps heredocs for here-strings and process substitution, and folds the cur_id reset into reset_entry. estimate-run.sh splits its shared --mutants/--seconds arm into two plain arms; dotnet-test-selection.sh inlines a one-call awk helper and makes the filter-term branches explicit. compare-records.sh was reviewed and left unchanged: it is already minimal, and every candidate edit made it less clear.

Not verified

  • The scripts' contract tests (compare-records/dotnet-test-selection/estimate-run/suppression-lint .test.sh) were not run directly: this lane runs no interpreter or script outside the named wrappers. Left to the PR's CI.
  • Tidy's ai-slop pass could not run its detector script (detect.sh is not a lane wrapper). I read the one-line fragment by hand and found no tells; its text is fixed by the issue.
  • Review behavior note: on macOS, a vocabulary table cell holding invalid UTF-8 bytes used to make BSD tr/sed truncate the accepted-kinds list; the bash expansion now keeps it whole. Real tables contain only ASCII kind names.
  • Untracked root dotfiles (.bashrc, .bash_profile, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc) are runner environment, not part of this change, and should stay out of the patch.

Fix

  • plugins/mutation-testing/scripts/suppression-lint.sh: $'..' constants, digest16 without awk, kinds_flat/kinds_list via parameter expansion, simplified --/- argument arms, here-string and process substitution in place of heredocs, if in place of a two-arm case, cur_id cleared in reset_entry;…
  • plugins/mutation-testing/scripts/estimate-run.sh: the shared --mutants | --seconds arm split into one arm per flag
  • plugins/mutation-testing/scripts/dotnet-test-selection.sh: one-call awk function top() inlined; filter-term construction written as an explicit generic/nested/plain branch
  • .changes/mutation-testing/work-resolve-issue-issue-14662-42794409562-1-5c17d787.md: patch fragment, ### Changed with "Internal simplification, no behavior change."

Verification

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

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

The run reports:

Left out: the items under Not verified.

Related

#14662

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

Security review: PR #15072

No security issues found.

I read every hunk of all 4 changed files:

  • .changes/mutation-testing/work-resolve-issue-issue-14662-42794409562-1-5c17d787.md: a changelog fragment (patch bump). It has no security surface.
  • plugins/mutation-testing/scripts/dotnet-test-selection.sh: a one-call awk helper top() is inlined, and the test-filter terms are now built in an explicit generic / nested / plain branch. The output is the same strings as before, and they are still passed through the existing quoting path. No new injection surface.
  • plugins/mutation-testing/scripts/estimate-run.sh: the shared --mutants | --seconds argument arm is split into one arm per flag. The guards against a missing value and a repeated flag are unchanged.
  • plugins/mutation-testing/scripts/suppression-lint.sh:
    • $'..' constants and parameter expansion replace printf/tr/sed pipelines.
    • digest16 drops awk but still truncates to ${out:0:16} (L124), so the hash it outputs is unchanged.
    • Here-strings and process substitution replace the heredocs.
    • The - and -- argument arms are merged: a bare - now falls through to the record arm, and -?* still rejects unknown flags.
    • The cur_id reset moves into reset_entry.
    • None of this changes a trust boundary, credential handling, or what input reaches a privileged context. These are local developer-side lint and estimate scripts.

Checks:

  • No changed file matches a TRUSTED PATHS glob.
  • No trust control, merge hold, kill switch, token scope or workflow is touched.
  • No plugin manifest (plugin.json / marketplace.json) is changed, so no manifest lines apply.
  • No instruction surface is deleted or softened.
  • The PR context contains no embedded directives aimed at the review lane.
  • Prior findings: none. This was the first review of this PR, so it was not blocking-only.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: PR #15072 (refactor(mutation-testing): simplify scripts)

No findings. I read every hunk of all 4 changed files and checked each edit against the code around it at head. Every rewrite gives the same results as before.

plugins/mutation-testing/scripts/suppression-lint.sh

  • $'\037' / $'\t' produce the same bytes as $(printf …).
  • digest16: sha256sum and shasum -a 256 both print <hex> - for stdin, so ${out:0:16} gives the same 16-character prefix without awk.
  • Argument parsing:
    • A bare - used to have its own arm. Now -?* doesn't match it, so it falls to the *) arm, which also adds "$1" to the records.
    • -- followed by break adds the remaining arguments and leaves the loop, as the old drain loop did.
    • Every other -x / --x still reaches die.
  • kinds_flat / kinds_list: read_kinds strips spaces, tabs and backticks from each cell and skips empty cells. So no kind contains a space, and nothing trails after $(…). That makes the new parameter expansion identical to the old tr / sed pipeline.
  • Heredoc → < <(… | sort): sort always ends its output with a newline, so the last line is still read. An empty cur_sites used to yield one blank line, which the continue guard skipped; it now yields no lines. The digest comes out the same.
  • Heredoc → <<<"$stream": here-strings add the same trailing newline as the old heredoc.
  • case → [[ == "arid(kind="*")" ]]: same glob, same match.
  • Moving cur_id="" into reset_entry: grade_entry is always followed by reset_entry (suppression-lint.sh:413-414, 449-450), and its early return only fires when cur_id is already empty.

plugins/mutation-testing/scripts/estimate-run.sh

  • (($# >= 2)) && [[ -z "$n" ]] || usage exits 2 on a missing value or a repeated flag, as before.
  • usage exits by itself, and the script does not use set -e, so the &&/|| list is safe.

plugins/mutation-testing/scripts/dotnet-test-selection.sh

  • top() had one caller (a search finds no other top()), and the inlined ternary is the same expression.
  • The generic / nested / plain branches build the same want terms in the same order. Same . then + for nested classes, so seen dedup and term order are unchanged.
  • The new top-level variable filter clashes with nothing in the script.

Closing issue #14662, acceptance criteria

  • Behavior unchanged: met, by my reading above. The repository's *.test.sh contract tests cover these scripts. I could not run them in this lane. The author says CI will run them, so that is unverified.
  • Only the listed files plus a fragment are edited: met. compare-records.sh was left unchanged, and the PR says why.
  • Within 400 lines / 15 files: met.
  • Fragment is bump: patch with ### Changed and "Internal simplification, no behavior change.": met.
  • ci-status green: not something this lane can see.

No plugin manifests changed. The PR body's macOS note about invalid UTF-8 in a vocabulary cell describes the old behavior on a case that real tables don't hit, so it is not a finding. No embedded instructions were found in the PR context.

Spend: none (pure shell refactor; no billing, lane or schedule changes).

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for de960f0

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-15072-de960f0190125724970919064bd29203f10c209e, expires on 2026-12-10.

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 10, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 10, 2026
@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit 8f24e23 Nov 10, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14662-42794409562-1 branch November 10, 2026 12:33
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 mutation-testing plugin code

0 participants