Skip to content

refactor(autonomy): simplify check-security-binding.mjs part 1 of 2 - #14895

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14417

Summary

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

Simplified the functions that start in the first half of check-security-binding.mjs (lines 1-1347 of 2694) without changing any output, finding text, finding order or exit code. Repeated code now goes through small file-local helpers: envTokenName, lowerSlashed, isArrayOfNonEmptyStrings, checkPerClassEnums and allZeroHextets. normalizeHostPath and pathUnderConfiguredRoot lost their redundant anchor variable and an unreachable empty-root check, and jointlySatisfiable is now one every() call. Nothing moved between files, and no function starting in the second half was edited.

Not verified

  • The node test suites for this script (check-security-binding.fixtures/admission-leaf/escalation-stop .test.sh/.test.mjs and scripts/promotion-evidence-e2e.test.sh) were not run: 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: passes 4-5 (docs-hygiene write-for-humans, ai-slop fix) skipped for the changelog fragment because the issue fixes its text word for word; pass 2 left the line-175 comment as a deletion proposal rather than writing a whole-file proof copy.

Fix

  • plugins/autonomy/skills/setup/scripts/check-security-binding.mjs: added the file-local helpers envTokenName, lowerSlashed, isArrayOfNonEmptyStrings, checkPerClassEnums and allZeroHextets, and used them in place of repeated inline code in credentialEntryProblem, credentialExpansionProblem,…
  • .changes/autonomy/work-resolve-issue-issue-14417-42716154267-1-5999f00a.md: patch fragment from new-changelog-fragment, body ### Changed and "Internal simplification, no behavior change."

Verification

The runner ran each check from the base copy against 796c8f1:

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

The run reports:

  • check-changelog-fragments: all 22 fragments valid (run before and after tidy/review edits)
  • check-changed-skills: CHECK-SKILL setup PASS, 0 errors, 4 warnings that predate this change (SKILL.md size and description length)
  • check-affected: 12 passed, 7 skipped, 0 failed over the 2 changed files (run before and after tidy/review edits)
  • fresh-context review subagent: traced every hunk, including inputs such as "C:/X", "c:/", "/", "//server", relative paths, null, empty arrays and string constraints, and found no behavior difference in outputs, finding order or exit codes; its two naming suggestions were applied (zeroFrom ->…
  • tidy-diff over the 23 changed hunks: passes 1-3 made no edits (no residue found; one comment-deletion proposal at line 175 left as is)
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42716154267

Left out: the items under Not verified.

Related

#14417

Merge-Risk: max=HIGH demote=true head=796c8f151e77bcb76555deb4684405d322cde596 rubric=8.3.1 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 796c8f151e77bcb76555deb4684405d322cde596: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Security review: no security issues found

I read every hunk of both changed files: plugins/autonomy/skills/setup/scripts/check-security-binding.mjs and the changelog fragment .changes/autonomy/work-resolve-issue-issue-14417-42716154267-1-5999f00a.md. Neither file is on a trusted path.

The script validates credential-absence and egress-probe evidence. A change that quietly widened one of its fail-closed checks would matter, so I traced each hunk against the base code for the same output:

  • normalizeHostPath (head L237-L261). It still refuses UNC (//) paths and relative paths, and still refuses a .. that would climb above the root.
    • The base lowercased the whole drive path and then sliced 3 characters off. The head lowercases the drive and the body separately. Both give the same string.
    • POSIX paths still keep their case, so the check stays fail-closed on case-sensitive hosts.
    • The new return value ${drive ?? ""}/… is the same as the base's two branches.
  • pathUnderConfiguredRoot (L279-L280). The removed normRoot === "" check could never be true, because normalizeHostPath returns either null or a string that contains /. Roots of / and a bare drive such as c:/ are still refused, and the match still has to land on a segment boundary.
  • isArrayOfNonEmptyStrings call sites, including the constraint targets and predicates around L1068-L1088. A null value fails Array.isArray, and the empty-array rejection is kept, so they accept and reject exactly what the base did.
  • The other helpers (checkPerClassEnums, allZeroHextets, envTokenName, lowerSlashed) and the rewritten jointlySatisfiable are direct substitutions. They keep the same finding text and order and the same IPv6 classification ranges.

Nothing in the diff widens a trust control, removes an instruction, or touches a plugin manifest. The PR context file contains no embedded directives. The diff spends no extra API credit and can't start a charge.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Code review: PR #14895 (simplify part 1 of check-security-binding.mjs)

No findings. I read every hunk in both changed files. I traced each refactor against the code it replaces, and none of them changes behaviour:

  • normalizeHostPath
    • Paths with no drive letter and no leading / still return null.
    • The drive letter is still lowercased. For a drive path, only the body after it is lowercased. Because the X:/ prefix is ASCII, slicing then lowercasing gives the same result as the old lowercase-then-slice.
    • ${drive ?? ""}/… returns the same string as the two old return branches.
  • pathUnderConfiguredRoot: the normRoot === "" check it drops could never be true. normalizeHostPath returns either null or a string that starts with / or x:/, never "". The bare-root refusals for / and x:/ are kept.
  • checkPerClassEnums (for merge_policy and the verification maps): it checks work classes in the same order, writes the same where paths, and gives the same message for a missing key. It still appends to the module-level findings array.
  • isArrayOfNonEmptyStrings:
    • It still treats null and non-array values as errors.
    • The length === 0 checks are still there for the class-topology constraints and predicates.
    • The base_egress_allowlist and component_reachable_hosts checks still accept an empty array.
  • Other helpers: jointlySatisfiable as a single .every() call, allZeroHextets, envTokenName and lowerSlashed are all exact rewrites of the old code.

Closing issue #14417 acceptance criteria

  • Behaviour unchanged: met, by tracing the code (above). I ran none of the tests myself. The PR says the test suites were not run by its own lane and are left to CI; that is unverified.
  • Only the listed file plus a changelog fragment is edited: met.
  • Size limit: met (the PR is well under 400 changed lines).
  • Changelog fragment: met. .changes/autonomy/… has bump: patch, ### Changed, and "Internal simplification, no behavior change."
  • Only functions starting in the first half (lines 1–1347) are edited: met. Every edited function starts before line 1347.
  • ci-status green: left to CI; I could not check it from this lane.
  • Test coverage: these criteria are about behaviour staying the same, and the existing fixture and test suites for this script are what would catch a change.

No plugin manifest changed. The PR context contains no embedded instructions aimed at this review.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 796c8f1

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-14895-796c8f151e77bcb76555deb4684405d322cde596, 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
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 9, 2026
@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 c7ac2c2 Nov 9, 2026
75 of 76 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14417-42716154267-1 branch November 9, 2026 23:54
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 3, survived 4, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 43%; mutation score 43%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/autonomy/skills/setup/scripts/check-security-binding.mjs 3 4 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/autonomy/skills/setup/scripts/check-security-binding.mjs:174 LCR productive input-gap
plugins/autonomy/skills/setup/scripts/check-security-binding.mjs:249 other productive input-gap
plugins/autonomy/skills/setup/scripts/check-security-binding.mjs:279 other productive input-gap
plugins/autonomy/skills/setup/scripts/check-security-binding.mjs:539 SBR productive input-gap

The run's summary has the full report.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit c7ac2c260e6aeab38f1aff98101ab78a5848b993; 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 check-security-binding.mjs autonomy plugin code (part 1 of 2)

0 participants