Skip to content

refactor(app-control): simplify the scripts and map helper code - #14656

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14399-42615184867-1
Nov 9, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14399

Summary

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

Simplified four of the five listed app-control scripts without changing behavior. In affected_features.py the project-relative path map is a single comprehension. In build_capture_script.py the recheck lines are a list comprehension. In verify_pin.py the git argv is a compact list and the CRLF-aware blob hash check uses a small blob_id helper instead of a nested chained call. In check-map.sh, entry_lines reuses the file's own section_lines helper (moved up so it is defined first) instead of a second fence-and-section awk program, the redundant unset seen is dropped (declare -A seen=() already resets it each iteration), and a two-step trim is folded into one. upkeep-skip.sh was reviewed and left unchanged: its argument parsing and decision logic are already minimal, and the remaining candidates would have changed error ordering or messages.

Not verified

  • The sibling test suites (affected_features.test.sh, build_capture_script.test.sh, verify_pin.test.sh, check-map.test.sh, upkeep-skip.test.sh) were not executed: this lane's Bash runs only the named wrappers. Left to the PR's CI.
  • ci-status green on the PR: left to the PR's CI.
  • tidy recorded as skipped: pass 5 (ai-slop:audit fix) could not run its deterministic detector (detect.sh) because lane Bash runs only the named wrappers; its rubric read of the one-line fragment found no tell. Passes 1 to 4 ran with no edits.

Fix

  • plugins/app-control/scripts/affected_features.py: the rel mapping built with a leading-prefix comprehension instead of a branching loop
  • plugins/app-control/scripts/build_capture_script.py: recheck lines built with a list comprehension
  • plugins/app-control/scripts/verify_pin.py: compact git argv; new blob_id helper replaces the nested hash-object chain in the file comparison
  • plugins/app-control/skills/map/scripts/check-map.sh: section_lines moved above its first use and reused by entry_lines; duplicate definition removed; redundant unset seen dropped; count trim folded into one line
  • .changes/app-control/work-resolve-issue-issue-14399-42615184867-1-8e80744c.md: patch fragment, ### Changed / Internal simplification, no behavior change.

Verification

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

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

The run reports:

  • .lane/checks/bin/check-changelog-fragments: all 116 fragments valid (run before and after tidy)
  • .lane/checks/bin/check-changed-skills: map skill PASS, 0 errors, 3 pre-existing warnings (description length, body length, refresh.md TOC), none from this change
  • .lane/checks/bin/check-affected: 14 passed, 5 skipped (typos not installed; checks that run checked-tree code), over 5 changed files
  • fresh-context review subagent: no behavior difference found; it checked entry_lines equivalence (trailing whitespace, CRLF, fenced headings, blank lines), seen reset, rel mapping, verify_pin argv and hash-object order, and that no *.test.sh greps the changed source; one 103-char line was wrapped…
  • code-tidying:tidy-diff over the 9 changed hunks: no further edits; comments kept as informative
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42615184867

Left out: the items under Not verified.

Related

#14399

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

Code review: no findings. I read every hunk of all 5 changed files. This is a full review; there were no earlier reviews of this PR to build on.

This is a behavior-preserving refactor for #14399. I checked each hunk against the base by reading the code. I did not run the sibling *.test.sh suites.

  • affected_features.py: when prefix == ".", lead is "". Every path then starts with it, and f[0:] is f, so the result is the same as the old rel[f] = f. For any other prefix, f[len(prefix)+1:] behind a startswith(prefix + "/") check is unchanged.
  • build_capture_script.py: the comprehension builds the same check lines. The parent pid is still added only for entries after the first.
  • verify_pin.py: the git argv has the same items in the same order. blob_id runs the same hash-object --no-filters --stdin call with the same why text. any() still stops at the first match, raw form first, then the CRLF-normalized form.
  • check-map.sh:
    • entry_lines used to run unfenced and then a heading awk. It now calls section_lines … | awk NF. Both skip fence markers and fenced content the same way. Trailing whitespace on the heading is handled the same: the old code matched it with [[:space:]]*$, the new code strips it with sub and compares exactly.
    • section_lines is defined only once now, at line 122, before its first caller at line 165.
    • Dropping unset seen is safe. declare -A seen=() at line 206 runs at top level and empties the array on every pass, and nothing reads seen after the loop.
    • The single-line trim of count gives the same result as the two-step version.

Closing issue #14399 acceptance criteria:

  • Behavior unchanged: the reading above found no difference, and the existing sibling test suites cover these scripts.
  • Edits only the listed files plus a fragment: met. upkeep-skip.sh was reviewed and left unchanged, which the issue allows.
  • Size: well under 400 lines and 15 files.
  • Fragment: bump: patch, with ### Changed and "Internal simplification, no behavior change.", as the issue requires.
  • ci-status green: CI decides this one. The author says the test suites were not run in the lane; I have not confirmed CI results.

No plugin manifest changed, so the manifest checks do not apply. I found no instructions hidden in the PR body or the issue text.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Security review: PR #14656, head ec88bd6

I found no security issues. I read every hunk of all 5 changed files. None of them matches a trusted-path glob, and none touches a trust control, a merge hold, a workflow, a plugin manifest or an instruction surface.

What I checked in each file:

  • plugins/app-control/scripts/verify_pin.py: This script checks pinned files.
    • Git command: it still runs git with the same hardened flags, in the same order: --no-replace-objects, --literal-pathspecs, -C top and -c core.fsmonitor=false, and the same ENV. The change only splits the list in two.
    • Pin comparison: the new blob_id helper runs the same hash-object --no-filters --stdin call. The check still refuses a file unless its raw bytes, or the CRLF-to-LF form of them, hash to the pinned oid. The check is no looser than before.
  • plugins/app-control/scripts/affected_features.py: The new lead prefix gives the same result as the old branch. When prefix == ".", every file maps to itself, because startswith("") is always true and f[0:] is the whole name. In every other case the code matches prefix + "/" and strips it, as before. The inside(project, top) containment check above it is unchanged.
  • plugins/app-control/scripts/build_capture_script.py: The comprehension builds the same check lines from the same bound process fields. It appends ppid only for bound children, as the old code did. It adds no new interpolation into the script it generates.
  • plugins/app-control/skills/map/scripts/check-map.sh: This is a lint helper that reads files.
    • entry_lines now reuses section_lines, which is moved above its first use and is otherwise unchanged.
    • The count trim is folded into one line.
    • unset seen is dropped.
    • None of this runs commands built from file content or touches credentials.
  • .changes/app-control/...md: This is a changelog fragment. It holds no code.

The PR context contains no embedded instructions aimed at the review lane.

critical-findings: 0

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for ec88bd6

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-14656-ec88bd6000e0cd9789764985b4bcf507495ef5c2, 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 0e0161a Nov 9, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14399-42615184867-1 branch November 9, 2026 14:55
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 scripts and map app-control plugin code

0 participants