Skip to content

refactor(code-metrics): parse audit entry options and check Python through entry-common.sh - #15614

Merged
melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-15591-43257018533-1
Nov 12, 2026
Merged

melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-15591-43257018533-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #15591

Summary

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

entry-common.sh gains cm_entry_args (the --json/--help/pass-through loop, taking the caller's own BASH_SOURCE[0] and banner last line) and cm_require_python (the Python prerequisite check with the caller's script name, exit 2), and its header list names both. audit-size.sh, audit-complexity.sh and audit-type-debt.sh call cm_entry_args with their banner lines 11, 13 and 14; those three plus audit-coverage.sh and audit-duplication.sh call cm_require_python, each keeping its own python-resolve.sh source line. Flags, --help output, messages and exit codes are unchanged; dispatch.sh and audit-suppressions.sh are untouched.

Not verified

  • check-affected does not name the 13 checks it passed, so audit-size.test.sh, audit-complexity.test.sh, audit-type-debt.test.sh, audit-coverage.test.sh, audit-duplication.test.sh and dispatch.test.sh may not have run here; left to the PR's CI
  • ci-status green is a PR CI check; left to the PR's CI
  • tidy: ai-slop pass ran its rubric by reading only; detect.sh was not run because this lane's Bash runs only the named wrappers
  • review-venue.txt was absent, so the review ran locally in a fresh-context subagent rather than in the CI code-review lane
  • Changes left uncommitted in the working tree per the lane's instructions; the runner turns them into the patch

Fix

  • plugins/code-metrics/scripts/entry-common.sh: added cm_entry_args and cm_require_python, listed them in the header (now seven pieces), and corrected the PY comment to say cm_require_python sets it
  • plugins/code-metrics/skills/audit/scripts/audit-size.sh: option loop replaced by cm_entry_args "${BASH_SOURCE[0]}" 11 "$"; Python check replaced by cm_require_python audit-size.sh
  • plugins/code-metrics/skills/audit/scripts/audit-complexity.sh: option loop replaced by cm_entry_args ... 13; Python check replaced by cm_require_python audit-complexity.sh
  • plugins/code-metrics/skills/audit/scripts/audit-type-debt.sh: option loop replaced by cm_entry_args ... 14; Python check replaced by cm_require_python audit-type-debt.sh
  • plugins/code-metrics/skills/audit-coverage/scripts/audit-coverage.sh: Python check replaced by cm_require_python audit-coverage.sh
  • plugins/code-metrics/skills/audit-duplication/scripts/audit-duplication.sh: Python check replaced by cm_require_python audit-duplication.sh
  • .changes/code-metrics/work-resolve-issue-issue-15591-43257018533-1-95c8e252.md: new patch fragment, ### Changed, "Internal restructuring, no behavior change."

Verification

The runner ran each check from the base copy against 23fca47:

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

The run reports:

  • check-changelog-fragments: all 10 fragments valid (run before and after tidy)
  • check-changed-skills: 3 skills checked, 0 failed (pre-existing size warnings only)
  • check-affected: 13 passed, 6 skipped over 7 changed files (run after tidy and again after the review fix)
  • Grep for line citations into the six changed scripts across the repo: none, so no citation drifts
  • Fresh-context review subagent over the whole diff: no behavior regressions (globals JSON/ARGS/PY stay global, exit in function ends the script, BASH_SOURCE passed by caller, banner lines and message bytes identical, --help test greps still match); one stale comment about PY fixed
  • tidy-diff over the 12 changed hunks: no edits needed
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/43257018533

Left out: the items under Not verified.

Related

#15591

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #15614, incremental from 23fca477 to 57a67ed3

