Skip to content

chore(repo): stop project settings shadowing the GitHub marketplace - #7423

Merged
kyle-sexton merged 2 commits into
mainfrom
chore/5939-stop-project-settings-shadowing
Oct 14, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
chore/5939-stop-project-settings-shadowing

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #5939
Hold: a human merges this

Summary

Project settings no longer declare the melodic-software marketplace. The checked-in extraKnownMarketplaces entry used a checkout-relative directory source, which shadowed the owner's user-level GitHub registration for any session opened in this checkout. This applies the owner's option A decision recorded on #5939.

Fix

  • .claude/settings.json: the extraKnownMarketplaces block is removed. enabledPlugins is unchanged; its @melodic-software keys resolve against the user registration.
  • scripts/check-plugin-catalog-enablement.sh: reads the marketplace name from .claude-plugin/marketplace.json .name instead of the settings key, and drops the exactly-one-entry precondition. An empty catalog name exits 2. The identity check against .claude/cloud-bootstrap.sh's marketplace_name still fails on disagreement.
  • scripts/check-plugin-catalog-enablement.test.sh: fixtures no longer declare extraKnownMarketplaces. Case 7 previously asserted that two declared marketplaces were fatal; with the precondition gone it now asserts the name comes from marketplace.json even when settings declare unrelated marketplaces. A new case covers the empty catalog name.
  • .claude/cloud-bootstrap.sh (comments only) and docs/cloud-sessions.md: describe the cloud bootstrap as the only, cloud-only, registration of the checkout as a directory source, and claude --plugin-dir for local branch testing.

Verification

  • bash scripts/check-plugin-catalog-enablement.test.sh: PASS=14 FAIL=0, exit 0 (11 cases red against the old script before the change).
  • bash scripts/check-plugin-catalog-enablement.sh on the branch tree: exit 0.
  • git show HEAD:.claude/settings.json | jq '.extraKnownMarketplaces': null; every other settings key is identical to main.
  • .claude/cloud-bootstrap.sh with comment lines filtered out is identical to main.
  • shellcheck on the gate script, its test and the bootstrap: exit 0. markdownlint was not run (not installed in the worktree).
  • A fresh-context phase verifier passed all six acceptance criteria.

Not done here (owner steps after merge): re-apply the user-level marketplace switch, open a fresh local session in this checkout, and confirm known_marketplaces.json still shows source: github.

Open question for review: .claude/cloud-bootstrap.sh (around lines 145-147) and docs/cloud-sessions.md (around lines 326-328) still say claude plugin marketplace remove deletes the entry from .claude/settings.json. That file no longer carries the entry; the wording was left unchanged rather than guessed, pending a check of what remove deletes today.

Related

🤖 Generated with Claude Code

Drop the project extraKnownMarketplaces entry, whose checkout-relative
directory source outranked the user's GitHub registration in every
session opened in this checkout. The catalog-enablement gate now reads
the marketplace name from marketplace.json, and the cloud bootstrap
stays the only, cloud-only, registration of the directory source.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 14, 2026 03:35
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T03:38:52.393417Z f14c146 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 2m 48s —— View job


Security review complete

  • Gather context (PR diff, changed files)
  • Check skip gate
  • Review instruction-surface deletion (.claude/settings.json extraKnownMarketplaces removal)
  • Review script changes for injection/logic flaws
  • Review doc/comment changes
  • Post findings

No security issues found.

Scope: .claude/cloud-bootstrap.sh, .claude/settings.json, docs/cloud-sessions.md, scripts/check-plugin-catalog-enablement.sh, and its test file.

Instruction-surface deletion check. The PR removes the extraKnownMarketplaces block from .claude/settings.json (blob L82-L89 on main). I read docs/conventions/instruction-exception-register/README.md (present in the checkout) and checked this deletion against its Gate‑0 classes (irreversible-action, secret-handling, data-integrity, external-publication, legal-compliance, agent-authority). It doesn't match: the deleted key wasn't a guardrail restraining a hazardous agent action, it was the risky default itself — a checked-in, checkout-relative directory source that auto-registered this repo as a trusted plugin marketplace for any local session opened here, shadowing the operator's own vetted (GitHub-sourced) registration. Removing it from project settings reduces unreviewed-code auto-trust rather than removing a check on one. Nothing elsewhere in the tree needs to pick up an enforcement role, because none was lost.

