Skip to content

fix(plugin-profiles): guard and remove always-on optional members - #18131

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-18124-44987662218-1
Nov 22, 2026
Merged

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

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #18124

Summary

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

excludedAlwaysOn in plan.mjs now counts always-on optional members as well as plugins members, so a profile that excludes one is rejected. This brings plan, check and save in line with resolveCatalog's repository guard, which already covered both lists (AC24). extend in profile-files.mjs now applies a file's remove list to the merged optional set as well as plugins, so an inherited optional member can be removed (AC3). Each fix has a test that fails on the old code, and the README and a patch changelog fragment record the change.

Not verified

  • The plugin-profiles node test suites (lib/*.test.mjs) were not run here: the lane allows no interpreter, and check-affected's output does not show whether it ran them. Left to the PR's CI.
  • tidy pass 5 (ai-slop) ran without its deterministic detector, because detect.sh is not a lane wrapper; the rubric was read by hand
  • check-affected skipped typos (not installed), comment-hygiene (network fetch denied), size-check (script missing) and three validate-plugins steps that run code from the checked tree
  • Changes left uncommitted in the working tree, as the lane instructs; the runner turns them into a patch

Fix

  • plugins/plugin-profiles/lib/plan.mjs: excludedAlwaysOn also matches ids in catalog.alwaysOn.optional
  • plugins/plugin-profiles/lib/profile-files.mjs: extend deletes each remove id from optional as well as plugins; deleted the header comment that described the old merge rule (the comment lint rejected a rewritten version)
  • plugins/plugin-profiles/lib/plan.test.mjs: new test, a profile excluding an always-on optional member throws PlanError
  • plugins/plugin-profiles/lib/profile-files.test.mjs: new test, a remove line drops inherited optional members from a named profile and from always-on
  • plugins/plugin-profiles/README.md: merge rule now says remove drops inherited members from plugins or optional; paragraph rewrapped
  • .changes/plugin-profiles/work-resolve-issue-issue-18124-44987662218-1-84877958.md: patch fragment recording both fixes, with how to move an exclude that is now rejected

Verification

The runner ran each check from the base copy against 8a9afc8:

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

The run reports:

Left out: the items under Not verified.

Related

#18124

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

Copy link
Copy Markdown
Contributor

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

Security review: PR #18131 (plugin-profiles always-on optional guard)

I found no security issues.

What changed:

  • excludedAlwaysOn in plan.mjs now also catches ids in catalog.alwaysOn.optional. A profile that keeps always-on can no longer exclude an always-on optional member. This makes the check stricter.
  • extend in profile-files.mjs now applies a file's remove list to the merged optional set too.
  • The rest of the PR is tests, the README and a changelog fragment.

Trust-boundary check: I checked whether a repository-level profile file can now use remove to switch off an always-on optional member. It can't. In resolveCatalog, the guarded set is built from the always-on plugins and optional members resolved from the shipped and user files. L162-L166 drops any guarded id from a repository file's remove and exclude lists before extend runs. So the wider remove only touches ids that are not always-on, and taking a plugin out of a named profile only turns something off. The fromRepository tracking (L121) is unchanged.

Other checks:

  • No plugin manifest, workflow, trusted path or trust control is touched.
  • The deleted header comment in profile-files.mjs was a code description, not a standing instruction.
  • The PR context has no embedded text aimed at the lane.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: PR #18131, fix(plugin-profiles): guard and remove always-on optional members

No blocking findings.

I read all 6 changed files in full. I also read profile-files.mjs at head and the callers of excludedAlwaysOn: check.mjs:69, plan.mjs:77 and scripts/profiles.mjs:1719.

Closing issue #18124: each acceptance criterion

  • excludedAlwaysOn rejects an exclude of an always-on optional member (met). The test is plan.test.mjs, "AC24: a profile that excludes an always-on optional member is rejected". Because check.mjs and the profiles.mjs save path call the same function, they now agree with the repository guard in resolveCatalog (profile-files.mjs#L158), which already covered both lists.
  • A remove line drops an inherited optional member (met). extend now deletes each remove id from the merged optional set. The new test in profile-files.test.mjs covers a named profile and always-on. The repository guard's guarded set is built through the same extend, so a user-level remove of an always-on optional member also takes that member out of the guard. That is consistent with the README's "drop one with a remove line in your own always-on.yaml".
  • Tests cover both cases (met). By reading the old code, I can see that each new assertion would fail before this change. I did not run the tests. The author reports they were not run in the lane either, so that is unverified and left to CI.
  • A changelog fragment records the fix (met). A patch fragment is present.

Other notes

  • The removed header comment in profile-files.mjs was the only in-code description of the merge rule. The README still documents it, and the updated README text matches the new behaviour.
  • No shipped profile YAML uses exclude or remove, so the stricter guard rejects no shipped profile.
  • No plugin manifest changed.
  • Loosened checks would be marked: fail (default; the prompt has no loosened_check_verdict: line); patterns: 0 (no loosened_check_patterns: line). The citation requirement was not checked because there is no loosened_check_decision_record: line. The change loosens nothing: the AC24 guard now rejects more.
  • No embedded instructions were found in the PR context.

Verifier dropped 0 of 0 candidates.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path is about to arm native auto-merge at head 8a9afc8003a92e3c437c14aa6d9d74e3f4b5bf70, the head its arming checks judged. The arm fails if the head moves first.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: max=MEDIUM demote=false head=8a9afc8003a92e3c437c14aa6d9d74e3f4b5bf70 rubric=10.6.1 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 22, 2026
Merged via the queue into main with commit 6bc2bbb Nov 22, 2026
51 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-18124-44987662218-1 branch November 22, 2026 06:36
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

plugin-profiles: guard and remove always-on optional members (AC24, AC3 of #16428)

0 participants