No security issues found. I read the whole change in both files in scope.

  • plugins/code-metrics/scripts/entry-common.sh: the incremental diff has no content patch for this file. I read the file at head and compared it with the full PR diff. Its contents match what the last review covered. The only change since 23fca477 is the file mode: the full diff now shows index 4561f0b5..310a8ba3 100644, so the 100644 → 100755 change seen last review is gone. That grants nothing new: the file is still a library that other scripts source. cm_entry_args still puts every pass-through argument into the ARGS array, and cm_require_python still prints a message built from a script-name literal and CM_PYTHON_FLOOR, then exits 2. Nothing new is evaluated or interpolated.
  • plugins/code-metrics/skills/audit/scripts/audit-size.test.sh: this is a test-only addition. It creates stub python3 / python / py files that exit 1 in a fresh mktemp -d directory and adds that directory to the trap cleanup. It puts the directory first on PATH for a single run and checks for exit code 2 and the prerequisite message. The sed reads MIN_PYTHON from the in-repo report.py. No untrusted input reaches anything here, and the change adds no secrets, network access or credential handling.

Scope checks:

  • Neither file matches a trusted path.
  • No plugin manifest, workflow, trust control, merge hold or standing instruction is touched.
  • The PR context file contains no embedded text aimed at this lane.
  • No settled threads apply. The prior summary-only post found nothing, and there is nothing to carry forward.

This review was blocking only (blocking only: yes), so only CRITICAL and IMPORTANT findings would have been reported. There were none.

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: 2 inline finding(s) on 23fca477c325003708594e44a7ce1606fb7e815a; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review: PR #15614, incremental from 23fca477 to 57a67ed3 (blocking only)

This lane already reviewed an earlier head of this pull request, so this pass reports only blocking findings. I read both files in the incremental scope:

  • plugins/code-metrics/scripts/entry-common.sh: mode-only change, no patch
  • plugins/code-metrics/skills/audit/scripts/audit-size.test.sh: one hunk

No blocking findings.

Both earlier findings are addressed.

  • File mode on entry-common.sh. The full PR diff no longer has an old mode / new mode header for this file, so it is back to the base's 100644. The incremental diff has no content patch for it.
  • Untested Python-missing branch. audit-size.test.sh:58-67 now puts failing python3/python/py stubs ahead of PATH and runs audit-size.sh. It then asserts exit code 2 and the exact stderr line from cm_require_python (entry-common.sh:75).

Checks on the new test (by reading only; I ran nothing).

  • Stubs cover every candidate. cm_resolve_python looks up each of python3 and python with command -v and then probes it. The stub found first exits 1, so the probe fails. py -3 likewise hits the failing py stub. So cm_require_python takes its error branch and exits 2.
  • Stub files resolve and get cleaned up. The stubs' #!/usr/bin/env bash still finds bash, because the stub directory goes in front of the real PATH instead of replacing it. NO_PYTHON is added to the EXIT trap.
  • Expected floor matches the script's. The test reads the floor from report.py with the same sed expression python-resolve.sh:48 uses (MIN_PYTHON = (3, 9) gives 3.9).
  • stderr carries only the prerequisite line. 2>&1 >/dev/null captures stderr alone. Nothing before cm_require_python in audit-size.sh:18-30 writes to stderr for --all <path>, so the exact-match assertion holds.
  • Later tests are unaffected. The stubbed PATH applies only to that one command, so the later "$PY" uses at lines 73 and 95 are unchanged.

Closing issue #15591. The new test is an addition the earlier review asked for, inside a listed test file. It now covers the "Behavior is unchanged" criterion for the shared message and exit code. The test-pass and ci-status criteria are still the author's claim, left to CI, and I have not verified them.

No plugin manifest changed in this increment. No embedded instructions in the PR context, settled-threads or prior-findings files.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

melodic-automation-lanes Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

Verification evidence for 57a67ed

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-15614-57a67ed31b9c4eefbd930966c31a4e510b9a8931, expires on 2026-12-12.

One comment per pull request, updated in place for each new head.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: max=LOW demote=false head=23fca477c325003708594e44a7ce1606fb7e815a rubric=8.4.11 rater=claude-opus-5-5 checker=claude-opus-5-5

Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM62uC1u
Lane-Thread: PRRT_kwDOTCGFQM62uC1z
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 12, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: max=MEDIUM demote=false head=57a67ed31b9c4eefbd930966c31a4e510b9a8931 rubric=8.4.12 rater=claude-opus-5-5 checker=claude-opus-5-5

Merged via the queue into main with commit b26ad72 Nov 12, 2026
57 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-15591-43257018533-1 branch November 12, 2026 16:57
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

Parse the code-metrics audit entry options and check Python through entry-common.sh

0 participants