Skip to content

refactor(user-experience): import nameOf in detect.mjs from team-policy.mjs - #15618

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

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

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #15613

Summary

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

detect.mjs had its own copy of nameOf, identical to the private one in lib/team-policy.mjs. team-policy.mjs now exports nameOf and lists it in its header interface block; detect.mjs imports it alongside rejections and its local copy is deleted, so nameOf is defined once. Behavior is unchanged: the function body is the same, and its single use in detect.mjs (the routing.deny filter) calls the imported function.

Not verified

  • plugins/user-experience/tests/detect.test.sh and team-policy.test.sh were not run here: this lane's Bash runs only the named wrappers, so it cannot run node; left to the PR's CI
  • ci-status green is a PR CI check; left to the PR's CI
  • tidy-diff pass 5 ran the ai-slop rubric by reading only: the ai-slop detect.sh script is not among the wrappers this lane's Bash may run

Fix

  • plugins/user-experience/scripts/lib/team-policy.mjs: export nameOf and add it to the header's interface list
  • plugins/user-experience/scripts/detect.mjs: import nameOf from ./lib/team-policy.mjs and delete the local definition
  • .changes/user-experience/work-resolve-issue-issue-15613-43261128121-1-1b405c3a.md: new patch fragment, ### Changed, "Internal restructuring, no behavior change."

Verification

The runner ran each check from the base copy against 3c973bc:

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

The run reports:

  • check-changelog-fragments: all 2 changelog fragments under .changes/ are valid
  • check-changed-skills: no changed skills under plugins/*/skills/, nothing to gate
  • check-affected: 12 passed, 7 skipped over 3 changed files
  • Grep for nameOf under plugins/user-experience: defined only at lib/team-policy.mjs:14 (exported), imported at detect.mjs:25, used at detect.mjs:325 and inside team-policy.mjs; no test or eval names it
  • Grep for line citations of detect.mjs or team-policy.mjs (file.mjs:<n>) under plugins/user-experience: none, so the one-line shifts break no citation
  • Fresh-context review subagent over the whole diff: no correctness bugs or behavior changes; the only other importer, tests/team-policy.test.mjs, imports { rules, rejections } and does not assert on the export list
  • tidy-diff over the 4 changed hunks: no edits (nothing to simplify, no zero-information comment, no residue; the fragment line is the issue's prescribed wording with no AI-writing tell)
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/43261128121

Left out: the items under Not verified.

Related

#15613

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

Copy link
Copy Markdown
Contributor

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

Security review: PR #15618

I found no security issues.

This PR is a refactor and changes no behavior:

  • plugins/user-experience/scripts/lib/team-policy.mjs now exports nameOf (it was private before) and lists it in the header's interface comment. The function body is unchanged: (s) => (s.includes("@") ? s.slice(0, s.lastIndexOf("@")) : s).
  • plugins/user-experience/scripts/detect.mjs deletes its own copy of nameOf and imports the one from ./lib/team-policy.mjs. The deleted copy had the same body with a different parameter name (detect), so the routing.deny filter that calls it behaves exactly as before.
  • .changes/user-experience/...md is a new changelog fragment (bump: patch) with no executable content.

No file in the diff matches a trusted-path glob. The diff touches no trust control, merge hold, plugin manifest, workflow, token scope or standing instruction. Exporting a pure string helper from a module inside the plugin adds no new way for untrusted input to reach anything. The PR context file contains no embedded instructions.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: no findings. I read every hunk of all 3 changed files.

The change does what issue #15613 asks for:

  • Defined once: nameOf is now exported from plugins/user-experience/scripts/lib/team-policy.mjs:14 and listed in the header's interface block at :8. The local copy in detect.mjs is gone and the function is imported at detect.mjs:25. A grep of plugins/user-experience/scripts finds no other definition. The only remaining call in detect.mjs is at :325, the routing.deny filter.
  • Behavior: the exported function's body is the same as the deleted local copy; only the parameter name changed (detect to s), so outputs cannot differ. The import adds no circular dependency, because team-policy.mjs imports nothing.
  • Scope: only the listed files changed: two scripts plus the patch fragment with the wording the issue prescribed. The PR is well under the 400-line and 15-file limits. The out-of-scope plugins/user-interface copy is untouched.
  • Not checked here: whether detect.test.sh and team-policy.test.sh pass and whether ci-status is green are left to the PR's CI. The author also lists them as not verified. I ran no tests myself.

No plugin manifest changed and no file matches a trusted-path glob. The PR context has no embedded instructions aimed at this lane.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: unrated reason=no-rating

@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 ebdeeb8 Nov 12, 2026
50 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-15613-43261128121-1 branch November 12, 2026 17:58
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit ebdeeb8c3fb4fd68044a3280fdc186002283c356; 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.

Import nameOf in the user-experience detect script from team-policy.mjs

0 participants