Skip to content

refactor(harness-ops): simplify lanes machine-behavior, probe-lane-config and restart-consumer scripts - #15263

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14572

Summary

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

Simplified the three lanes scripts without changing behavior. restart-consumer.sh replaced 13 pairs of repeated --flag value / --flag=value parse branches with one set_opt helper that validates the integer options, removed a duplicated comment in acquire_lock and merged two return guards. machine-behavior.sh did the same for its three options and dropped a redundant per-entry jq unique (a later add | unique already de-duplicates). probe-lane-config.sh inlined its single-use repo_root helper. Help text (the header comments usage() prints), flags, messages, exit codes and outputs are unchanged.

Not verified

  • The scripts' test suites (machine-behavior.test.sh, probe-lane-config.test.sh, restart-consumer.test.sh) were not executed: this lane runs no test runner. Left to the PR's CI.
  • ci-status green is a PR CI check; left to the PR's CI.
  • tidy ran passes 1-3 and 5 with no edits; pass 4 (docs-hygiene write-for-humans) was skipped because the only markdown is the changelog fragment, whose body text the issue mandates verbatim. Proposal not applied: restart-consumer.sh's set_opt one-line comment may be class A (restates the code); a…
  • Untracked home-directory dotfiles in the checkout (.bashrc, .gitconfig, .mcp.json, .idea, .vscode, ...) are runner environment artifacts, not part of this change, and were left out of the tidy measurement.
  • Left uncommitted in the working tree as the runner instructs; the runner turns it into the patch.

Fix

  • plugins/harness-ops/skills/lanes/scripts/restart-consumer.sh: one set_opt helper and two parse branches replace 26 per-option branches; removed a duplicate comment in acquire_lock; merged the NO_TELEMETRY/DRY_RUN guards in upsert_own_telemetry
  • plugins/harness-ops/skills/lanes/scripts/machine-behavior.sh: set_opt helper and two parse branches replace six; dropped the redundant inner jq unique in plugin_versions
  • plugins/harness-ops/skills/lanes/scripts/probe-lane-config.sh: inlined the single-use repo_root function
  • .changes/harness-ops/work-resolve-issue-issue-14572-42959427989-1-28e27651.md: patch fragment, ### Changed / "Internal simplification, no behavior change."

Verification

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

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

The run reports:

  • check-changelog-fragments: all 21 fragments valid
  • check-changed-skills: lanes skill PASS, 0 errors (3 pre-existing size warnings)
  • check-affected: first run failed shellcheck SC2249 (no default case in the new set_opt helpers); added *) ;; defaults; re-run 13 passed, 6 skipped, 0 failed
  • fresh-context review subagent: no behavior difference found across flags (both forms), values containing '=', empty equals values, case-pattern ordering, exit from set_opt, set -u with arrays, or the jq change. Its only note is non-observable in practice: outside a git repo, a working directory…
  • ai-slop detect.sh on the changelog fragment: 0 findings
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42959427989

Left out: the items under Not verified.

Related

#14572

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

Security review: PR #15263 (head b2393e65)

I found no security issues. I read every hunk of all 4 changed files. None of them matches a trusted-path glob, and no plugin manifest, workflow, trust control, merge hold or standing instruction changes.

What the change does:

  • Option parsing in restart-consumer.sh and machine-behavior.sh. Repeated --flag value / --flag=value branches become one set_opt helper per script. I checked whether this changes behaviour:
    • The integer options (--telemetry-issue, --max-restarts, --window-hours, --interval-minutes, --now) still go through check_uint in both forms, with the flag name (${1%%=*}) as its label.
    • set_opt is called directly, not in a subshell, so || exit 3 still ends the script.
    • The space form still runs check_optarg / require_value first, and the = form still skips it, as the base did.
    • The strings these options take (--config, --launcher, --data-dir, --agents-json, --telemetry-json, --repo, --plugin) are assigned exactly as before, so nothing new reaches a path or command.
  • jq in machine-behavior.sh. Dropping the per-entry unique changes nothing, because the later add | unique still removes duplicates. This is not security-relevant.
  • probe-lane-config.sh. The single-use repo_root helper is now inline. It still falls back to $PWD, as before.
  • acquire_lock comment. The removed text is an explanatory code comment, not a standing instruction (CLAUDE.md, rule, skill or agent body, or hook list). The lock-stamp logic it described is unchanged.
  • NO_TELEMETRY / DRY_RUN guards. ((NO_TELEMETRY || DRY_RUN)) && return 0 is the same as the two separate guards it replaces.

The PR context file holds no embedded directives aimed at this lane.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: no findings

I read all four changed files in full and checked the edited code against the head files. Every change keeps the old behavior:

  • machine-behavior.sh: The space form of each option still calls require_value before set_opt. The = form still skips that check, as it did before.
    • ${1%%=*} and ${1#*=} split a value that contains = the same way the old code did. For example, --repo=a=b gives the name --repo and the value a=b.
    • The old per-entry unique in plugin_versions was redundant, because map(.versions) | add | unique at line 77 already removes duplicates.
  • restart-consumer.sh: Space-form options still run check_optarg first, and =-form options still skip it.
    • The integer options still run check_uint, with the same option name in the error message and the same exit 3.
    • exit 3 inside set_opt still ends the script, because parse_args is called directly, not in a subshell.
    • The comment removed from acquire_lock is still in the function's header comment at line 623.
    • ((NO_TELEMETRY || DRY_RUN)) && return 0 behaves the same as the two separate guards it replaces.
  • probe-lane-config.sh: repo_root had only the one caller, and the inlined code gives ROOT the same value.
  • Changelog fragment: It has bump: patch, a ### Changed heading and the exact line the issue requires.

The new set_opt helpers copy a pattern the repository already uses in telemetry-upsert.sh (telemetry-upsert.sh#L198-L217), so they don't add a second way of doing the same thing.

Closing issue #14572, acceptance criteria

  • Behavior unchanged: met, judged by reading the code. Nothing was run. The tests that would catch a regression are the existing machine-behavior.test.sh, probe-lane-config.test.sh and restart-consumer.test.sh; the PR says it did not run them and leaves that to CI.
  • Only the listed files and fragments edited: met.
  • Within 400 lines and 15 files: met.
  • ci-status green: I can't check CI status from this lane. The author's verification results are their own claims, not confirmed here.
  • Fragment with the required body: met.

No plugin manifest changed. Nothing in this change creates a cost or a security hold.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for b2393e6

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-15263-b2393e65d085e747a80f7cababfe399c965965b2, 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 e0f6ded Nov 11, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14572-42959427989-1 branch November 11, 2026 05:00
@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/lanes/scripts/machine-behavior.sh 3 0 0 0 0 0
plugins/harness-ops/skills/lanes/scripts/probe-lane-config.sh 1 0 0 0 0 0
plugins/harness-ops/skills/lanes/scripts/restart-consumer.sh 1 2 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/harness-ops/skills/lanes/scripts/restart-consumer.sh:297 SBR productive input-gap
plugins/harness-ops/skills/lanes/scripts/restart-consumer.sh:1186 LCR productive no-assertion

The run's summary has the full report.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

0 participants