Skip to content

refactor(lib): simplify resolve-convention-home, resolve-convention-pattern and rewrite-guard - #14375

Merged
melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-14339-42568954572-1
Nov 9, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14339

Summary

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

Simplified three of the five listed shared lib sources without changing what they print, return or write, and regenerated their copies. resolve-convention-home.sh drops valid_home's first empty-token check (the check after the trailing-slash strip already returns the same empty reason) and the printf subshell it used to build a backslash (now a *\\* case pattern). resolve-convention-pattern.sh saves the two YAML lookups' results instead of repeating them before the folder-form checks. rewrite-guard.sh's hook::rewrite_guard_begin uses early returns instead of two nested ifs. History and ticket notes were cut from comments in all three. lib/read-verification.sh and lib/redact.py were reviewed against the same four checks and left unchanged: neither had a reuse, simplification, efficiency or abstraction fix that would make it shorter or clearer without risking its output. The resolve-convention-pattern.sh header (lines 2-76) is untouched because --help prints it.

Not verified

  • Test suites (lib/resolve-convention-pattern.test.sh, lib/rewrite-guard.test.sh, plugins/harness-config/lib/resolve-convention-home.test.sh and the other suites that source these libs) were not executed: this lane's Bash runs only the named wrappers, so they are left to the PR's CI
  • ci-status green is a PR check, left to the PR's CI
  • tidy skipped: the change touches the shared path lib/ and exceeds the 10-file / 1-area cutoffs (78 files across 38 plugin areas, counting generated copies and fragments)
  • build/lint step: no build applies to shell scripts; shellcheck/shfmt did not run separately here beyond what check-affected ran, so lint is left to the PR's CI
  • Each of the 37 fragments uses one body naming all three changed sources, though most plugins carry only resolve-convention-home.sh
  • Changes are left uncommitted in the working tree, as the runner instructs, rather than committed as ci-mode.md step 3 says

Fix

  • lib/resolve-convention-home.sh: valid_home drops the duplicate empty check and the backslash subshell; WHY comment loses its history narration
  • lib/resolve-convention-pattern.sh: top-level resolution keeps key_in_yaml/subject_in_yaml instead of re-running yaml_lookup; --help comment loses its history note
  • lib/rewrite-guard.sh: hook::rewrite_guard_begin uses early returns; header and comments lose issue-number and history notes
  • plugins/*/lib/resolve-convention-home.sh (37 copies), plugins/guardrails/hooks/resolve-convention-pattern.sh, plugins/testing/hooks/rewrite-guard.sh: regenerated by sync-shared-copies
  • .changes/<plugin>/work-resolve-issue-issue-14339-42568954572-1-*.md (37 fragments, one per carrying plugin): patch, ### Changed, behavior unchanged

Verification

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

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

The run reports:

  • sync-shared-copies: regenerated 38 copies, then the rewrite-guard copy again after the final comment reflow; exit 0
  • check-changelog-fragments: all 41 fragments under .changes/ valid
  • check-changed-skills: no changed skills, nothing to gate
  • check-affected: 13 passed, 6 skipped (ruff: no changed .py; typos not installed; validate-plugins sub-checks that run code from the checked tree; changed-skills) over 78 changed files
  • fresh-context review subagent over the lib diff: no behavior change found for empty and backslash tokens, every YAML/deferral combination in resolve-convention-pattern.sh, or mktemp/cp failure and set -e/set -u in rewrite_guard_begin; one cosmetic nit (unreflowed comment paragraph) fixed
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42568954572

Left out: the items under Not verified.

Related

#14339

Merge-Risk: max=MEDIUM demote=false head=607409da7f38fc393ae7844cc552eba421301385 rubric=8.1.2 rater=claude-opus-5-5 checker=claude-opus-5-5

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

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #14375, incremental (c342130 → 607409d)

No security issues found. This review covered only new findings that would block the merge, because this lane already reviewed an earlier head.

Scope

The only new commit, 607409d, touches two files:

  • lib/rewrite-guard.sh
  • plugins/testing/hooks/rewrite-guard.sh

The incremental diff has no patch for either file, so I checked them three ways:

  • I read both files at the head commit.
  • I compared them with the full PR diff. Both index lines there now read 100644, so the PR no longer changes either file's mode.
  • I checked the content against the code the last review read.

The commit only changes the mode of both files from 100755 back to the base's 100644. Their content is unchanged. This matches the fix described in the resolved thread about the mode flip.

What I checked

  • Mode change: removing the executable bit from a library that hooks only source opens no path an attacker could use. The file has no shebang.
  • Content: in hook::rewrite_guard_begin, the early returns on mktemp/cp failure, the snapshot release, and the EXIT-trap capture with its eval of trap -p output match the head the last review read (lib/rewrite-guard.sh#L82-L112). The generated copy matches the canonical source (plugins/testing/hooks/rewrite-guard.sh#L84-L114).
  • Out of scope: the commit changes no trust control, plugin manifest, workflow, token request, merge hold or standing instruction.

Settled and prior items

  • Settled thread on lib/rewrite-guard.sh L1 (the mode flip): resolved and fixed in this commit. I have not raised it again.
  • Prior summary comment: it reported no findings, so nothing carries over.

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 c342130e6e423cc1f253d20495bf47de32415f5e; the summary is in this lane's pull request comment.

claude-lane: claude-review

Comment thread lib/rewrite-guard.sh Resolved
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review (incremental, blocking only): PR #14375 at 607409da

Scope. This review covers only what changed since c342130e: lib/rewrite-guard.sh and its generated copy plugins/testing/hooks/rewrite-guard.sh. The incremental diff has no content patch for either file, so the push changed only file modes. In the full PR diff, both files now show index … 100644 and no old mode/new mode lines. Both are back at the base's 100644 and match each other, so the shared-copies mode check is satisfied. Their content is the same as at the head I reviewed last time.

Prior finding. The earlier finding about the unrequested 100644 → 100755 mode change (thread) is fixed at this head. The thread is resolved and its lines have not changed since resolution, so I'm not raising it again.

Blocking only. This lane already reviewed an earlier head, so this review reports only blocking findings. I found none in the incremental change.

Not independently verified. I ran nothing. CI status and the claim that scripts/sync-shared-copies.sh was re-run are the author's claims, not checked by this lane.

The settled-threads and prior-findings files contain no embedded instructions. No plugin manifest changed. This change has no cost or spend impact.

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

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 607409d

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-14375-607409da7f38fc393ae7844cc552eba421301385, expires on 2026-12-09.

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 9, 2026
Merged via the queue into main with commit cc2eff2 Nov 9, 2026
75 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14339-42568954572-1 branch November 9, 2026 06:55
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit cc2eff2c7256841f8b5f8018ee22639e4903fc02; 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 read-verification.sh, redact.py, resolve-convention-home.sh and 2 more shared lib sources

0 participants