Skip to content

refactor(context7): simplify lookup update.sh - #15309

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14436

Summary

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

Simplified plugins/context7/skills/lookup/scripts/update.sh without changing behavior. verify_ctx7_callable uses guard clauses. check_skill_drift runs one diff -u instead of diff -q followed by diff -u, which drops a second comparison of the same files. The maintainer hint now reuses $SKILL_MD, the master-commit lookup sits next to the check that uses it, and the refresh-baseline condition is a single [[ ]]. A fresh-context review found two edge-case behavior changes in an earlier draft: an inherited CLI_DRIFT environment variable, and install_and_verify's status when stdout can't be written. Both edits were reverted, so behavior is unchanged on those paths too.

Not verified

  • update.test.sh (plugins/context7/skills/lookup/scripts) was not executed here: this lane runs only the named wrappers. Left to the PR's CI
  • ci-status green: left to the PR's CI
  • tidy passes 4 and 5 (markdown) skipped for the changelog fragment: the issue sets its body word for word, so a prose rewrite is not allowed
  • cant-fail-scan not applicable: it scans test files and no test changed

Fix

  • plugins/context7/skills/lookup/scripts/update.sh: guard clauses in verify_ctx7_callable (it now returns 1 for both failures; callers only test success); one diff -u replaces diff -q plus diff -u in check_skill_drift; $SKILL_MD reused in the integrate hint; UPSTREAM_SHA resolution moved beside its…
  • .changes/context7/work-resolve-issue-issue-14436-42989247789-1-b399312b.md: patch fragment with '### Changed' and 'Internal simplification, no behavior change.'

Verification

The runner ran each check from the base copy against 4b73044:

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

The run reports:

  • check-changelog-fragments: all 6 fragments valid (run before and after tidy and the review reverts)
  • check-changed-skills: lookup PASS, 0 errors, 2 warnings already on main (no '## Next' section, description length 491)
  • check-affected: 13 passed, 6 skipped over 2 changed files
  • fresh-context review subagent over the whole diff: 2 edge-case behavior changes found (inherited CLI_DRIFT env var; install_and_verify status when stdout write fails); both edits reverted. It confirmed the remaining edits keep output, stderr and exit codes the same
  • tidy-diff (code-tidying:tidy-diff): passes 1 to 3 found nothing to change in the listed lines
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42989247789

Left out: the items under Not verified.

Related

#14436

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

Security review: PR #15309 (refactor(context7): simplify lookup update.sh)

I found no security issues.

I read every hunk of both changed files:

  • .changes/context7/…-b399312b.md: a changelog fragment with a patch bump. It has no security surface.
  • plugins/context7/skills/lookup/scripts/update.sh: a maintainer script refactor.
    • verify_ctx7_callable: the checks are now guard clauses, and an empty version now returns 1 instead of 2. It still fails closed: a failure prints nothing to stdout and returns non-zero.
    • check_skill_drift: one diff -u, whose exit status drives the branch, replaces diff -q followed by diff -u. Nothing new gets interpolated or run.
    • Integrate hint: it now prints $SKILL_MD, a path the script sets itself.
    • UPSTREAM_SHA: the git ls-remote lookup moved below the function definitions. It still runs before the ^[0-9a-f]{40}$ check, and that check still gates the value before it reaches the sed -E substitution, so upstream ref data still has no new injection path into sed or the shell.
    • Refresh condition: the --refresh-baseline test is now one [[ … && … ]] with the same meaning.

Neither file matches a trusted-path glob, and the diff touches no trust control, merge hold, manifest, workflow or instruction surface. The PR context contains no embedded directives aimed at this lane.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: refactor(context7): simplify lookup update.sh

I found nothing to block or flag. I read both changed files in full (the changelog fragment and plugins/context7/skills/lookup/scripts/update.sh) and checked each change against #14436's rule that behavior stays the same. I ran nothing. CI status and update.test.sh results are still up to the PR's CI.

Behavior checks, one per change:

  • verify_ctx7_callable uses guard clauses. An empty --version now returns 1 where it used to return 2. Both callers only check for success: INSTALLED=$(verify_ctx7_callable) || ... at update.sh#L81 and if ! new_version=$(verify_ctx7_callable) at #L70. So no caller can tell the two codes apart.
    • With the explicit return 0 gone, the function now returns printf's status. Its output is only ever captured by a command substitution in the same shell, so that status can't change any outcome.
  • One diff -u replaces diff -q followed by diff -u. Results are sorted the same way: exit 0 means unchanged, and exit 1 or 2 takes the drift path, just as before.
    • On stderr, the old diff -q hid its errors and the old diff -u printed them. The new diff -u prints them the same way, so the user sees the same error text.
    • The script runs without -e (#L22), so putting the assignment inside the if changes nothing.
  • UPSTREAM_SHA lookup moved. It now runs after the check_skill_drift definition instead of before it. Only a function definition sat between the old and new spots, and nothing reads UPSTREAM_SHA before the if that now follows it. The git ls-remote call, its output and the order of commands are unchanged.
  • $SKILL_MD in the maintainer hint. It is set to "$SKILL_DIR/SKILL.md" at #L35, so the printed text is the same.
  • Refresh-baseline condition as a single [[ ... && ... ]]. This is equivalent to the old form.

Closing issue #14436, acceptance criteria:

  • Behavior unchanged: met, as above. The existing update.test.sh checks the drift, unchanged, missing-baseline and refresh-baseline paths (for example the drift message at line 104 and the commit stamp at line 158), so a regression on those paths would fail it.
  • Diff edits only the listed file and changelog fragments: met.
  • At most 400 changed lines and 15 files: met (2 files, about 30 lines).
  • ci-status green: still up to the PR's CI; I didn't verify it.
  • Fragment for context7 with ### Changed and "Internal simplification, no behavior change.": met, with bump: patch.

No plugin manifest changed, so there are no manifest lines. No .claude/rules/ file applies to these paths.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 4b73044

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-15309-4b73044533f7a2f420b4557758e9e06809ddd927, 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 3c28950 Nov 11, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14436-42989247789-1 branch November 11, 2026 09:29
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 3c289504c3b28b0d54d34374f4384802691a76c5; 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 update.sh context7 plugin code

0 participants