Skip to content

refactor(lane-binding): simplify lane-binding.mjs without changing behavior - #15697

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-15696-43324264806-1
Nov 12, 2026
Merged

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

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #15696

Summary

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

Simplified .github/scripts/lib/lane-binding.mjs with no behavior change. bindingOf now tests the footer on the lines it already split instead of re-parsing the body through laneFooter. legacyCounts is one boolean expression. In laneChecker, the run reader is a named async loadRun instead of an inline async IIFE, the two artifact filters are merged into one, readPull is one expression, and the local lines that shadowed the module helper is renamed record. The LEGACY_CUTOFF line was left byte-for-byte, because test_babysit_lane_binding.py reads it with a regex. One draft move (the zip size check placed ahead of the local-header reads) was reverted, because it could change which error a malformed, oversized archive throws first. The generated copies in the review and work-items plugins were regenerated with sync-shared-copies.

Not verified

  • node --test .github/scripts/lib/lane-binding.test.mjs and the consumer test suites (pr-merge, pr-unblock, babysit-prs Python port) were not executed: this lane runs no interpreter. Left to the PR's CI.
  • ci-status green is a PR CI check, left to the PR's CI.
  • tidy skipped: the change touches .github/, a listed tidy shared path, so it was not tidied.
  • verify (build/tests) skipped: no build step for this ESM file, and no test runner can run in this lane. The PR's CI runs them.
  • The working tree shows untracked files this run did not create (.bash_profile, .bashrc, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc). They look like sandbox mount placeholders and do not belong in the patch.

Fix

  • .github/scripts/lib/lane-binding.mjs: bindingOf avoids a second parse; legacyCounts collapsed to one expression; laneChecker's run read extracted into loadRun, artifact filters merged, readPull made one expression, shadowing local renamed (17 added, 26 removed).
  • plugins/review/lib/lane-binding.mjs: regenerated copy from scripts/sync-shared-copies.sh.
  • plugins/work-items/lib/lane-binding.mjs: regenerated copy from scripts/sync-shared-copies.sh.
  • .changes/review/work-resolve-issue-issue-15696-43324264806-1-093130d9.md: patch fragment, ### Changed, "Internal simplification, no behavior change."
  • .changes/work-items/work-resolve-issue-issue-15696-43324264806-1-b9776421.md: patch fragment, ### Changed, "Internal simplification, no behavior change."

Verification

The runner ran each check from the base copy against 91e8710:

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

