Skip to content

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

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14418-42734415286-1
Nov 10, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14418

Summary

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

Simplified the second half of plugins/autonomy/skills/setup/scripts/check-security-binding.mjs without changing behavior: 33 lines added, 63 removed. The file had 2679 lines when this part started, so range 2 is lines 1341-2679. Only functions starting there were changed: checkSemantics, checkTopologySemantics, resolveEffectivePromotion and the top-level entry point. verifyProbeTranscript starts at line 1314 (range 1) and was not touched. In detail: optional chaining replaces the isPlainObject guards on untrusted JSON lookups with constant keys. The duplicated ai-review lookup is reused. The two floor checks in checkTopologySemantics share one loop. holdsDistinct and the inline vendor-disjoint check become one relatedBy(a, b, constraints) helper. The evidenceUnavailable flag is replaced by events === null. The four identical flag branches in argv parsing now share an options table. All finding text, finding order, exit codes and CLI flags are unchanged.

Not verified

  • The node test suites for this script (check-security-binding.fixtures.test.sh/.mjs, .admission-leaf.test.sh/.mjs, .escalation-stop.test.sh/.mjs) were not run: this lane cannot start node. They are left to the PR's CI.
  • ci-status green is a PR CI check, left to the PR's CI.
  • Tidy (code-tidying:tidy-diff) ran passes 1-4 with no edits. Pass 5 (ai-slop:audit fix) was skipped: its detector and digest-guard scripts cannot run under this lane's Bash allowlist. A by-eye read of the fragment's one mandated line found no AI-writing tells.
  • No separate lint or build of the .mjs file: no node or eslint can run here. check-affected ran the lints it could, and the rest are left to the PR's CI.
  • Changes are left uncommitted in the working tree, as the runner instructs; the runner turns them into the patch.

Fix

  • plugins/autonomy/skills/setup/scripts/check-security-binding.mjs: changes to the range-2 functions only. checkSemantics: ratifiedPromoted and the merge_policy/aiReview/topology lookups use optional chaining, and the second ai-review lookup reuses aiReview. checkTopologySemantics: the…
  • .changes/autonomy/work-resolve-issue-issue-14418-42734415286-1-b0c6a5c7.md: new patch fragment (made with new-changelog-fragment autonomy patch) with '### Changed' and 'Internal simplification, no behavior change.'

Verification

The runner ran each check from the base copy against 652183f:

  • 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 11 fragments valid (run before and after tidy).
  • .lane/checks/bin/check-changed-skills: CHECK-SKILL setup PASS, 0 errors, 4 warnings. The warnings are about SKILL.md size and description length, which this change did not touch (run before and after tidy).
  • .lane/checks/bin/check-affected: 12 passed, 7 skipped, the rest CI-only, over 2 changed files (run before and after tidy).
  • git-read diff --numstat HEAD: 33 added / 63 removed in the one listed .mjs file, plus the 7-line untracked fragment. Within the 400-line / 15-file limit.
  • Fresh-context review subagent over the full diff: no behavior differences found. It checked each hunk against the full file, including the optional-chaining guards on every JSON value type, argv edge cases (missing values, repeated flags, proto/constructor) and the credentialRoots null-vs-array…
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42734415286

Left out: the items under Not verified.

Related

#14418

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

Security review: no security issues found

critical-findings: 0

