Skip to content

refactor(harness-ops): simplify sync-run.sh, part 2 of 2 - #15356

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14587

Summary

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

Simplified the functions that start in the second half of sync-run.sh (original lines 1727-3452, of 3452), with no change in behavior. Three new helpers (withheld_add, us_failed_add, ir_stopped_add) build the withheld-downgrade, user-scope failure and Step 2 stopped-path rows. Each replaces two copies of the same jq row builder in run_marketplace and produces byte-identical JSON. The one-per-line local declarations in run_marketplace, recover_pending, install_one, run_install_step, run_enable_step, enable_one, cache_content_block, finalize_moves, monitor_rows and emit_marketplace_block are merged. An initializer that uses $mp stays in its own statement, because bash expands every word before local runs. Also dropped: the unused ncur copy in finalize_moves, a then : else-branch in Step 5b, and an if-block in install_one, now one && line. sync-run.sh goes from 3452 to 3379 lines (45 added, 118 removed).

Not verified

  • plugins/harness-ops/skills/plugins/scripts/sync-run.test.sh was not run: this lane can run no interpreter or test runner, so the suite is left to the PR's CI
  • ci-status green is a PR CI check, left to the PR's CI
  • tidy passes 4-5 (docs-hygiene writing rules, ai-slop fix) skipped for the changelog fragment: its only body line is the text the issue requires verbatim, so no rewrite is allowed. Passes 1-3 ran with no edits.
  • typos check skipped by check-affected: typos is not installed in this lane

Fix

  • plugins/harness-ops/skills/plugins/scripts/sync-run.sh: added withheld_add, us_failed_add and ir_stopped_add, and replaced the two duplicate inline row builders for each in run_marketplace; merged per-line local declarations in the range-2 functions; removed the ncur temporary in finalize_moves,…
  • .changes/harness-ops/work-resolve-issue-issue-14587-43014401043-1-8b823a9a.md: new patch fragment, ### Changed / - Internal simplification, no behavior change.

Verification

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

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

The run reports:

  • check-changelog-fragments: all 13 fragments valid (run before and after tidy)
  • check-changed-skills: plugins/harness-ops/skills/plugins PASS, 0 errors, 4 warnings, all about files this change does not touch: SKILL.md size and description length, and context/converge.md having no table of contents
  • check-affected: 13 passed, 6 skipped (ruff: no .py; typos: not installed; 3 validate-plugins checks and changed-skills skipped as code from the checked tree), over 2 changed files
  • fresh-context review subagent over the whole diff: no behavior changes found. It checked merged-local initializer expansion, dynamic-scope shadowing of out/reason, byte-identical JSON and key order for the three helpers, the && rewrite under set -uo pipefail, and that sync-run.test.sh…
  • range check: every changed function starts at or after line 1727 of the 3452-line original (run_marketplace 1833, recover_pending 2266, install_one 2301, run_install_step 2323, run_enable_step 2402, enable_one 2459, cache_content_block 2482, finalize_moves 2540, monitor_rows 2912,…
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/43014401043

Left out: the items under Not verified.

Related

#14587

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

Security review: PR #15356, refactor(harness-ops): simplify sync-run.sh, part 2 of 2

No security issues found. I read every hunk of both changed files.

What the change does. It refactors plugins/harness-ops/skills/plugins/scripts/sync-run.sh and adds a changelog fragment. Specifically:

  • Three helpers, withheld_add, us_failed_add and ir_stopped_add, replace jq row builders that appeared twice each.
  • One-per-line local declarations are merged.
  • An unused temporary (ncur) is dropped.
  • A then : branch is inverted to !=.
  • An if block becomes a single && line.

What I checked:

  • Injection. Each new helper passes every caller value to jq -n as --arg (or --argjson for the integer CLI_RC). The values are never interpolated into the jq program text. That matches the inline builders they replace, so no new injection path into jq or the shell opens. The reason strings given to ir_stopped_add are fixed literals, now passed as --arg $reason where before they were jq string literals. Same output, no added exposure.
  • Shell expansion. The merged local lines still quote every positional initializer ("$1", "$2"). The $RUN_DIR/... paths that depend on $mp stay in their own statements. No variable starts expanding unquoted.
  • Mutating CLI calls. The claude plugin update, install and enable calls are unchanged. Every failure branch still records its row and continues, so no failure path is skipped or turned into a success.
  • Trust controls. No file matches the TRUSTED PATHS list, and the diff touches no trust control, merge hold, token scope, kill switch or plugin manifest. No manifest lines apply.
  • Standing instructions. No standing instruction is deleted or softened. The changelog fragment only says "Internal simplification, no behavior change."

PR context. The context file contains no embedded instructions aimed at this lane. It notes that the closing issue's body was left out because its author is not on the allowed-author list. That is the wrapper's filter at work, not a finding.

Prior findings. This is the lane's first review of this PR: 0 earlier heads, blocking only: no.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: #15356, refactor(harness-ops): simplify sync-run.sh, part 2 of 2

No findings. I read both changed files in full: sync-run.sh and the new changelog fragment.

What I checked

  • The three new helpers produce the same JSON.
    • withheld_add and us_failed_add build the same objects as the inline code they replace, with the same keys in the same order.
    • ir_stopped_add used to embed the reason as a jq string literal. It now passes the reason with --arg reason. The output is identical, and the key order (id, scope, rc, output, path, stopped, reason) is kept.
  • us_failed_add has its own local reason out. So run_marketplace no longer sets its own reason/out on the two user-scope failure paths. Both call sites continue right after the call. The only other place run_marketplace reads reason/out (around sync-run.sh:2017-2021) assigns both just before using them, so nothing reads a stale value.
  • Merged local lines under set -uo pipefail (sync-run.sh:221).
    • install_one and enable_one dropped the reason="" initializer. Both assign reason=$(cli_outcome_line …) before reading it, and enable_one's audit branch never reads it, so set -u cannot report an unbound variable.
    • Initializers that use $mp (post=, pre_refresh=, report=) still sit in their own local statements, after mp is assigned.
    • monitor_rows declares the same set of locals as before, so the name it writes through printf -v "$__var" still lands where it did.
  • Control flow.
    • install_disabled_notice … && disabled="true" is not the last command in install_one, and the script has no set -e or ERR trap, so the function's exit status is unchanged.
    • The Step 5b if [[ … != "true" ]] is a straight inversion of the old empty then : / else.
    • Removing ncur in finalize_moves is a straight substitution of $post_v.

Closing issue #14587 criteria

  • Behavior unchanged: I found no behavior change by reading the code. I did not run anything. That sync-run.test.sh passes is left to CI; the PR body says it was not run.
  • Only the listed file plus a changelog fragment: met.
  • ≤ 400 changed lines: met (45 added, 118 removed).
  • Fragment: met. It has bump: patch, ### Changed, and the required line verbatim.
  • Only range-2 functions changed: met. The new helpers sit after fleet_read, and every edited function starts after line 1727 of the original file.
  • ci-status green: the PR's CI decides this; I did not check it.

The verification commands and output in the PR body are the author's claims; I did not confirm them.

I saw no embedded instructions in the PR context, and there were no prior findings to carry over. No plugin manifest changed.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for a8c21db

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-15356-a8c21db9873d3409db596087a4c72f8f25a52d5a, 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 62b4712 Nov 11, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14587-43014401043-1 branch November 11, 2026 13:01
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 62b4712f34c04f1b6bb419b593bb20f70acff656; 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 sync-run.sh harness-ops plugin code (part 2 of 2)

0 participants