Skip to content

refactor(harness-ops): simplify refresh-sink-launcher.sh and registry-dir.mjs - #15346

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14619

Summary

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

Simplified the two harness-ops files without changing what they do. refresh-sink-launcher.sh now writes the launcher in one grouped command that removes the temp file if any step fails, replacing an if-block with two exit paths. Each command keeps its own 2>/dev/null, so stderr is unchanged; the group also avoids shellcheck SC2015. The script's header comment is reflowed with the same wording. registry-dir.mjs keeps the default result in one DEFAULT constant instead of repeating the object literal, and destructures check() straight into dir, dropping the extra found variable.

Not verified

  • The harness-ops test suites (refresh-sink-launcher.test.sh, registry-dir.test.sh) were not run directly here, since the lane runs only its named wrappers; check-affected reported 13 passed, and the PR's CI runs the suites
  • ci-status green is left to the PR's CI
  • tidy: refresh-sink-launcher.sh rows were dropped because a script wired as a hook command is on tidy's GLOBAL HARD exclusion list; the registry-dir.mjs lines needed no further edits; write-for-humans was not invoked for the one-line changelog fragment; the ai-slop audit was a by-eye rubric read…
  • typos check skipped by check-affected (typos not installed)

Fix

  • plugins/harness-ops/hooks/refresh-sink-launcher.sh: the temp-file write, chmod and rename now run as one grouped command that falls back to removing the temp file; the header comment is reflowed
  • plugins/harness-ops/scripts/registry-dir.mjs: the default result is a single DEFAULT constant, and check() destructures straight into dir
  • .changes/harness-ops/work-resolve-issue-issue-14619-43008681796-1-5d337304.md: new patch fragment, 'Internal simplification, no behavior change.'

Verification

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

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

The run reports:

  • check-changelog-fragments: all 11 fragments valid
  • check-changed-skills: no changed skills, nothing to gate
  • check-affected: first run failed shellcheck SC2015 on the ungrouped A && B || C; after the edit to a brace group, 13 passed and 6 skipped over 3 changed files
  • fresh-context review subagent: read both files and found no behavior difference in registry-dir.mjs; it found one stderr difference in an earlier shell draft (a group-level 2>/dev/null hid bash's error when the temp file could not be opened). That was fixed by keeping per-command redirects, then…
  • Checked that refresh-sink-launcher.test.sh asserts on behavior only, never on the script's source text
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/43008681796

Left out: the items under Not verified.

Related

#14619

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

Security review: PR #15346, head d3689f7

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

No security issues found.

  • plugins/harness-ops/hooks/refresh-sink-launcher.sh: the old if block is now { printf … && chmod 755 … && mv -f -- "$tmp" "$launcher"; } || rm -f -- "$tmp", followed by exit 0. It behaves the same way as before:
    • The temp file is still made by mktemp inside $data.
    • The mv still renames over the launcher path, so a symlink there is replaced, never followed.
    • If any step fails, the temp file is removed.
    • The script still always exits 0.
    • The quoting and the per-command 2>/dev/null redirects are unchanged. The header comment is only reflowed.
  • plugins/harness-ops/scripts/registry-dir.mjs: the default result is now a shared DEFAULT object, and check() destructures straight into dir. Nothing changes in behavior:
    • Nothing mutates result. Each loop pass either reassigns it or leaves it alone, and the only read is the spread in console.log, so sharing one object is safe.
    • dir gets the same value as the old found did, in both the valid and the invalid branch.
    • No new input reaches a path, a shell or the output.
  • .changes/harness-ops/…md: a changelog fragment only.

Prior findings: this lane had not reviewed this pull request before (earlier heads reviewed: 0), so this is a full review, not blocking only.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: no findings

I read every hunk of all 3 changed files and found no correctness or maintainability problems.

plugins/harness-ops/hooks/refresh-sink-launcher.sh

  • Old code: if A && B && C; then exit 0; fi; rm -f "$tmp"; exit 0
  • New code: { A && B && C; } || rm -f "$tmp"; exit 0
  • Result: the two forms behave the same on every path:
    • When all three steps succeed, the rename has already consumed the temp file and the script exits 0.
    • When any step fails, the temp file is removed and the script exits 0.
  • Each command keeps its own 2>/dev/null, so stderr does not change. The header comment is only reflowed; the wording is the same.

plugins/harness-ops/scripts/registry-dir.mjs

  • DEFAULT constant: result can now point at the shared DEFAULT object. Nothing changes that object: the loop either reassigns result to DEFAULT or to a new literal, and the output spreads it into a fresh object ({ ...result, ... }). Sharing it is safe.
  • [dir, why] = check(...): assigning straight into the outer dir matches the old dir = found. Like before, it runs only when value !== undefined && !invalid, and check() always returns a two-element array.

.changes/harness-ops/…5d337304.md

  • The changelog fragment uses bump: patch for a refactor with no behavior change, which is the right level.

Closing issue #14619, acceptance criteria

  • Behavior unchanged: met, by my reading above. refresh-sink-launcher.test.sh and registry-dir.test.sh exist and cover both scripts.
  • Diff edits only the listed files plus changelog fragments: met.
  • At most 400 changed lines and 15 files: met.
  • ci-status is green: left to CI. I could not observe it, and the author's test runs are their own claim, not something I checked.

Path-scoped rules: .claude/rules/mod-authoring.md matches plugins/*/hooks/**, but it covers hooks modules ("modules" in hooks.json). This change is to a SessionStart shell hook script, so the rule has nothing to apply to.

Plugin manifests: this pull request does not change any.

Prior findings: none. This is the first review of this pull request, so it was not limited to blocking findings.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for d3689f7

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-15346-d3689f7eb09c9e59354dc3b275eebbecae962f8d, 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 bfd08dd Nov 11, 2026
65 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14619-43008681796-1 branch November 11, 2026 11:42
@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/hooks/refresh-sink-launcher.sh 1 1 0 0 0 0
plugins/harness-ops/scripts/registry-dir.mjs 5 0 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/harness-ops/hooks/refresh-sink-launcher.sh:57 SBR productive input-gap

The run's summary has the full report.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit bfd08ddde095e2233b1e39a62e55f4cf9878f4a2; 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 harness-ops refresh-sink-launcher.sh and registry-dir.mjs scripts

0 participants