Skip to content

Fix bundling not de-duplicating equal schemas#669

Merged
jviotti merged 2 commits intomainfrom
bundle-deduplicate
Feb 23, 2026
Merged

Fix bundling not de-duplicating equal schemas#669
jviotti merged 2 commits intomainfrom
bundle-deduplicate

Conversation

@jviotti
Copy link
Member

@jviotti jviotti commented Feb 20, 2026

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti jviotti marked this pull request as ready for review February 20, 2026 20:32
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 7 files

@augmentcode
Copy link

augmentcode bot commented Feb 20, 2026

🤖 Augment PR Summary

Summary: This PR fixes schema bundling so that identical schemas (especially embedded resources) are properly de-duplicated instead of being treated as conflicting duplicates.

Changes:

  • Fixes resource registration in CustomResolver::add to compare against the normalized subschema (not the original root schema) when detecting duplicate identifiers.
  • Updates bundling logic in vendored core to determine the container keyword ($defs vs definitions) via the schema base dialect.
  • Adds elevate_embedded_resources to lift embedded, absolute-ID resources from a resolved schema’s definitions into the bundle root and remove duplicates.
  • Tracks resolved schema dialects alongside deferred remote schemas to drive correct extraction behavior.
  • Adjusts an existing bundle test expectation to reflect the new “lifted” embedded resource layout.
  • Adds a new test covering de-duplication of equal embedded resources when resolving multiple schemas.
  • Updates the pinned sourcemeta/core dependency revision to include the bundling fix.

Technical Notes: The new behavior relies on resource identifiers (absolute URIs via $id) as the key for de-duplication and conflict detection when consolidating embedded resources into the bundle’s definitions container.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 1 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti jviotti merged commit a3a9650 into main Feb 23, 2026
14 checks passed
@jviotti jviotti deleted the bundle-deduplicate branch February 23, 2026 13:04
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Feb 24, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [sourcemeta/jsonschema](https://github.com/sourcemeta/jsonschema) | patch | `v14.13.3` → `v14.13.4` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>sourcemeta/jsonschema (sourcemeta/jsonschema)</summary>

### [`v14.13.4`](https://github.com/sourcemeta/jsonschema/releases/tag/v14.13.4)

[Compare Source](sourcemeta/jsonschema@v14.13.3...v14.13.4)

#### What's Changed

- Fix bundling not de-duplicating equal schemas by [@&#8203;jviotti](https://github.com/jviotti) in [#&#8203;669](sourcemeta/jsonschema#669)
- Improve error handling on `--resolve` meta-schema errors by [@&#8203;jviotti](https://github.com/jviotti) in [#&#8203;673](sourcemeta/jsonschema#673)
- Respect ordering of `--resolve` arguments to avoid meta-schema ambiguity by [@&#8203;jviotti](https://github.com/jviotti) in [#&#8203;674](sourcemeta/jsonschema#674)

**Full Changelog**: <sourcemeta/jsonschema@v14.13.3...v14.13.4>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4zMS4xIiwidXBkYXRlZEluVmVyIjoiNDMuMzEuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6OnBhdGNoIl19-->
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