Skip to content

refactor(knowledge): simplify repo-visibility --repo argument parsing without behavior change - #15231

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14596

Summary

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

I reviewed the five listed files against /simplify's four checks. The only behavior-identical simplification worth making was in repo-visibility.mjs main(): the --repo branch now strips .git once into repo and reuses it, instead of running the same replace twice, and it drops the !owner/!repo guards, which isValidName already covers (an empty or missing segment fails NAME's +). The other files (gates/init.py, failures.py, headings.py, work-root.mjs) are already minimal. Two more edits I tried (moving r.stdout.trim() after the gh error check, and a regex tilde test in expandPathValue) were reverted: the fresh-context review showed each changes behavior for out-of-contract input (a runner stub with no stdout, a non-string value).

Not verified

  • node --test for plugins/knowledge/scripts/repo-visibility.test.mjs and work-root.test.mjs was not run: this lane can run no interpreter, so the PR's CI runs it. The review read the --repo cases at repo-visibility.test.mjs:414-469 and found none the change breaks
  • tidy-diff ran passes 1-3 (no edits needed) but skipped markdown passes 4-5 on the changelog fragment, whose text the issue's acceptance criteria fix word for word
  • review-venue.txt was absent, so the review ran locally in one fresh-context subagent instead of the CI code-review lane
  • ci-status green is left to the PR's CI

Fix

  • plugins/knowledge/scripts/repo-visibility.mjs: main()'s --repo branch computes the .git-stripped repo name once and drops the empty-segment guards that isValidName already makes; same exit codes, stderr text and githubVisibility arguments for every argv
  • .changes/knowledge/work-resolve-issue-issue-14596-42939091480-1-68256929.md: patch fragment, '### Changed' / 'Internal simplification, no behavior change.'

Verification

The runner ran each check from the base copy against 5c94554:

  • 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
  • check-changed-skills: no changed skills, nothing to gate
  • check-affected: 12 passed, 7 skipped (shellcheck, ruff, typos and changed-skills not applicable or not installed; three validate-plugins checks reported as skipped by the check itself), 0 failed
  • fresh-context review subagent: traced the --repo inputs by hand ('acme', '/x', 'acme/', 'acme/.git', 'acme/..git', 'acme/x/y', 'acme/x.git.git', a trailing newline) and found the same exit code, stderr text and result for each; the two differences it found were in edits that were then reverted
  • git-read diff --stat HEAD: 1 tracked file changed, 4 insertions and 3 deletions
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42939091480

Left out: the items under Not verified.

Related

#14596

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

Security review: PR #15231, no security issues found

I read both changed files in full: the changelog fragment and plugins/knowledge/scripts/repo-visibility.mjs. Neither one matches a trusted-path glob, and the diff changes no trust control, plugin manifest or standing instruction.

Input validation in --repo (repo-visibility.mjs main()). The change removes the !owner / !repo guards and strips .git from the repo name once instead of twice. I checked whether this lets anything new through:

  • isValidName (L129-L131) tests NAME = /^[A-Za-z0-9._-]+$/ (L56). The + rejects an empty string, and the check also rejects . and ... So an empty owner, an empty rawRepo (which now defaults to ""), and a repo name that is empty once .git is stripped all fail, exactly as they did on the base.
  • String.split always returns at least one element, so owner is never undefined.
  • The regex has no m flag, so $ cannot match before a newline in the middle of the string; slashes and other path characters are still rejected.
  • githubVisibility checks both names again (L160) before building the repos/${owner}/${repo} argument it passes to gh, which it receives as an argument array.

Every input is accepted or rejected exactly as before, so there is no new path-injection or argument-injection surface.

PR context. The description holds no embedded instructions aimed at this lane.

This was a first review of the PR (no earlier heads reviewed), not blocking only.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

No findings. This was a full review: both changed files were read in full. It is the first review of this PR, so it was not limited to blocking findings.

What changed. The --repo branch of main() in plugins/knowledge/scripts/repo-visibility.mjs now strips .git from the repo name once and reuses the result. It also drops the !owner / !repo checks.

Behavior looks unchanged. I traced each input by reading the code; I did not run anything.

  • isValidName checks the name against NAME = /^[A-Za-z0-9._-]+$/ and rejects . and .. (L56, L129-L131). An empty string fails because of the +, so the dropped checks were redundant.
  • acme: the repo part is missing and now defaults to "", which fails isValidName. Result: exit 2, as before.
  • /x: the owner is "" and fails, as before.
  • acme/.git: before, the raw .git passed !repo but the stripped "" failed. Now "" fails directly. Same result.
  • acme/x/y: still caught by the extra check.
  • acme/corpus.git: githubVisibility still gets ("acme", "corpus").
  • The stderr text and exit codes are the same.

Test coverage. plugins/knowledge/scripts/repo-visibility.test.mjs:445-469 covers the .git stripping (acme/corpus.git) and the missing-repo case (acme), which now runs through the new = "" default.

Closing issue #14596 acceptance criteria:

  • Behavior unchanged: met, by my reading of the code above.
  • Only listed files and fragments edited: met. The diff touches repo-visibility.mjs and one changelog fragment.
  • Size limits: met. Code change is 4 insertions and 3 deletions.
  • Fragment: met. bump: patch, a ### Changed heading, and the exact required line.
  • ci-status green: not something this lane can check. It is left to CI.

Unverified claims. The PR author's verification (fragment and skill checks, the hand trace by a review subagent) is their claim, not something I confirmed. Per the PR body, node --test was not run in the authoring lane either.

No manifest changes and no .claude/rules path rules apply. No embedded instructions were found in the PR context or the prior-findings file.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 5c94554

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-15231-5c9455498ba08b8d4c0f4d06a0d14f0e6b470ab5, 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 1012829 Nov 11, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14596-42939091480-1 branch November 11, 2026 02:03
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 1012829173b2b10e4ce8dfc71df2b5d14fbe3539; 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 gates and scripts knowledge plugin code

0 participants