.claude/cloud-bootstrap.sh's actual registration logic is unchanged — I diffed it and confirmed the only change is the comment block (lines ~127-137); the script still registers the checkout as a directory marketplace source, but only in cloud sessions, matching the PR description.

Script changes. scripts/check-plugin-catalog-enablement.sh now derives the marketplace name from .claude-plugin/marketplace.json's .name field instead of .claude/settings.json's extraKnownMarketplaces keys, and drops the "exactly one entry" precondition. All variables remain properly quoted in jq/bash; the suffix-stripping uses literal parameter expansion (not a regex), so no injection surface is introduced. This is a CI lint/consistency gate, not a trust boundary, and its behavior change is scoped to naming derivation, not to which code gets installed or trusted. The test fixture changes are test-only with no exploitable path.

No inline comments were needed.

claude-lane-summary: lane=claude-security-review sha=f14c146bfb38272a5a62017d03082f8247fc6547 run=38507047441

@claude

claude Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 3m 31s —— View job


Review complete

  • Gather context (diff, CLAUDE.md, REVIEW.md, standards)
  • Review changed files for correctness/maintainability
  • Verify candidate findings
  • Post findings / summary

Reviewed the 5 changed files (.claude/settings.json, .claude/cloud-bootstrap.sh, docs/cloud-sessions.md, scripts/check-plugin-catalog-enablement.sh, scripts/check-plugin-catalog-enablement.test.sh) against origin/main. Traced the gate script's new marketplace.json-derived MARKET logic end to end and checked it against the actual committed .claude-plugin/marketplace.json (name: "melodic-software") and .claude/cloud-bootstrap.sh's hardcoded marketplace_name="melodic-software" — they agree, and the updated test fixtures (check-plugin-catalog-enablement.test.sh) correctly exercise the new "name comes from the catalog, not settings" behavior, including the new empty-name fatal case. I was not able to independently run shellcheck or the test suite in this sandbox (commands require approval I don't have), so the PR's own verification claims (PASS=14/FAIL=0, shellcheck clean) are author-claimed and unverified by me.

Finding

Stale claude plugin marketplace remove rationale, now inconsistent with this PR's own change (not on a changed line, so no changed line can carry it):

Both still say claude plugin marketplace remove "deletes the marketplace's entry from .claude/settings.json." After this PR, .claude/settings.json declares no marketplace at all — the comment's own reason for avoiding remove no longer describes anything that exists in that file. The PR body already flags this exact spot as an "open question ... left unchanged rather than guessed," so this isn't a new discovery, just confirming it's real and should block merge or get an explicit decision (fix the wording now vs. a tracked follow-up) rather than ship silently. Since the registration path is now claude plugin marketplace add "$repo_root" --scope user (user scope, not the project settings file), the comment likely needs to describe remove's effect on the user-scope marketplace registration instead, once that's confirmed.

Fix this →

No other correctness or maintainability issues found: the removed extraKnownMarketplaces precondition, the marketplace.json-derived MARKET, and the identity check all hold together consistently, and the test fixture updates match the new behavior they assert.

claude-lane-summary: lane=claude-review sha=f14c146bfb38272a5a62017d03082f8247fc6547 run=38507047473

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f14c146bfb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review has reviewed this pull request through e5cbe56; a later push is reviewed from there.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

claude-review has reviewed this pull request through e5cbe56; a later push is reviewed from there.

… marketplace

An extraKnownMarketplaces entry under the catalog's own name makes Claude
Code refetch from that source, recreating the shadowing this PR removes
while the gate stays green. Unrelated marketplaces still pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@claude

claude Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 1m 2s —— View job


Security review complete

  • Gather context (incremental diff, PR description, prior review)
  • Review incremental changes to scripts/check-plugin-catalog-enablement.sh
  • Review incremental changes to scripts/check-plugin-catalog-enablement.test.sh
  • Verify candidate findings
  • Post findings

No security issues found.

Scope. Per this lane's incremental instructions, this pass covers only what changed since f14c146 (already reviewed): the new check 4 (SHADOWING) in scripts/check-plugin-catalog-enablement.sh and its corresponding fixture case 7b in check-plugin-catalog-enablement.test.sh. This closes the gap flagged by the Codex review comment on the prior commit: settings could previously reintroduce extraKnownMarketplaces under the catalog's own name and the gate would stay green.

Logic check. jq -e --arg m "$MARKET" '(.extraKnownMarketplaces // {}) | has($m)' "$SETTINGS" is parameterized via --arg (no string interpolation into the jq program, so no injection surface from a marketplace name containing jq/regex metacharacters), and has() does an exact key match rather than a substring/regex test, so declaring an unrelated marketplace (the "other" entry in the new fixture) still passes while a key exactly matching the catalog's own name (fixture in the test, melodic-software in the real tree) fails the gate with errors=$((errors + 1)), which is caught by the ((errors > 0)) exit-1 path. This is the control the PR description says it's restoring, and it now also gates the project-settings reintroduction path the first round of review didn't need to check (nothing had reintroduced it yet). Test case 7b exercises exactly this: a fixture key alongside an unrelated other key, asserting the gate fails and names 'fixture' in its output.

Test-only file. check-plugin-catalog-enablement.test.sh's changes are fixture/assertion additions with no exploitable path (throwaway mktemp tree, same pattern as the existing cases).

I wasn't able to execute bash scripts/check-plugin-catalog-enablement.test.sh in this sandbox (command execution requires an approval this lane's tool access doesn't have), so the PASS/FAIL counts in the PR description remain author-claimed and unverified by me, consistent with the prior review round's note.

claude-lane-summary: lane=claude-security-review sha=e5cbe562195eaf7196767bbb520d8a69aa4845e4 run=38507626487

@claude

claude Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 1m 51s —— View job


Incremental code review — findings

  • Gather context (.claude-lane/incremental.diff, gh pr diff for context)
  • Review scripts/check-plugin-catalog-enablement.sh changes since f14c146
  • Review scripts/check-plugin-catalog-enablement.test.sh changes since f14c146
  • Verify candidate findings
  • Post results

Scope: this commit (e5cbe56) adds check 4, SHADOWING: the gate now fails when .claude/settings.json redeclares extraKnownMarketplaces under the catalog's own name, closing exactly the gap Codex's review on f14c146 flagged (settings could reintroduce the shadowing while the gate stayed green).

What I checked:

  • scripts/check-plugin-catalog-enablement.sh#L178-L188: jq -e --arg m "$MARKET" '(.extraKnownMarketplaces // {}) | has($m)' "$SETTINGS" >/dev/null is a correct, injection-safe presence check (uses --arg, not string interpolation into the jq program) and -e's exit code drives the if correctly — has true → exit 0 → shadow reported, errors incremented. Traced all four checks' error accumulation into the final ((errors > 0)) gate; this one composes correctly with the others.
  • Other marketplace names remain unaffected (has($m) only matches the exact catalog name), consistent with the stated "other marketplaces are allowed" intent and with test case 7.
  • scripts/check-plugin-catalog-enablement.test.sh#L264-L284: new case 7b fixtures extraKnownMarketplaces with both the catalog's own name (fixture) and an unrelated one (other), and asserts rc=1 plus the SHADOWED MARKETPLACE / 'fixture' substrings. This is the right fixture shape to distinguish "any declaration is fatal" from "only an unrelated declaration is fine," and it doesn't collide with any fixture state left behind by the preceding cases (each case fully rewrites $SETTINGS).
  • No regression risk to the other six scenario classes (orphan, unsorted keys, foreign-marketplace key, regex-literal suffix matching, bootstrap identity, catalog name derivation) — none of their fixtures declare extraKnownMarketplaces under the catalog name, so check 4 is a no-op for them.

I was not able to run bash scripts/check-plugin-catalog-enablement.test.sh in this sandbox (the shell tool required approval I don't have), so the PR's claimed PASS=14/FAIL=0 is author-claimed and unverified by me here; my read is a static, line-by-line trace of the new check and its test fixture.

No correctness or maintainability issues found in this incremental diff.

claude-lane-summary: lane=claude-review sha=e5cbe562195eaf7196767bbb520d8a69aa4845e4 run=38507626449

@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 14, 2026
Merged via the queue into main with commit 1f96acd Oct 14, 2026
27 checks passed
@kyle-sexton
kyle-sexton deleted the chore/5939-stop-project-settings-shadowing branch October 14, 2026 04:09
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.

chore(repo): stop project settings shadowing the GitHub melodic-software marketplace

1 participant