Skip to content

refactor(scripts): resolve validate-plugins' overlap interpreter through python-probe - #15443

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #15436

Summary

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

scripts/lib/python-probe.sh now has python_probe::find_to <out-var> <floor>. It holds the one copy of the python3/python search loop, including the WindowsApps stub skip and the floor check. It assigns the first passing interpreter, or the empty string and return 1 when none passes. require_to now calls find_to and still ends FAIL/exit 1 and SKIP/exit 0. validate-plugins.sh sources the lib from its own tree and calls find_to with 2>/dev/null in place of its own loop, keeping its error: messages and exit 2. Design choice: find_to assigns with printf -v and lowercases with tr, not a nameref and ${var,,}. Those bash-4-only features would have broken validate-plugins.sh on bash 3.2, which the script still allows for (its ${only[]+...} guards and tr lowering). It also drops require_to's local -n.

Not verified

  • Test suites for require_to callers (scripts/.test.sh, plugins/testing/evals/ui-defects/.test.sh) and validate-plugins.sh were not executed here (the lane cannot run interpreters); left to the PR's CI
  • ci-status green is a PR CI check; left to the PR's CI
  • tidy not run: the change touches scripts/, a listed shared path for the tidy cutoffs
  • Review note kept, not fixed: if tr itself failed, find_to's WindowsApps check would not match (the old ${var,,} could not fail). validate-plugins.sh already had this exposure and it needs a missing or broken tr

Fix

  • scripts/lib/python-probe.sh: add python_probe::find_to (the search loop, assigning via printf -v); require_to calls it instead of its own loop and no longer declares a nameref; usage and scoping comments updated
  • scripts/validate-plugins.sh: source scripts/lib/python-probe.sh from SCRIPT_DIR (|| exit 1); replace the native-overlap interpreter loop with python_probe::find_to OVERLAP_PYTHON "$OVERLAP_FLOOR" 2>/dev/null; error message, exit 2 and floor parse unchanged

Verification

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

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

The run reports:

  • check-changelog-fragments: all 15 fragments valid (no fragment needed; scripts/ is not a plugin)
  • check-changed-skills: no changed skills, nothing to gate
  • check-affected: first run failed shellcheck SC2154 (OVERLAP_PYTHON referenced but not assigned); fixed by initializing OVERLAP_PYTHON="" before the call; re-run: 10 passed, 6 skipped over 2 changed files
  • fresh-context review subagent: no correctness bugs and no behavior change for the 11 require_to callers (all set -euo pipefail, bare-statement calls) or validate-plugins.sh; one low finding fixed (added || exit 1 to the source line so an unreadable lib cannot surface as a misleading 'Python not…
  • diff size: 2 files, 71 changed lines (31+/16- and 7+/17-)
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/43106078743

Left out: the items under Not verified.

Related

#15436

Follow-ups

  • Pre-existing (advisory): **Advisory: no test can fail if this function's behavior changes.** Issue #15436 says: "Behavior is unchanged: the same outputs, exit codes and printed results for the same inputs in both scripts." Th (thread)

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

Security review: PR #15443 (head 6572356)

No security issues found. I read every hunk of both changed files: scripts/lib/python-probe.sh and scripts/validate-plugins.sh. Neither file matches a trusted-path glob, and neither is a trust control, merge hold, manifest or instruction surface.

What I checked:

  • Code injection through -c (existing pattern, now in one place). find_to still puts '$_pp_floor' into the python -c string. Both callers build the floor from the engine file with the sed pattern s/^MIN_PYTHON = (\([0-9]*\), \([0-9]*\)).*/\1.\2/p, which can only produce digits and a dot. That engine is checked-in repository code, gated by runs_checked_code in validate-plugins.sh, so the floor string cannot carry a quote or code. The loop's behaviour is the same as the two copies it replaces.
  • printf -v "$1" out-var. This replaces the old nameref. The name comes from the caller: OVERLAP_PYTHON in validate-plugins.sh, and require_to's own $1 for the other callers. The _pp_ prefix on the locals prevents shadowing. No outside input reaches the variable name.
  • New source in validate-plugins.sh. The library is loaded from $SCRIPT_DIR, before the cd to CHECK_DATA_ROOT. So in foreign-data mode the shell code comes from the trusted script tree, not from the data root. That keeps the data-root/code-root separation, and || exit 1 stops the script if the library can't be read.
  • WindowsApps stub skip. It's kept, and now uses tr lowercasing. This only affects reliability (it avoids starting the Store alias), not security.

No manifest lines apply: the diff touches no plugin.json or marketplace.json. The PR context contains no embedded instructions aimed at this lane. Spend: none beyond the normal CI runs.

critical-findings: 0

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 1 inline finding(s) on 6572356035de83896d85812f70262583639e5ca1; the summary is in this lane's pull request comment.

claude-lane: claude-review

Comment thread scripts/lib/python-probe.sh Resolved
@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: PR #15443 (head 6572356)

I found no correctness bugs. I read every hunk of both changed files, and the full head versions of scripts/lib/python-probe.sh and scripts/validate-plugins.sh.

What I checked

  • require_to's results are unchanged. An unparsable floor still prints FAIL: and exits 1. No interpreter still prints SKIP: Python <floor>+ not found and exits 0. All 11 require_to callers use the out-var name PYTHON as a global, and none uses a _pp_ name, so printf -v "$1" reaches the same variable the old nameref did. The search loop now runs inside an if, so errexit is off there. The only effect is on a failing tr, which the PR body already names.
  • validate-plugins.sh keeps its contract. It keeps the floor parse, both error: messages, exit 2, and the 2>/dev/null. It now applies that redirect to the whole find_to call, which only adds command -v's stderr, and that was already being dropped. Nothing later in the script read the old loop's globals (candidate, resolved, lower). The library is sourced from SCRIPT_DIR, the tooling tree, not from CHECK_DATA_ROOT, so a foreign checked tree still cannot inject probe code.
  • Bash 3.2. The lib no longer uses local -n or ${var,,}. printf -v has been available since bash 3.1.

Closing issue #15436, criterion by criterion

  • "The search loop exists once, in scripts/lib/python-probe.sh, and validate-plugins.sh uses it": met.
  • "Behavior is unchanged…": met by reading the code. The test gap is in the inline comment.
  • "The diff edits only the listed files…": met (2 files).
  • "within 400 changed lines and 15 hand-edited files": met.
  • "ci-status is green": I could not check this. The PR says CI will check it and I have not confirmed it.

The author's verification claims (check-affected, the review subagent, test suites) are their own and I did not re-run them. This lane has no shell.

No .claude/rules/ path rule applies, no plugin manifest changed, and there is no paved-path concern.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 1 of max 4 on 6572356.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 6572356

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-15443-6572356035de83896d85812f70262583639e5ca1, 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 6e8b37c Nov 11, 2026
84 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-15436-43106078743-1 branch November 11, 2026 22:31
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 6e8b37cd9075022ec7bcb2f2fbdd37f761079716; 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.

Resolve validate-plugins' overlap interpreter through python-probe

0 participants