I read every hunk of both changed files. Neither matches a trusted-path glob, and neither is a plugin manifest.

  • .changes/autonomy/...b0c6a5c7.md is a changelog fragment and runs nothing.
  • plugins/autonomy/skills/setup/scripts/check-security-binding.mjs is the validator that blocks unratified merge_policy: "auto" and weakened verification floors. A change here could quietly weaken a gate, so I checked each hunk for fail-closed equivalence against the head file:
    • Optional chaining in place of the isPlainObject guards (ratifiedPromoted, merge_policy?.[workClass], verification_blocking?.["ai-review"], verification_topology?.[workClass]). The binding comes only from JSON.parse (L2626), so each value is a plain object, an array or a primitive. The lookup keys are constants: C1–C5, C2-auto-merge/C3-auto-merge, C3-ai-review-blocking and ai-review (L75, L384). None of them is an inherited Object.prototype or Array.prototype name, so no non-object value can make state === "promoted" true. The auto-merge ratification check still fails closed.
    • Reusing aiReview at L2088. It is the same binding.verification_blocking["ai-review"] read: nothing changes it between L2036 and L2088, and the enclosing block already requires verification_blocking to be a plain object.
    • Topology floor loop and relatedBy helper. Same comparisons, same finding text and same order.
    • events === null in place of evidenceUnavailable. events stays non-null only on the success path (L2420–2424), so a missing evidence file still resolves every cell to unpromoted.
    • argv options table. It uses Object.hasOwn on a literal whose keys are only the four -- flags, so prototype-named arguments are not matched. A flag with no value still yields undefined, which still reaches the usage exit (exit 2).
    • credentialRoots. An absent argument and an empty-after-trim argument both still give null.

No instruction surface, trust control, token scope or merge-hold logic is widened or loosened. The PR context file holds no embedded directives aimed at this lane. The PR's own notes say the script's node test suites were not run by the authoring lane and are left to CI.

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: PR #14928, refactor(autonomy): simplify check-security-binding.mjs (part 2 of 2)

No findings. I read every hunk of both changed files and checked each against the head file to see whether behavior stays the same.

Checked for equivalence (by reading the code; I did not run any tests):

  • Optional chaining replaces isPlainObject guards (ratifiedPromoted, merge_policy?.[workClass], verification_blocking?.["ai-review"], verification_topology?.[workClass]). The binding comes from JSON.parse (L2626), so none of the inputs have custom prototypes. Every key looked up is a constant cell or work-class name. A string, number, boolean or array in those positions gives undefined for these keys, so each === "auto" / === "promoted" comparison, and the isPlainObject(aiReview) / isPlainObject(topology) checks, give the same results as before. checkSemantics only runs when the binding is a plain object (L2634).
  • Reusing aiReview at L2088 is safe. It sits inside the isPlainObject(binding.verification_blocking) block, so it is the same value as the old direct lookup.
  • The floor loop in checkTopologySemantics keeps the same knob order (min_checkers, then min_model_checkers) and the same message text.
  • relatedBy(a, b, constraints) gives the same result as holdsDistinct with RELATIONAL_CONSTRAINTS (an array, L406) and as the inline vendor-disjoint check with ["distinct_vendor_from"].
  • events === null replaces evidenceUnavailable. events is set only after the array check passes, and is otherwise null exactly when the catch ran.
  • The argv options table. Object.hasOwn ignores inherited names (__proto__, toString). A flag with no value still sets undefined and hits the usage exit 2. A repeated flag still uses its last value. The Object.values(...).some(...) check gives the same result as the four old clauses.
  • credentialRoots. With the flag absent, undefined ?? [] leads to null, as before. With the flag present, an empty parse leads to null and a non-empty one to the array, as before. credentialRootsParsed is not used anywhere else.

Closing issue #14418 acceptance criteria:

  • Behavior unchanged: met, as far as I can tell by reading. The repository's fixture test suites cover this script. They were not run by the author's lane (the author says so), so they are left to CI.
  • Only the listed file and a changelog fragment changed: met.
  • Within 400 lines and 15 files: met (the author reports 33 added and 63 removed).
  • ci-status green: left to CI, not verified here.
  • Fragment: met. bump: patch, with ### Changed and the required line.
  • Only functions starting in range 2 (lines 1341–2679) changed: met. checkSemantics starts at L1875, checkTopologySemantics at L2215, resolveEffectivePromotion at L2418, and the entry point is after them.

I found no embedded instructions in the PR context, and there were no prior findings.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 652183f

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-14928-652183fffcb9a5fb400212831e6c06da5a333361, expires on 2026-12-10.

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 10, 2026
Merged via the queue into main with commit 95bbaa7 Nov 10, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14418-42734415286-1 branch November 10, 2026 03:55
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 95bbaa7a0763892a826386206bc97642fadf6adc; 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 2 of 2)

0 participants