Skip to content

refactor(harness-ops): simplify lane-launcher.sh option parsing and config validation (part 1 of 2) - #14892

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14569

Summary

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

Simplified the first half of lane-launcher.sh (lines 1-1131 of 2262 when this part started), without changing behavior. In parse_args, the six options that take a value (--config, --repo, --agents-json, --data-dir, --gate-arm-script, --telemetry-json) each had a space form and an =form copied out separately. They now share two case arms and a new set_valued_opt helper that maps each flag to its variable. In resolve_config, five copies of the 'run jq, exit 3 on failure' guard now go through one config_query helper, and the error text and exit code are the same as before. Every changed function starts in range 1: parse_args, resolve_config and the two new helpers placed just above them. The file is 22 lines shorter.

Not verified

  • lane-launcher.test.sh was not run directly: this lane's Bash runs only the named wrappers. It is left to the PR's CI; check-affected's output does not say whether it ran this suite
  • ci-status green is a PR CI check, left to the PR's CI
  • tidy passes 4 and 5 (markdown writing rules and ai-slop) were skipped for the changelog fragment, because the issue's acceptance criteria fix its body word for word
  • Only range 1 of 2 was simplified (functions starting at lines 1-1131); range 2 is the other part's work
  • The diff is left uncommitted in the working tree as the runner instructs, rather than committed as ci-mode step 3 says

Fix

  • plugins/harness-ops/skills/lanes/scripts/lane-launcher.sh: added set_valued_opt and collapsed the twelve case arms for value-taking options into two; added config_query and routed the five resolve_config validation queries through it; removed a trailing comment that only repeated its warn line;…
  • .changes/harness-ops/work-resolve-issue-issue-14569-42716167310-1-7e82b548.md: patch fragment created by new-changelog-fragment, with body '### Changed' and the line 'Internal simplification, no behavior change.'

Verification

The runner ran each check from the base copy against 9e4e582:

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

The run reports:

  • check-changelog-fragments: all 22 fragments valid
  • check-changed-skills: lanes skill PASS, 0 errors (3 size warnings about SKILL.md that this change did not cause)
  • check-affected: the first run failed shellcheck on SC2249 (set_valued_opt's case had no default arm) and SC2016 (the jq filter in single quotes); after a default arm and a disable comment were added, it reports 13 passed, 6 skipped over 2 changed files
  • fresh-context review subagent: no bugs found. It checked printf -v scoping into the caller's locals, that exit works from a helper not run in a subshell, jq filter quoting including test("[/\\]"), ${1%%=} on --config=a=b and --config=, case-arm order relative to the - catch-all, and that the…
  • git-read diff: the 'lane stage shape' and 'lane schedule' error labels match the old text exactly
  • tidy-diff over the 16 changed hunks: no edits needed
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42716167310

Left out: the items under Not verified.

Related

#14569

Merge-Risk: max=MEDIUM demote=false head=9e4e58294b5dc8b0e94bab248422b5b572b7d339 rubric=8.3.0 rater=claude-opus-5-5 checker=claude-opus-5-5

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

Security review: PR #14892 (head 9e4e5829)

I found no security issues.

Scope. I read every hunk of both changed files:

  • plugins/harness-ops/skills/lanes/scripts/lane-launcher.sh
  • .changes/harness-ops/work-resolve-issue-issue-14569-42716167310-1-7e82b548.md, a changelog fragment that is prose only

Neither file matches a trusted-path glob. The diff touches no trust control, merge hold, plugin manifest or standing instruction.

What I checked in lane-launcher.sh:

  • set_valued_opt and the merged parse_args arms.
    • The space form still calls check_optarg before it reads $2, as before.
    • The = form splits with ${1%%=*} and ${1#*=}. Both are pure parameter expansions with no eval or word splitting. --config=a=b still gives CONFIG=a=b, and --config= still gives an empty value, as before.
    • The new *) return 1 arm can't be reached, because only the six listed flags dispatch to the helper.
    • The values go into the same variables as before, so nothing new is trusted.
  • config_query.
    • jq -r "$3" "$CONFIG" passes the filter as one quoted argument, so the $JQ_VALID_STAGE / $JQ_SCHEDULE_MINUTES prefixes still concatenate into one filter.
    • The filters are hard-coded at each call site and none comes from the config file, so this adds no jq or shell injection path.
    • The function runs in the current shell, not a subshell, so exit 3 on a failed query still rejects the config. The validators still fail closed.
    • The target names given to printf -v "$1" are fixed literals that the caller declares local. None of them clashes with the helper's own local out.
  • The removed comment on the stage warn line. It was a trailing code comment, not a standing instruction.

No PR context or issue text tried to direct the review. The closing issue's body was omitted by the wrapper because its author is not on the allowed list.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Code review: no findings

This is a refactor that should not change behavior. It adds two helpers to lane-launcher.sh:

  • set_valued_opt replaces twelve copied case arms for the six options that take a value.
  • config_query replaces five copies of the "run jq, exit 3 on failure" check in resolve_config.

How I checked that behavior is unchanged. I read the head file, not just the diff.

  • Option parsing.
    • ${1%%=*} cuts at the first =, so --config=a=b gives flag --config and value a=b. The old ${1#*=} gave the same value.
    • The =* arms still come before the -* catch-all (L482-L509).
    • check_optarg ... || exit 3 still runs in parse_args, not in a subshell, so its exit still stops the script.
  • Config validation.
    • config_query runs in the caller's shell, so its exit 3 still stops the script.
    • printf -v writes into resolve_config's locals. They are all declared before the first call (L623). None of them is named out, so none is hidden by the helper's own local.
    • $(...) drops trailing newlines as before.
    • All five error labels match the old text.
    • Each jq filter is the same text as before. Only how it is passed changed: jq now gets it through "$3". So the stub in lane-launcher.test.sh that matches on the filter text still finds group_by, test("[/ and .key == "effort", and its "validation query failed (…)" assertions still hold (L292-L308).
    • The SC2016 disable comment is right: $i is a jq variable. It is needed now that the filter is passed to a shell function instead of to jq directly.

Closing issue #14569, acceptance criteria:

  • Behavior unchanged: met, by the reading above. I did not run the tests; I had no shell.
  • Only the listed file and changelog fragments are edited: met.
  • Within 400 changed lines: met, about 50 lines.
  • Fragment bump: patch with ### Changed and the exact line "Internal simplification, no behavior change.": met.
  • Only functions that start in range 1 (lines 1-1131) are changed: met. The changed functions start at lines 457, 472, 580 and 589.
  • ci-status green: I can't check this from the lane; it is left to the PR's CI.

The PR's statement that lane-launcher.test.sh passes and the check-affected results are the author's claims. I did not confirm them.

No plugin manifest changed, no .claude/rules/ file applies, and the PR context had no instructions aimed at the reviewer.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 9e4e582

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-14892-9e4e58294b5dc8b0e94bab248422b5b572b7d339, expires on 2026-12-09.

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
Merged via the queue into main with commit 8082fb7 Nov 10, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14569-42716167310-1 branch November 10, 2026 01:08
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 6, survived 1, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 86%; mutation score 86%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/harness-ops/skills/lanes/scripts/lane-launcher.sh 6 1 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/harness-ops/skills/lanes/scripts/lane-launcher.sh:488 other productive input-gap

The run's summary has the full report.

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 lane-launcher.sh harness-ops plugin code (part 1 of 2)

0 participants