Repository navigation
fix(catalog-sync): define __proto__ keys in deepMergeProviders (#4957) - #5011
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 53 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. CodeRabbit Verify
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
deepMergeProvidersfolds the runtime overlay (an external, file-spelled source) into the effective provider config. Assigningout[k]is a[[Set]]write, so an overlay key named__proto__at any depth invoked the inherited accessor and moved the merged object's prototype instead of becoming an own property (design #2953 class, follow-up to the #2954 audit).The merge now writes every overlay key with
Object.defineProperty(enumerable/writable/configurable own data property) and resolves the base side through an own-property check, sobase["__proto__"]cannot silently resolve toObject.prototypeand be merged in.Closes #4957.
Evidence
origin/main(35 pass / 2 fail): a__proto__object at depth 2 and a__proto__string at depth 3 both need an own property, andObject.getPrototypeOf(...)must stayObject.prototype.node --test bin/provider-catalog-sync.test.mjs— 37 pass / 0 fail, including the existing Split opencode.jsonc into tracked configured default + runtime overlay (stop config drift) #4544 merge andrunSyncoverlay tests.__proto__(object and string),constructor,toString, ordinary key — own property present, JSON round-trip preserves the own__proto__key with the prototype unmoved.Merge Danger
Door: two-way — restoring the assignment form restores the old semantics; the merge output shape for ordinary keys is unchanged.
Blast Radius: narrow —
bin/provider-catalog-sync.mjsmerge helper and its test file only.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.