Skip to content

refactor(harness-ops): simplify fleet-state and normalize-enabled-plugins scripts - #15023

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14582

Summary

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

Behavior-preserving simplification of two of the three listed harness-ops plugin scripts. fleet-state.sh defined the same version-triple jq function twice, once as version_triple in the selector projection and once as triple in pass 3. It is now one VERSION_TRIPLE_DEF prepended to both jq programs, and emit_one's nested output routing is flattened into one branch. normalize-enabled-plugins.sh inlines its single-use report_project function and shares one require_json helper for the two identical unreadable-JSON refusals. The set +e capture around is_sorted stays because the repo's shellcheck config enables SC2310. jq-capture.sh is already minimal: two small helpers with no redundant work, so it is left unchanged.

Not verified

  • fleet-state.test.sh and other script tests were not run, since this lane cannot run bash or jq directly and check-changed-skills skipped script tests; they are left to the PR's CI
  • ci-status green is a PR CI check, left to the PR's CI
  • jq-capture.sh was reviewed and left unchanged: no behavior-preserving simplification found that makes it shorter or clearer
  • Untracked runner dotfiles in the checkout root (.bashrc, .bash_profile, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc) are not part of this change and should not be included in the patch

Fix

  • plugins/harness-ops/skills/plugins/scripts/fleet-state.sh: the duplicate triple / version_triple jq defs become one VERSION_TRIPLE_DEF prepended to the --from projection program and PASS3_PROGRAM. Pass 3 now calls version_triple. emit_one's output routing is collapsed into a single if/else,…
  • plugins/harness-ops/skills/plugins/scripts/normalize-enabled-plugins.sh: the single-use report_project function is inlined into the --report-project branch, and the two identical jq -e . unreadable-json refusals share a new require_json helper. Messages and exit codes are unchanged.
  • .changes/harness-ops/work-resolve-issue-issue-14582-42778826544-1-16f09257.md: new patch fragment, ### Changed / - Internal simplification, no behavior change.

Verification

The runner ran each check from the base copy against 54a9bb0:

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

The run reports:

  • check-changelog-fragments: all 4 fragments valid
  • check-changed-skills: plugins skill PASS, 0 errors (4 pre-existing size/TOC warnings)
  • check-affected: first run failed shellcheck on SC2310 (an if is_sorted rewrite). I restored the set +e capture, and the re-run passed: 13 passed, 6 skipped (validate-plugins sub-checks and changed-skills skip because they run the checked tree's own code; ruff and typos do not apply)
  • tidy (code-tidying:tidy-diff): passes 1-3 made no edits to the code lines. Pass 4 (write-for-humans) left the fragment unchanged because the issue fixes its wording. Pass 5: ai-slop detect.sh found 0 findings across 1 file
  • review: a fresh-context subagent compared the diff with the HEAD originals for jq def scoping, shell quoting, set -e handling and emit_one routing. It found no correctness issues
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42778826544

Left out: the items under Not verified.

Related

#14582

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

Security review: no security issues found.

critical-findings: 0

I read every hunk of all 3 changed files. None of them matches a trusted-path glob, and the PR touches no trust control, workflow, plugin manifest or standing instruction.

  • plugins/harness-ops/skills/plugins/scripts/fleet-state.sh: two copies of the jq version parser (version_triple and triple) become one VERSION_TRIPLE_DEF string, which is put at the front of both the --from projection program and PASS3_PROGRAM. Both are fixed shell literals, and user-controlled values still reach jq only through --arg/--slurpfile, so no new injection surface. The definition is set unconditionally at top level (line 575), before either program is built or run. I checked the emit_one rewrite case by case and it behaves the same as before:
    • With --ids set and a failing marketplace, the failure block still goes to stderr, so the process-substitution consumer never reads a JSON object as a plugin id for claude plugin update.
    • In every other case a non-empty block goes to stdout.
    • An empty block still prints nothing.
    • The exit code is passed through unchanged.
  • plugins/harness-ops/skills/plugins/scripts/normalize-enabled-plugins.sh: report_project is inlined, and the two identical unreadable-JSON refusals now share a require_json helper. The messages and exit codes (2 on refusal, 0 on report) are unchanged. Paths are still quoted, and the set +e capture around is_sorted is kept.
  • .changes/harness-ops/...md: a changelog fragment only.

Nothing in the PR context file tries to give the lane instructions. This was a full review of the first head this lane has seen, not a blocking-only pass.

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: PR #15023 (refactor harness-ops fleet-state / normalize-enabled-plugins)

No findings. I read every hunk of all 3 changed files, plus the unchanged code each changed line calls.

What I checked

  • fleet-state.sh: one shared VERSION_TRIPLE_DEF.
    • VERSION_TRIPLE_DEF is assigned at the top level (L575), after the jq check. That is before both places that use it: the --from projection (L698) and PASS3_PROGRAM (L1131).
    • Pass 3 appends PROJECTION_PROGRAM after | (L1329). The top-level def is still in scope there, and the projection's local proven_downgrade def still parses in that pipe position.
    • The old pass-3 triple used the capture names x/y/z; the shared def uses maj/min/pat. Both use the same regex and give the same [n, n, n] result. All four triple calls in pass 3 were renamed to version_triple, and no stray triple calls remain in this file.
  • fleet-state.sh, emit_one. The flattened routing matches the old nested version in every case:
    • rc≠0 with --ids: block goes to stderr.
    • rc≠0 without --ids: block goes to stdout.
    • rc=0: stdout, but only when the block is non-empty.
    • The function returns rc in every case; on success that is 0, as before.
  • normalize-enabled-plugins.sh.
    • Inlining report_project keeps the same outputs, stderr text and exit codes. n/sorted_rc become globals, but the branch always exits, so they can't leak into the code after it.
    • require_json prints the same refused: unreadable-json (<path>) message and exits 2, the same as the two checks it replaces.
    • The set +e capture around is_sorted is kept, so a jq failure there (return 2) still reports project-unsorted, as before.

Closing issue #14582 acceptance criteria

  • Behavior unchanged: met by reading the code. The --ids downgrade selectors that call version_triple are exercised by fleet-state.test.sh. I did not run any tests. The PR's verification results and its test plan are the author's claims and are unverified here.
  • Only listed files and a changelog fragment are edited: met. jq-capture.sh is left unchanged, and the PR explains why.
  • Within 400 changed lines and 15 files: met (about 60 lines, 3 files).
  • ci-status green: left to CI; not checkable from this lane.
  • Fragment: .changes/harness-ops/... has bump: patch, ### Changed, and "Internal simplification, no behavior change.": met.

No plugin manifest changes and no embedded instructions in the PR context. This was a full review, not blocking-only (the lane had not reviewed an earlier head).

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head 54a9bb086629e1a78696ba832022702940f33c6e. No person needs to act: a lane clears this reason, and the next scheduled run judges it again.

pr-merge's gate refuses its verifier verdict (verify:missing)

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 54a9bb0

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-15023-54a9bb086629e1a78696ba832022702940f33c6e, 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
Merged via the queue into main with commit 241bb6c Nov 10, 2026
64 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14582-42778826544-1 branch November 10, 2026 08:37
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 241bb6c4bf314ada6a83a83683d7ccc6b82381ef; 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 plugins harness-ops plugin code (2 of 2)

0 participants