The run reports:

  • sync-shared-copies: regenerated plugins/review/lib/lane-binding.mjs and plugins/work-items/lib/lane-binding.mjs, exit 0.
  • new-changelog-fragment review patch and work-items patch: created both fragments, exit 0.
  • check-changelog-fragments: all 9 fragments under .changes/ valid.
  • check-changed-skills: no changed skills under plugins/*/skills/, nothing to gate.
  • check-affected: 12 passed, 7 skipped (no failures) over the changed files.
  • git-read diff --numstat HEAD: 3 files at 17 added / 26 removed each, which is the hand-edited file plus 2 generated copies, well inside the 400-line / 15-file limit.
  • Fresh-context subagent review of the diff against the original hunks: found no behavior difference in return values, errors, or the order and count of injected calls. Its only notes were theoretical getter/toString side-effect orderings that string comment bodies and plain artifact objects cannot…
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/43324264806

Left out: the items under Not verified.

Related

#15696

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

Copy link
Copy Markdown
Contributor

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

Security review: PR #15697, refactor(lane-binding)

No security issues found.

What I checked. lane-binding.mjs matches the trusted-path glob .github/scripts/lib/lane-binding.mjs. It decides whether a github-actions[bot] comment is really a review lane's own: footer, binding line, run path, head, branch, and an artifact record with a body digest. Merge holds and review evidence depend on that decision. I read the whole change in each copy and the code around it. The point was to confirm the refactor doesn't let more comments through as lane-owned.

  • bindingOf (.github/scripts/lib/lane-binding.mjs:76): it now checks !FOOTER.test(all[at.at(-1)].trim()) instead of laneFooter(body) === null.
    • Both read the same last non-blank line from the same lines() and nonBlankIndexes() helpers.
    • FOOTER (:58) has no g or y flag, so test keeps no state between calls.
    • Its single capture group is required and can't be empty. So exec(...)?.[1] ?? null is non-null exactly when test is true.
    • The at.length < 2 guard ensures at.at(-1) exists. The two forms are equivalent.
  • legacyCounts (:125): the early return became cutoff === null || (...). The truth table is unchanged and LEGACY_CUTOFF is unchanged.
  • laneChecker → loadRun (:200-213): the two filters are now one && filter, in the same order.
    • a.expired is only read once the name check passes. A null artifact gives "", fails the prefix check, and can't throw.
    • The download loop, the complete === true record test and the returned shape are unchanged.
    • runs.set(runId, loadRun(runId)) caches a promise just like the async IIFE did, including a rejected one. Reads that fail still throw, so it still fails closed.
  • readPull: (pull ??= getPull(...)) returns the same memoized value as before.
  • check() (:220-266): unchanged. The run-path, head-sha, head-branch and head-repo checks, the digest match, the still-running throw and the every-attempt-recorded rule are all intact.

I found no change that would accept a comment the base rejected. No trust control is widened.

Copies. plugins/review/lib/lane-binding.mjs has the same hunks shifted by two lines; I read it in full. plugins/work-items/lib/lane-binding.mjs and the second .changes/ fragment are byte-identical copies of files I read. In their plugin lib/ paths they are library modules, not hooks, manifests or workflows, so their location doesn't change what the code does. The .changes/ fragments are changelog prose only.

Other checks.

  • No plugin.json or marketplace.json changes, so there are no manifest lines.
  • No standing instruction is deleted or narrowed.
  • The PR context holds no embedded directives aimed at the lane.
  • Cost: none. This is a pure refactor and adds no billable resource or lane spend.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: PR #15697, simplify lane-binding.mjs (no findings)

I read the whole diff: the three files in scope, plus two copies that have identical content (plugins/work-items/lib/lane-binding.mjs and the work-items changelog fragment). Each copy sits at a path of the same kind as its original, so the path does not change what the content does. I compared every change with the unchanged code at head (.github/scripts/lib/lane-binding.mjs) and found that behavior is the same:

  • bindingOf (L76): laneFooter(body) === null comes out the same as !FOOTER.test(<last non-blank line>.trim()). FOOTER's capture group is never empty when it matches, so ?.[1] ?? null is null only when there is no match. at.length < 2 runs first, so at.at(-1) always exists.
  • legacyCounts (L125): the single boolean expression gives the same result as the old early return.
  • laneChecker (L199-L219):
    • readPull still calls getPull once and caches the result.
    • loadRun(runId) runs synchronously up to its first await, just like the old async IIFE. The calls to getRun, listArtifacts and download keep the same order and count, and the promise is still cached per run id.
    • The merged filter startsWith(RECORD_PREFIX) && a.expired !== true short-circuits the same way the two old filters did, including for a null artifact.
    • Renaming the local lines to record removes the shadowing of the module helper without changing behavior.
  • The existing lane-binding.test.mjs already covers each changed branch: bindingOf footer and binding mismatches (L12-L16), legacyCounts with a null cutoff, past the cutoff and when edited (L30-L33), and records that expired (L105, L133). Any regression in these paths would fail those tests.

Closing issue #15696 acceptance criteria:

  • Behavior unchanged: met (checked by reading the code as above; tests already cover it).
  • Only the listed file, its generated copies and fragments are edited: met.
  • Within size limits: met (17 added and 26 removed per file).
  • sync-shared-copies copies are committed: met. Both plugin copies match the hand-edited file's hunks.
  • A fragment for each touched plugin, with bump: patch, ### Changed and "Internal simplification, no behavior change.": met for review and work-items.
  • ci-status green: left to CI. I did not run any tests; the PR body's verification output is the author's claim and I have not checked it.

No plugin.json or marketplace.json changes, so there are no manifest lines. No settled threads and no prior findings. I found no embedded instructions in the PR context.

Verifier dropped 0 of 0 candidates.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 91e8710

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-15697-91e871057faa3319b9fd21e8e5e47a0720e858a3, 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=HIGH demote=true head=91e871057faa3319b9fd21e8e5e47a0720e858a3 rubric=8.4.13 rater=claude-opus-5-5 checker=claude-opus-5-5

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit c5465f2 Nov 12, 2026
54 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-15696-43324264806-1 branch November 12, 2026 23:25
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit c5465f21e5b12fe2e328e584f79e751541437cc6; 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 lane-binding.mjs shared script

0 participants