Skip to content

refactor(songwriting): simplify datamuse.sh - #15267

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14760

Summary

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

Simplified plugins/songwriting/context/pat-pattison/scripts/datamuse.sh without changing its behavior. The five rel_<mode> cases whose mode name equals the relation code (syn, ant, trg, jja, jjb) now share one case arm. The single-use LIMIT and api variables are gone: max reads ${LIMIT:-25} directly and fetch carries the endpoint URL inline. The family pipeline now fits on one line. The header comment block is untouched because usage() prints it, and the near/cons command substitutions are kept so a failed first request still stops family before jq runs.

Not verified

  • plugins/songwriting/context/pat-pattison/scripts/datamuse.test.sh was not executed here (the lane runs no interpreter); left to the PR's CI
  • tidy passes 4 and 5 (docs-hygiene and ai-slop on the changelog fragment) skipped: the issue's acceptance criteria fix the fragment text word for word. Passes 1-3 ran and found nothing to change.
  • review-venue.txt was absent, so the local fresh-context subagent review stood in for the CI code-review lane
  • ci-status green is an acceptance criterion the PR's CI decides

Fix

  • plugins/songwriting/context/pat-pattison/scripts/datamuse.sh: merged the syn/ant/trg/jja/jjb case arms into one arm that builds query=rel_$MODE=$word; dropped the LIMIT reassignment and the max=$LIMIT copy in favor of max="${LIMIT:-25}"; inlined the single-use api variable into fetch(); joined the…
  • .changes/songwriting/work-resolve-issue-issue-14760-42962469891-1-0765d9a5.md: new patch fragment, '### Changed' with 'Internal simplification, no behavior change.'

Verification

The runner ran each check from the base copy against 0cc8f5e:

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

The run reports:

  • check-changelog-fragments: all 23 fragments valid
  • check-changed-skills: no changed skills, nothing to gate
  • check-affected: 13 passed, 6 skipped (typos not installed; validate-plugins substeps that run checked-tree code are left to CI), 0 failed
  • datamuse.test.sh contract read against the new script: the mode-to-query table, the max=25 default, LIMIT override, the syllables max=5 pin, the '+' joining, the family two-request merge, and the transport-failure exit propagation all go through code paths that build the same strings and exit codes…
  • fresh-context review subagent over the diff: found no difference on normal paths. It flagged that a here-string needs a temp file where the echo pipe does not, so that edit was reverted to the echo pipe. It also flagged that an inherited empty LIMIT is no longer rewritten to 25 in the child…
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42962469891

Left out: the items under Not verified.

Related

#14760

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

Code review: no findings. I read the full diff for both changed files and the whole datamuse.sh at head.

Behavior check on plugins/songwriting/context/pat-pattison/scripts/datamuse.sh

  • Merged case arm. syn | ant | trg | jja | jjb) query="rel_$MODE=$word" produces exactly the old rel_syn / rel_ant / rel_trg / rel_jja / rel_jjb strings. $MODE can only be one of those five literals inside that arm.
  • max. max="${LIMIT:-25}" gives the same value as the old LIMIT="${LIMIT:-25}"; max="$LIMIT", including when LIMIT is empty or unset. syllables still pins max=5.
  • Dropped LIMIT rewrite. The script no longer rewrites an inherited empty LIMIT to 25. Nothing can see that difference: the only child processes are curl and jq, and neither reads LIMIT.
  • fetch(). It now has the endpoint URL inline and builds the same request string. It still reads $max when it runs, after max is set, so the function being defined above the assignment does not matter.
  • family. The pipeline joined onto one line runs the same command. The two command substitutions are kept, so under set -e a failed first request still exits before jq runs.

Closing issue #14760 acceptance criteria

  • Behavior unchanged: met, by the reading above.
  • Edits only the listed file plus a changelog fragment: met.
  • Within 400 lines and 15 files: met.
  • Patch fragment with ### Changed and "Internal simplification, no behavior change.": met in .changes/songwriting/work-resolve-issue-issue-14760-42962469891-1-0765d9a5.md.
  • ci-status green: left to CI. I did not run it.
  • Test coverage: the author says datamuse.test.sh covers the mode-to-query table, the LIMIT default and override, and the family merge. That is the author's claim; I did not check or run it here.

Other checks

  • No plugin manifest changed.
  • No path-scoped rule under .claude/rules/ matches the changed files.
  • No changed file is on the trusted-path list.
  • Nothing in the PR context tried to give the review instructions.

@github-actions

Copy link
Copy Markdown
Contributor

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

Security review: PR #15267 (refactor(songwriting): simplify datamuse.sh)

I found no security issues in this change.

Scope: I read both changed files in full: plugins/songwriting/context/pat-pattison/scripts/datamuse.sh and the new changelog fragment .changes/songwriting/work-resolve-issue-issue-14760-42962469891-1-0765d9a5.md. Neither file matches a trusted-path glob. The change touches no trust control, plugin manifest or standing instruction.

What I checked:

  • The merged case arm (syn | ant | trg | jja | jjb) query="rel_$MODE=$word"): $MODE can only reach that arm as one of those five literal values, so rel_$MODE builds the same five strings as before. No new value reaches the request URL.
  • The inlined endpoint in fetch(): the URL is the same hard-coded https://api.datamuse.com/words as before. Since the api variable is gone, nothing in the environment can change where the request goes.
  • max="${LIMIT:-25}": the value reaches the query string as it did before. That LIMIT is unvalidated is pre-existing, not something this PR adds. The only behavior change is that an empty LIMIT inherited by a child process is no longer rewritten to 25, and that has no security effect.
  • The family pipeline joined onto one line: no change in meaning. $near and $cons are still quoted in echo, and the command substitutions still stop the script under set -e if a request fails.
  • The changelog fragment: plain text with nothing that runs.

PR context: contains no embedded instructions aimed at this lane.

critical-findings: 0

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 0cc8f5e

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-15267-0cc8f5e53375b5754fe06f40a5909ee01efa0ff6, 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 bec2266 Nov 11, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14760-42962469891-1 branch November 11, 2026 05:24
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit bec226628c64da36c3ca0f6ed48e280b712a90af; 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 datamuse.sh songwriting plugin code

0 participants