Skip to content

📦🔧:keep deep merges within their own graphs - #110

Closed
DerekNonGeneric wants to merge 1 commit into
claude/project-thread-hho3c3-base-105from
claude/project-thread-hho3c3-review-105
Closed

DerekNonGeneric wants to merge 1 commit into
claude/project-thread-hho3c3-base-105from
claude/project-thread-hho3c3-review-105

Conversation

@DerekNonGeneric

@DerekNonGeneric DerekNonGeneric commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Requested by DerekNonGeneric · project thread

Review only. Do not merge. This replays the already-merged #105 (commit 682eaae against its parent) so CodeRabbit can review it, because it hit its rate limit when #105 was open and it refuses to review closed PRs. Findings will be fixed in a separate PR against main, and this PR will be closed.


Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Deep merges now apply source objects in order, including repeated sources, and only merge into the target’s own properties.
    • Circular references are preserved separately for each existing destination, and shared objects retain their relationships when copied.
    • Plain objects created in other realms are copied consistently, whether nested directly or inside arrays. Objects such as dates are not mistakenly treated as plain objects.

Limit recursive merging to the target's own properties. Track active
source-target pairs rather than skipping later source arguments, and
isolate copy caches when one source fills distinct existing targets.

Share the plain-object classifier with array copying so foreign-realm
objects are copied consistently. Add graph and isolation regressions.

Signed-off-by: Derek Lewis <DerekNonGeneric@inf.is>
Assisted-by: Codex:gpt-6-astra
PR-URL: #105
Fixes: #100
@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: fd995fde-12bb-43e4-831a-3d4353e552dc

📥 Commits

Reviewing files that changed from the base of the PR and between b554adf and 682eaae.

📒 Files selected for processing (8)
  • .changeset/fair-graphs-stay-local.md
  • packages/util-array/src/_internal/_copy-deep.ts
  • packages/util-array/test/helpers/copy-array.ts
  • packages/util-core/src/_internal/_is-plain-object.ts
  • packages/util-core/src/index.ts
  • packages/util-object/src/_internal/_mixin.ts
  • packages/util-object/src/guards/is-plain-object.ts
  • packages/util-object/test/helpers/merge-graphs.ts

Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour.


📝 Walkthrough

Walkthrough

The changes add shared plain-object detection and use it in array copying and object guards. They also update deep-merge handling for repeated sources, inherited target properties, and cyclic object graphs, with tests and patch release entries.

Changes

Object graph copying and merging

Layer / File(s) Summary
Shared plain-object detection
packages/util-core/src/_internal/_is-plain-object.ts, packages/util-core/src/index.ts, packages/util-object/src/guards/is-plain-object.ts, packages/util-array/src/_internal/_copy-deep.ts, packages/util-array/test/helpers/copy-array.ts
util-core adds and exports _isPlainObject. isPlainObject and _copyDeep use the shared guard. Tests cover copying cross-realm objects and retaining a tagged Date by reference.
Merge graph handling
packages/util-object/src/_internal/_mixin.ts, packages/util-object/test/helpers/merge-graphs.ts, .changeset/fair-graphs-stay-local.md
_mixin tracks active source-target pairs, reads only own target properties, and handles cached copies across destinations. Tests cover source precedence, inherited target values, cycles, and cross-realm objects. The changeset adds patch release entries for three packages.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 682ea

No identified regression requires a fix before merge; normal checks remain appropriate.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: limiting deep merges to each target's own object graph. It is concise and specific despite the decorative emojis.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 7 files. (1 skipped: 1 u…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Member Author

@coderabbitai review


Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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.

1 participant